Browse Source
This version can only reinstall a device package. Update opens the same kind of window as an item that needs ThingsBoard 4.4 (#16231): it says so, leads to the Community Grant Program, and keeps "Update anyway" to reinstall through the install wizard.pull/16554/head
6 changed files with 102 additions and 26 deletions
@ -0,0 +1,29 @@ |
|||
<!-- |
|||
|
|||
SPDX-FileCopyrightText: Copyright The Thingsboard Authors |
|||
SPDX-License-Identifier: Apache-2.0 |
|||
|
|||
--> |
|||
<div class="tb-iot-hub-pe-required"> |
|||
<button mat-icon-button class="tb-iot-hub-pe-required-close" (click)="close()" tabindex="-1"> |
|||
<mat-icon>close</mat-icon> |
|||
</button> |
|||
|
|||
<span class="tb-iot-hub-pe-required-icon" aria-hidden="true"></span> |
|||
|
|||
<h2 class="tb-iot-hub-pe-required-title"> |
|||
{{ 'iot-hub.update-confirm-title' | translate:{ name: data.itemName } }} |
|||
</h2> |
|||
|
|||
<p class="tb-iot-hub-pe-required-message" |
|||
[innerHTML]="'iot-hub.update-desc-device' | translate"></p> |
|||
|
|||
<div class="tb-iot-hub-pe-required-actions"> |
|||
<button mat-stroked-button color="warn" (click)="reinstall()"> |
|||
{{ 'iot-hub.update-anyway' | translate }} |
|||
</button> |
|||
<button mat-flat-button color="primary" (click)="viewUpgradeOptions()"> |
|||
{{ 'iot-hub.view-upgrade-options' | translate }} |
|||
</button> |
|||
</div> |
|||
</div> |
|||
@ -0,0 +1,47 @@ |
|||
// SPDX-FileCopyrightText: Copyright The Thingsboard Authors
|
|||
// SPDX-License-Identifier: Apache-2.0
|
|||
import { Component, Inject } from '@angular/core'; |
|||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; |
|||
import { Router } from '@angular/router'; |
|||
import { Store } from '@ngrx/store'; |
|||
import { AppState } from '@core/core.state'; |
|||
import { DialogComponent } from '@shared/components/dialog.component'; |
|||
|
|||
export interface IotHubDeviceUpdateDialogData { |
|||
itemName: string; |
|||
} |
|||
|
|||
/** |
|||
* Update of a device package. This version can only reinstall it, so the dialog leads to the upgrade that updates device |
|||
* packages without reinstalling, as the dialog of an item that needs a newer version does, and keeps the reinstall as |
|||
* the other way. Closes with 'reinstall' when the user chooses it. |
|||
*/ |
|||
@Component({ |
|||
selector: 'tb-iot-hub-device-update-dialog', |
|||
standalone: false, |
|||
templateUrl: './iot-hub-device-update-dialog.component.html', |
|||
styleUrls: ['./iot-hub-pe-required-dialog.component.scss'] |
|||
}) |
|||
export class TbIotHubDeviceUpdateDialogComponent extends DialogComponent<TbIotHubDeviceUpdateDialogComponent, string | boolean> { |
|||
|
|||
constructor( |
|||
protected store: Store<AppState>, |
|||
protected router: Router, |
|||
protected dialogRef: MatDialogRef<TbIotHubDeviceUpdateDialogComponent, string | boolean>, |
|||
@Inject(MAT_DIALOG_DATA) public data: IotHubDeviceUpdateDialogData |
|||
) { |
|||
super(store, router, dialogRef); |
|||
} |
|||
|
|||
close(): void { |
|||
this.dialogRef.close(false); |
|||
} |
|||
|
|||
reinstall(): void { |
|||
this.dialogRef.close('reinstall'); |
|||
} |
|||
|
|||
viewUpgradeOptions(): void { |
|||
window.open('https://thingsboard.io/community-grant-program/', '_blank'); |
|||
} |
|||
} |
|||
Loading…
Reference in new issue