-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: 🐛 Pipetest - fix vertical sorting in garden (#957)
- Loading branch information
1 parent
300848f
commit 463026c
Showing
2 changed files
with
13 additions
and
4 deletions.
There are no files selected for viewing
11 changes: 7 additions & 4 deletions
11
libs/pipingapp/src/lib/utils-garden/getPipetestStatusColors.ts
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 |
---|---|---|
@@ -1,12 +1,15 @@ | ||
import { Pipetest } from '@cc-components/pipingshared'; | ||
import { pipetestStatusColormap } from '@cc-components/shared/mapping'; | ||
import { BaseStatus } from 'libs/shared/dist/src/packages'; | ||
import { pipetestAndHeatTraceColorMap } from '@cc-components/shared/mapping'; | ||
import { getTextColor } from './getTextColor'; | ||
|
||
type PackageStatusReturn = { | ||
backgroundColor: string; | ||
textColor: string; | ||
}; | ||
|
||
export const getPipetestStatusColors = (data: Pipetest): PackageStatusReturn => { | ||
const backgroundColor = pipetestStatusColormap[data.formStatus as BaseStatus]; | ||
return { backgroundColor }; | ||
const backgroundColor = pipetestAndHeatTraceColorMap[data.checklistStep || '']; | ||
const textColor = getTextColor(data.checklistStep || ''); | ||
|
||
return { backgroundColor: backgroundColor, textColor: textColor }; | ||
}; |
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,6 @@ | ||
export const getTextColor = (status: string) => { | ||
if (status === 'Pressure test' || status === 'Insulation' || status === 'Complete') | ||
return '#000000'; | ||
|
||
return '#ffffff'; | ||
}; |