From f2f7283c9c97e30752fdd4cf56ca3b41999e6962 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Sun, 10 Jul 2022 01:06:50 +0300 Subject: [PATCH] Filters metadata --- src/assets/styles/common-components.scss | 3 +-- src/lib/filtering/models/filter.model.ts | 2 +- src/lib/filtering/models/filter.ts | 9 +++++++-- src/lib/filtering/models/nested-filter.ts | 4 ++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/assets/styles/common-components.scss b/src/assets/styles/common-components.scss index 7ac4631..a1954ac 100644 --- a/src/assets/styles/common-components.scss +++ b/src/assets/styles/common-components.scss @@ -1,7 +1,6 @@ @use 'common-mixins' as mixins; -.oval, -.square { +.oval { font-weight: 600; display: flex; justify-content: center; diff --git a/src/lib/filtering/models/filter.model.ts b/src/lib/filtering/models/filter.model.ts index 46ac80f..b5fd02b 100644 --- a/src/lib/filtering/models/filter.model.ts +++ b/src/lib/filtering/models/filter.model.ts @@ -10,5 +10,5 @@ export interface IFilter { readonly required?: boolean; readonly disabled?: boolean; readonly helpModeKey?: string; - readonly color?: string; + readonly metadata?: Record; } diff --git a/src/lib/filtering/models/filter.ts b/src/lib/filtering/models/filter.ts index 7e8ef40..5469311 100644 --- a/src/lib/filtering/models/filter.ts +++ b/src/lib/filtering/models/filter.ts @@ -4,12 +4,15 @@ import { IListable } from '../../listing'; export class Filter implements IFilter, IListable { readonly id: string; readonly label: string; - checked: boolean; readonly required: boolean; readonly topLevelFilter: boolean; - matches?: number; readonly icon?: string; readonly checker?: (obj?: unknown) => boolean; + readonly skipTranslation?: boolean; + readonly metadata?: Record; + + checked: boolean; + matches?: number; constructor(filter: IFilter) { this.id = filter.id; @@ -20,6 +23,8 @@ export class Filter implements IFilter, IListable { this.topLevelFilter = !!filter.topLevelFilter; this.checker = filter.checker; this.required = !!filter.required; + this.skipTranslation = !!filter.skipTranslation; + this.metadata = filter.metadata; } get searchKey(): string { diff --git a/src/lib/filtering/models/nested-filter.ts b/src/lib/filtering/models/nested-filter.ts index 2962811..add8a83 100644 --- a/src/lib/filtering/models/nested-filter.ts +++ b/src/lib/filtering/models/nested-filter.ts @@ -9,7 +9,7 @@ export class NestedFilter extends Filter implements INestedFilter, IListable { helpModeKey?: string; readonly children: Filter[]; readonly skipTranslation?: boolean; - readonly color?: string; + readonly metadata?: Record; constructor(nestedFilter: INestedFilter) { super(nestedFilter); @@ -19,6 +19,6 @@ export class NestedFilter extends Filter implements INestedFilter, IListable { this.helpModeKey = nestedFilter.helpModeKey; this.children = nestedFilter.children ?? []; this.skipTranslation = nestedFilter.skipTranslation; - this.color = nestedFilter.color; + this.metadata = nestedFilter.metadata; } }