-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added roboto font #840
Merged
Merged
Added roboto font #840
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ import { campaignStatuses, headingMapping, resourceDataStatuses } from "../confi | |
import { getBoundaryColumnName, getBoundaryTabName } from "./boundaryUtils"; | ||
import { searchProjectTypeCampaignService } from "../service/campaignManageService"; | ||
import { validateBoundaryOfResouces } from "../validators/campaignValidators"; | ||
import { getExcelWorkbookFromFileURL, getNewExcelWorkbook, lockTargetFields } from "./excelUtils"; | ||
import { getExcelWorkbookFromFileURL, getNewExcelWorkbook, lockTargetFields, updateFontNameToRoboto } from "./excelUtils"; | ||
const _ = require('lodash'); | ||
|
||
|
||
|
@@ -243,6 +243,7 @@ function processErrorData(request: any, createAndSearchConfig: any, workbook: an | |
|
||
// Adjust the worksheet ref to include the last column | ||
adjustRef(worksheet, lastColumn); | ||
updateFontNameToRoboto(worksheet) | ||
|
||
workbook.xlsx.writeBuffer(); | ||
} | ||
|
@@ -277,6 +278,7 @@ function processErrorDataForTargets(request: any, createAndSearchConfig: any, wo | |
} | ||
|
||
request.body.additionalDetailsErrors = additionalDetailsErrors; | ||
updateFontNameToRoboto(desiredSheet) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar to the previous comment, add error handling around the - updateFontNameToRoboto(desiredSheet)
+ try {
+ updateFontNameToRoboto(desiredSheet);
+ } catch (error) {
+ logger.error('Failed to update font name to Roboto in desiredSheet:', error);
+ } |
||
workbook.worksheets[sheetName] = desiredSheet; | ||
} | ||
|
||
|
@@ -1245,6 +1247,7 @@ async function getCodesTarget(request: any, localizationMap?: any) { | |
} | ||
}); | ||
} | ||
logger.info("Boundary target mapping " + JSON.stringify(boundaryTargetMapping)); | ||
return boundaryTargetMapping; | ||
} | ||
|
||
|
@@ -1380,10 +1383,6 @@ async function createNewSheet(request: any, workbook: any, newSheetData: any, un | |
|
||
// const targetColumnNumber = localizedHeaders.findIndex((header: any) => header == getLocalizedHeaders(config?.targetColumnsForSpecificCampaigns?.smcCampaignColumns, localizationMap)); | ||
const boundaryCodeColumnIndex = localizedHeaders.findIndex((header: any) => header === getLocalizedName("HCM_ADMIN_CONSOLE_BOUNDARY_CODE", localizationMap)); | ||
// if (targetColumnNumber > -1) { | ||
// // Change the target column background color | ||
// changeFirstRowColumnColour(newSheet, 'B6D7A8', targetColumnNumber + 1); | ||
// } | ||
const responseFromCampaignSearch = await getCampaignSearchResponse(request); | ||
const campaignType = responseFromCampaignSearch?.CampaignDetails[0]?.projectType; | ||
const mdmsResponse = await callMdmsTypeSchema(request, request?.query?.tenantId, request?.query?.type, campaignType) | ||
|
@@ -1711,11 +1710,6 @@ const getConfigurableColumnHeadersBasedOnCampaignType = async (request: any, loc | |
const responseFromCampaignSearch = await getCampaignSearchResponse(request); | ||
const campaignType = responseFromCampaignSearch?.CampaignDetails[0]?.projectType; | ||
|
||
// const filters = { | ||
// "title": request?.query?.type || request?.body?.ResourceDetails?.type, | ||
// "campaignType": campaignType | ||
// } | ||
// Call the MDMSV2 API to get data | ||
const mdmsResponse = await callMdmsTypeSchema(request, request?.query?.tenantId || request?.body?.ResourceDetails?.tenantId, request?.query?.type || request?.body?.ResourceDetails?.type, campaignType) | ||
// const mdmsResponse = await callMdmsV2Data(request, config?.values?.moduleName, request?.query?.type || request?.body?.ResourceDetails?.type, request?.query?.tenantId || request?.body?.ResourceDetails?.tenantId, filters); | ||
if (!mdmsResponse || mdmsResponse?.columns.length === 0) { | ||
|
@@ -1725,9 +1719,6 @@ const getConfigurableColumnHeadersBasedOnCampaignType = async (request: any, loc | |
// Extract columns from the response | ||
const columnsForGivenCampaignId = mdmsResponse?.columns; | ||
|
||
// // Extract the names of columns and insert them into an array | ||
// const sortedColumnNames = columnsForGivenCampaignId?.map((column: any) => column.name); | ||
|
||
// Get localized headers based on the column names | ||
const headerColumnsAfterHierarchy = getLocalizedHeaders(columnsForGivenCampaignId, localizationMap); | ||
if (!headerColumnsAfterHierarchy.includes(getLocalizedName(config.boundary.boundaryCode, localizationMap))) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The call to
updateFontNameToRoboto
should be followed by error handling to ensure robustness.Committable suggestion