Skip to content

Commit 8373868

Browse files
committed
[DSC-1864] porting of Fixed browse by vocabulary treeview accessibility issues
1 parent 251975d commit 8373868

2 files changed

Lines changed: 16 additions & 14 deletions

File tree

src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.html

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1-
<ds-alert *ngIf="description" [content]="description" [type]="'alert-info'"></ds-alert>
2-
<div class="treeview-header row mb-1">
3-
<div class="col-12">
1+
<ds-alert *ngIf="description" [content]="description" [type]="AlertType.Info"></ds-alert>
2+
<div class="treeview-header row">
3+
<div class="col-12 d-flex">
44
<div class="input-group">
5-
<input type="text" class="form-control" [(ngModel)]="searchText" (keyup.enter)="search()"
6-
[placeholder]="'vocabulary-treeview.search.form.search-placeholder' | translate">
5+
<input type="text" class="form-control" [(ngModel)]="searchText" (keyup.enter)="search()">
76
<div class="input-group-append" id="button-addon4">
8-
<button class="btn btn-outline-primary" type="button" (click)="search()" [disabled]="!isSearchEnabled()">
9-
{{'vocabulary-treeview.search.form.search' | translate}}
10-
</button>
11-
<button class="btn btn-outline-secondary" type="button" (click)="reset()">
12-
{{'vocabulary-treeview.search.form.reset' | translate}}
13-
</button>
14-
<button class="btn btn-outline-primary" type="button" (click)="add()" [disabled]="this.vocabularyOptions.closed">
15-
{{'vocabulary-treeview.search.form.add' | translate}}
7+
<button class="btn btn-primary" type="button" (click)="search()" [disabled]="!isSearchEnabled()">
8+
<span><i class="fas fa-search"></i> {{'vocabulary-treeview.search.form.search' | translate}}</span>
169
</button>
1710
</div>
1811
</div>
12+
<button class="btn btn-secondary ml-3 flex-shrink-0" type="button" (click)="reset()">
13+
<span><i class="fas fa-eraser"></i> {{'vocabulary-treeview.search.form.reset' | translate}}</span>
14+
</button>
15+
<button *ngIf="showAdd && !this.vocabularyOptions.closed" class="btn btn-secondary ml-3 flex-shrink-0" type="button" (click)="add()">
16+
<span><i class="fas fa-plus"></i> {{'vocabulary-treeview.search.form.add' | translate}}</span>
17+
</button>
1918
</div>
2019
</div>
2120
<div class="treeview-container">
@@ -59,7 +58,7 @@ <h2 *ngIf="!(loading | async) && dataSource.data.length === 0" class="h4 text-ce
5958
<button type="button" class="btn btn-default px-2 mr-1" cdkTreeNodeToggle
6059
[attr.aria-label]="'toggle ' + node.name"
6160
(click)="loadChildren(node)">
62-
<i class="fas fa-fw {{treeControl.isExpanded(node) ? 'fa-angle-down' : 'fa-angle-right'}}"></i>
61+
<span class="fas fa-fw {{treeControl.isExpanded(node) ? 'fa-angle-down' : 'fa-angle-right'}}"></span>
6362
</button>
6463

6564
<label *ngIf="multiSelect" class="d-flex align-items-center m-0 p-0 form-check"

src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { VocabularyTreeFlattener } from './vocabulary-tree-flattener';
1515
import { VocabularyTreeFlatDataSource } from './vocabulary-tree-flat-data-source';
1616
import { VocabularyService } from '../../../core/submission/vocabularies/vocabulary.service';
1717
import { FormFieldMetadataValueObject } from '../builder/models/form-field-metadata-value.model';
18+
import { AlertType } from '../../alert/alert-type';
1819

1920
export type VocabularyTreeItemType = FormFieldMetadataValueObject | VocabularyEntry | VocabularyEntryDetail;
2021

@@ -110,6 +111,8 @@ export class VocabularyTreeviewComponent implements OnDestroy, OnInit, OnChanges
110111
*/
111112
private subs: Subscription[] = [];
112113

114+
readonly AlertType = AlertType;
115+
113116
/**
114117
* Initialize instance variables
115118
*

0 commit comments

Comments
 (0)