mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
[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:
parent
afc6e19152
commit
d3d917d010
@ -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>
|
||||||
|
@ -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) : ''}`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -582,6 +582,6 @@
|
|||||||
},
|
},
|
||||||
"ADF_DROPDOWN": {
|
"ADF_DROPDOWN": {
|
||||||
"LOADING": "Loading...",
|
"LOADING": "Loading...",
|
||||||
"SELECTION_ARIA_LABEL": "{{placeholder}} listbox {{selectedOption}}"
|
"SELECTION_ARIA_LABEL": "{{placeholder}} combobox {{selectedOption}}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user