diff --git a/CHANGELOG.md b/CHANGELOG.md index 00ef7247..480f75a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,8 +10,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Extended the tags selector component by a `readonly` attribute +- Extended the tags selector component to support creating custom tags - Added global styles to the _Storybook_ setup +### Changed + +- Improved the language localization for German (`de`) + ## 2.138.0 - 2025-02-08 ### Added diff --git a/apps/client/src/locales/messages.ca.xlf b/apps/client/src/locales/messages.ca.xlf index 3bee762a..82f3f96b 100644 --- a/apps/client/src/locales/messages.ca.xlf +++ b/apps/client/src/locales/messages.ca.xlf @@ -2218,12 +2218,12 @@ 87 - apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html - 387 + libs/ui/src/lib/tags-selector/tags-selector.component.html + 4 libs/ui/src/lib/tags-selector/tags-selector.component.html - 2 + 16 @@ -2639,7 +2639,7 @@ Informar d’un Problema amb les Dades apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html - 406 + 385 @@ -7748,6 +7748,14 @@ 154 + + Create + Create + + libs/ui/src/lib/tags-selector/tags-selector.component.html + 50 + + diff --git a/apps/client/src/locales/messages.de.xlf b/apps/client/src/locales/messages.de.xlf index 9f5fd16f..0040f8cb 100644 --- a/apps/client/src/locales/messages.de.xlf +++ b/apps/client/src/locales/messages.de.xlf @@ -1357,12 +1357,12 @@ 87 - apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html - 387 + libs/ui/src/lib/tags-selector/tags-selector.component.html + 4 libs/ui/src/lib/tags-selector/tags-selector.component.html - 2 + 16 @@ -1370,7 +1370,7 @@ Datenfehler melden apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html - 406 + 385 @@ -7748,6 +7748,14 @@ 154 + + Create + Erstelle + + libs/ui/src/lib/tags-selector/tags-selector.component.html + 50 + + diff --git a/apps/client/src/locales/messages.es.xlf b/apps/client/src/locales/messages.es.xlf index c71d49f5..bc6a6241 100644 --- a/apps/client/src/locales/messages.es.xlf +++ b/apps/client/src/locales/messages.es.xlf @@ -1358,12 +1358,12 @@ 87 - apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html - 387 + libs/ui/src/lib/tags-selector/tags-selector.component.html + 4 libs/ui/src/lib/tags-selector/tags-selector.component.html - 2 + 16 @@ -1371,7 +1371,7 @@ Reporta un anomalía de los datos apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html - 406 + 385 @@ -7749,6 +7749,14 @@ 154 + + Create + Create + + libs/ui/src/lib/tags-selector/tags-selector.component.html + 50 + + diff --git a/apps/client/src/locales/messages.fr.xlf b/apps/client/src/locales/messages.fr.xlf index 521cfe6f..353a2a3f 100644 --- a/apps/client/src/locales/messages.fr.xlf +++ b/apps/client/src/locales/messages.fr.xlf @@ -969,12 +969,12 @@ 87 - apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html - 387 + libs/ui/src/lib/tags-selector/tags-selector.component.html + 4 libs/ui/src/lib/tags-selector/tags-selector.component.html - 2 + 16 @@ -1718,7 +1718,7 @@ Signaler une Erreur de Données apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html - 406 + 385 @@ -7748,6 +7748,14 @@ 154 + + Create + Create + + libs/ui/src/lib/tags-selector/tags-selector.component.html + 50 + + diff --git a/apps/client/src/locales/messages.it.xlf b/apps/client/src/locales/messages.it.xlf index 4d428d41..c6cb7ac7 100644 --- a/apps/client/src/locales/messages.it.xlf +++ b/apps/client/src/locales/messages.it.xlf @@ -1358,12 +1358,12 @@ 87 - apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html - 387 + libs/ui/src/lib/tags-selector/tags-selector.component.html + 4 libs/ui/src/lib/tags-selector/tags-selector.component.html - 2 + 16 @@ -1371,7 +1371,7 @@ Segnala un’anomalia dei dati apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html - 406 + 385 @@ -7749,6 +7749,14 @@ 154 + + Create + Create + + libs/ui/src/lib/tags-selector/tags-selector.component.html + 50 + + diff --git a/apps/client/src/locales/messages.nl.xlf b/apps/client/src/locales/messages.nl.xlf index a3c6c6d6..53efeab9 100644 --- a/apps/client/src/locales/messages.nl.xlf +++ b/apps/client/src/locales/messages.nl.xlf @@ -1357,12 +1357,12 @@ 87 - apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html - 387 + libs/ui/src/lib/tags-selector/tags-selector.component.html + 4 libs/ui/src/lib/tags-selector/tags-selector.component.html - 2 + 16 @@ -1370,7 +1370,7 @@ Gegevensstoring melden apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html - 406 + 385 @@ -7748,6 +7748,14 @@ 154 + + Create + Create + + libs/ui/src/lib/tags-selector/tags-selector.component.html + 50 + + diff --git a/apps/client/src/locales/messages.pl.xlf b/apps/client/src/locales/messages.pl.xlf index 135e5847..2942a489 100644 --- a/apps/client/src/locales/messages.pl.xlf +++ b/apps/client/src/locales/messages.pl.xlf @@ -2046,12 +2046,12 @@ 87 - apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html - 387 + libs/ui/src/lib/tags-selector/tags-selector.component.html + 4 libs/ui/src/lib/tags-selector/tags-selector.component.html - 2 + 16 @@ -2803,7 +2803,7 @@ Zgłoś Błąd Danych apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html - 406 + 385 @@ -7748,6 +7748,14 @@ 154 + + Create + Create + + libs/ui/src/lib/tags-selector/tags-selector.component.html + 50 + + diff --git a/apps/client/src/locales/messages.pt.xlf b/apps/client/src/locales/messages.pt.xlf index 37d4688f..8b9b7ac0 100644 --- a/apps/client/src/locales/messages.pt.xlf +++ b/apps/client/src/locales/messages.pt.xlf @@ -1665,12 +1665,12 @@ 87 - apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html - 387 + libs/ui/src/lib/tags-selector/tags-selector.component.html + 4 libs/ui/src/lib/tags-selector/tags-selector.component.html - 2 + 16 @@ -1678,7 +1678,7 @@ Dados do Relatório com Problema apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html - 406 + 385 @@ -7748,6 +7748,14 @@ 154 + + Create + Create + + libs/ui/src/lib/tags-selector/tags-selector.component.html + 50 + + diff --git a/apps/client/src/locales/messages.tr.xlf b/apps/client/src/locales/messages.tr.xlf index 0c6c7206..3c7d3f10 100644 --- a/apps/client/src/locales/messages.tr.xlf +++ b/apps/client/src/locales/messages.tr.xlf @@ -1782,12 +1782,12 @@ 87 - apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html - 387 + libs/ui/src/lib/tags-selector/tags-selector.component.html + 4 libs/ui/src/lib/tags-selector/tags-selector.component.html - 2 + 16 @@ -2647,7 +2647,7 @@ Rapor Veri Sorunu apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html - 406 + 385 @@ -7748,6 +7748,14 @@ 154 + + Create + Create + + libs/ui/src/lib/tags-selector/tags-selector.component.html + 50 + + diff --git a/apps/client/src/locales/messages.uk.xlf b/apps/client/src/locales/messages.uk.xlf index 235d99bf..26690077 100644 --- a/apps/client/src/locales/messages.uk.xlf +++ b/apps/client/src/locales/messages.uk.xlf @@ -2258,12 +2258,12 @@ 87 - apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html - 387 + libs/ui/src/lib/tags-selector/tags-selector.component.html + 4 libs/ui/src/lib/tags-selector/tags-selector.component.html - 2 + 16 @@ -2767,7 +2767,7 @@ Повідомити про збій даних apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html - 406 + 385 @@ -7748,6 +7748,14 @@ 154 + + Create + Create + + libs/ui/src/lib/tags-selector/tags-selector.component.html + 50 + + diff --git a/apps/client/src/locales/messages.xlf b/apps/client/src/locales/messages.xlf index 5a70868d..ac05bc01 100644 --- a/apps/client/src/locales/messages.xlf +++ b/apps/client/src/locales/messages.xlf @@ -1943,12 +1943,12 @@ 87 - apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html - 387 + libs/ui/src/lib/tags-selector/tags-selector.component.html + 4 libs/ui/src/lib/tags-selector/tags-selector.component.html - 2 + 16 @@ -2623,7 +2623,7 @@ Report Data Glitch apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html - 406 + 385 @@ -7007,6 +7007,13 @@ 154 + + Create + + libs/ui/src/lib/tags-selector/tags-selector.component.html + 50 + + diff --git a/apps/client/src/locales/messages.zh.xlf b/apps/client/src/locales/messages.zh.xlf index 984c0bed..68090697 100644 --- a/apps/client/src/locales/messages.zh.xlf +++ b/apps/client/src/locales/messages.zh.xlf @@ -2063,12 +2063,12 @@ 87 - apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html - 387 + libs/ui/src/lib/tags-selector/tags-selector.component.html + 4 libs/ui/src/lib/tags-selector/tags-selector.component.html - 2 + 16 @@ -2820,7 +2820,7 @@ 报告数据故障 apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html - 406 + 385 @@ -7749,6 +7749,14 @@ 154 + + Create + Create + + libs/ui/src/lib/tags-selector/tags-selector.component.html + 50 + + diff --git a/libs/ui/src/lib/tags-selector/tags-selector.component.html b/libs/ui/src/lib/tags-selector/tags-selector.component.html index 1b681772..4f392942 100644 --- a/libs/ui/src/lib/tags-selector/tags-selector.component.html +++ b/libs/ui/src/lib/tags-selector/tags-selector.component.html @@ -42,6 +42,17 @@ {{ tag.name }} } + + @if (hasPermissionToCreateTags && tagInputControl.value) { + + + + Create "{{ + tagInputControl.value.trim() + }}" + + + } } diff --git a/libs/ui/src/lib/tags-selector/tags-selector.component.stories.ts b/libs/ui/src/lib/tags-selector/tags-selector.component.stories.ts index 4fd0f7e7..8d1431b4 100644 --- a/libs/ui/src/lib/tags-selector/tags-selector.component.stories.ts +++ b/libs/ui/src/lib/tags-selector/tags-selector.component.stories.ts @@ -47,6 +47,20 @@ export const Default: Story = { } }; +export const CreateCustomTags: Story = { + args: { + hasPermissionToCreateTags: true, + tags: [ + { + id: 'EMERGENCY_FUND', + name: 'Emergency Fund', + userId: null + } + ], + tagsAvailable: OPTIONS + } +}; + export const Readonly: Story = { args: { readonly: true, diff --git a/libs/ui/src/lib/tags-selector/tags-selector.component.ts b/libs/ui/src/lib/tags-selector/tags-selector.component.ts index 6b59d53f..611c1e93 100644 --- a/libs/ui/src/lib/tags-selector/tags-selector.component.ts +++ b/libs/ui/src/lib/tags-selector/tags-selector.component.ts @@ -42,6 +42,7 @@ import { BehaviorSubject, Subject, takeUntil } from 'rxjs'; templateUrl: 'tags-selector.component.html' }) export class GfTagsSelectorComponent implements OnInit, OnChanges, OnDestroy { + @Input() hasPermissionToCreateTags = false; @Input() readonly = false; @Input() tags: Tag[]; @Input() tagsAvailable: Tag[]; @@ -76,10 +77,18 @@ export class GfTagsSelectorComponent implements OnInit, OnChanges, OnDestroy { } public onAddTag(event: MatAutocompleteSelectedEvent) { - const tag = this.tagsAvailable.find(({ id }) => { + let tag = this.tagsAvailable.find(({ id }) => { return id === event.option.value; }); + if (!tag && this.hasPermissionToCreateTags) { + tag = { + id: undefined, + name: event.option.value as string, + userId: null + }; + } + this.tagsSelected.update((tags) => { return [...(tags ?? []), tag]; });