diff --git a/utilities/project-factory/src/server/utils/genericUtils.ts b/utilities/project-factory/src/server/utils/genericUtils.ts index 6c276c37092..cadf686227d 100644 --- a/utilities/project-factory/src/server/utils/genericUtils.ts +++ b/utilities/project-factory/src/server/utils/genericUtils.ts @@ -1084,10 +1084,18 @@ function getDifferentDistrictTabs(boundaryData: any, differentTabsBasedOnLevel: async function getConfigurableColumnHeadersFromSchemaForTargetSheet(request: any, hierarchy: any, boundaryData: any, differentTabsBasedOnLevel: any, campaignObject: any, localizationMap?: any) { const districtIndex = hierarchy.indexOf(differentTabsBasedOnLevel); - var headers = getLocalizedHeaders(hierarchy.slice(districtIndex), localizationMap); + let headers: any; + const isSourceMicroplan = checkIfSourceIsMicroplan(campaignObject); + if (isSourceMicroplan) { + logger.info(`Source is Microplan.`); + headers = getLocalizedHeaders(hierarchy, localizationMap); + } + else { + headers = getLocalizedHeaders(hierarchy.slice(districtIndex), localizationMap); const headerColumnsAfterHierarchy = await generateDynamicTargetHeaders(request, campaignObject, localizationMap); const localizedHeadersAfterHierarchy = getLocalizedHeaders(headerColumnsAfterHierarchy, localizationMap); headers = [...headers, getLocalizedName(config?.boundary?.boundaryCode, localizationMap), ...localizedHeadersAfterHierarchy] + } return getLocalizedHeaders(headers, localizationMap); }