Skip to content

Commit

Permalink
feat: ✨ add new columns (#864)
Browse files Browse the repository at this point in the history
* feat: ✨ add new columns

* feat: ✨ add new datafield and new columns

* remove commented code
  • Loading branch information
MagnusGjosund authored Mar 8, 2024
1 parent 15342ce commit 8c918b9
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 2 deletions.
50 changes: 50 additions & 0 deletions libs/heattraceapp/src/lib/config/tableConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ import {
useGridDataSource,
} from '@cc-components/shared/workspace-config';
import {
BaseStatus,
DateCell,
DescriptionCell,
LinkCell,
StatusCircle,
StyledMonospace,
domainNames,
pipetestStatusColormap,
statusColorMap,
useHttpClient,
} from '@cc-components/shared';

Expand Down Expand Up @@ -70,6 +72,16 @@ const columnDefinitions: [ColDef<HeatTrace>, ...ColDef<HeatTrace>[]] = [
headerName: domainNames.commPriority1,
valueGetter: (pkg) => pkg.data?.priority1,
},
{
colId: 'Priority2',
headerName: domainNames.commPriority2,
valueGetter: (pkg) => pkg.data?.priority2,
},
{
colId: 'Priority3',
headerName: domainNames.commPriority3,
valueGetter: (pkg) => pkg.data?.priority3,
},
{
colId: 'Location',
headerName: domainNames.mcLocation,
Expand All @@ -78,8 +90,25 @@ const columnDefinitions: [ColDef<HeatTrace>, ...ColDef<HeatTrace>[]] = [
return <StyledMonospace>{props.value}</StyledMonospace>;
},
},
{
colId: 'MechanicalCompletionStatus',
headerName: domainNames.mcStatus,
valueGetter: (pkg) => pkg.data?.mechanicalCompletionStatus,
cellRenderer: (props: ICellRendererProps<HeatTrace, string>) => {
if (!props.data?.mechanicalCompletionStatus) return null;
return (
<StatusCircle
content={props.data.mechanicalCompletionStatus}
statusColor={
statusColorMap[props.data.mechanicalCompletionStatus as BaseStatus]
}
/>
);
},
},
// Need to implement the visual checklistStatus
{
colId: 'FormStatus',
headerName: domainNames.checklistStatus,
valueGetter: (pkg) => pkg.data?.formStatus,
cellRenderer: (props: ICellRendererProps<HeatTrace, string>) => {
Expand All @@ -94,12 +123,33 @@ const columnDefinitions: [ColDef<HeatTrace>, ...ColDef<HeatTrace>[]] = [
},
{ headerName: domainNames.currentStep, valueGetter: (pkg) => pkg.data?.checklistStep },
{
colId: 'RfCPlannedForecastDate',
headerName: 'RFC',
valueGetter: (pkg) => pkg.data?.rfCPlannedForecastDate,
cellRenderer: (props: ICellRendererProps<HeatTrace, string | null | undefined>) => {
return props.value ? <DateCell dateString={props.value} /> : null;
},
},
{
colId: 'CommissioningIdentifierCode',
headerName: domainNames.commIdentifier,
valueGetter: (pkg) => pkg.data?.commissioningIdentifierDescription,
},
{
colId: 'MechanicalCompletionHandoverStatus',
headerName: domainNames.mcHandoverStatus,
valueGetter: (pkg) => pkg.data?.mechanicalCompletionHandoverStatus,
},
{
colId: 'MechanicalCompletionResponsible',
headerName: domainNames.mcResponsible,
valueGetter: (pkg) => pkg.data?.mechanicalCompletionResponsible,
},
{
colId: 'MechanicalCompletionPhase',
headerName: domainNames.mcPhase,
valueGetter: (pkg) => pkg.data?.mechanicalCompletionPhase,
},
{
headerName: 'Pipetests',
valueGetter: (pkg) => pkg.data?.pipetest,
Expand Down
4 changes: 4 additions & 0 deletions libs/heattraceshared/src/lib/types/heattrace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@ export type HeatTrace = {
commissioningPackageUrlId: string | null;
commissioningResponsible: string | null;
commissioningStatus: string | null;
commissioningIdentifierCode: string | null;
commissioningIdentifierDescription: string | null;
mechanicalCompletionPackageNo: string | null;
mechanicalCompletionPackageId: string | null;
mechanicalCompletionUrlId: string | null;
mechanicalCompletionResponsible: string | null;
mechanicalCompletionStatus: string | null;
mechanicalCompletionPhase: string | null;
mechanicalCompletionHandoverStatus: string | null;
status: string;
discipline: string;
location: string;
Expand Down
4 changes: 2 additions & 2 deletions libs/pipingapp/src/lib/config/tableConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const columnDefinitions: [ColDef<Pipetest>, ...ColDef<Pipetest>[]] = [
},
{
headerName: domainNames.mcStatus,
colId: 'MechanicalCompletionStatus',
colId: 'mechanicalCompletionStatus',
valueGetter: (element) => element.data?.mechanicalCompletionStatus,
cellRenderer: (props: ICellRendererProps<Pipetest, string | null>) => {
if (!props.value) return;
Expand Down Expand Up @@ -154,4 +154,4 @@ const columnDefinitions: [ColDef<Pipetest>, ...ColDef<Pipetest>[]] = [
return <DescriptionCell description={values} />;
},
},
];
];
1 change: 1 addition & 0 deletions libs/shared/src/packages/utils-domain/names.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export const domainNames = {
mcPkg: 'Mc Pkg',
mcResponsible: `MC ${'Responsible'}`,
mcStatus: 'MC Status',
mcHandoverStatus: 'MC Handover Status',

// Punch
punch: 'Punch',
Expand Down

0 comments on commit 8c918b9

Please sign in to comment.