Browse Source

Add type-specific dialog labels, itemType query param filter, and hide check-for-updates after use

- Install/update success dialogs show type-specific "Open {type}" label instead of generic "Open details"
- Items page navigates to installed items with ?itemType= query param
- Installed items page reads query param to pre-apply type filter
- Hide "Check for updates" button after updates are checked
pull/15508/head
Igor Kulikov 4 months ago
parent
commit
5e59700436
  1. 2
      ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-install-dialog.component.html
  2. 18
      ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-installed-items.component.html
  3. 7
      ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-installed-items.component.ts
  4. 2
      ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-items-page.component.ts
  5. 2
      ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-update-dialog.component.html

2
ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-install-dialog.component.html

@ -69,7 +69,7 @@
<button mat-button (click)="close()">{{ (entityDetailsUrl ? 'action.cancel' : 'action.close') | translate }}</button>
@if (entityDetailsUrl) {
<button mat-flat-button color="primary" (click)="openEntityDetails()">
{{ 'iot-hub.open-details' | translate }}
{{ 'iot-hub.open-item-type' | translate:{ type: getTypeLabel() } }}
</button>
}
}

18
ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-installed-items.component.html

@ -25,14 +25,16 @@
<!-- Header -->
<div class="tb-installed-header">
<h1 class="tb-installed-title">{{ 'iot-hub.installed-items' | translate }}</h1>
<button mat-flat-button color="primary" (click)="checkForUpdates()" [disabled]="isCheckingUpdates">
@if (isCheckingUpdates) {
<mat-spinner diameter="18"></mat-spinner>
} @else {
<mat-icon>update</mat-icon>
}
{{ 'iot-hub.check-for-updates' | translate }}
</button>
@if (!updatesChecked) {
<button mat-flat-button color="primary" (click)="checkForUpdates()" [disabled]="isCheckingUpdates">
@if (isCheckingUpdates) {
<mat-spinner diameter="18"></mat-spinner>
} @else {
<mat-icon>update</mat-icon>
}
{{ 'iot-hub.check-for-updates' | translate }}
</button>
}
</div>
<!-- Filter + Search row -->

7
ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-installed-items.component.ts

@ -15,7 +15,7 @@
///
import { Component, OnInit, AfterViewInit, ViewChild } from '@angular/core';
import { Router } from '@angular/router';
import { ActivatedRoute, Router } from '@angular/router';
import { MatDialog } from '@angular/material/dialog';
import { MatSort } from '@angular/material/sort';
import { MatPaginator } from '@angular/material/paginator';
@ -72,11 +72,16 @@ export class TbIotHubInstalledItemsComponent implements OnInit, AfterViewInit {
private dialogService: DialogService,
private translate: TranslateService,
private store: Store<AppState>,
private route: ActivatedRoute,
private router: Router,
private dialog: MatDialog
) {}
ngOnInit(): void {
const itemType = this.route.snapshot.queryParamMap.get('itemType');
if (itemType && this.allItemTypes.includes(itemType)) {
this.activeTypeFilters.add(itemType);
}
this.searchSubject.pipe(
debounceTime(300)
).subscribe(() => {

2
ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-items-page.component.ts

@ -100,7 +100,7 @@ export class TbIotHubItemsPageComponent implements OnInit {
}
navigateToInstalledItems(): void {
this.router.navigate(['/iot-hub/installed']);
this.router.navigate(['/iot-hub/installed'], { queryParams: { itemType: this.config.type } });
}
openSignup(): void {

2
ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-update-dialog.component.html

@ -53,7 +53,7 @@
<button mat-button (click)="close()">{{ (entityDetailsUrl ? 'action.cancel' : 'action.close') | translate }}</button>
@if (entityDetailsUrl) {
<button mat-flat-button color="primary" (click)="openEntityDetails()">
{{ 'iot-hub.open-details' | translate }}
{{ 'iot-hub.open-item-type' | translate:{ type: getTypeLabel() } }}
</button>
}
}

Loading…
Cancel
Save