Browse Source

UI: Add "Confirm OTA Update" title to OTA update confirmation dialog

pull/13533/head
Vladyslav_Prykhodko 1 year ago
parent
commit
2dadf7207c
  1. 11
      ui-ngx/src/app/core/http/ota-package.service.ts
  2. 1
      ui-ngx/src/assets/locale/locale.constant-en_US.json

11
ui-ngx/src/app/core/http/ota-package.service.ts

@ -129,15 +129,16 @@ export class OtaPackageService {
}
return forkJoin(tasks).pipe(
mergeMap(([deviceFirmwareUpdate, deviceSoftwareUpdate]) => {
let text = '';
const lines: string[] = [];
if (deviceFirmwareUpdate > 0) {
text += this.translate.instant('ota-update.change-firmware', {count: deviceFirmwareUpdate});
lines.push(this.translate.instant('ota-update.change-firmware', {count: deviceFirmwareUpdate}));
}
if (deviceSoftwareUpdate > 0) {
text += text.length ? ' ' : '';
text += this.translate.instant('ota-update.change-software', {count: deviceSoftwareUpdate});
lines.push(this.translate.instant('ota-update.change-software', {count: deviceSoftwareUpdate}));
}
return text !== '' ? this.dialogService.confirm('', text, null, this.translate.instant('common.proceed')) : of(true);
return lines.length
? this.dialogService.confirm(this.translate.instant('ota-update.change-ota-setting-title'), lines.join('<br/>'), null, this.translate.instant('common.proceed'))
: of(true);
})
);
}

1
ui-ngx/src/assets/locale/locale.constant-en_US.json

@ -4167,6 +4167,7 @@
"checksum-copied-message": "Package checksum has been copied to clipboard",
"change-firmware": "Change of the firmware may cause update of { count, plural, =1 {1 device} other {# devices} }.",
"change-software": "Change of the software may cause update of { count, plural, =1 {1 device} other {# devices} }.",
"change-ota-setting-title": "Are you sure you want to change OTA settings?",
"chose-compatible-device-profile": "The uploaded package will be available only for devices with the chosen profile.",
"chose-firmware-distributed-device": "Choose firmware that will be distributed to the devices",
"chose-software-distributed-device": "Choose software that will be distributed to the devices",

Loading…
Cancel
Save