WIP RED-2657 -> fixing more keys

This commit is contained in:
Valentin Mihai 2022-02-16 00:38:32 +02:00
parent 53c3a6b304
commit 9e21637009
9 changed files with 24 additions and 7 deletions

View File

@ -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({

View File

@ -8,4 +8,5 @@ export interface IFilter {
readonly checker?: (obj?: unknown) => boolean;
readonly required?: boolean;
readonly disabled?: boolean;
readonly helpModeKey?: string;
}

View File

@ -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 ?? [];
}
}

View File

@ -5,6 +5,7 @@
[class.active]="filter.checked"
[class.disabled]="filter.disabled"
class="quick-filter"
[iqserHelpMode]="filter.helpModeKey"
>
{{ filter.label }}
</div>

View File

@ -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();
}

View File

@ -1,13 +1,13 @@
<div class="page-header">
<div *ngIf="pageLabel" class="breadcrumb">{{ pageLabel }}</div>
<div *ngIf="filters$ | async as filters" class="filters" [iqserHelpMode]="helpModeKey">
<div *ngIf="filters$ | async as filters" class="filters">
<div *ngIf="filters.length && searchPosition !== searchPositions.beforeFilters" translate="filters.filter-by"></div>
<ng-container *ngIf="searchPosition === searchPositions.beforeFilters" [ngTemplateOutlet]="searchBar"></ng-container>
<ng-container *ngFor="let config of filters; trackBy: trackByLabel">
<iqser-popup-filter *ngIf="!config.hide" [primaryFiltersSlug]="config.slug"></iqser-popup-filter>
<iqser-popup-filter *ngIf="!config.hide" [primaryFiltersSlug]="config.slug" [iqserHelpMode]="filterHelpModeKey"></iqser-popup-filter>
</ng-container>
<ng-container *ngIf="searchPosition === searchPositions.afterFilters" [ngTemplateOutlet]="searchBar"></ng-container>
@ -17,6 +17,7 @@
*ngIf="showResetFilters$ | async"
class="reset-filters"
translate="reset-filters"
[iqserHelpMode]="resetFiltersHelpModeKey"
></div>
</div>
@ -58,6 +59,7 @@
[tooltip]="'common.close' | translate"
icon="iqser:close"
tooltipPosition="below"
iqserHelpMode="edit_dossier_in_dossier"
></iqser-circle-button>
</div>
</div>

View File

@ -25,7 +25,7 @@ export class PageHeaderComponent<T extends IListable> {
@Input() viewModeSelection?: TemplateRef<unknown>;
@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<T extends IListable> {
trackByLabel<K extends { label?: string }>(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` : '';
}
}

View File

@ -1,7 +1,7 @@
<button (click)="scroll(buttonType.top)" [hidden]="(showScrollUp$ | async) === false" class="scroll-button top pointer">
<button (click)="scroll(buttonType.top)" [hidden]="(showScrollUp$ | async) === false" class="scroll-button top pointer" iqserHelpMode="scroll_up_and_down">
<mat-icon svgIcon="iqser:arrow-down-o"></mat-icon>
</button>
<button (click)="scroll(buttonType.bottom)" [hidden]="(showScrollDown$ | async) === false" class="scroll-button bottom pointer">
<button (click)="scroll(buttonType.bottom)" [hidden]="(showScrollDown$ | async) === false" class="scroll-button bottom pointer" iqserHelpMode="scroll_up_and_down">
<mat-icon svgIcon="iqser:arrow-down-o"></mat-icon>
</button>

View File

@ -12,7 +12,7 @@
<ng-container [ngTemplateOutlet]="bulkActions"></ng-container>
<iqser-quick-filters *ngIf="quickFilters$ | async" iqserHelpMode="dossiers-quickfilter-my-dossiers"></iqser-quick-filters>
<iqser-quick-filters *ngIf="quickFilters$ | async"></iqser-quick-filters>
<!-- Custom content-->
<ng-content></ng-content>