From cc610d658950ff2679f3a362dca044e81194b20a Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Thu, 4 Apr 2024 13:48:16 +0200 Subject: [PATCH 01/72] Remove color function --- .../components/search/dropdown_filter.ts | 15 +++-- .../search/filter_collection_element.ts | 3 +- .../components/search/search_token.ts | 15 +++-- app/views/layouts/_searchbar.html.erb | 60 +++++-------------- 4 files changed, 37 insertions(+), 56 deletions(-) diff --git a/app/assets/javascripts/components/search/dropdown_filter.ts b/app/assets/javascripts/components/search/dropdown_filter.ts index fb5bc8a16e..3499a1959a 100644 --- a/app/assets/javascripts/components/search/dropdown_filter.ts +++ b/app/assets/javascripts/components/search/dropdown_filter.ts @@ -1,6 +1,11 @@ import { html, TemplateResult } from "lit"; import { customElement, property } from "lit/decorators.js"; -import { FilterCollection, Label, FilterCollectionElement } from "components/search/filter_collection_element"; +import { + FilterCollection, + Label, + FilterCollectionElement, + AccentColor +} from "components/search/filter_collection_element"; import { i18n } from "i18n/i18n"; import { DodonaElement } from "components/meta/dodona_element"; @@ -10,7 +15,7 @@ import { DodonaElement } from "components/meta/dodona_element"; * * @element d-dropdown-filter * - * @prop {(s: Label) => string} color - a function that fetches the color associated with each label + * @prop {AccentColor} color - the color associated with the filter * @prop {string} type - The type of the filter collection, used to determine the dropdown button text * @prop {string} param - the searchQuery param to be used for this filter * @prop {boolean} multi - whether one or more labels can be selected at the same time @@ -19,8 +24,8 @@ import { DodonaElement } from "components/meta/dodona_element"; */ @customElement("d-dropdown-filter") export class DropdownFilter extends FilterCollectionElement { - @property() - color: (s: Label) => string; + @property({ type: String }) + color: AccentColor; @property() type: string; @@ -43,7 +48,7 @@ export class DropdownFilter extends FilterCollectionElement { return html`