-
Notifications
You must be signed in to change notification settings - Fork 13
UI cleanup (part 4) #1217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
UI cleanup (part 4) #1217
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
215ee7f
feat: add capture set clues to UI
annavik edb5c35
fix: render info tooltip in portals
annavik 29d1599
feat: expose IDs in UI for captures, stations and sessions
annavik 26417c2
style: update job warning color and link to docs
annavik adfbc48
feat: show link when capture set needs to be populated
annavik 84b5ce9
feat: use smart capture set picker in export form
annavik d175258
feat: make it possible to clear capture set in export form
annavik 3845496
fix: prioritize to show latest job status if a job exists
annavik 7478302
fix: cleanup forms
annavik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
75 changes: 75 additions & 0 deletions
75
ui/src/design-system/components/select/capture-set-picker.tsx
This file contains hidden or 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,75 @@ | ||
| import { FormMessage } from 'components/form/layout/layout' | ||
| import { useCaptureSets } from 'data-services/hooks/capture-sets/useCaptureSets' | ||
| import { ChevronRight } from 'lucide-react' | ||
| import { Select } from 'nova-ui-kit' | ||
| import { Link, useParams } from 'react-router-dom' | ||
| import { APP_ROUTES } from 'utils/constants' | ||
| import { STRING, translate } from 'utils/language' | ||
|
|
||
| export const CaptureSetPicker = ({ | ||
| value: _value, | ||
| onValueChange, | ||
| }: { | ||
| value?: string | ||
| onValueChange: (value?: string) => void | ||
| }) => { | ||
| const { projectId } = useParams() | ||
| const { captureSets = [], isLoading } = useCaptureSets({ | ||
| projectId: projectId as string, | ||
| }) | ||
| const captureSet = captureSets.find((c) => c.id === _value) | ||
| const value = captureSet ? _value : '' | ||
|
|
||
| return ( | ||
| <div className="flex flex-col gap-4"> | ||
| <Select.Root | ||
| key={value} | ||
| disabled={isLoading || captureSets.length === 0} | ||
| onValueChange={onValueChange} | ||
| value={value} | ||
| > | ||
| <Select.Trigger loading={isLoading}> | ||
| <Select.Value placeholder={translate(STRING.SELECT_PLACEHOLDER)} /> | ||
| </Select.Trigger> | ||
| <Select.Content className="max-h-72"> | ||
| {captureSets.map((c) => ( | ||
| <Select.Item key={c.id} value={c.id}> | ||
| {c.name} | ||
| </Select.Item> | ||
| ))} | ||
| </Select.Content> | ||
| </Select.Root> | ||
| {captureSet?.numImages !== undefined ? ( | ||
| captureSet.numImages === 0 ? ( | ||
| <div className="flex flex-col gap-4"> | ||
| <FormMessage | ||
| className="flex justify-between gap-4" | ||
| message={translate(STRING.MESSAGE_CAPTURE_SET_EMPTY)} | ||
| theme="warning" | ||
| withIcon | ||
| > | ||
| {captureSet.canPopulate ? ( | ||
| <Link | ||
| className="font-bold" | ||
| to={APP_ROUTES.CAPTURE_SETS({ | ||
| projectId: projectId as string, | ||
| })} | ||
| > | ||
| <span>{translate(STRING.POPULATE)}</span> | ||
| <ChevronRight className="inline w-4 h-4 ml-2" /> | ||
| </Link> | ||
| ) : null} | ||
| </FormMessage> | ||
| </div> | ||
| ) : ( | ||
| <FormMessage | ||
| message={translate(STRING.MESSAGE_CAPTURE_SET_COUNT, { | ||
| total: captureSet.numImages.toLocaleString(), | ||
| })} | ||
| withIcon | ||
| /> | ||
| ) | ||
| ) : null} | ||
| </div> | ||
| ) | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.