Skip to content

Commit

Permalink
Fix for #1397
Browse files Browse the repository at this point in the history
  • Loading branch information
Remi749 committed Jan 25, 2024
1 parent f4dfa18 commit 5255d5e
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions SharePointFramework/PortfolioWebParts/src/data/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,23 @@ export class DataAdapter implements IPortfolioWebPartsDataAdapter {
): Promise<IPortfolioAggregationConfiguration> {
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'),
Expand All @@ -173,6 +181,7 @@ export class DataAdapter implements IPortfolioWebPartsDataAdapter {
.getByInternalNameOrTitle('GtDataSourceLevel')
.select('Choices')()
])

return {
columns,
views,
Expand Down

0 comments on commit 5255d5e

Please sign in to comment.