From a0505cc3f3f35426edc90df51e39985435ddb2bb Mon Sep 17 00:00:00 2001 From: Remi Blom-Ohlsen Date: Wed, 24 Jan 2024 16:19:04 +0100 Subject: [PATCH] Always show uncategorized ProjectContentColumns for all aggregated categories --- .../components/PortfolioAggregation/useDefaultColumns.tsx | 3 ++- .../src/services/PortalDataService/PortalDataService.ts | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/SharePointFramework/PortfolioWebParts/src/components/PortfolioAggregation/useDefaultColumns.tsx b/SharePointFramework/PortfolioWebParts/src/components/PortfolioAggregation/useDefaultColumns.tsx index dc542c603..00a1dc172 100644 --- a/SharePointFramework/PortfolioWebParts/src/components/PortfolioAggregation/useDefaultColumns.tsx +++ b/SharePointFramework/PortfolioWebParts/src/components/PortfolioAggregation/useDefaultColumns.tsx @@ -1,6 +1,7 @@ import _ from 'lodash' import { useMemo } from 'react' import { IPortfolioAggregationContext } from './context' +import { ProjectContentColumn } from 'pp365-shared-library' /** * Get default columns that should be included in the list view. @@ -8,7 +9,7 @@ import { IPortfolioAggregationContext } from './context' * @param context Context for the Portfolio Aggregation component */ export function useDefaultColumns(context: IPortfolioAggregationContext) { - const selectedColumns = useMemo( + const selectedColumns: ProjectContentColumn[] = useMemo( () => _.filter([...context.state.columns], (c) => c.data?.isSelected || c.data?.isLocked), [context.state.columns] ) diff --git a/SharePointFramework/shared-library/src/services/PortalDataService/PortalDataService.ts b/SharePointFramework/shared-library/src/services/PortalDataService/PortalDataService.ts index e68f5d1c5..86e8762e4 100644 --- a/SharePointFramework/shared-library/src/services/PortalDataService/PortalDataService.ts +++ b/SharePointFramework/shared-library/src/services/PortalDataService/PortalDataService.ts @@ -658,10 +658,14 @@ export class PortalDataService extends DataService - col.GtDataSourceCategory === dataSourceCategory || + col.GtDataSourceCategory === dataSourceCategory || col.GtDataSourceCategory === null || (!col.GtDataSourceCategory && !col.GtDataSourceLevel) || (!col.GtDataSourceCategory && _.contains(col.GtDataSourceLevel, level)) ) + + if (level === 'Prosjekt') + filteredColumnItems.filter((col) => col.GtInternalName !== 'SiteTitle') + return filteredColumnItems.map((item) => new ProjectContentColumn(item)) } catch (error) { throw new Error(error)