[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"
id="site-dropdown"
placeholder="{{placeholder | translate}}"
[aria-label]="ariaLabel"
floatPlaceholder="never"
[(value)]="selected"
(selectionChange)="selectedSite($event)"
role="listbox">
(selectionChange)="selectedSite($event)">
<mat-option *ngFor="let site of siteList?.list.entries;" [value]="site">
{{ site.entry.title | translate}}
</mat-option>

View File

@ -76,7 +76,6 @@ export class DropdownSitesComponent implements OnInit {
private loading = true;
private skipCount = 0;
private _ariaLabel = '';
selected: SiteEntry = null;
MY_FILES_VALUE = '-my-';
@ -88,16 +87,11 @@ export class DropdownSitesComponent implements OnInit {
}
ngOnInit() {
this.updateAriaLabel(this.selected);
if (!this.siteList) {
this.loadSiteList();
}
}
get ariaLabel(): string {
return this._ariaLabel;
}
loadAllOnScroll() {
if (this.isInfiniteScrollingEnabled()) {
this.loading = true;
@ -106,7 +100,6 @@ export class DropdownSitesComponent implements OnInit {
}
selectedSite(event: MatSelectChange) {
this.updateAriaLabel(event.value);
this.liveAnnouncer.announce(this.translateService.instant('ADF_DROPDOWN.SELECTION_ARIA_LABEL', {
placeholder: this.translateService.instant(this.placeholder),
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.updateAriaLabel(this.selected);
if (this.value && !this.selected && this.siteListHasMoreItems()) {
this.loadSiteList();
@ -190,8 +182,4 @@ export class DropdownSitesComponent implements OnInit {
return site.entry.visibility === 'PUBLIC' ||
!!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": {
"LOADING": "Loading...",
"SELECTION_ARIA_LABEL": "{{placeholder}} listbox {{selectedOption}}"
"SELECTION_ARIA_LABEL": "{{placeholder}} combobox {{selectedOption}}"
}
}