Skip to content

Commit

Permalink
Merge branch 'feat--migrate-SWCR-serverside' of https://github.com/eq…
Browse files Browse the repository at this point in the history
…uinor/cc-components into feat--migrate-SWCR-serverside
  • Loading branch information
Gustav-Eikaas committed Nov 14, 2023
2 parents 25a6c7b + 9a9141c commit e6f02f2
Show file tree
Hide file tree
Showing 39 changed files with 328 additions and 878 deletions.
2 changes: 1 addition & 1 deletion apps/swcr/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createRender, RootAppWrapper } from '@cc-components/shared';
import { configure, WorkspaceWrapper } from '@cc-components/swcrapp';
import { useHttpClient } from '@equinor/fusion-framework-react-app/http';
import { createRender, RootAppWrapper } from '@cc-components/shared';

const SwcrApp = () => {
const client = useHttpClient('cc-api');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TabTable } from '../../../../../../table-helpers/src/lib/table/TabTable/TabTable';
import { StyledContentWrapper } from '@cc-components/sharedcomponents';
import { columns } from './columns';
import { columns } from './detailsColumns';
import { SwcrBase } from './types';

type SwcrTabProps<T> = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
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 { SwcrBase } from './types';

export const columns: ColDef<SwcrBase>[] = [
{
field: '#',
valueGetter: (pkg) => pkg.data?.softwareChangeRecordNo,
cellRenderer: (props: ICellRendererProps<SwcrBase, string | null>) => {
return (
<LinkCell
url={props.data?.softwareChangeRecordUrl}
urlText={props.data?.softwareChangeRecordNo}
/>
);
},
minWidth: 100,
},
{
field: 'Description',
valueGetter: (pkg) => pkg.data?.description,
cellRenderer: (props: ICellRendererProps<SwcrBase>) => (
<DescriptionCell description={props.value} />
),
flex: 1,
minWidth: 200,
},
{
field: 'Status',
valueGetter: (pkg) => pkg.data?.status,
flex: 1,
minWidth: 100,
},
{
field: 'Priority',
valueGetter: (pkg) => pkg.data?.priority,
flex: 1,
minWidth: 100,
},
];
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 { SwcrBase } from './types';

export const columns: ColDef<SwcrBase>[] = [
{
field: '#',
valueGetter: (pkg) => pkg.data?.softwareChangeRecordNo,
cellRenderer: (props: ICellRendererProps<SwcrBase, string | null>) => {
return (
<LinkCell
url={props.data?.softwareChangeRecordUrl}
urlText={props.data?.softwareChangeRecordNo}
/>
);
},
minWidth: 100,
},
{
field: 'Description',
valueGetter: (pkg) => pkg.data?.description,
cellRenderer: (props: ICellRendererProps<SwcrBase>) => (
<DescriptionCell description={props.value} />
),
flex: 1,
minWidth: 200,
},
{
field: 'Status',
valueGetter: (pkg) => pkg.data?.status,
flex: 1,
minWidth: 100,
},
{
field: 'Priority',
valueGetter: (pkg) => pkg.data?.priority,
flex: 1,
minWidth: 100,
},
];
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export type SwcrBase = {
softwareChangeRecordNo: string;
softwareChangeRecordId: string;
softwareChangeRecordUrl: string;
status: string;
softwareChangeRecordId: string;
description: string;
priority: string;
status: string;
};
1 change: 0 additions & 1 deletion libs/swcrapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"@cc-components/shared": "workspace:^",
"@cc-components/swcrshared": "workspace:^",
"@cc-components/swcrsidesheet": "workspace:^",
"@equinor/workspace-fusion": "5.1.0",
"@cc-components/sharedcomponents": "workspace:^"
}
}
112 changes: 0 additions & 112 deletions libs/swcrapp/src/lib/config/filterConfig.tsx

This file was deleted.

15 changes: 8 additions & 7 deletions libs/swcrapp/src/lib/config/gardenConfig.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { SwcrPackage } from '@cc-components/swcrshared';
import { GardenConfig } from '@equinor/workspace-fusion/garden';
import SwcrItem from '../ui-garden/Item';
import { FilterState } from '@equinor/workspace-fusion/filter';
import { useGardenDataSource } from '@cc-components/shared/workspace-config';
import { SwcrPackage } from '@cc-components/swcrshared';
import { useHttpClient } from '@equinor/fusion-framework-react-app/http';
import { FilterState } from '@equinor/workspace-fusion/filter';
import { GardenConfig } from '@equinor/workspace-fusion/garden';
import SwcrItem from '../ui-garden/Item';


export const useGardenConfig = (contextId: string): GardenConfig<SwcrPackage, FilterState> => {
export const useGardenConfig = (
contextId: string
): GardenConfig<SwcrPackage, FilterState> => {
const client = useHttpClient('cc-api');
const { getBlockAsync, getGardenMeta, getHeader, getSubgroupItems } =
useGardenDataSource({
Expand All @@ -24,7 +25,7 @@ export const useGardenConfig = (contextId: string): GardenConfig<SwcrPackage, Fi
getHeader,
getSubgroupItems,
getDisplayName: (item) => item.softwareChangeRecordNo,
initialGrouping: ['System'],
initialGrouping: ['RFC_PlannedDate'],
visuals: {
rowHeight: 25,
},
Expand Down
2 changes: 1 addition & 1 deletion libs/swcrapp/src/lib/config/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { WorkspaceWrapper } from './workspaceConfig';
export { configure } from './frameworkConfig';
export { WorkspaceWrapper } from './workspaceConfig';
4 changes: 2 additions & 2 deletions libs/swcrapp/src/lib/config/sidesheetConfig.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SidesheetConfig } from '@equinor/workspace-fusion/sidesheet';
import { SwcrSidesheet } from '@cc-components/swcrsidesheet';
import { SwcrPackage } from '@cc-components/swcrshared';
import { SwcrSidesheet } from '@cc-components/swcrsidesheet';
import { SidesheetConfig } from '@equinor/workspace-fusion/sidesheet';
export const sidesheetConfig: SidesheetConfig<SwcrPackage> = {
type: 'default',
DetailsSidesheet: (props) => (
Expand Down
4 changes: 2 additions & 2 deletions libs/swcrapp/src/lib/config/statusBarConfig.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useHttpClient } from '@cc-components/shared';
import { StatusBarConfig } from '@equinor/workspace-fusion/status-bar';
import { useHttpClient } from '@equinor/fusion-framework-react-app/http';

export const useStatusBarConfig = (contextId: string): StatusBarConfig => {
const client = useHttpClient('cc-api');
const client = useHttpClient();

return async (filters, signal) => {
const res = await client.fetch(`/api/contexts/${contextId}/SWCR/kpis`, {
Expand Down
Loading

0 comments on commit e6f02f2

Please sign in to comment.