From 5255d5e5e770ca31aa5c93990204f27d5a815885 Mon Sep 17 00:00:00 2001 From: Remi Blom-Ohlsen Date: Thu, 25 Jan 2024 17:24:47 +0100 Subject: [PATCH] Fix for #1397 --- .../PortfolioWebParts/src/data/index.ts | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/SharePointFramework/PortfolioWebParts/src/data/index.ts b/SharePointFramework/PortfolioWebParts/src/data/index.ts index 33e1bf1d5..86e1573b5 100644 --- a/SharePointFramework/PortfolioWebParts/src/data/index.ts +++ b/SharePointFramework/PortfolioWebParts/src/data/index.ts @@ -156,15 +156,23 @@ export class DataAdapter implements IPortfolioWebPartsDataAdapter { ): Promise { try { let calculatedLevel = strings.DataSourceLevelPortfolio + if (this.portalDataService.url !== this._spfxContext.pageContext.web.absoluteUrl) { calculatedLevel = strings.DataSourceLevelProject } + level = level ?? calculatedLevel - const columns = await this.portalDataService.fetchProjectContentColumns( - 'PROJECT_CONTENT_COLUMNS', - category, - level - ) + + const columns: ProjectContentColumn[] = await new Promise((resolve, reject) => { + this.portalDataService.fetchProjectContentColumns( + 'PROJECT_CONTENT_COLUMNS', + category, + level + ) + .then(resolve) + .catch(reject) + }) + const [views, viewsUrls, columnUrls, levels] = await Promise.all([ this.fetchDataSources(category, level, columns), this.portalDataService.getListFormUrls('DATA_SOURCES'), @@ -173,6 +181,7 @@ export class DataAdapter implements IPortfolioWebPartsDataAdapter { .getByInternalNameOrTitle('GtDataSourceLevel') .select('Choices')() ]) + return { columns, views,