[ACS-3550] a 11 y aca move copy dialog small correction (#7986)

* ACS-3550 Removed redundant attributes

* ACS-3550 Removed redundant code
This commit is contained in:
AleksanderSklorz 2022-11-17 12:28:21 +01:00 committed by GitHub
parent afc6e19152
commit d3d917d010
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 16 deletions

View File

@ -8,11 +8,9 @@
class="adf-site-dropdown-list-element" class="adf-site-dropdown-list-element"
id="site-dropdown" id="site-dropdown"
placeholder="{{placeholder | translate}}" placeholder="{{placeholder | translate}}"
[aria-label]="ariaLabel"
floatPlaceholder="never" floatPlaceholder="never"
[(value)]="selected" [(value)]="selected"
(selectionChange)="selectedSite($event)" (selectionChange)="selectedSite($event)">
role="listbox">
<mat-option *ngFor="let site of siteList?.list.entries;" [value]="site"> <mat-option *ngFor="let site of siteList?.list.entries;" [value]="site">
{{ site.entry.title | translate}} {{ site.entry.title | translate}}
</mat-option> </mat-option>

View File

@ -76,7 +76,6 @@ export class DropdownSitesComponent implements OnInit {
private loading = true; private loading = true;
private skipCount = 0; private skipCount = 0;
private _ariaLabel = '';
selected: SiteEntry = null; selected: SiteEntry = null;
MY_FILES_VALUE = '-my-'; MY_FILES_VALUE = '-my-';
@ -88,16 +87,11 @@ export class DropdownSitesComponent implements OnInit {
} }
ngOnInit() { ngOnInit() {
this.updateAriaLabel(this.selected);
if (!this.siteList) { if (!this.siteList) {
this.loadSiteList(); this.loadSiteList();
} }
} }
get ariaLabel(): string {
return this._ariaLabel;
}
loadAllOnScroll() { loadAllOnScroll() {
if (this.isInfiniteScrollingEnabled()) { if (this.isInfiniteScrollingEnabled()) {
this.loading = true; this.loading = true;
@ -106,7 +100,6 @@ export class DropdownSitesComponent implements OnInit {
} }
selectedSite(event: MatSelectChange) { selectedSite(event: MatSelectChange) {
this.updateAriaLabel(event.value);
this.liveAnnouncer.announce(this.translateService.instant('ADF_DROPDOWN.SELECTION_ARIA_LABEL', { this.liveAnnouncer.announce(this.translateService.instant('ADF_DROPDOWN.SELECTION_ARIA_LABEL', {
placeholder: this.translateService.instant(this.placeholder), placeholder: this.translateService.instant(this.placeholder),
selectedOption: this.translateService.instant(event.value.entry.title) selectedOption: this.translateService.instant(event.value.entry.title)
@ -155,7 +148,6 @@ export class DropdownSitesComponent implements OnInit {
} }
this.selected = this.siteList.list.entries.find((site: SiteEntry) => site.entry.id === this.value); this.selected = this.siteList.list.entries.find((site: SiteEntry) => site.entry.id === this.value);
this.updateAriaLabel(this.selected);
if (this.value && !this.selected && this.siteListHasMoreItems()) { if (this.value && !this.selected && this.siteListHasMoreItems()) {
this.loadSiteList(); this.loadSiteList();
@ -190,8 +182,4 @@ export class DropdownSitesComponent implements OnInit {
return site.entry.visibility === 'PUBLIC' || return site.entry.visibility === 'PUBLIC' ||
!!site.relations.members.list.entries.find((member) => member.entry.id.toLowerCase() === loggedUserName.toLowerCase()); !!site.relations.members.list.entries.find((member) => member.entry.id.toLowerCase() === loggedUserName.toLowerCase());
} }
private updateAriaLabel(site: SiteEntry): void {
this._ariaLabel = `${this.translateService.instant(this.placeholder)} ${site ? this.translateService.instant(site.entry.title) : ''}`;
}
} }

View File

@ -582,6 +582,6 @@
}, },
"ADF_DROPDOWN": { "ADF_DROPDOWN": {
"LOADING": "Loading...", "LOADING": "Loading...",
"SELECTION_ARIA_LABEL": "{{placeholder}} listbox {{selectedOption}}" "SELECTION_ARIA_LABEL": "{{placeholder}} combobox {{selectedOption}}"
} }
} }