[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 fileActionsApi.waitForNodes(recentFile, { expect: 1 });
await recentFilesPage.navigate(); await recentFilesPage.navigate();
await expect(recentFilesPage.dataTable.getRowByName(recentFile)).toBeVisible(); 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.acaHeader.viewDetails.click();
await recentFilesPage.infoDrawer.commentsTab.click(); await recentFilesPage.infoDrawer.commentsTab.click();
await expect(recentFilesPage.infoDrawer.commentInputField).toBeVisible(); await expect(recentFilesPage.infoDrawer.commentInputField).toBeVisible();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -12,7 +12,7 @@
acaContextActions acaContextActions
[currentFolderId]="'-trashcan-'" [currentFolderId]="'-trashcan-'"
[selectionMode]="'multiple'" [selectionMode]="'multiple'"
[multiselect]="false" [multiselect]="true"
[navigate]="false" [navigate]="false"
[sortingMode]="'client'" [sortingMode]="'client'"
[imageResolver]="imageResolver" [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. * 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. * @returns reference to cell element which contains text.
*/ */
getNthRow = (orderNum: number): Locator => this.getRowLocator.nth(orderNum); getNthRow = (orderNum: number): Locator => this.getRowLocator.nth(orderNum);
@ -238,11 +238,11 @@ export class DataTableComponent extends BaseComponent {
} }
async selectItem(name: string): Promise<void> { async selectItem(name: string): Promise<void> {
const isSelected = await this.hasCheckMarkIcon(name); const isSelected = await this.isRowSelected(name);
if (!isSelected) { if (!isSelected) {
let row = this.getRowByName(name); let row = this.getRowByName(name);
await row.locator('[title="Size"]').click({ modifiers: ['Meta'] }); 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'); await this.page.keyboard.down('Meta');
let row = this.getRowByName(name); let row = this.getRowByName(name);
await row.locator('[title="Size"]').click(); 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); row = this.getRowByName(name2);
await row.locator('[title="Size"]').click(); 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); 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>> { async getColumnHeaders(): Promise<Array<string>> {
@ -338,9 +338,9 @@ export class DataTableComponent extends BaseComponent {
await this.paginationOptions.getByText("50").click(); await this.paginationOptions.getByText("50").click();
} }
/** /**
* Method used to create objects from names and visibility of sites from datatable * Method used to create objects from names and visibility of sites from datatable
* *
* @returns an object with sites' names and their corresponding visibility values * @returns an object with sites' names and their corresponding visibility values
*/ */
async getSitesNameAndVisibility(): Promise<{ [siteName: string]: string }> { async getSitesNameAndVisibility(): Promise<{ [siteName: string]: string }> {
@ -356,9 +356,9 @@ export class DataTableComponent extends BaseComponent {
return sitesInfo; return sitesInfo;
} }
/** /**
* Method used to create objects from names and roles of sites from datatable * Method used to create objects from names and roles of sites from datatable
* *
* @returns an object with sites' names and their corresponding role values * @returns an object with sites' names and their corresponding role values
*/ */
async getSitesNameAndRole(): Promise<{ [siteName: string]: string }> { async getSitesNameAndRole(): Promise<{ [siteName: string]: string }> {