-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add unsigned checklist tab to handover sidesheet (#1121)
* feat: Add unsigned checklist tab to handover sidesheet * Update libs/handoversidesheet/src/lib/ui-sidesheet/HandoverSidesheet.tsx Co-authored-by: Gustav-Eikaas <89254170+Gustav-Eikaas@users.noreply.github.com> --------- Co-authored-by: Gustav-Eikaas <89254170+Gustav-Eikaas@users.noreply.github.com>
- Loading branch information
1 parent
1c8bb70
commit 9b6fd5b
Showing
8 changed files
with
123 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
.../src/packages/sidesheet/src/lib/sidesheet/tabs/unsignedChecklist/UnsignedChecklistTab.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 { UnsignedChecklistBase } from './types'; | ||
|
||
type UnsignedChecklistTabProps<T> = { | ||
unsignedChecklists: T[] | undefined; | ||
isFetching: boolean; | ||
error: Error | null; | ||
}; | ||
export const UnsignedChecklistTab = <T extends UnsignedChecklistBase>({ | ||
unsignedChecklists: unsignedChecklists, | ||
error, | ||
isFetching, | ||
}: UnsignedChecklistTabProps<T>): JSX.Element => { | ||
return ( | ||
<StyledContentWrapper> | ||
<TabTable | ||
columns={columns} | ||
error={error} | ||
isFetching={isFetching} | ||
packages={unsignedChecklists} | ||
resourceName="Unsigned Checklists" | ||
/> | ||
</StyledContentWrapper> | ||
); | ||
}; |
52 changes: 52 additions & 0 deletions
52
libs/shared/src/packages/sidesheet/src/lib/sidesheet/tabs/unsignedChecklist/columns.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
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 { UnsignedChecklistBase } from './types'; | ||
|
||
export const columns: ColDef<UnsignedChecklistBase>[] = [ | ||
{ | ||
colId: 'type', | ||
headerName: 'Type', | ||
valueGetter: (pkg) => pkg.data?.type, | ||
cellRenderer: (props: ICellRendererProps<UnsignedChecklistBase>) => { | ||
return <LinkCell url={props.data?.checklistUrl} urlText={props.value} />; | ||
}, | ||
flex: 1, | ||
}, | ||
{ | ||
colId: 'group', | ||
headerName: 'Group', | ||
valueGetter: (pkg) => pkg.data?.group, | ||
cellRenderer: (props: ICellRendererProps<UnsignedChecklistBase, string | null>) => { | ||
return <DescriptionCell description={props.value} displayFullText />; | ||
}, | ||
flex: 1, | ||
}, | ||
{ | ||
colId: 'discipline', | ||
headerName: 'Discipline', | ||
valueGetter: (pkg) => pkg.data?.discipline, | ||
cellRenderer: (props: ICellRendererProps<UnsignedChecklistBase, string | null>) => { | ||
return <DescriptionCell description={props.value} displayFullText />; | ||
}, | ||
flex: 1, | ||
}, | ||
{ | ||
colId: 'responsible', | ||
headerName: 'Responsible', | ||
valueGetter: (pkg) => pkg.data?.responsible, | ||
cellRenderer: (props: ICellRendererProps<UnsignedChecklistBase, string | null>) => { | ||
return <DescriptionCell description={props.value} displayFullText />; | ||
}, | ||
flex: 1, | ||
}, | ||
{ | ||
colId: '#', | ||
headerName: 'Tag', | ||
valueGetter: (pkg) => pkg.data?.tagNo, | ||
cellRenderer: (props: ICellRendererProps<UnsignedChecklistBase, string | null>) => { | ||
return <DescriptionCell description={props.value} displayFullText />; | ||
}, | ||
flex: 1, | ||
}, | ||
]; |
1 change: 1 addition & 0 deletions
1
libs/shared/src/packages/sidesheet/src/lib/sidesheet/tabs/unsignedChecklist/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { UnsignedChecklistTab } from './UnsignedChecklistTab'; |
8 changes: 8 additions & 0 deletions
8
libs/shared/src/packages/sidesheet/src/lib/sidesheet/tabs/unsignedChecklist/types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export type UnsignedChecklistBase = { | ||
type: string; | ||
group: string; | ||
discipline: string; | ||
responsible: string; | ||
tagNo: string; | ||
checklistUrl: string; | ||
}; |