Skip to content

Commit

Permalink
Merge branch 'main' into feat/3d-workorder
Browse files Browse the repository at this point in the history
  • Loading branch information
espenkalle authored Feb 14, 2024
2 parents 60b2795 + 3a79fa6 commit a49ae27
Show file tree
Hide file tree
Showing 36 changed files with 629 additions and 424 deletions.
2 changes: 2 additions & 0 deletions apps/piping/app.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ export default () => ({
},
environment: {
uri: 'https://backend-fusion-data-gateway-test.radix.equinor.com',
electricalUri:
'https://electrical-consumers-fusion-data-gateway-test.radix.equinor.com',
defaultScopes: ['api://ed6de162-dd30-4757-95eb-0ffc8d34fbe0/access_as_user'],
},
endpoints: {},
Expand Down
3 changes: 3 additions & 0 deletions apps/piping/app.config.local.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ export default () => ({
},
environment: {
uri: 'https://localhost:7074',
electricalUri:
'https://electrical-consumers-fusion-data-gateway-test.radix.equinor.com',
// electricalUri: 'https://localhost:7075',
defaultScopes: ['api://ed6de162-dd30-4757-95eb-0ffc8d34fbe0/access_as_user'],
},
endpoints: {},
Expand Down
16 changes: 15 additions & 1 deletion libs/heattraceapp/src/lib/config/tableConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import {
DateCell,
DescriptionCell,
LinkCell,
StatusCircle,
StyledMonospace,
pipetestStatusColormap,
useHttpClient,
} from '@cc-components/shared';

Expand Down Expand Up @@ -76,7 +78,19 @@ const columnDefinitions: [ColDef<HeatTrace>, ...ColDef<HeatTrace>[]] = [
},
},
// Need to implement the visual checklistStatus
{ headerName: 'Checklist status', valueGetter: (pkg) => pkg.data?.formStatus },
{
headerName: 'Checklist status',
valueGetter: (pkg) => pkg.data?.formStatus,
cellRenderer: (props: ICellRendererProps<HeatTrace, string>) => {
if (!props.data?.formStatus) return null;
return (
<StatusCircle
content={props.data.formStatus}
statusColor={pipetestStatusColormap[props.data.formStatus]}
/>
);
},
},
{ headerName: 'Current step', valueGetter: (pkg) => pkg.data?.checklistStep },
{
headerName: 'RFC',
Expand Down
1 change: 1 addition & 0 deletions libs/heattraceshared/src/lib/types/heatTraceChecklist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export type HeatTraceChecklist = {
checklistUrl: string | null;
commissioningPackageUrl: string | null;
mechanicalCompletionUrl: string | null;
tagUrl: string | null;
pipingRevisionMechanicalCompletionPackageNo: string;
register: string;
};
24 changes: 13 additions & 11 deletions libs/heattracesidesheet/src/lib/ui-sidesheet/HeattraceSidesheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ import { useMemo, useRef } from 'react';
import { useGetWorkorders } from '../utils-sidesheet';
import { WorkorderTab } from '@cc-components/shared/sidesheet';
import {
BaseStatus,
ElectricalNetwork,
LinkCell,
StatusCircle,
statusColorMap,
useContextId,
useHttpClient,
} from '@cc-components/shared';
Expand Down Expand Up @@ -44,19 +47,18 @@ const HeattraceSidesheetComponent = (props: Required<HeatTraceProps>) => {
/>
<StyledBanner>
<BannerItem
title="Heat trace"
title="Checklist status"
value={
props.item.heatTraceCableNo ? (
<LinkCell
url={props.item.heatTraceCableUrl ?? ''}
urlText={props.item.heatTraceCableNo}
/>
) : (
'N/A'
)
<StatusCircle
content={props?.item?.formStatus || 'N/A'}
statusColor={
props?.item?.formStatus
? statusColorMap[props.item.formStatus as BaseStatus]
: 'transparent'
}
/>
}
></BannerItem>
<BannerItem title="Checklist status" value={props.item.formStatus || 'N/A'} />
/>
<BannerItem
title="Comm Pkg"
value={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ export const checklistColumns: ColDef<HeatTraceChecklist>[] = [
headerName: 'Tag No',
valueGetter: (pkg) => pkg.data?.tagNo,
cellRenderer: (props: ICellRendererProps<HeatTraceChecklist>) => {
return (
<LinkCell url={props.data?.heatTraceCableUrl ?? ''} urlText={props.value ?? ''} />
);
return <LinkCell url={props.data?.tagUrl ?? ''} urlText={props.value ?? ''} />;
},
},
{
Expand All @@ -26,6 +24,10 @@ export const checklistColumns: ColDef<HeatTraceChecklist>[] = [
);
},
},
{
headerName: 'Formular group',
valueGetter: (pkg) => pkg.data?.formularGroup,
},
{
headerName: 'Responsible',
valueGetter: (pkg) => pkg.data?.formResponsible,
Expand Down
7 changes: 6 additions & 1 deletion libs/pipingapp/src/lib/config/frameworkConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export const configure = async (config: IAppConfigurator, c: ComponentRenderArgs
});
});
});
// Add more config if needed, e.g. enableAgGrid

