From 463e329163b9401a71cbe7734765d1f29cf333bb Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Fri, 27 May 2022 22:12:57 +0300 Subject: [PATCH] RED-3977 - Scroll button help mode key improvements --- src/lib/listing/scroll-button/scroll-button.component.ts | 6 +----- src/lib/listing/table/table.component.html | 1 + src/lib/listing/table/table.component.ts | 1 + 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/lib/listing/scroll-button/scroll-button.component.ts b/src/lib/listing/scroll-button/scroll-button.component.ts index d405d10..97e2e6d 100644 --- a/src/lib/listing/scroll-button/scroll-button.component.ts +++ b/src/lib/listing/scroll-button/scroll-button.component.ts @@ -22,6 +22,7 @@ export class ScrollButtonComponent implements OnInit { @Input() @Required() scrollViewport!: CdkVirtualScrollViewport; @Input() @Required() itemSize!: number; + @Input() helpModeKey?: string; showScrollUp$?: Observable; showScrollDown$?: Observable; @@ -61,9 +62,4 @@ export class ScrollButtonComponent implements OnInit { this.scroll(ButtonTypes.top); } } - - get helpModeKey(): string { - const screen = window.location.href.includes('/dossiers/') ? 'document' : 'dossier'; - return `${screen}`; - } } diff --git a/src/lib/listing/table/table.component.html b/src/lib/listing/table/table.component.html index cb6baed..956bcab 100644 --- a/src/lib/listing/table/table.component.html +++ b/src/lib/listing/table/table.component.html @@ -35,4 +35,5 @@ *ngIf="hasScrollButton && tableContent?.scrollViewport" [itemSize]="itemSize" [scrollViewport]="tableContent.scrollViewport" + [helpModeKey]="helpModeKey" > diff --git a/src/lib/listing/table/table.component.ts b/src/lib/listing/table/table.component.ts index aa3316c..74096d0 100644 --- a/src/lib/listing/table/table.component.ts +++ b/src/lib/listing/table/table.component.ts @@ -45,6 +45,7 @@ export class TableComponent extends AutoUnsubscribe impleme @Input() noDataButtonLabel?: string; @Input() showNoDataButton = false; @Input() noMatchText?: string; + @Input() helpModeKey?: string; @Input() tableItemClasses?: Record boolean>; @Input() itemMouseEnterFn?: (entity: T) => void; @Input() itemMouseLeaveFn?: (entity: T) => void;