mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4559] Add chips to multivalue metadata properties (#5552)
* [ADF-4559] Add chips to multivalue metadata properties * Fix app config schema * Restore app config * Fix checkListIsSorted method * Fix e2e datatable sorting * Fix e2e tests * Improve chips input
This commit is contained in:
@@ -118,14 +118,15 @@ export class DataTableComponentPage {
|
||||
*
|
||||
* @param sortOrder: 'ASC' if the list is await expected to be sorted ascending and 'DESC' for descending
|
||||
* @param columnTitle: titleColumn column
|
||||
* @param listType: 'string' for string typed lists and 'number' for number typed (int, float) lists
|
||||
* @return 'true' if the list is sorted as await expected and 'false' if it isn't
|
||||
*/
|
||||
async checkListIsSorted(sortOrder: string, columnTitle: string): Promise<any> {
|
||||
async checkListIsSorted(sortOrder: string, columnTitle: string, listType: string = 'STRING'): Promise<any> {
|
||||
const column = element.all(by.css(`div.adf-datatable-cell[title='${columnTitle}'] span`));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(column.first());
|
||||
const initialList = [];
|
||||
|
||||
const length = await column.count();
|
||||
const length = await column.count();
|
||||
|
||||
for (let i = 0; i < length; i++) {
|
||||
const text = await BrowserActions.getText(column.get(i));
|
||||
@@ -135,7 +136,12 @@ export class DataTableComponentPage {
|
||||
}
|
||||
|
||||
let sortedList = [...initialList];
|
||||
sortedList = sortedList.sort();
|
||||
if (listType.toLocaleLowerCase() === 'string') {
|
||||
sortedList = sortedList.sort();
|
||||
} else if (listType.toLocaleLowerCase() === 'number') {
|
||||
sortedList = sortedList.sort((a, b) => a - b);
|
||||
}
|
||||
|
||||
if (sortOrder.toLocaleLowerCase() === 'desc') {
|
||||
sortedList = sortedList.reverse();
|
||||
}
|
||||
|
Reference in New Issue
Block a user