diff --git a/client/apps/portal-administration/src/components/Ag-Grid/defaultGridOptions.ts b/client/apps/portal-administration/src/components/Ag-Grid/defaultGridOptions.ts index e8eec7f7..6da1b301 100644 --- a/client/apps/portal-administration/src/components/Ag-Grid/defaultGridOptions.ts +++ b/client/apps/portal-administration/src/components/Ag-Grid/defaultGridOptions.ts @@ -18,7 +18,7 @@ export const defaultGridOptions: GridOptions = { export const bottomPadding = 70; -export function capitalizeFirstLetter(str: string) { +export function capitalizeFirstLetter(str?: string) { if (!str) return ''; // Handle empty string return str.charAt(0).toUpperCase() + str.slice(1); } diff --git a/client/apps/portal-administration/src/components/PortalApps/portalAppsColDef.tsx b/client/apps/portal-administration/src/components/PortalApps/portalAppsColDef.tsx index d6b37c22..865b5e67 100644 --- a/client/apps/portal-administration/src/components/PortalApps/portalAppsColDef.tsx +++ b/client/apps/portal-administration/src/components/PortalApps/portalAppsColDef.tsx @@ -2,8 +2,7 @@ import { CustomCellRendererProps } from '@ag-grid-community/react'; import { AgStyles } from '../AgStyle'; import { ColDef } from '@equinor/workspace-ag-grid'; - -const FAIL_MESSAGE = 'Application Error!'; +import { capitalizeFirstLetter } from '../Ag-Grid/defaultGridOptions'; export const colDefs: ColDef[] = [ { @@ -65,11 +64,14 @@ export const colDefs: ColDef[] = [ cellRenderer: ( params: CustomCellRendererProps<{ appManifest?: { displayName: string }; + appKey: string; }> ) => { return ( - {params.data?.appManifest ? params.data?.appManifest.displayName : FAIL_MESSAGE} + {params.data?.appManifest + ? params.data?.appManifest.displayName + : capitalizeFirstLetter(params.data?.appKey)} ); }, @@ -93,20 +95,6 @@ export const colDefs: ColDef[] = [ filterOptions: ['contains', 'startsWith', 'endsWith'], defaultOption: 'startsWith', }, - cellRenderer: ( - params: CustomCellRendererProps<{ - appManifest?: { category: { displayName: string } }; - doesNotExistInFusion: boolean; - }> - ) => { - return ( - - {params.data?.doesNotExistInFusion === false - ? params.data?.appManifest?.category.displayName - : FAIL_MESSAGE} - - ); - }, }, { field: 'appManifest.build.version',