RED-6154, add unique ids to page header and table header inputs.

This commit is contained in:
George 2023-02-22 21:20:12 +02:00
parent a2bde131ad
commit d956c5f68d
4 changed files with 11 additions and 1 deletions

View File

@ -72,6 +72,7 @@
<ng-content select="[slot=right]"></ng-content>
<iqser-circle-button
[buttonId]="closeButtonId"
(action)="closeAction.emit()"
*ngIf="showCloseButton"
[class.ml-6]="actionConfigs"

View File

@ -35,6 +35,10 @@ export class PageHeaderComponent<T extends IListable> {
constructor(@Optional() readonly filterService: FilterService, @Optional() readonly searchService: SearchService<T>) {}
get closeButtonId() {
return this.pageLabel?.toLowerCase()?.replace(/ /g, '-') + '-close-view-btn';
}
get filterHelpModeKey() {
return this.helpModeKey ? `filter_${this.helpModeKey}_list` : '';
}

View File

@ -1,6 +1,7 @@
<div [class.selection-enabled]="selectionEnabled" class="header-item">
<div [iqserHelpMode]="helpModeKey" class="header-title">
<iqser-round-checkbox
[id]="selectAllId"
(click)="listingService.selectAll()"
*ngIf="selectionEnabled"
[active]="listingService.areAllSelected$ | async"
@ -8,7 +9,7 @@
></iqser-round-checkbox>
<span class="all-caps-label">
{{ tableHeaderLabel | translate : { length: totalSize || (listingService.displayedLength$ | async) } }}
{{ tableHeaderLabel | translate : {length: totalSize || (listingService.displayedLength$ | async)} }}
</span>
</div>

View File

@ -28,4 +28,8 @@ export class TableHeaderComponent<T extends IListable<PrimaryKey>, PrimaryKey ex
readonly listingService: ListingService<T>,
readonly filterService: FilterService,
) {}
get selectAllId() {
return this.tableHeaderLabel.split('.')[0].replace(/ /g, '-') + '-select-all-check';
}
}