WEB-638 fix: improve core utility logic and migrate from deprecated substr (#3062)

improve
This commit is contained in:
Shubham Kumar
2026-01-31 06:45:07 -06:00
committed by GitHub
parent ba47f04b62
commit 41a71cd269
8 changed files with 15 additions and 10 deletions
@@ -95,7 +95,7 @@ export class AmazonS3Component implements OnInit {
const value = configuration.value;
if (configuration.name === 's3_access_key' || configuration.name === 's3_secret_key') {
return value
? value.replace(value.substr(1, value.length - 3), value.substr(1, value.length - 3).replace(/./g, '*'))
? value.replace(value.substring(1, value.length - 2), value.substring(1, value.length - 2).replace(/./g, '*'))
: '';
}
return value;
@@ -94,7 +94,10 @@ export class NotificationComponent implements OnInit {
getConfigurationValue(configuration: any): string {
const value = configuration.value;
if (configuration.name === 'server_key') {
return value.replace(value.substr(1, value.length - 3), value.substr(1, value.length - 3).replace(/./g, '*'));
return value.replace(
value.substring(1, value.length - 2),
value.substring(1, value.length - 2).replace(/./g, '*')
);
}
return value;
}
@@ -110,7 +110,7 @@ export class ColumnDialogComponent implements OnInit {
return 'Dropdown';
}
default: {
return columnDisplayType[0] + columnDisplayType.substr(1).toLowerCase();
return columnDisplayType[0] + columnDisplayType.substring(1).toLowerCase();
}
}
}
@@ -449,7 +449,7 @@ export class EditDataTableComponent implements OnInit {
return 'Dropdown';
}
default: {
return columnDisplayType[0] + columnDisplayType.substr(1).toLowerCase();
return columnDisplayType[0] + columnDisplayType.substring(1).toLowerCase();
}
}
}