const envConfig: PipingEnvConfig = c.env.config?.environment as PipingEnvConfig;

Expand All @@ -32,10 +31,16 @@ export const configure = async (config: IAppConfigurator, c: ComponentRenderArgs
defaultScopes: envConfig?.defaultScopes,
});

config.configureHttpClient('electrical-api', {
baseUri: envConfig?.electricalUri,
defaultScopes: envConfig?.defaultScopes,
});

enableAgGrid(config);
};

type PipingEnvConfig = {
uri: string;
electricalUri: string;
defaultScopes: string[];
};
7 changes: 5 additions & 2 deletions libs/pipingapp/src/lib/config/gardenConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,13 @@ export const useGardenConfig = (
getGardenMeta,
getHeader,
getSubgroupItems,
getDisplayName: (item) => item.id,
initialGrouping: ['Priority1'],
getDisplayName: (item) => item.pipetestNo,
initialGrouping: ['RFC'],
customViews: {
customItemView: GardenItem as any,
},
visuals: {
rowHeight: 31,
},
};
};
121 changes: 93 additions & 28 deletions libs/pipingapp/src/lib/config/tableConfig.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
import { ColDef, GridConfig, ICellRendererProps } from '@equinor/workspace-fusion/grid';
import { CheckList, Pipetest } from '@cc-components/pipingshared';
import { Pipetest } from '@cc-components/pipingshared';
import { FilterState } from '@equinor/workspace-fusion/filter';
import {
defaultGridOptions,
useGridDataSource,
} from '@cc-components/shared/workspace-config';
import {
BaseStatus,
DateCell,
DescriptionCell,
StyledMonospace,
LinkCell,
StatusCircle,
domainNames,
pipetestStatusColormap,
useHttpClient,
} from '@cc-components/shared';
import { generateCommaSeperatedStringArrayColumn } from '../utils-table/generateCommaSeperatedStringArrayColumn';
import { getHTList } from '../utils-table/tableHelpers';
import { generateCommaSeperatedString } from '../utils-table/tableHelpers';

