Browse Source

fix(iot-hub): ask to update a device package anyway, as on Remove

Updating a device package removes its entities and their data, like Remove, so the button is the same warning "Update anyway".
pull/16553/head
dpinkevych 4 weeks ago
parent
commit
5c7a55f71e
Failed to extract signature
  1. 4
      ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-update-dialog.component.html
  2. 5
      ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-update-dialog.component.ts
  3. 1
      ui-ngx/src/assets/locale/locale.constant-en_US.json

4
ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-update-dialog.component.html

@ -35,7 +35,9 @@
@switch (state) {
@case ('confirm') {
<button mat-button (click)="cancel()">{{ 'action.cancel' | translate }}</button>
<button mat-flat-button color="primary" (click)="update()">{{ 'iot-hub.update' | translate }}</button>
<button mat-flat-button [color]="reinstalls ? 'warn' : 'primary'" (click)="update()">
{{ (reinstalls ? 'iot-hub.update-anyway' : 'iot-hub.update') | translate }}
</button>
}
@case ('updating') {
<button mat-button disabled>{{ 'action.cancel' | translate }}</button>

5
ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-update-dialog.component.ts

@ -64,6 +64,11 @@ export class TbIotHubUpdateDialogComponent extends DialogComponent<TbIotHubUpdat
* types it is not stopped by the modified-entity check, so the tenant's own edits to those dashboards, devices
* and rule chains are lost. Say that instead of the generic "replace the current version" wording.
*/
/** A device package is reinstalled: its entities and their data are removed, as on Remove. */
get reinstalls(): boolean {
return this.data?.itemType === ItemType.DEVICE;
}
get updateDescKey(): string {
switch (this.data?.itemType) {
case ItemType.SOLUTION_TEMPLATE:

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

@ -3869,6 +3869,7 @@
"update-item-title": "Update Item",
"update-confirm": "Update '{{name}}' to version {{version}}?",
"update-confirm-title": "Update '{{name}}'?",
"update-anyway": "Update anyway",
"update-desc": "Updating this will replace the current version with the latest and reconfigure the associated resources within your tenant",
"device-update-removing": "Removing the entities of the installed version…",
"device-update-close-text": "The update has already removed entities of the installed version, and the new version is not installed yet. If you close the wizard now, the package stays at its installed version without them; Update installs it again.",

Loading…
Cancel
Save