Skip to content

Commit

Permalink
HLM-6407 adding changes for facility template
Browse files Browse the repository at this point in the history
  • Loading branch information
Priyanka-eGov committed Jul 23, 2024
1 parent ad39c8e commit 2e8be47
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion utilities/project-factory/src/server/utils/genericUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 2e8be47

Please sign in to comment.