Skip to content

Commit

Permalink
feat: handover workorders tab
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustav-Eikaas committed Aug 21, 2024
1 parent 060c233 commit cf32aed
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 35 deletions.
33 changes: 17 additions & 16 deletions libs/handoversidesheet/src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,24 +84,25 @@ export type HandoverUnsignedTask = {
} & HandoverChild;

export type HandoverWorkOrder = {
workOrderNo: string;
workOrderNumber: string;
workOrderId: string;
workOrderUrlId: string;
projectProgress: number | null;
title: string | null;
description: null | null;
jobStatus: string | null;
materialStatus: string | null;
commissioningPackageNo: string | null;
commissioningPackageId: string | null;
facility: string | null;
commissioningPackageUrlId: string | null;
discipline: string | null;
plannedCompletionDate: string | null;
title: string;
jobStatus: string;
materialStatus: string;
commissioningPackageUrl: string;
facility: string;
discipline: string;
workOrderUrl: string | null;
actualCompletionDate: string | null;
workOrderUrl: string;
estimatedManHours: number | null;
remainingManHours: number | null;
workBreakdownStructure: string | null;
responsible: string | null;
plannedFinishDate: string | null;
remainingHours: number | null;
estimatedHours: number | null;
responsible: string;
workBreakdownStructure: string;
commpkgId: string | null;
commissioningPackageUrlId: string | null;
commpkgNumber: string | null;
} & HandoverChild;

Original file line number Diff line number Diff line change
Expand Up @@ -251,21 +251,7 @@ const HandoverSidesheetComponent = (props: Required<HandoverProps>) => {
</StyledPanel>
<StyledPanel>
<WorkorderTab
workorders={(workOrderPackages ?? []).map(
(workorder): WorkorderBase => ({
...workorder,
workOrderNumber: workorder.workOrderNo,
actualCompletionDate: workorder.actualCompletionDate,
plannedFinishDate: workorder.plannedCompletionDate,
discipline: workorder.discipline,
estimatedHours: workorder.estimatedManHours,
jobStatus: workorder.jobStatus,
remainingHours: workorder.remainingManHours,
title: workorder.title,
workOrderUrl: workorder.workOrderUrl,
projectProgress: workorder.projectProgress,
})
)}
workorders={workOrderPackages}
isFetching={isDataFetchingWorkOrder}
error={woError}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { ColDef, ICellRendererProps } from '@equinor/workspace-ag-grid';
import styled from 'styled-components';

import { DateCell } from '../../../../../../table-helpers/src/lib/table/cells/DateCell';
import { DescriptionCell } from '../../../../../../table-helpers/src/lib/table/cells/DescriptionCell';
import { EstimateCell } from '../../../../../../table-helpers/src/lib/table/cells/EstimateCell';
Expand All @@ -19,7 +17,7 @@ export const columns = (
cellRenderer: (props: ICellRendererProps<WorkorderBase, string | null>) => {
return (
<LinkCell
url={props.data?.workOrderUrl}
url={props.data?.workOrderUrl ?? undefined}
urlText={props.data?.workOrderNumber}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ export type WorkorderBase = {
title: string | null;
workOrderUrlId: string;
workOrderNumber: string;
workOrderUrl:string;
workOrderUrl: string | null;
};

0 comments on commit cf32aed

Please sign in to comment.