Skip to content

Commit

Permalink
fix: 🐛 Pipetest - fix vertical sorting in garden (#957)
Browse files Browse the repository at this point in the history
  • Loading branch information
MagnusGjosund authored Apr 17, 2024
1 parent 300848f commit 463026c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
11 changes: 7 additions & 4 deletions libs/pipingapp/src/lib/utils-garden/getPipetestStatusColors.ts
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 };
};
6 changes: 6 additions & 0 deletions libs/pipingapp/src/lib/utils-garden/getTextColor.ts
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';
};

0 comments on commit 463026c

Please sign in to comment.