-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add filter UI to jobs (+ some more job related updates) (#626)
* fix: update status colors in list view * feat: add pipeline info to list view * refactor: update filter component to be more flexible * feat: add filters to jobs (station, pipeline and source image collection) * feat: add source images column * feat: add deployment info to job table * fix: update filter keys to streamline * feat: add station info to job details * refactor: centralize job status handling * feat: setup job status filter * feat: update job columns with links and sorting where possible * feat: update job fields with links where possible * feat: prepare type and source image filter * fix: tweak filter keys * feat: add column settings to jobs * fix: hide controls for missing backend filters --------- Co-authored-by: Michael Bunsen <notbot@gmail.com>
- Loading branch information
Showing
24 changed files
with
519 additions
and
373 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { usePipelines } from 'data-services/hooks/pipelines/usePipelines' | ||
import { Select } from 'nova-ui-kit' | ||
import { useParams } from 'react-router-dom' | ||
import { FilterProps } from './types' | ||
|
||
export const PipelineFilter = ({ value, onAdd }: FilterProps) => { | ||
const { projectId } = useParams() | ||
const { pipelines = [], isLoading } = usePipelines({ | ||
projectId: projectId as string, | ||
}) | ||
|
||
return ( | ||
<Select.Root | ||
disabled={pipelines.length === 0} | ||
value={value ?? ''} | ||
onValueChange={onAdd} | ||
> | ||
<Select.Trigger loading={isLoading}> | ||
<Select.Value placeholder="All pipelines" /> | ||
</Select.Trigger> | ||
<Select.Content className="max-h-72"> | ||
{pipelines.map((p) => ( | ||
<Select.Item key={p.id} value={p.id}> | ||
{p.name} | ||
</Select.Item> | ||
))} | ||
</Select.Content> | ||
</Select.Root> | ||
) | ||
} |
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,32 @@ | ||
import { Job, SERVER_JOB_STATUS_CODES } from 'data-services/models/job' | ||
import { Select } from 'nova-ui-kit' | ||
import { FilterProps } from './types' | ||
|
||
const OPTIONS = SERVER_JOB_STATUS_CODES.map((code) => { | ||
const statusInfo = Job.getStatusInfo(code) | ||
|
||
return { | ||
...statusInfo, | ||
} | ||
}).sort((o1, o2) => o1.type - o2.type) | ||
|
||
export const StatusFilter = ({ value, onAdd }: FilterProps) => ( | ||
<Select.Root value={value ?? ''} onValueChange={onAdd}> | ||
<Select.Trigger> | ||
<Select.Value placeholder="Select a value" /> | ||
</Select.Trigger> | ||
<Select.Content> | ||
{OPTIONS.map((option) => ( | ||
<Select.Item key={option.code} value={option.code}> | ||
<span className="flex items-center gap-2"> | ||
<span | ||
className="w-3 h-3 rounded-full mb-0.5" | ||
style={{ backgroundColor: option.color }} | ||
/> | ||
<span>{option.label}</span> | ||
</span> | ||
</Select.Item> | ||
))} | ||
</Select.Content> | ||
</Select.Root> | ||
) |
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,26 @@ | ||
import { Job, SERVER_JOB_TYPES } from 'data-services/models/job' | ||
import { Select } from 'nova-ui-kit' | ||
import { FilterProps } from './types' | ||
|
||
const OPTIONS = SERVER_JOB_TYPES.map((key) => { | ||
const typrInfo = Job.getJobTypeInfo(key) | ||
|
||
return { | ||
...typrInfo, | ||
} | ||
}) | ||
|
||
export const TypeFilter = ({ value, onAdd }: FilterProps) => ( | ||
<Select.Root value={value ?? ''} onValueChange={onAdd}> | ||
<Select.Trigger> | ||
<Select.Value placeholder="Select a value" /> | ||
</Select.Trigger> | ||
<Select.Content> | ||
{OPTIONS.map((option) => ( | ||
<Select.Item key={option.key} value={option.key}> | ||
{option.label} | ||
</Select.Item> | ||
))} | ||
</Select.Content> | ||
</Select.Root> | ||
) |
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
Oops, something went wrong.