From 9e21637009dd66744ac1ff722eed65c6bb5c2707 Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Wed, 16 Feb 2022 00:38:32 +0200 Subject: [PATCH] WIP RED-2657 -> fixing more keys --- src/lib/filtering/filters.module.ts | 3 ++- src/lib/filtering/models/filter.model.ts | 1 + src/lib/filtering/models/nested-filter.ts | 2 ++ .../quick-filters/quick-filters.component.html | 1 + src/lib/help-mode/help-mode.service.ts | 2 ++ src/lib/listing/page-header/page-header.component.html | 6 ++++-- src/lib/listing/page-header/page-header.component.ts | 10 +++++++++- .../listing/scroll-button/scroll-button.component.html | 4 ++-- .../listing/table-header/table-header.component.html | 2 +- 9 files changed, 24 insertions(+), 7 deletions(-) diff --git a/src/lib/filtering/filters.module.ts b/src/lib/filtering/filters.module.ts index 4796037..21b9f2f 100644 --- a/src/lib/filtering/filters.module.ts +++ b/src/lib/filtering/filters.module.ts @@ -8,9 +8,10 @@ import { PopupFilterComponent } from './popup-filter/popup-filter.component'; import { QuickFiltersComponent } from './quick-filters/quick-filters.component'; import { IqserIconsModule } from '../icons'; import { IqserInputsModule } from '../inputs'; +import { IqserHelpModeModule } from '../help-mode'; const matModules = [MatCheckboxModule, MatMenuModule]; -const modules = [TranslateModule, IqserButtonsModule, IqserIconsModule, IqserInputsModule]; +const modules = [TranslateModule, IqserButtonsModule, IqserIconsModule, IqserInputsModule, IqserHelpModeModule]; const components = [QuickFiltersComponent, PopupFilterComponent]; @NgModule({ diff --git a/src/lib/filtering/models/filter.model.ts b/src/lib/filtering/models/filter.model.ts index c955f26..c44e9f8 100644 --- a/src/lib/filtering/models/filter.model.ts +++ b/src/lib/filtering/models/filter.model.ts @@ -8,4 +8,5 @@ export interface IFilter { readonly checker?: (obj?: unknown) => boolean; readonly required?: boolean; readonly disabled?: boolean; + readonly helpModeKey?: string; } diff --git a/src/lib/filtering/models/nested-filter.ts b/src/lib/filtering/models/nested-filter.ts index 5560c52..e035c82 100644 --- a/src/lib/filtering/models/nested-filter.ts +++ b/src/lib/filtering/models/nested-filter.ts @@ -6,6 +6,7 @@ export class NestedFilter extends Filter implements INestedFilter, IListable { expanded: boolean; indeterminate: boolean; disabled?: boolean; + helpModeKey?: string; readonly children: Filter[]; constructor(nestedFilter: INestedFilter) { @@ -13,6 +14,7 @@ export class NestedFilter extends Filter implements INestedFilter, IListable { this.expanded = !!nestedFilter.expanded; this.indeterminate = !!nestedFilter.indeterminate; this.disabled = !!nestedFilter.disabled; + this.helpModeKey = nestedFilter.helpModeKey; this.children = nestedFilter.children ?? []; } } diff --git a/src/lib/filtering/quick-filters/quick-filters.component.html b/src/lib/filtering/quick-filters/quick-filters.component.html index b35d198..5e5cf12 100644 --- a/src/lib/filtering/quick-filters/quick-filters.component.html +++ b/src/lib/filtering/quick-filters/quick-filters.component.html @@ -5,6 +5,7 @@ [class.active]="filter.checked" [class.disabled]="filter.disabled" class="quick-filter" + [iqserHelpMode]="filter.helpModeKey" > {{ filter.label }} diff --git a/src/lib/help-mode/help-mode.service.ts b/src/lib/help-mode/help-mode.service.ts index 6f3c1f6..140186e 100644 --- a/src/lib/help-mode/help-mode.service.ts +++ b/src/lib/help-mode/help-mode.service.ts @@ -59,6 +59,7 @@ export class HelpModeService { activateHelpMode(): void { if (!this.isHelpModeActive) { + document.body.style.setProperty('overflow', 'hidden'); this._isHelpModeActive$.next(true); this.openHelpModeDialog(); setTimeout(() => { @@ -69,6 +70,7 @@ export class HelpModeService { deactivateHelpMode(): void { if (this.isHelpModeActive) { + document.body.style.removeProperty('overflow'); this._isHelpModeActive$.next(false); this._disableHelperElements(); } diff --git a/src/lib/listing/page-header/page-header.component.html b/src/lib/listing/page-header/page-header.component.html index 3bb6c79..e23b73c 100644 --- a/src/lib/listing/page-header/page-header.component.html +++ b/src/lib/listing/page-header/page-header.component.html @@ -1,13 +1,13 @@ diff --git a/src/lib/listing/page-header/page-header.component.ts b/src/lib/listing/page-header/page-header.component.ts index 4e9eb9a..bd60fa5 100644 --- a/src/lib/listing/page-header/page-header.component.ts +++ b/src/lib/listing/page-header/page-header.component.ts @@ -25,7 +25,7 @@ export class PageHeaderComponent { @Input() viewModeSelection?: TemplateRef; @Input() searchPlaceholder?: string; @Input() searchWidth?: number | 'full'; - @Input() helpModeKey?: 'filter-dossier-list' | 'filter-document-list'; + @Input() helpModeKey?: 'dossier' | 'document'; @Input() searchPosition: SearchPosition = SearchPositions.afterFilters; @Output() readonly closeAction = new EventEmitter(); @@ -53,4 +53,12 @@ export class PageHeaderComponent { trackByLabel(index: number, item: K): string | undefined { return item.label; } + + get filterHelpModeKey() { + return !!this.helpModeKey ? `filter_${this.helpModeKey}_list` : ''; + } + + get resetFiltersHelpModeKey() { + return !!this.helpModeKey ? `delete_${this.helpModeKey}_filter` : ''; + } } diff --git a/src/lib/listing/scroll-button/scroll-button.component.html b/src/lib/listing/scroll-button/scroll-button.component.html index b04b249..e30974d 100644 --- a/src/lib/listing/scroll-button/scroll-button.component.html +++ b/src/lib/listing/scroll-button/scroll-button.component.html @@ -1,7 +1,7 @@ - - diff --git a/src/lib/listing/table-header/table-header.component.html b/src/lib/listing/table-header/table-header.component.html index 360352c..06d9dc4 100644 --- a/src/lib/listing/table-header/table-header.component.html +++ b/src/lib/listing/table-header/table-header.component.html @@ -12,7 +12,7 @@ - +