From 7ae335c3d20beedfb748b7d07c9c289819eb6c8c Mon Sep 17 00:00:00 2001 From: AleksanderSklorz <115619721+AleksanderSklorz@users.noreply.github.com> Date: Tue, 24 Oct 2023 22:29:59 +0200 Subject: [PATCH] [ACS-5647] rework template of library metadata form component (#3487) * ACS-5647 Removed template for view mode and used template for edit mode instead * ACS-5647 Fixed auto focus for name field * ACS-5647 Reverted data automation id * ACS-5647 Corrected unit tests * e2e fix for library details --------- Co-authored-by: akash.rathod@hyland.com --- .../actions/src/tests/create-library.spec.ts | 8 +- .../library-metadata-form.component.html | 110 +++--------------- .../library-metadata-form.component.spec.ts | 31 ++++- .../library-metadata-form.component.ts | 18 +-- .../components/adf-info-drawer.component.ts | 2 +- .../info-drawer-metadata-library.ts | 8 +- 6 files changed, 66 insertions(+), 111 deletions(-) diff --git a/e2e/playwright/actions/src/tests/create-library.spec.ts b/e2e/playwright/actions/src/tests/create-library.spec.ts index 3b9b00a67..25f702135 100644 --- a/e2e/playwright/actions/src/tests/create-library.spec.ts +++ b/e2e/playwright/actions/src/tests/create-library.spec.ts @@ -145,10 +145,10 @@ test.describe('Create Libraries ', () => { await expect(libraryTable.getCellLinkByName(randomLibraryName).and(myLibrariesPage.page.getByTitle(randomLibraryDescription))).toBeVisible(); await libraryTable.getRowByName(randomLibraryName).click(); await libraryViewDetails.click(); - await expect(libraryDetails.getNameField('Name').getByText(randomLibraryName)).toBeVisible(); - await expect(libraryDetails.getIdField('Library ID').getByText(randomLibraryId)).toBeVisible(); - await expect(libraryDetails.getVisibilityField('Visibility').getByText(publicVisibility)).toBeVisible(); - await expect(libraryDetails.getDescriptionField(libraryDescriptionLabel).getByText(randomLibraryDescription)).toBeVisible(); + expect(await libraryDetails.getNameField('Name').locator('input').inputValue()).toBe(randomLibraryName); + expect(await libraryDetails.getIdField('Library ID').locator('input').inputValue()).toBe(randomLibraryId); + await expect(libraryDetails.getVisibilityField('Visibility').locator('.mat-select-value').getByText(publicVisibility)).toBeVisible(); + expect(await libraryDetails.getDescriptionField.inputValue()).toBe(randomLibraryDescription); await apiClientFactory.sites.deleteSite(randomLibraryId, { permanent: true }); }); diff --git a/projects/aca-content/src/lib/components/info-drawer/library-metadata-tab/library-metadata-form.component.html b/projects/aca-content/src/lib/components/info-drawer/library-metadata-tab/library-metadata-form.component.html index 220221205..7d80a4127 100644 --- a/projects/aca-content/src/lib/components/info-drawer/library-metadata-tab/library-metadata-form.component.html +++ b/projects/aca-content/src/lib/components/info-drawer/library-metadata-tab/library-metadata-form.component.html @@ -1,90 +1,11 @@ - -
-
-
-
- - - {{ 'LIBRARY.DIALOG.FORM.NAME' | translate }} - - - - - {{ form.controls.title.value }} - -
-
-
-
- -
-
-
-
- - - {{ 'LIBRARY.DIALOG.FORM.SITE_ID' | translate }} - - - - - {{ form.controls.id.value }} - -
-
-
-
- -
-
-
-
- - - {{ 'LIBRARY.DIALOG.FORM.VISIBILITY' | translate }} - - - - - {{ visibilityLabel | translate }} - -
-
-
-
- -
-
-
-
- - - {{ 'LIBRARY.DIALOG.FORM.DESCRIPTION' | translate }} - - - - - {{ form.controls.description?.value }} - -
-
-
-
-
- - - - - - +
- + - + - + {{ type.label | translate }} @@ -108,7 +29,7 @@ - +