-
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.
435 mechanical completion migration (#638)
* feat: ♻️ mc migration init * feat: ✨ grouping and garden description * fix: 🐛 gettagsize fix * fix: 🐛 buggy popover fix * use data.commissioningStatus * feat: ✨ sidesheet tabs * merge main * add ncr to sidesheet * added url to sidesheet header * app.config * resolve
- Loading branch information
1 parent
e090891
commit d6247c3
Showing
36 changed files
with
602 additions
and
989 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 was deleted.
Oops, something went wrong.
130 changes: 0 additions & 130 deletions
130
libs/mechanicalcompletionapp/src/lib/config/filterConfig.tsx
This file was deleted.
Oops, something went wrong.
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
77 changes: 49 additions & 28 deletions
77
libs/mechanicalcompletionapp/src/lib/config/gardenConfig.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 |
---|---|---|
@@ -1,32 +1,53 @@ | ||
import { McPackage } from '@cc-components/mechanicalcompletionshared'; | ||
import { GardenConfig } from '@equinor/workspace-fusion/garden'; | ||
import { CustomGroupByKeys, ExtendedGardenFields } from '../types'; | ||
import { GardenHeader, GardenItem, GardenGroupBy } from '../ui-garden'; | ||
import { fieldSettings } from '../utils-garden/fieldSettings'; | ||
import { getHighlightedColumn } from '../utils-garden/getHighlightedColumn'; | ||
import { getItemWidth } from '../utils-garden/getItemWidth'; | ||
import { GardenItem } from '../ui-garden'; | ||
import { useGardenDataSource } from '@cc-components/shared/workspace-config'; | ||
import { useHttpClient } from '@cc-components/shared'; | ||
import { FilterState } from '@equinor/workspace-fusion/filter'; | ||
|
||
export const gardenConfig: GardenConfig< | ||
McPackage, | ||
ExtendedGardenFields, | ||
CustomGroupByKeys, | ||
Record<'averageTagVolume', number> | ||
> = { | ||
getDisplayName: (item) => item.mcPkgNumber, | ||
customGroupByKeys: { | ||
plannedForecast: 'Planned', | ||
weeklyDaily: 'Weekly', | ||
}, | ||
initialGrouping: { horizontalGroupingAccessor: 'rfcmc', verticalGroupingKeys: [] }, | ||
fieldSettings: fieldSettings, | ||
customViews: { | ||
customItemView: GardenItem, | ||
customHeaderView: GardenHeader, | ||
customGroupByView: GardenGroupBy, | ||
}, | ||
visuals: { | ||
calculateItemWidth: getItemWidth, | ||
highlightHorizontalColumn: getHighlightedColumn, | ||
rowHeight: 30, | ||
}, | ||
export const useGardenConfig = ( | ||
contextId: string | ||
): GardenConfig<McPackage, FilterState> => { | ||
const client = useHttpClient(); | ||
|
||
const { getBlockAsync, getGardenMeta, getHeader, getSubgroupItems } = | ||
useGardenDataSource({ | ||
getBlockAsync: (requestArgs) => | ||
client.fetch( | ||
`/api/contexts/${contextId}/mechanical-completion/garden`, | ||
requestArgs | ||
), | ||
getGardenMeta: (requestArgs) => | ||
client.fetch( | ||
`/api/contexts/${contextId}/mechanical-completion/garden-meta`, | ||
requestArgs | ||
), | ||
getHeader: (requestArgs) => | ||
client.fetch( | ||
`/api/contexts/${contextId}/mechanical-completion/garden`, | ||
requestArgs | ||
), | ||
getSubgroupItems: (requestArgs) => | ||
client.fetch( | ||
`/api/contexts/${contextId}/mechanical-completion/subgroup-items`, | ||
requestArgs | ||
), | ||
}); | ||
|
||
return { | ||
getDisplayName: (item) => item.mechanicalCompletionPackageNo, | ||
initialGrouping: ['RFCC'], | ||
initialDateVariant: 'Planned', | ||
initialTimeInterval: 'Weekly', | ||
getBlockAsync, | ||
getGardenMeta, | ||
getHeader, | ||
getSubgroupItems, | ||
customViews: { | ||
customItemView: GardenItem, | ||
}, | ||
visuals: { | ||
rowHeight: 31, | ||
}, | ||
}; | ||
}; |
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
51 changes: 20 additions & 31 deletions
51
libs/mechanicalcompletionapp/src/lib/config/statusBarConfig.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 |
---|---|---|
@@ -1,34 +1,23 @@ | ||
import { McPackage } from '@cc-components/mechanicalcompletionshared'; | ||
import { numberFormat } from '@cc-components/shared/utils-formatting'; | ||
import { useHttpClient } from '@cc-components/shared'; | ||
import { StatusBarConfig } from '@equinor/workspace-fusion/status-bar'; | ||
import { getStatusBarData } from '../utils-status-bar'; | ||
export const statusBarConfig: StatusBarConfig<McPackage> = (data) => { | ||
const kpis = getStatusBarData(data); | ||
|
||
return [ | ||
{ | ||
title: 'Total MCpkgs', | ||
value: numberFormat(kpis.mcPkgsCount), | ||
}, | ||
{ | ||
title: 'Final punch', | ||
value: numberFormat(kpis.finalPunchCount), | ||
}, | ||
{ | ||
title: 'Punch status Accepted', | ||
value: numberFormat(kpis.punchAcceptedCount), | ||
}, | ||
{ | ||
title: 'MC to Com', | ||
value: numberFormat(kpis.mcToComCount), | ||
}, | ||
{ | ||
title: 'RFCC', | ||
value: numberFormat(kpis.rfccCount), | ||
}, | ||
{ | ||
title: 'RFCC %', | ||
value: `${numberFormat(kpis.rfccPercentage)}%`, | ||
}, | ||
]; | ||
export const useStatusBarConfig = (contextId: string): StatusBarConfig => { | ||
const client = useHttpClient(); | ||
|
||
return async (filters, signal) => { | ||
const res = await client.fetch( | ||
`/api/contexts/${contextId}/mechanical-completion/kpis`, | ||
{ | ||
method: 'POST', | ||
body: JSON.stringify({ | ||
filter: filters, | ||
}), | ||
signal, | ||
headers: { | ||
['content-type']: 'application/json', | ||
}, | ||
} | ||
); | ||
return (await res.json()).map((s: any) => ({ ...s, title: s.name })); | ||
}; | ||
}; |
Oops, something went wrong.