[ADF-4831] DocumentList - filetype alternative text is not meaningful (#4998)

* filetype alternative text

* icons text translation key

* icon text accessibility translation

* fix e2e

* add miscellaneous file type
This commit is contained in:
Cilibiu Bogdan 2019-09-05 13:50:28 +03:00 committed by Eugenio Romano
parent ef09b077c4
commit bf6889ee54
3 changed files with 36 additions and 5 deletions

View File

@ -116,15 +116,28 @@
</mat-icon>
<ng-template #no_selected_row>
<img class="adf-datatable-center-img-ie"
[attr.aria-label]="data.getValue(row, col) | fileType"
alt="{{ iconAltTextKey(data.getValue(row, col)) | translate }}"
[attr.aria-label]=" (data.getValue(row, col) | fileType) === 'disable' ?
('ADF-DATATABLE.ACCESSIBILITY.ICON_DISABLED' | translate) :
'ADF-DATATABLE.ACCESSIBILITY.ICON_TEXT' | translate:{
type: 'ADF-DATATABLE.FILE_TYPE.' + (data.getValue(row, col) | fileType | uppercase) | translate
}"
[attr.alt]=" (data.getValue(row, col) | fileType) === 'disable' ?
('ADF-DATATABLE.ACCESSIBILITY.ICON_DISABLED' | translate) :
'ADF-DATATABLE.ACCESSIBILITY.ICON_TEXT' | translate:{
type: 'ADF-DATATABLE.FILE_TYPE.' + (data.getValue(row, col) | fileType | uppercase) | translate
}"
src="{{ data.getValue(row, col) }}"
(error)="onImageLoadingError($event, row)">
</ng-template>
</ng-template>
</div>
<div *ngSwitchCase="'icon'" class="adf-cell-value">
<span class="adf-sr-only">{{ iconAltTextKey(data.getValue(row, col)) | translate }}</span>
<span class="adf-sr-only">
{{ 'ADF-DATATABLE.ACCESSIBILITY.ICON_ALT_TEXT' | translate:{
type: 'ADF-DATATABLE.FILE_TYPE.' + (data.getValue(row, col) | fileType | uppercase) | translate
}
}}
</span>
<mat-icon>{{ data.getValue(row, col) }}</mat-icon>
</div>
<div *ngSwitchCase="'date'" class="adf-cell-value"

View File

@ -260,7 +260,25 @@
"SELECT_ALL": "Select all",
"SELECT_FILE": "Select file",
"SORT_ASCENDING": "ascending",
"SORT_DESCENDING": "descending"
"SORT_DESCENDING": "descending",
"ICON_TEXT": "File type {{ type }}",
"ICON_DISABLED": "disabled"
},
"FILE_TYPE": {
"DOCUMENT": "document",
"FOLDER": "folder",
"PDF": "pdf document",
"IMAGE": "image",
"EXCEL": "excel document",
"WORD": "word document",
"POWERPOINT": "powerpoint document",
"VIDEO": "video",
"AUDIO": "audio",
"WEBSITE": "website",
"ARCHIVE": "archive",
"PRESENTATION": "presentation",
"SPREADSHEET": "spreadsheet",
"MISCELLANEOUS": "miscellaneous"
}
},
"USER_PROFILE": {

View File

@ -322,7 +322,7 @@ export class DataTableComponentPage {
}
async checkRowContentIsDisabled(content: string): Promise<void> {
const resultElement = this.rootElement.all(by.css(`div[data-automation-id='${content}'] div.adf-cell-value img[aria-label='disable']`)).first();
const resultElement = this.rootElement.all(by.css(`div[data-automation-id='${content}'] div.adf-cell-value img[aria-label='disabled']`)).first();
await BrowserVisibility.waitUntilElementIsVisible(resultElement);
}