mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
81901: Set aria-disabled for menu links and sidebar sections
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
<div class="sidebar-section">
|
<div class="sidebar-section">
|
||||||
<a class="nav-item nav-link d-flex flex-row flex-nowrap"
|
<a class="nav-item nav-link d-flex flex-row flex-nowrap"
|
||||||
attr.aria-labelledby="sidebarName-{{section.id}}"
|
[ngClass]="{ disabled: !hasLink }"
|
||||||
|
[attr.aria-disabled]="!hasLink"
|
||||||
|
[attr.aria-labelledby]="'sidebarName-' + section.id"
|
||||||
[title]="('menu.section.icon.' + section.id) | translate"
|
[title]="('menu.section.icon.' + section.id) | translate"
|
||||||
[routerLink]="itemModel.link"
|
[routerLink]="itemModel.link"
|
||||||
href="javascript:void(0);"
|
href="javascript:void(0);"
|
||||||
|
@@ -5,6 +5,7 @@ import { MenuService } from '../../../shared/menu/menu.service';
|
|||||||
import { rendersSectionForMenu } from '../../../shared/menu/menu-section.decorator';
|
import { rendersSectionForMenu } from '../../../shared/menu/menu-section.decorator';
|
||||||
import { LinkMenuItemModel } from '../../../shared/menu/menu-item/models/link.model';
|
import { LinkMenuItemModel } from '../../../shared/menu/menu-item/models/link.model';
|
||||||
import { MenuSection } from '../../../shared/menu/menu.reducer';
|
import { MenuSection } from '../../../shared/menu/menu.reducer';
|
||||||
|
import { isNotEmpty } from '../../../shared/empty.util';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a non-expandable section in the admin sidebar
|
* Represents a non-expandable section in the admin sidebar
|
||||||
@@ -24,12 +25,14 @@ export class AdminSidebarSectionComponent extends MenuSectionComponent implement
|
|||||||
*/
|
*/
|
||||||
menuID: MenuID = MenuID.ADMIN;
|
menuID: MenuID = MenuID.ADMIN;
|
||||||
itemModel;
|
itemModel;
|
||||||
|
hasLink: boolean;
|
||||||
constructor(@Inject('sectionDataProvider') menuSection: MenuSection, protected menuService: MenuService, protected injector: Injector,) {
|
constructor(@Inject('sectionDataProvider') menuSection: MenuSection, protected menuService: MenuService, protected injector: Injector,) {
|
||||||
super(menuSection, menuService, injector);
|
super(menuSection, menuService, injector);
|
||||||
this.itemModel = menuSection.model as LinkMenuItemModel;
|
this.itemModel = menuSection.model as LinkMenuItemModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
this.hasLink = isNotEmpty(this.itemModel.link);
|
||||||
super.ngOnInit();
|
super.ngOnInit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1 +1,6 @@
|
|||||||
<a href="javascript:void(0);" class="nav-item nav-link" [ngClass]="{'disabled': !hasLink}" [routerLink]="getRouterLink()">{{item.text | translate}}</a>
|
<a class="nav-item nav-link"
|
||||||
|
[ngClass]="{ 'disabled': !hasLink }"
|
||||||
|
[attr.aria-disabled]="!hasLink"
|
||||||
|
[routerLink]="getRouterLink()"
|
||||||
|
href="javascript:void(0);"
|
||||||
|
>{{item.text | translate}}</a>
|
||||||
|
Reference in New Issue
Block a user