-
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
21 changed files
with
1,037 additions
and
92 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
22 changes: 22 additions & 0 deletions
22
.../src/app/(private)/project/[projectId]/commit/[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,22 @@ | ||
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: { commitUuid: string; documentId: number } | ||
}) { | ||
const result = await getDocument({ | ||
commitUuid: params.commitUuid, | ||
documentId: params.documentId, | ||
}) | ||
const { content } = result.unwrap() | ||
|
||
return ( | ||
<div className='w-full h-full relative'> | ||
<DocumentEditor content={content} /> | ||
</div> | ||
) | ||
} |
30 changes: 30 additions & 0 deletions
30
apps/web/src/app/(private)/project/[projectId]/commit/[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,30 @@ | ||
import { ReactNode } from 'react' | ||
|
||
import { CommitProvider } from '@latitude-data/web-ui' | ||
import Sidebar from '$/components/Sidebar' | ||
import { getCommitOrder } from '$core/data-access' | ||
|
||
// import { getIsCommitEditableAction } from '$/actions/commits' | ||
|
||
export default async function PrivateLayout({ | ||
children, | ||
params, | ||
}: { | ||
children: ReactNode | ||
params: { commitUuid: string } | ||
}) { | ||
const commitUuid = params.commitUuid | ||
const commitOrder = await getCommitOrder({ uuid: commitUuid }) | ||
const isDraft = commitOrder.unwrap() === null | ||
|
||
return ( | ||
<CommitProvider commitUuid={commitUuid} isDraft={isDraft}> | ||
<main className='flex flex-row w-full'> | ||
<div className='w-[280px]'> | ||
<Sidebar commitUuid={commitUuid} /> | ||
</div> | ||
<div className='flex-1'>{children}</div> | ||
</main> | ||
</CommitProvider> | ||
) | ||
} |
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"; |
Oops, something went wrong.