-
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.
Redirect to log correct page in paginated logs list (#626)
We were doing a shitty version of this in the client with a useEffect and I realize that we have a backend. So I just moved to it Also: Make playground resizable and avoid requesting a log when one is in flight
- Loading branch information
1 parent
1ecff0b
commit 49d292b
Showing
8 changed files
with
262 additions
and
198 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
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
61 changes: 61 additions & 0 deletions
61
...d]/documents/[documentUuid]/logs/_components/DocumentLogs/DocumentLogBlankSlate/index.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,61 @@ | ||
import { Commit } from '@latitude-data/core/browser' | ||
import { Button, Text } from '@latitude-data/web-ui' | ||
import { getDocumentByUuidCached } from '$/app/(private)/_data-access' | ||
import { ROUTES } from '$/services/routes' | ||
import Link from 'next/link' | ||
|
||
import { DocumentBlankSlateLayout } from '../../../../../_components/DocumentBlankSlateLayout' | ||
import { DocumentsClient } from '../../../../../_components/DocumentsClient' | ||
|
||
export async function DocumentLogBlankSlate({ | ||
commit, | ||
projectId, | ||
documentUuid, | ||
}: { | ||
commit: Commit | ||
documentUuid: string | ||
projectId: number | ||
}) { | ||
const document = await getDocumentByUuidCached({ | ||
documentUuid, | ||
projectId, | ||
commitUuid: commit.uuid, | ||
}) | ||
return ( | ||
<DocumentBlankSlateLayout> | ||
<div className='flex flex-col gap-4 items-center'> | ||
<Text.H5> | ||
To get started, please choose one of the following options: | ||
</Text.H5> | ||
</div> | ||
<Link | ||
href={ | ||
ROUTES.projects | ||
.detail({ id: projectId }) | ||
.commits.detail({ uuid: commit.uuid }) | ||
.documents.detail({ uuid: documentUuid }).logs.upload | ||
} | ||
> | ||
<Button fullWidth variant='outline'> | ||
<div className='flex flex-col gap-1 p-4'> | ||
<Text.H4M>Import logs from UI</Text.H4M> | ||
<Text.H5 color='foregroundMuted'> | ||
If you run prompts outside of Latitude, you can upload your logs | ||
in order to evaluate them. | ||
</Text.H5> | ||
</div> | ||
</Button> | ||
</Link> | ||
<Text.H5 color='foregroundMuted'>Or</Text.H5> | ||
<div className='p-6 bg-background border rounded-lg flex flex-col gap-4 max-w-3xl'> | ||
<Text.H4M>Import logs from code</Text.H4M> | ||
<Text.H5 color='foregroundMuted'> | ||
Run this code snippet to start importing logs into Latitude. Once | ||
done, come back to this page, and you'll be able to evaluate both | ||
existing and incoming logs. | ||
</Text.H5> | ||
<DocumentsClient document={document} /> | ||
</div> | ||
</DocumentBlankSlateLayout> | ||
) | ||
} |
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
Oops, something went wrong.