From e2b8557f4bf146e7bc5425ef858f3a6013b85658 Mon Sep 17 00:00:00 2001 From: Thomas Hunter Date: Tue, 22 Jun 2021 17:28:38 +0200 Subject: [PATCH] [AAE-5362] Add option to make actions button visible only on hover (#7117) * [AAE-5362] Add option to make actions button visible only on hover * [AAE-5362] Refactor * Unrelated linting fixes --- docs/core/components/datatable.component.md | 1 + .../content-metadata/content-metadata.component.spec.ts | 6 +++--- .../lib/site-dropdown/sites-dropdown.component.spec.ts | 2 +- lib/core/comments/comments.component.spec.ts | 6 +++--- .../components/datatable/datatable.component.html | 6 ++++-- .../components/datatable/datatable.component.scss | 8 ++++++++ .../components/datatable/datatable.component.ts | 9 +++++++++ 7 files changed, 29 insertions(+), 9 deletions(-) diff --git a/docs/core/components/datatable.component.md b/docs/core/components/datatable.component.md index 94a0085e5af..b489738260c 100644 --- a/docs/core/components/datatable.component.md +++ b/docs/core/components/datatable.component.md @@ -346,6 +346,7 @@ Learm more about styling your datatable: [Customizing the component's styles](#c | ---- | ---- | ------------- | ----------- | | actions | `boolean` | false | Toggles the data actions column. | | actionsPosition | `string` | "right" | Position of the actions dropdown menu. Can be "left" or "right". | +| actionsVisibleOnHover | `boolean` | false | If set to true, the actions button will only be visible on row hover. | | allowFiltering | `boolean` | false | Flag that indicate if the datatable allow the use facet [widget](../../../lib/testing/src/lib/core/pages/form/widgets/widget.ts) search for filtering. | | columns | `any[]` | \[] | The columns that the datatable will show. | | contextMenu | `boolean` | false | Toggles custom context menu for the component. | diff --git a/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.spec.ts b/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.spec.ts index b03c8990ddd..acb1a883b57 100644 --- a/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.spec.ts +++ b/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.spec.ts @@ -407,7 +407,7 @@ describe('ContentMetadataComponent', () => { component.displayEmpty = true; fixture.detectChanges(); - await fixture.whenStable() + await fixture.whenStable(); let defaultProp = queryDom(fixture); let exifProp = queryDom(fixture, 'EXIF'); @@ -419,7 +419,7 @@ describe('ContentMetadataComponent', () => { component.displayAspect = 'CUSTOM'; fixture.detectChanges(); - await fixture.whenStable() + await fixture.whenStable(); defaultProp = queryDom(fixture); exifProp = queryDom(fixture, 'EXIF'); @@ -431,7 +431,7 @@ describe('ContentMetadataComponent', () => { component.displayAspect = 'Properties'; fixture.detectChanges(); - await fixture.whenStable() + await fixture.whenStable(); defaultProp = queryDom(fixture); exifProp = queryDom(fixture, 'EXIF'); diff --git a/lib/content-services/src/lib/site-dropdown/sites-dropdown.component.spec.ts b/lib/content-services/src/lib/site-dropdown/sites-dropdown.component.spec.ts index 1b180ce64ea..aa7cdc7fb98 100644 --- a/lib/content-services/src/lib/site-dropdown/sites-dropdown.component.spec.ts +++ b/lib/content-services/src/lib/site-dropdown/sites-dropdown.component.spec.ts @@ -188,7 +188,7 @@ describe('DropdownSitesComponent', () => { fixture.detectChanges(); await fixture.whenStable(); - let options = debug.queryAll(By.css('mat-option')); + const options = debug.queryAll(By.css('mat-option')); options[0].triggerEventHandler('click', null); fixture.detectChanges(); diff --git a/lib/core/comments/comments.component.spec.ts b/lib/core/comments/comments.component.spec.ts index 8035a3cfe04..71fe0ea2e12 100644 --- a/lib/core/comments/comments.component.spec.ts +++ b/lib/core/comments/comments.component.spec.ts @@ -135,7 +135,7 @@ describe('CommentsComponent', () => { getProcessCommentsSpy.and.returnValue(of([])); fixture.detectChanges(); - await fixture.whenStable() + await fixture.whenStable(); expect(fixture.nativeElement.querySelector('#comment-container')).toBeNull(); }); @@ -145,7 +145,7 @@ describe('CommentsComponent', () => { component.ngOnChanges({'taskId': change}); fixture.detectChanges(); - await fixture.whenStable() + await fixture.whenStable(); expect(fixture.nativeElement.querySelector('#comment-input')).not.toBeNull(); }); @@ -154,7 +154,7 @@ describe('CommentsComponent', () => { component.readOnly = true; fixture.detectChanges(); - await fixture.whenStable() + await fixture.whenStable(); expect(fixture.nativeElement.querySelector('#comment-input')).toBeNull(); }); diff --git a/lib/core/datatable/components/datatable/datatable.component.html b/lib/core/datatable/components/datatable/datatable.component.html index e39cf4e49d7..41d8e261517 100644 --- a/lib/core/datatable/components/datatable/datatable.component.html +++ b/lib/core/datatable/components/datatable/datatable.component.html @@ -72,7 +72,8 @@ [attr.data-automation-id]="'datatable-row-' + idx">
-