-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added mergedAt attribute to commit (#44)
- Loading branch information
Showing
25 changed files
with
1,436 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
apps/web/src/app/(private)/projects/[projectId]/commits/[commitUuid]/layout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { ReactNode } from 'react' | ||
|
||
import { CommitProvider } from '@latitude-data/web-ui' | ||
import Sidebar from '$/components/Sidebar' | ||
import { getCommitMergedAt } from '$core/data-access' | ||
|
||
export default async function PrivateLayout({ | ||
children, | ||
params, | ||
}: { | ||
children: ReactNode | ||
params: { commitUuid: string; projectId: number } | ||
}) { | ||
const { commitUuid, projectId } = params | ||
const commitMergeTime = await getCommitMergedAt({ projectId, commitUuid }) | ||
const isDraft = commitMergeTime.unwrap() === null | ||
|
||
return ( | ||
<CommitProvider commitUuid={commitUuid} isDraft={isDraft}> | ||
<main className='flex flex-row w-full'> | ||
<div className='w-[280px]'> | ||
<Sidebar commitUuid={commitUuid} projectId={projectId} /> | ||
</div> | ||
<div className='flex-1'>{children}</div> | ||
</main> | ||
</CommitProvider> | ||
) | ||
} |
15 changes: 15 additions & 0 deletions
15
apps/web/src/app/(private)/projects/[projectId]/layout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { ReactNode } from 'react' | ||
|
||
import { ProjectProvider } from '@latitude-data/web-ui' | ||
|
||
export default async function PrivateLayout({ | ||
children, | ||
params, | ||
}: { | ||
children: ReactNode | ||
params: { projectId: number } | ||
}) { | ||
const { projectId } = params | ||
|
||
return <ProjectProvider projectId={projectId}>{children}</ProjectProvider> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
ALTER TABLE "latitude"."commits" DROP CONSTRAINT "commits_next_commit_id_commits_id_fk"; | ||
--> statement-breakpoint | ||
ALTER TABLE "latitude"."commits" DROP CONSTRAINT "commits_project_id_workspaces_id_fk"; | ||
--> statement-breakpoint | ||
DROP INDEX IF EXISTS "commit_next_commit_idx";--> statement-breakpoint | ||
ALTER TABLE "latitude"."commits" ADD COLUMN "merged_at" timestamp;--> statement-breakpoint | ||
DO $$ BEGIN | ||
ALTER TABLE "latitude"."commits" ADD CONSTRAINT "commits_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "latitude"."projects"("id") ON DELETE cascade ON UPDATE no action; | ||
EXCEPTION | ||
WHEN duplicate_object THEN null; | ||
END $$; | ||
--> statement-breakpoint | ||
CREATE INDEX IF NOT EXISTS "project_commit_order_idx" ON "latitude"."commits" USING btree ("merged_at","project_id");--> statement-breakpoint | ||
ALTER TABLE "latitude"."commits" DROP COLUMN IF EXISTS "next_commit_id"; |
Oops, something went wrong.