Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Commit

Permalink
fix: add "unknown" to JobStatus enum
Browse files Browse the repository at this point in the history
  • Loading branch information
s-r-x committed Jan 10, 2023
1 parent e8f7ff1 commit b381ad1
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/root/src/gql/type-defs/job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const jobTypeDef = gql`
failed
paused
stuck
unknown
}
enum JobStatusClean {
completed
Expand Down
3 changes: 2 additions & 1 deletion packages/root/src/typings/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ export enum JobStatus {
Delayed = 'delayed',
Failed = 'failed',
Paused = 'paused',
Stuck = 'stuck'
Stuck = 'stuck',
Unknown = 'unknown'
}

export enum JobStatusClean {
Expand Down
1 change: 1 addition & 0 deletions packages/ui/src/components/JobStatusChip/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const palette: Record<JobStatus, string> = {
[JobStatus.Paused]: grey[600],
[JobStatus.Active]: cyan[500],
[JobStatus.Stuck]: grey[400],
[JobStatus.Unknown]: grey[300],
};
export const useJobStatusesPalette = () => palette;
export const useJobStatusColor = (status: JobStatus): string => {
Expand Down
7 changes: 6 additions & 1 deletion packages/ui/src/screens/jobs/List/Pagination/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ export const useCount = (): number => {
const status = useAtomValue(activeStatusAtom);
const activeQueue = useAtomValue(activeQueueAtom) as string;
const jobsCounts = useQueueData(activeQueue)?.jobsCounts;
if (!jobsCounts || jobId || status === JobStatus.Stuck) {
if (
!jobsCounts ||
jobId ||
status === JobStatus.Stuck ||
status === JobStatus.Unknown
) {
return 0;
}
if (status in jobsCounts) {
Expand Down
3 changes: 2 additions & 1 deletion packages/ui/src/typings/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ export enum JobStatus {
Delayed = 'delayed',
Failed = 'failed',
Paused = 'paused',
Stuck = 'stuck'
Stuck = 'stuck',
Unknown = 'unknown'
}

export enum JobStatusClean {
Expand Down

0 comments on commit b381ad1

Please sign in to comment.