diff --git a/libs/handoversidesheet/src/lib/types.ts b/libs/handoversidesheet/src/lib/types.ts index e0b8a3027..de7b1d526 100644 --- a/libs/handoversidesheet/src/lib/types.ts +++ b/libs/handoversidesheet/src/lib/types.ts @@ -115,3 +115,12 @@ export type HandoverWorkOrder = { commissioningPackageUrlId: string | null; commpkgNumber: string | null; } & HandoverChild; + +export type HandoverNotification = { + notificationNo: string; + type: string; + title: string; + status: string; + nextToSign: string; + notificationUrl: string; +} \ No newline at end of file diff --git a/libs/handoversidesheet/src/lib/ui-sidesheet/HandoverSidesheet.tsx b/libs/handoversidesheet/src/lib/ui-sidesheet/HandoverSidesheet.tsx index 020250601..31b20481d 100644 --- a/libs/handoversidesheet/src/lib/ui-sidesheet/HandoverSidesheet.tsx +++ b/libs/handoversidesheet/src/lib/ui-sidesheet/HandoverSidesheet.tsx @@ -21,6 +21,7 @@ import { PunchTab, QueryTab, SwcrTab, + NotificationTab, UnsignedActionTab, UnsignedTaskTab, UnsignedChecklistTab, @@ -145,6 +146,12 @@ const HandoverSidesheetComponent = (props: Required) => { error: queryError, } = useHandoverResource(props.id, 'query'); + const { + data: notifications, + dataIsFetching: isDataFetchingNotifications, + error: notificationsError, + } = useHandoverResource(props.item.commissioningPackageId, 'notifications'); + const { data: ncrPackages, dataIsFetching: isDataFetchingNcr, @@ -233,7 +240,6 @@ const HandoverSidesheetComponent = (props: Required) => { Unsigned Checklists - ) => { Query {' '} + + Notifications + {' '} + + NCR {' '} @@ -321,6 +335,13 @@ const HandoverSidesheetComponent = (props: Required) => { error={queryError} /> + + + = { diff --git a/libs/shared/src/packages/sidesheet/src/lib/sidesheet/tabs/index.ts b/libs/shared/src/packages/sidesheet/src/lib/sidesheet/tabs/index.ts index c1a2c5c7a..e29856074 100644 --- a/libs/shared/src/packages/sidesheet/src/lib/sidesheet/tabs/index.ts +++ b/libs/shared/src/packages/sidesheet/src/lib/sidesheet/tabs/index.ts @@ -10,3 +10,4 @@ export * from './unsignedChecklist'; export * from './details'; export * from './material'; export * from './mccr'; +export * from './notification'; diff --git a/libs/shared/src/packages/sidesheet/src/lib/sidesheet/tabs/notification/NotificationTab.tsx b/libs/shared/src/packages/sidesheet/src/lib/sidesheet/tabs/notification/NotificationTab.tsx new file mode 100644 index 000000000..d3aab7ce3 --- /dev/null +++ b/libs/shared/src/packages/sidesheet/src/lib/sidesheet/tabs/notification/NotificationTab.tsx @@ -0,0 +1,27 @@ +import { TabTable } from '../../../../../../table-helpers/src/lib/table/TabTable/TabTable'; +import { StyledContentWrapper } from '@cc-components/sharedcomponents'; +import { columns } from './columns'; +import { NotificationBase } from './types'; + +type NotificationTabProps = { + notifications: T[] | undefined; + isFetching: boolean; + error: Error | null; +}; +export const NotificationTab = ({ + error, + isFetching, + notifications, +}: NotificationTabProps): JSX.Element => { + return ( + + + + ); +}; diff --git a/libs/shared/src/packages/sidesheet/src/lib/sidesheet/tabs/notification/columns.tsx b/libs/shared/src/packages/sidesheet/src/lib/sidesheet/tabs/notification/columns.tsx new file mode 100644 index 000000000..e5df9c94b --- /dev/null +++ b/libs/shared/src/packages/sidesheet/src/lib/sidesheet/tabs/notification/columns.tsx @@ -0,0 +1,38 @@ +import { ColDef, ICellRendererProps } from '@equinor/workspace-ag-grid'; + +import { DescriptionCell } from '../../../../../../table-helpers/src/lib/table/cells/DescriptionCell'; +import { LinkCell } from '../../../../../../table-helpers/src/lib/table/cells/LinkCell'; +import { NotificationBase } from './types'; + +export const columns: ColDef[] = [ + { + headerName: 'Document No.', + valueGetter: (pkg) => pkg.data?.notificationNo, + cellRenderer: (props: ICellRendererProps) => { + return ( + + ); + }, + }, + { + colId: 'title', + headerName: 'Title', + valueGetter: (pkg) => pkg.data?.title, + cellRenderer: (props: ICellRendererProps) => { + return ; + }, + width: 200, + }, + { + headerName: 'Status', + valueGetter: (pkg) => pkg.data?.status, + }, + + { + headerName: 'Next to sign', + valueGetter: (pkg) => pkg.data?.nextToSign, + }, +]; diff --git a/libs/shared/src/packages/sidesheet/src/lib/sidesheet/tabs/notification/index.ts b/libs/shared/src/packages/sidesheet/src/lib/sidesheet/tabs/notification/index.ts new file mode 100644 index 000000000..8ab4ca465 --- /dev/null +++ b/libs/shared/src/packages/sidesheet/src/lib/sidesheet/tabs/notification/index.ts @@ -0,0 +1 @@ +export { NotificationTab } from './NotificationTab'; diff --git a/libs/shared/src/packages/sidesheet/src/lib/sidesheet/tabs/notification/types.ts b/libs/shared/src/packages/sidesheet/src/lib/sidesheet/tabs/notification/types.ts new file mode 100644 index 000000000..c15250e57 --- /dev/null +++ b/libs/shared/src/packages/sidesheet/src/lib/sidesheet/tabs/notification/types.ts @@ -0,0 +1,8 @@ +export type NotificationBase = { + notificationNo: string; + type: string; + title: string; + status: string; + nextToSign: string; + notificationUrl: string; +}; diff --git a/libs/shared/src/packages/sidesheet/src/lib/sidesheet/tabs/query/QueryTab.tsx b/libs/shared/src/packages/sidesheet/src/lib/sidesheet/tabs/query/QueryTab.tsx index 255aab7cf..242f4768a 100644 --- a/libs/shared/src/packages/sidesheet/src/lib/sidesheet/tabs/query/QueryTab.tsx +++ b/libs/shared/src/packages/sidesheet/src/lib/sidesheet/tabs/query/QueryTab.tsx @@ -20,7 +20,7 @@ export const QueryTab = ({ error={error} isFetching={isFetching} packages={queries} - resourceName="Query / Notification" + resourceName="Query" /> );