[ADF-5543] Enable lint accessibility and resolve found issues (#9421)

This commit is contained in:
tomson
2024-04-17 09:36:40 +02:00
committed by GitHub
parent eaad09b06d
commit 74ef7eed1a
61 changed files with 1162 additions and 1054 deletions

View File

@@ -5,8 +5,7 @@
{
"files": ["*.ts"],
"extends": [
"plugin:@nrwl/nx/angular",
"plugin:@angular-eslint/template/process-inline-templates"
"plugin:@nrwl/nx/angular"
],
"rules": {
"jsdoc/newline-after-description": "warn",

View File

@@ -4,14 +4,15 @@
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell class="adf-file-properties-table-cell" *matCellDef="let element">
<mat-icon mat-list-icon class="adf-datatable-selected"
*ngIf="selectedNode && element.id === selectedNode.id" (click)="onRowClicked(element)">
*ngIf="selectedNode && element.id === selectedNode.id" (click)="onRowClicked(element)">
check_circle
</mat-icon>
<img mat-list-icon class="adf-attach-widget__icon"
*ngIf="!selectedNode || element.id !== selectedNode.id" [id]="'file-'+element?.id+'-icon'"
(click)="onRowClicked(element)"
[src]="element.content ? getIcon(element.content.mimeType) : getIcon(element['mimeType'])"
[alt]="mimeTypeIcon" role="button" tabindex="0" />
*ngIf="!selectedNode || element.id !== selectedNode.id" [id]="'file-'+element?.id+'-icon'"
(click)="onRowClicked(element)"
(keyup.enter)="onRowClicked(element)"
[src]="element.content ? getIcon(element.content.mimeType) : getIcon(element['mimeType'])"
[alt]="mimeTypeIcon" role="button" tabindex="0" />
</td>
</ng-container>
@@ -22,17 +23,22 @@
role="button"
tabindex="0"
class="adf-file"
(keyup.enter)="onAttachFileClicked(element)"
(click)="onAttachFileClicked(element)"
>{{element.name}}</span>
>{{ element.name }}</span>
</td>
</ng-container>
<ng-container *ngFor="let columnName of field?.params?.displayableCMProperties" [matColumnDef]="columnName.name">
<th mat-header-cell *matHeaderCellDef>{{ columnName.title ? columnName.title : columnName.name | titlecase
}}</th>
<ng-container *ngFor="let columnName of field?.params?.displayableCMProperties"
[matColumnDef]="columnName.name">
<th mat-header-cell *matHeaderCellDef>{{
columnName.title ? columnName.title : columnName.name | titlecase
}}
</th>
<td mat-cell class="adf-file-properties-table-cell" *matCellDef="let row">
<span matLine id="{{'fileProperty-'+row?.id+'-'+columnName?.name}}" role="button" tabindex="0"
(click)="onRowClicked(row)">{{ getColumnValue(row, columnName) }}</span>
(keyup.enter)="onRowClicked(row)"
(click)="onRowClicked(row)">{{ getColumnValue(row, columnName) }}</span>
</td>
</ng-container>
@@ -40,36 +46,40 @@
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell class="adf-file-properties-table-cell" *matCellDef="let element">
<button id="{{'file-'+element?.id+'-option-menu'}}" mat-icon-button [matMenuTriggerFor]="fileActionMenu"
*ngIf="!!element.content?.mimeType" [attr.aria-label]="'ADF_PROCESS_LIST.DETAILS.BUTTON.FILE_OPTION_MENU' | translate">
*ngIf="!!element.content?.mimeType"
[attr.aria-label]="'ADF_PROCESS_LIST.DETAILS.BUTTON.FILE_OPTION_MENU' | translate">
<mat-icon>more_vert</mat-icon>
</button>
<mat-menu #fileActionMenu="matMenu" xPosition="before">
<button *ngIf="displayMenuOption('show') && !!element.content?.mimeType"
id="{{'file-'+element?.id+'-show-file'}}" mat-menu-item (click)="onAttachFileClicked(element)">
id="{{'file-'+element?.id+'-show-file'}}" mat-menu-item
(click)="onAttachFileClicked(element)">
<mat-icon>visibility</mat-icon>
<span>{{ 'FORM.FIELD.VIEW_FILE' | translate }}</span>
</button>
<button *ngIf="displayMenuOption('download') && !!element.content?.mimeType"
id="{{'file-'+element?.id+'-download-file'}}" mat-menu-item (click)="downloadContent(element)">
id="{{'file-'+element?.id+'-download-file'}}" mat-menu-item
(click)="downloadContent(element)">
<mat-icon>file_download</mat-icon>
<span>{{ 'FORM.FIELD.DOWNLOAD_FILE' | translate }}</span>
</button>
<button *ngIf="displayMenuOption('retrieveMetadata') && !!element.content?.mimeType"
id="{{'file-'+element?.id+'-retrieve-file-metadata'}}" mat-menu-item
(click)="contentModelFormFileHandler(element)">
id="{{'file-'+element?.id+'-retrieve-file-metadata'}}" mat-menu-item
(click)="contentModelFormFileHandler(element)">
<mat-icon class="mat-24">low_priority</mat-icon>
<span>{{ 'ADF_CLOUD_FORM_COMPONENT.RETRIEVE_METADATA' | translate }}</span>
</button>
<button *ngIf="!field.readOnly && displayMenuOption('remove')"
id="{{'file-'+element?.id+'-remove-file'}}" mat-menu-item [id]="'file-'+element?.id+'-remove'"
(click)="onRemoveAttachFile(element);" (keyup.enter)="onRemoveAttachFile(element);">
id="{{'file-'+element?.id+'-remove-file'}}" mat-menu-item
[id]="'file-'+element?.id+'-remove'"
(click)="onRemoveAttachFile(element);" (keyup.enter)="onRemoveAttachFile(element);">
<mat-icon class="mat-24">highlight_off</mat-icon>
<span>{{ 'FORM.FIELD.REMOVE_FILE' | translate }}</span>
</button>
<div *ngIf="displayMenuOption('newVersion')">
<button [adf-upload]="true" [mode]="['click']"
(upload-files)="onUploadNewFileVersion($event, element);"
id="{{'file-'+ element?.id +'-upload-new-version'}}" mat-menu-item>
(upload-files)="onUploadNewFileVersion($event, element);"
id="{{'file-'+ element?.id +'-upload-new-version'}}" mat-menu-item>
<mat-icon class="mat-24">file_upload</mat-icon>
<span>{{ 'ADF_VERSION_LIST.ACTIONS.UPLOAD.TITLE' | translate }}</span>
</button>

View File

@@ -24,11 +24,11 @@
>
<ng-container *ngIf="previewState">
<label class="adf-display-external-property-widget-preview"
<span class="adf-display-external-property-widget-preview"
data-automation-id="adf-display-external-property-widget-preview"
>
{{ field.externalProperty }}
</label>
</span>
</ng-container>
</mat-form-field>