-
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.
- Loading branch information
Showing
33 changed files
with
2,278 additions
and
126 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
23 changes: 23 additions & 0 deletions
23
...rc/app/(private)/projects/[projectId]/commits/[commitUuid]/document/[documentId]/page.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,23 @@ | ||
import { DocumentEditor } from '@latitude-data/web-ui' | ||
import { getDocument } from '$core/data-access' | ||
|
||
export const dynamic = 'force-dynamic' | ||
|
||
export default async function Editor({ | ||
params, | ||
}: { | ||
params: { projectId: number; commitUuid: string; documentId: number } | ||
}) { | ||
const result = await getDocument({ | ||
projectId: params.projectId, | ||
commitUuid: params.commitUuid, | ||
documentId: params.documentId, | ||
}) | ||
const { content } = result.unwrap() | ||
|
||
return ( | ||
<div className='w-full h-full relative'> | ||
<DocumentEditor content={content} /> | ||
</div> | ||
) | ||
} |
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
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,6 @@ | ||
ALTER TABLE "latitude"."commits" DROP CONSTRAINT "commits_next_commit_id_commits_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 | ||
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"; |
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,7 @@ | ||
ALTER TABLE "latitude"."commits" DROP CONSTRAINT "commits_project_id_workspaces_id_fk"; | ||
--> 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 $$; |
Oops, something went wrong.