export const useTableConfig = (contextId: string): GridConfig<Pipetest, FilterState> => {
const client = useHttpClient();
Expand Down Expand Up @@ -46,47 +49,109 @@ export const useTableConfig = (contextId: string): GridConfig<Pipetest, FilterSt
const columnDefinitions: [ColDef<Pipetest>, ...ColDef<Pipetest>[]] = [
{
headerName: 'Pipetest',
valueGetter: (pkg) => pkg.data?.id,
cellRenderer: (props: ICellRendererProps<Pipetest, string>) => {
return <StyledMonospace>{props.value}</StyledMonospace>;
},
colId: 'pipetestNo',
valueGetter: (element) => element.data?.pipetestNo,
cellRenderer: (props: ICellRendererProps<Pipetest, string>) => (
<LinkCell url={props.data?.mechanicalCompletionUrl} urlText={props.value ?? ''} />
),
},
{
headerName: 'Description',
colId: 'description',
valueGetter: (pkg) => pkg.data?.description,
valueGetter: (element) => element.data?.description,
cellRenderer: (props: ICellRendererProps<Pipetest, string | null>) => (
<DescriptionCell description={props.value} />
),
width: 300,
},
{
headerName: domainNames.commPriority1,
colId: 'priority1',
valueGetter: (element) => element.data?.priority1,
},
{
headerName: domainNames.commPriority2,
colId: 'priority2',
valueGetter: (element) => element.data?.priority2,
},
{
headerName: domainNames.commPriority3,
colId: 'priority3',
valueGetter: (element) => element.data?.priority3,
},
{
headerName: domainNames.mcLocation,
colId: 'location',
valueGetter: (element) => element.data?.location,
},
{
headerName: domainNames.mcStatus,
colId: 'MechanicalCompletionStatus',
valueGetter: (element) => element.data?.mechanicalCompletionStatus,
cellRenderer: (props: ICellRendererProps<Pipetest, string | null>) => {
return <DescriptionCell description={props.value} />;
if (!props.value) return;
return (
<StatusCircle
content={props.value}
statusColor={pipetestStatusColormap[props.value as BaseStatus]}
/>
);
},
width: 300,
},
{ headerName: 'Priority', valueGetter: (pkg) => pkg.data?.commPkPriority1 },
{
headerName: 'Location',
valueGetter: (pkg) => pkg.data?.location,
cellRenderer: (props: ICellRendererProps<Pipetest, string>) => {
return <StyledMonospace>{props.value}</StyledMonospace>;
headerName: domainNames.checklistStatus,
colId: 'formStatus',
valueGetter: (element) => element.data?.formStatus,
cellRenderer: (props: ICellRendererProps<Pipetest, string | null>) => {
if (!props.value) return;
return (
<StatusCircle
content={props.value}
statusColor={pipetestStatusColormap[props.value as BaseStatus]}
/>
);
},
},
{ headerName: 'Checklist status', valueGetter: (pkg) => 't.b.d :D' },
{ headerName: 'Current step', valueGetter: (pkg) => 't.b.d :D' },
{
headerName: domainNames.currentStep,
colId: 'currentStep',
valueGetter: (element) => element.data?.checklistStep,
},
{
headerName: 'RFC',
valueGetter: (pkg) => pkg.data?.rfccPlanned,
colId: 'rfCPlannedForecastDate',
valueGetter: (element) => element.data?.rfCPlannedForecastDate,
cellRenderer: (props: ICellRendererProps<Pipetest, string | null | undefined>) => {
return props.value ? <DateCell dateString={props.value} /> : null;
},
},
{
headerName: domainNames.commIdentifier,
colId: 'commIdentifier',
valueGetter: (element) => '', // TODO: Add this once it is ready in the backend
},
{
headerName: 'MC Handover Status',
colId: 'mechanicalCompletionHandoverStatus',
valueGetter: (element) => '', // TODO: Add this once it is ready in the backend
},
{
headerName: domainNames.mcResponsible,
colId: 'mechanicalCompletionResponsible',
valueGetter: (element) => element.data?.mechanicalCompletionResponsible,
},
{
headerName: domainNames.mcPhase,
colId: 'mechanicalCompletionPhase',
valueGetter: (element) => '', // TODO: Add this once it is ready in the backend
},
{
headerName: 'HT cables',
valueGetter: (pkg) => pkg.data?.checkLists,
cellRenderer: (props: ICellRendererProps<Pipetest, CheckList[]>) => {
if (!props.value) return null;
return (
<StyledMonospace>
{generateCommaSeperatedStringArrayColumn(getHTList(props.value))}
</StyledMonospace>
);
colId: 'heatTraceCableNos',
valueGetter: (element) => element.data?.heatTraceCableNos,
cellRenderer: (props: ICellRendererProps<Pipetest, string | null>) => {
const values = generateCommaSeperatedString(props.data?.heatTraceCableNos ?? []);
return <DescriptionCell description={values} />;
},
},
];
];
1 change: 1 addition & 0 deletions libs/pipingapp/src/lib/config/workspaceConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const WorkspaceWrapper = () => {
if (isLoading) {
return <CCApiAccessLoading />;
}

return (
<Workspace
key={contextId + bookmarkKey}
Expand Down
Loading

0 comments on commit a49ae27

Please sign in to comment.