Skip to content

Commit

Permalink
[ACS-8080] Enable multiselection in lists (#3873)
Browse files Browse the repository at this point in the history
* [ACS-8080] Enable multiselection in lists

* [ACS-8080] Fix selected row in E2Es

* [ACS-8080] E2Es fix

* [ACS-8080] E2Es fix

---------

Co-authored-by: [email protected] <[email protected]>
  • Loading branch information
MichalKinas and akashrathod28 authored Jun 6, 2024
1 parent 1574518 commit a5343fd
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 17 deletions.
2 changes: 1 addition & 1 deletion e2e/playwright/info-drawer/src/tests/comments.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ <h1 class="aca-page-title">{{ 'APP.BROWSE.LIBRARIES.MENU.FAVORITE_LIBRARIES.TITL
acaContextActions
[node]="$any(list)"
[loading]="isLoading"
[selectionMode]="'single'"
[selectionMode]="'multiple'"
[multiselect]="true"
[navigate]="false"
[sorting]="['title', 'asc']"
[sortingMode]="'client'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ <h1 class="aca-page-title">{{ 'APP.BROWSE.FAVORITES.TITLE' | translate }}</h1>
acaContextActions
[currentFolderId]="'-favorites-'"
[selectionMode]="'multiple'"
[multiselect]="true"
[navigate]="false"
[sorting]="['modifiedAt', 'desc']"
[sortingMode]="'client'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
acaDocumentList
acaContextActions
[selectionMode]="'multiple'"
[multiselect]="false"
[multiselect]="true"
[currentFolderId]="node?.id"
[loading]="true"
[showHeader]="showHeader"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ <h1 class="aca-page-title">{{ 'APP.BROWSE.LIBRARIES.MENU.MY_LIBRARIES.TITLE' | t
acaDocumentList
acaContextActions
[currentFolderId]="'-mysites-'"
[selectionMode]="'single'"
[selectionMode]="'multiple'"
[multiselect]="true"
[navigate]="false"
[sorting]="['title', 'asc']"
[sortingMode]="'client'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ <h1 class="aca-page-title">{{ 'APP.BROWSE.RECENT.TITLE' | translate }}</h1>
acaContextActions
[currentFolderId]="'-recent-'"
[selectionMode]="'multiple'"
[multiselect]="true"
[navigate]="false"
[sorting]="['modifiedAt', 'desc']"
[sortingMode]="'client'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
acaContextActions
acaDocumentList
[showHeader]="showHeader"
[selectionMode]="'single'"
[selectionMode]="'multiple'"
[multiselect]="true"
[sorting]="['name', 'asc']"
[node]="data"
[imageResolver]="imageResolver"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
acaDocumentList
acaContextActions
[selectionMode]="'multiple'"
[multiselect]="true"
[sortingMode]="'server'"
[sorting]="sorting"
[imageResolver]="imageResolver"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ <h1 class="aca-page-title">{{ 'APP.BROWSE.SHARED.TITLE' | translate }}</h1>
acaContextActions
[currentFolderId]="'-sharedlinks-'"
[selectionMode]="'multiple'"
[multiselect]="true"
[sorting]="['modifiedAt', 'desc']"
[imageResolver]="imageResolver"
[sortingMode]="'client'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ <h1 class="aca-page-title">{{ 'APP.BROWSE.TRASHCAN.TITLE' | translate }}</h1>
acaContextActions
[currentFolderId]="'-trashcan-'"
[selectionMode]="'multiple'"
[multiselect]="false"
[multiselect]="true"
[navigate]="false"
[sortingMode]="'client'"
[imageResolver]="imageResolver"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -238,27 +238,27 @@ 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' });
}
}

async selectMultiItem(name: string, name2: string): Promise<void> {
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>> {
Expand Down Expand Up @@ -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 }> {
Expand All @@ -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 }> {
Expand Down

0 comments on commit a5343fd

Please sign in to comment.