Skip to content
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

limited the number of columns of target for upto only 18 in number #1190

Merged
merged 7 commits into from
Jul 31, 2024
8 changes: 5 additions & 3 deletions utilities/project-factory/src/server/utils/targetUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,15 @@ function modifyDeliveryConditions(dataa: any[]): any {

function generateTargetColumnsBasedOnDeliveryConditions(uniqueDeliveryConditions: any, localizationMap?: any) {
const targetColumnsBasedOnDeliveryConditions: string[] = [];

uniqueDeliveryConditions.forEach((str: any) => {
uniqueDeliveryConditions.forEach((str: any, index: number) => {
const uniqueDeliveryConditionsObject = JSON.parse(str); // Parse JSON string into object
const targetColumnString = createTargetString(uniqueDeliveryConditionsObject, localizationMap);
targetColumnsBasedOnDeliveryConditions.push(targetColumnString);
});

if (targetColumnsBasedOnDeliveryConditions.length > 18) {
targetColumnsBasedOnDeliveryConditions.splice(18);
targetColumnsBasedOnDeliveryConditions.push(getLocalizedName("OTHER_TARGETS", localizationMap));
}
return targetColumnsBasedOnDeliveryConditions;
}

Expand Down
Loading