diff --git a/libs/pipingapp/src/lib/utils-garden/getPipetestStatusColors.ts b/libs/pipingapp/src/lib/utils-garden/getPipetestStatusColors.ts index 88935009e..18a101b57 100644 --- a/libs/pipingapp/src/lib/utils-garden/getPipetestStatusColors.ts +++ b/libs/pipingapp/src/lib/utils-garden/getPipetestStatusColors.ts @@ -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 }; }; diff --git a/libs/pipingapp/src/lib/utils-garden/getTextColor.ts b/libs/pipingapp/src/lib/utils-garden/getTextColor.ts new file mode 100644 index 000000000..2cabec385 --- /dev/null +++ b/libs/pipingapp/src/lib/utils-garden/getTextColor.ts @@ -0,0 +1,6 @@ +export const getTextColor = (status: string) => { + if (status === 'Pressure test' || status === 'Insulation' || status === 'Complete') + return '#000000'; + + return '#ffffff'; +};