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

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

@ -25,14 +25,16 @@
<!-- Header --> <!-- Header -->
<div class="tb-installed-header"> <div class="tb-installed-header">
<h1 class="tb-installed-title">{{ 'iot-hub.installed-items' | translate }}</h1> <h1 class="tb-installed-title">{{ 'iot-hub.installed-items' | translate }}</h1>
<button mat-flat-button color="primary" (click)="checkForUpdates()" [disabled]="isCheckingUpdates"> @if (!updatesChecked) {
@if (isCheckingUpdates) { <button mat-flat-button color="primary" (click)="checkForUpdates()" [disabled]="isCheckingUpdates">
<mat-spinner diameter="18"></mat-spinner> @if (isCheckingUpdates) {
} @else { <mat-spinner diameter="18"></mat-spinner>
<mat-icon>update</mat-icon> } @else {
} <mat-icon>update</mat-icon>
{{ 'iot-hub.check-for-updates' | translate }} }
</button> {{ 'iot-hub.check-for-updates' | translate }}
</button>
}
</div> </div>
<!-- Filter + Search row --> <!-- 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 { 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 { MatDialog } from '@angular/material/dialog';
import { MatSort } from '@angular/material/sort'; import { MatSort } from '@angular/material/sort';
import { MatPaginator } from '@angular/material/paginator'; import { MatPaginator } from '@angular/material/paginator';
@ -72,11 +72,16 @@ export class TbIotHubInstalledItemsComponent implements OnInit, AfterViewInit {
private dialogService: DialogService, private dialogService: DialogService,
private translate: TranslateService, private translate: TranslateService,
private store: Store<AppState>, private store: Store<AppState>,
private route: ActivatedRoute,
private router: Router, private router: Router,
private dialog: MatDialog private dialog: MatDialog
) {} ) {}
ngOnInit(): void { ngOnInit(): void {
const itemType = this.route.snapshot.queryParamMap.get('itemType');
if (itemType && this.allItemTypes.includes(itemType)) {
this.activeTypeFilters.add(itemType);
}
this.searchSubject.pipe( this.searchSubject.pipe(
debounceTime(300) debounceTime(300)
).subscribe(() => { ).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 { navigateToInstalledItems(): void {
this.router.navigate(['/iot-hub/installed']); this.router.navigate(['/iot-hub/installed'], { queryParams: { itemType: this.config.type } });
} }
openSignup(): void { 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> <button mat-button (click)="close()">{{ (entityDetailsUrl ? 'action.cancel' : 'action.close') | translate }}</button>
@if (entityDetailsUrl) { @if (entityDetailsUrl) {
<button mat-flat-button color="primary" (click)="openEntityDetails()"> <button mat-flat-button color="primary" (click)="openEntityDetails()">
{{ 'iot-hub.open-details' | translate }} {{ 'iot-hub.open-item-type' | translate:{ type: getTypeLabel() } }}
</button> </button>
} }
} }

Loading…
Cancel
Save