mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-4077] - TaskCloud: Refactor priority (#6385)
* [AAE-4077] - TaskCloud: Refactor priority * export default priority values * Fix e2e tests * fix navigation from task-list * Update task-list-properties-sort.e2e.ts * Fix lint Co-authored-by: Cano <david.cano.nieto@gmail.com>
This commit is contained in:
@@ -171,6 +171,8 @@ export class DataTableComponentPage {
|
||||
sortedList = sortedList.sort();
|
||||
} else if (listType.toLocaleLowerCase() === 'number') {
|
||||
sortedList = sortedList.sort((a, b) => a - b);
|
||||
} else if (listType.toLocaleLowerCase() === 'priority') {
|
||||
sortedList = sortedList.sort(this.sortPriority);
|
||||
}
|
||||
|
||||
if (sortOrder.toLocaleLowerCase() === 'desc') {
|
||||
@@ -180,6 +182,34 @@ export class DataTableComponentPage {
|
||||
return initialList.toString() === sortedList.toString();
|
||||
}
|
||||
|
||||
sortPriority(a: string, b: string) {
|
||||
if (a === b) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (a.toLocaleLowerCase() === 'not set') {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (a.toLocaleLowerCase() === 'low') {
|
||||
if (b === 'not set') {
|
||||
return 1;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (a.toLocaleLowerCase() === 'normal') {
|
||||
if (b.toLocaleLowerCase() === 'high') {
|
||||
return -1;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
async rightClickOnRow(columnName: string, columnValue: string): Promise<void> {
|
||||
await this.rightClickOnItem(columnName, columnValue);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(element(by.id('adf-context-menu-content')));
|
||||
@@ -198,7 +228,7 @@ export class DataTableComponentPage {
|
||||
async rightClickOnItem(columnName: string, columnValue: string): Promise<void> {
|
||||
const row = this.getRow(columnName, columnValue);
|
||||
await BrowserActions.rightClick(row);
|
||||
}
|
||||
}
|
||||
|
||||
getFileHyperlink(filename: string): ElementFinder {
|
||||
return element(by.cssContainingText('adf-name-column[class*="adf-datatable-link"] span', filename));
|
||||
|
Reference in New Issue
Block a user