forked from DSpace/dspace-angular
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Bulk Access Management usability issues
- Added aria-labels to trash icon - Added aria-labels ui-switch components (had to upgrade ngx-ui-switch to 14.1.0) - Fixed aria-controls pointing to non-existing ids - Fixed bulk-access-browse not having the tab role on it's tabs
- Loading branch information
1 parent
cc71d60
commit 0534722
Showing
7 changed files
with
81 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 58 additions & 49 deletions
107
src/app/access-control/bulk-access/browse/bulk-access-browse.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,76 @@ | ||
<ngb-accordion #acc="ngbAccordion" [activeIds]="'browse'"> | ||
<ngb-panel [id]="'browse'"> | ||
<ng-template ngbPanelHeader> | ||
<div class="w-100 d-flex justify-content-between collapse-toggle" ngbPanelToggle (click)="acc.toggle('browse')" | ||
<div class="w-100 d-flex gap-3 justify-content-between collapse-toggle" ngbPanelToggle (click)="acc.toggle('browse')" | ||
data-test="browse"> | ||
<button type="button" class="btn btn-link p-0" (click)="$event.preventDefault()" | ||
[attr.aria-expanded]="!acc.isExpanded('browse')" | ||
aria-controls="collapsePanels"> | ||
aria-controls="bulk-access-browse-panel-content"> | ||
{{ 'admin.access-control.bulk-access-browse.header' | translate }} | ||
</button> | ||
<div class="text-right d-flex"> | ||
<div class="ml-3 d-inline-block"> | ||
<div class="text-right d-flex gap-2"> | ||
<div class="d-flex my-auto"> | ||
<span *ngIf="acc.isExpanded('browse')" class="fas fa-chevron-up fa-fw"></span> | ||
<span *ngIf="!acc.isExpanded('browse')" class="fas fa-chevron-down fa-fw"></span> | ||
</div> | ||
</div> | ||
</div> | ||
</ng-template> | ||
<ng-template ngbPanelContent> | ||
<ul ngbNav #nav="ngbNav" [(activeId)]="activateId" class="nav-pills"> | ||
<li [ngbNavItem]="'search'"> | ||
<a ngbNavLink>{{'admin.access-control.bulk-access-browse.search.header' | translate}}</a> | ||
<ng-template ngbNavContent> | ||
<div class="mx-n3"> | ||
<ds-themed-search [configuration]="'administrativeBulkAccess'" | ||
[selectable]="true" | ||
[selectionConfig]="{ repeatable: true, listId: listId }" | ||
[showThumbnails]="false"></ds-themed-search> | ||
</div> | ||
</ng-template> | ||
</li> | ||
<li [ngbNavItem]="'selected'"> | ||
<a ngbNavLink> | ||
{{'admin.access-control.bulk-access-browse.selected.header' | translate: {number: ((objectsSelected$ | async)?.payload?.totalElements) ? (objectsSelected$ | async)?.payload?.totalElements : '0'} }} | ||
</a> | ||
<ng-template ngbNavContent> | ||
<ds-pagination | ||
[paginationOptions]="(paginationOptions$ | async)" | ||
[pageInfoState]="(objectsSelected$|async)?.payload.pageInfo" | ||
[collectionSize]="(objectsSelected$|async)?.payload?.totalElements" | ||
[objects]="(objectsSelected$|async)" | ||
[showPaginator]="false" | ||
(prev)="pagePrev()" | ||
(next)="pageNext()"> | ||
<ul *ngIf="(objectsSelected$|async)?.hasSucceeded" class="list-unstyled ml-4"> | ||
<li *ngFor='let object of (objectsSelected$|async)?.payload?.page | paginate: { itemsPerPage: (paginationOptions$ | async).pageSize, | ||
currentPage: (paginationOptions$ | async).currentPage, totalItems: (objectsSelected$|async)?.payload?.page.length }; let i = index; let last = last ' | ||
class="mt-4 mb-4 d-flex" | ||
[attr.data-test]="'list-object' | dsBrowserOnly"> | ||
<ds-selectable-list-item-control [index]="i" | ||
[object]="object" | ||
[selectionConfig]="{ repeatable: true, listId: listId }"></ds-selectable-list-item-control> | ||
<ds-listable-object-component-loader [listID]="listId" | ||
[index]="i" | ||
[object]="object" | ||
[showThumbnails]="false" | ||
[viewMode]="'list'"></ds-listable-object-component-loader> | ||
</li> | ||
</ul> | ||
</ds-pagination> | ||
</ng-template> | ||
</li> | ||
</ul> | ||
<div [ngbNavOutlet]="nav" class="mt-5"></div> | ||
<div id="bulk-access-browse-panel-content"> | ||
<ul ngbNav #nav="ngbNav" [(activeId)]="activateId" class="nav-pills"> | ||
<li [attr.aria-selected]="activateId === 'search'" [ngbNavItem]="'search'" | ||
aria-controls="bulk-access-browse-panel-tab-search" role="tab"> | ||
<a id="bulk-access-browse-panel-link-search" ngbNavLink> | ||
{{'admin.access-control.bulk-access-browse.search.header' | translate}} | ||
</a> | ||
<ng-template ngbNavContent> | ||
<div aria-labelledby="bulk-access-browse-panel-link-search" class="mx-n3" | ||
id="bulk-access-browse-panel-tab-search"> | ||
<ds-themed-search [configuration]="'administrativeBulkAccess'" | ||
[selectable]="true" | ||
[selectionConfig]="{ repeatable: true, listId: listId }" | ||
[showThumbnails]="false"></ds-themed-search> | ||
</div> | ||
</ng-template> | ||
</li> | ||
<li [attr.aria-selected]="activateId === 'selected'" [ngbNavItem]="'selected'" | ||
aria-controls="bulk-access-browse-panel-tab-selected" role="tab"> | ||
<a id="bulk-access-browse-panel-link-selected" ngbNavLink> | ||
{{'admin.access-control.bulk-access-browse.selected.header' | translate: {number: ((objectsSelected$ | async)?.payload?.totalElements) ? (objectsSelected$ | async)?.payload?.totalElements : '0'} }} | ||
</a> | ||
<ng-template ngbNavContent> | ||
<ds-pagination | ||
[paginationOptions]="(paginationOptions$ | async)" | ||
[pageInfoState]="(objectsSelected$|async)?.payload.pageInfo" | ||
[collectionSize]="(objectsSelected$|async)?.payload?.totalElements" | ||
[objects]="(objectsSelected$|async)" | ||
[showPaginator]="false" | ||
(prev)="pagePrev()" | ||
(next)="pageNext()" | ||
aria-labelledby="bulk-access-browse-panel-link-selected" | ||
id="bulk-access-browse-panel-tab-selected"> | ||
<ul *ngIf="(objectsSelected$|async)?.hasSucceeded" class="list-unstyled ml-4"> | ||
<li *ngFor='let object of (objectsSelected$|async)?.payload?.page | paginate: { itemsPerPage: (paginationOptions$ | async).pageSize, | ||
currentPage: (paginationOptions$ | async).currentPage, totalItems: (objectsSelected$|async)?.payload?.page.length }; let i = index; let last = last ' | ||
class="mt-4 mb-4 d-flex" | ||
[attr.data-test]="'list-object' | dsBrowserOnly"> | ||
<ds-selectable-list-item-control [index]="i" | ||
[object]="object" | ||
[selectionConfig]="{ repeatable: true, listId: listId }"></ds-selectable-list-item-control> | ||
<ds-listable-object-component-loader [listID]="listId" | ||
[index]="i" | ||
[object]="object" | ||
[showThumbnails]="false" | ||
[viewMode]="'list'"></ds-listable-object-component-loader> | ||
</li> | ||
</ul> | ||
</ds-pagination> | ||
</ng-template> | ||
</li> | ||
</ul> | ||
<div [ngbNavOutlet]="nav" class="mt-5"></div> | ||
</div> | ||
</ng-template> | ||
</ngb-panel> | ||
</ngb-accordion> |
10 changes: 5 additions & 5 deletions
10
src/app/access-control/bulk-access/settings/bulk-access-settings.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
<ngb-accordion #acc="ngbAccordion" [activeIds]="'settings'"> | ||
<ngb-panel [id]="'settings'"> | ||
<ng-template ngbPanelHeader> | ||
<div class="w-100 d-flex justify-content-between collapse-toggle" ngbPanelToggle (click)="acc.toggle('settings')" data-test="settings"> | ||
<div class="w-100 d-flex gap-3 justify-content-between collapse-toggle" ngbPanelToggle (click)="acc.toggle('settings')" data-test="settings"> | ||
<button type="button" class="btn btn-link p-0" (click)="$event.preventDefault()" [attr.aria-expanded]="!acc.isExpanded('browse')" | ||
aria-controls="collapsePanels"> | ||
aria-controls="bulk-access-settings-panel-content"> | ||
{{ 'admin.access-control.bulk-access-settings.header' | translate }} | ||
</button> | ||
<div class="text-right d-flex"> | ||
<div class="ml-3 d-inline-block"> | ||
<div class="text-right d-flex gap-2"> | ||
<div class="d-flex my-auto"> | ||
<span *ngIf="acc.isExpanded('settings')" class="fas fa-chevron-up fa-fw"></span> | ||
<span *ngIf="!acc.isExpanded('settings')" class="fas fa-chevron-down fa-fw"></span> | ||
</div> | ||
</div> | ||
</div> | ||
</ng-template> | ||
<ng-template ngbPanelContent> | ||
<ds-access-control-form-container #dsAccessControlForm [showSubmit]="false"></ds-access-control-form-container> | ||
<ds-access-control-form-container id="bulk-access-settings-panel-content" #dsAccessControlForm [showSubmit]="false"></ds-access-control-form-container> | ||
</ng-template> | ||
</ngb-panel> | ||
</ngb-accordion> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters