[ACS-8080] Enable multiselection in lists (#3873)

* [ACS-8080] Enable multiselection in lists

* [ACS-8080] Fix selected row in E2Es

* [ACS-8080] E2Es fix

* [ACS-8080] E2Es fix

---------

Co-authored-by: akash.rathod@hyland.com <akash.rathod@hyland.com>
This commit is contained in:
MichalKinas 2024-06-06 08:15:34 +02:00 committed by GitHub
parent 157451841c
commit a5343fd627
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 24 additions and 17 deletions

View File

@ -115,7 +115,7 @@ test.describe('Info Drawer - Comments', () => {
await fileActionsApi.waitForNodes(recentFile, { expect: 1 });
await recentFilesPage.navigate();
await expect(recentFilesPage.dataTable.getRowByName(recentFile)).toBeVisible();
await recentFilesPage.dataTable.getRowByName(recentFile).click();
await recentFilesPage.dataTable.selectItem(recentFile);
await recentFilesPage.acaHeader.viewDetails.click();
await recentFilesPage.infoDrawer.commentsTab.click();
await expect(recentFilesPage.infoDrawer.commentInputField).toBeVisible();

View File

@ -12,7 +12,8 @@
acaContextActions
[node]="$any(list)"
[loading]="isLoading"
[selectionMode]="'single'"
[selectionMode]="'multiple'"
[multiselect]="true"
[navigate]="false"
[sorting]="['title', 'asc']"
[sortingMode]="'client'"

View File

@ -12,6 +12,7 @@
acaContextActions
[currentFolderId]="'-favorites-'"
[selectionMode]="'multiple'"
[multiselect]="true"
[navigate]="false"
[sorting]="['modifiedAt', 'desc']"
[sortingMode]="'client'"

View File

@ -16,7 +16,7 @@
acaDocumentList
acaContextActions
[selectionMode]="'multiple'"
[multiselect]="false"
[multiselect]="true"
[currentFolderId]="node?.id"
[loading]="true"
[showHeader]="showHeader"

View File

@ -11,7 +11,8 @@
acaDocumentList
acaContextActions
[currentFolderId]="'-mysites-'"
[selectionMode]="'single'"
[selectionMode]="'multiple'"
[multiselect]="true"
[navigate]="false"
[sorting]="['title', 'asc']"
[sortingMode]="'client'"

View File

@ -12,6 +12,7 @@
acaContextActions
[currentFolderId]="'-recent-'"
[selectionMode]="'multiple'"
[multiselect]="true"
[navigate]="false"
[sorting]="['modifiedAt', 'desc']"
[sortingMode]="'client'"

View File

@ -26,7 +26,8 @@
acaContextActions
acaDocumentList
[showHeader]="showHeader"
[selectionMode]="'single'"
[selectionMode]="'multiple'"
[multiselect]="true"
[sorting]="['name', 'asc']"
[node]="data"
[imageResolver]="imageResolver"

View File

@ -37,6 +37,7 @@
acaDocumentList
acaContextActions
[selectionMode]="'multiple'"
[multiselect]="true"
[sortingMode]="'server'"
[sorting]="sorting"
[imageResolver]="imageResolver"

View File

@ -12,6 +12,7 @@
acaContextActions
[currentFolderId]="'-sharedlinks-'"
[selectionMode]="'multiple'"
[multiselect]="true"
[sorting]="['modifiedAt', 'desc']"
[imageResolver]="imageResolver"
[sortingMode]="'client'"

View File

@ -12,7 +12,7 @@
acaContextActions
[currentFolderId]="'-trashcan-'"
[selectionMode]="'multiple'"
[multiselect]="false"
[multiselect]="true"
[navigate]="false"
[sortingMode]="'client'"
[imageResolver]="imageResolver"

View File

@ -80,7 +80,7 @@ export class DataTableComponent extends BaseComponent {
/**
* Method used in cases where we want to retrieve a row from the datatable based on its numerical order within the array.
*
*
* @returns reference to cell element which contains text.
*/
getNthRow = (orderNum: number): Locator => this.getRowLocator.nth(orderNum);
@ -238,11 +238,11 @@ export class DataTableComponent extends BaseComponent {
}
async selectItem(name: string): Promise<void> {
const isSelected = await this.hasCheckMarkIcon(name);
const isSelected = await this.isRowSelected(name);
if (!isSelected) {
let row = this.getRowByName(name);
await row.locator('[title="Size"]').click({ modifiers: ['Meta'] });
await row.locator('.adf-datatable-selected').waitFor({ state: 'attached' });
await row.locator('.adf-datatable-checkbox .mat-checkbox-checked').waitFor({ state: 'attached' });
}
}
@ -250,15 +250,15 @@ export class DataTableComponent extends BaseComponent {
await this.page.keyboard.down('Meta');
let row = this.getRowByName(name);
await row.locator('[title="Size"]').click();
await row.locator('.adf-datatable-selected').waitFor({ state: 'attached' });
await row.locator('.adf-datatable-checkbox .mat-checkbox-checked').waitFor({ state: 'attached' });
row = this.getRowByName(name2);
await row.locator('[title="Size"]').click();
await row.locator('.adf-datatable-selected').waitFor({ state: 'attached' });
await row.locator('.adf-datatable-checkbox .mat-checkbox-checked').waitFor({ state: 'attached' });
}
async hasCheckMarkIcon(itemName: string): Promise<boolean> {
async isRowSelected(itemName: string): Promise<boolean> {
const row = this.getRowByName(itemName);
return await row.locator('.adf-datatable-selected').isVisible();
return await row.locator('.adf-datatable-checkbox .mat-checkbox-checked').isVisible();
}
async getColumnHeaders(): Promise<Array<string>> {
@ -338,9 +338,9 @@ export class DataTableComponent extends BaseComponent {
await this.paginationOptions.getByText("50").click();
}
/**
/**
* Method used to create objects from names and visibility of sites from datatable
*
*
* @returns an object with sites' names and their corresponding visibility values
*/
async getSitesNameAndVisibility(): Promise<{ [siteName: string]: string }> {
@ -356,9 +356,9 @@ export class DataTableComponent extends BaseComponent {
return sitesInfo;
}
/**
/**
* Method used to create objects from names and roles of sites from datatable
*
*
* @returns an object with sites' names and their corresponding role values
*/
async getSitesNameAndRole(): Promise<{ [siteName: string]: string }> {