Skip to content

Commit

Permalink
fix(status-chip): warning icon
Browse files Browse the repository at this point in the history
  • Loading branch information
RemiBonnet committed Dec 22, 2022
1 parent 55fef2e commit a07b9a5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions libs/shared/enums/src/lib/running-status.enum.ts
Expand Up @@ -7,4 +7,5 @@ export enum RunningStatus {
STOPPED = 'STOPPED',
TERMINATED = 'TERMINATED',
UNKNOWN = 'UNKNOWN',
COMPLETED = 'COMPLETED',
}
13 changes: 11 additions & 2 deletions libs/shared/ui/src/lib/components/status-chip/status-chip.tsx
Expand Up @@ -18,7 +18,7 @@ export function StatusChip(props: StatusChipProps) {
switch (status) {
case StateEnum.DEPLOYED:
case StateEnum.RUNNING:
case StateEnum.COMPLETED:
case RunningStatus.COMPLETED:
return true
default:
return false
Expand Down Expand Up @@ -61,7 +61,6 @@ export function StatusChip(props: StatusChipProps) {
case StateEnum.STOP_ERROR:
case StateEnum.DELETE_ERROR:
case RunningStatus.ERROR:
case RunningStatus.WARNING:
return true
default:
return false
Expand Down Expand Up @@ -99,6 +98,15 @@ export function StatusChip(props: StatusChipProps) {
}
}

function showWarning(): boolean {
switch (status) {
case RunningStatus.WARNING:
return true
default:
return false
}
}

return (
<Tooltip
content={
Expand All @@ -112,6 +120,7 @@ export function StatusChip(props: StatusChipProps) {
>
<div data-testid="status-chip" className={className}>
{showRunningIcon() && <Icon width="0.875rem" viewBox="0 0 14 14" name={IconEnum.SUCCESS} />}
{showWarning() && <Icon width="0.875rem" viewBox="0 0 14 14" pathColor="#F4C004" name={IconEnum.SUCCESS} />}
{showReadyIcon() && (
<Icon
className="min-w-[14px]"
Expand Down

0 comments on commit a07b9a5

Please sign in to comment.