From c11b7e1191089ec935a204ae86bf5185f1834f5f Mon Sep 17 00:00:00 2001 From: Vanderhaegen Cedrik Date: Fri, 10 Nov 2023 14:34:04 +0100 Subject: [PATCH 1/6] update placeholder --- src/components/smart/FilterAanduidingsobject.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/smart/FilterAanduidingsobject.vue b/src/components/smart/FilterAanduidingsobject.vue index 3a562f6d..22e24ef0 100644 --- a/src/components/smart/FilterAanduidingsobject.vue +++ b/src/components/smart/FilterAanduidingsobject.vue @@ -4,6 +4,7 @@ data-cy="filter-aanduidingsobject" :callback-fn="performAutocompleteSearch" :value="aanduidingsobjectValue" + placeholder="geef naam of id in" @update:value="updateValue" > From fde2219d796b219c5070e19f4688bf32f7d9a6c6 Mon Sep 17 00:00:00 2001 From: Vanderhaegen Cedrik Date: Fri, 10 Nov 2023 14:37:54 +0100 Subject: [PATCH 2/6] tweak ao search --- src/components/smart/FilterAanduidingsobject.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/smart/FilterAanduidingsobject.vue b/src/components/smart/FilterAanduidingsobject.vue index 22e24ef0..f7b67d6e 100644 --- a/src/components/smart/FilterAanduidingsobject.vue +++ b/src/components/smart/FilterAanduidingsobject.vue @@ -38,7 +38,7 @@ const aanduidingsobjectValue = computed(() => { const updateValue = (value: IESAanduidingsobject) => emit('update:value', value); const performAutocompleteSearch = async (searchTerm: string): Promise => { try { - aanduidingsobjecten.value = await inventarisApiService.getAanduidingsobjecten(searchTerm); + aanduidingsobjecten.value = await inventarisApiService.getAanduidingsobjecten(`${searchTerm}*`); const autocompleteData: IAutocompleteOption[] = aanduidingsobjecten.value.map((ao) => { return { title: ao.titel, From 23f429cedce31cd81b511b16379114e6fe052997 Mon Sep 17 00:00:00 2001 From: Vanderhaegen Cedrik Date: Fri, 10 Nov 2023 15:50:49 +0100 Subject: [PATCH 3/6] zet min chars lager om op id's te kunnen zoeken --- src/components/smart/FilterAanduidingsobject.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/smart/FilterAanduidingsobject.vue b/src/components/smart/FilterAanduidingsobject.vue index f7b67d6e..a5f2c4cc 100644 --- a/src/components/smart/FilterAanduidingsobject.vue +++ b/src/components/smart/FilterAanduidingsobject.vue @@ -4,6 +4,7 @@ data-cy="filter-aanduidingsobject" :callback-fn="performAutocompleteSearch" :value="aanduidingsobjectValue" + :min-chars="2" placeholder="geef naam of id in" @update:value="updateValue" > From 6f2e3f8eaebe21e7b2d9bbaf5a22f7b4ad234c9e Mon Sep 17 00:00:00 2001 From: Vanderhaegen Cedrik Date: Mon, 13 Nov 2023 10:10:22 +0100 Subject: [PATCH 4/6] simplify return --- src/components/smart/FilterAanduidingsobject.vue | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/components/smart/FilterAanduidingsobject.vue b/src/components/smart/FilterAanduidingsobject.vue index a5f2c4cc..0dfb10a8 100644 --- a/src/components/smart/FilterAanduidingsobject.vue +++ b/src/components/smart/FilterAanduidingsobject.vue @@ -40,14 +40,12 @@ const updateValue = (value: IESAanduidingsobject) => emit('update:value', value) const performAutocompleteSearch = async (searchTerm: string): Promise => { try { aanduidingsobjecten.value = await inventarisApiService.getAanduidingsobjecten(`${searchTerm}*`); - const autocompleteData: IAutocompleteOption[] = aanduidingsobjecten.value.map((ao) => { + return aanduidingsobjecten.value.map((ao) => { return { title: ao.titel, value: ao.uri, }; }); - - return autocompleteData; } catch (error) { console.error('Error fetching autocomplete data:', error); return Promise.resolve([]); From d70f0009a80810fc8d108ac725f3147dcbc3e72c Mon Sep 17 00:00:00 2001 From: Vanderhaegen Cedrik Date: Mon, 13 Nov 2023 14:27:57 +0100 Subject: [PATCH 5/6] fix filter stories --- .../filter-aoe-actor.stories.ts | 15 ++++++++++++++ .../filter-gemeente.stories.ts | 20 +++++++++++++++++++ .../filter-provincie.stories.ts | 20 +++++++++++++++++++ 3 files changed, 55 insertions(+) diff --git a/src/stories/smart-components/filter-aoe-actor.stories.ts b/src/stories/smart-components/filter-aoe-actor.stories.ts index 87b7f21b..297daa2d 100644 --- a/src/stories/smart-components/filter-aoe-actor.stories.ts +++ b/src/stories/smart-components/filter-aoe-actor.stories.ts @@ -64,4 +64,19 @@ export const Default: Story = { api: 'https://dev-actoren.onroerenderfgoed.be', id: 'my-id', }, + render: () => ({ + components: { + FilterAOEActor, + }, + setup() { + const api = 'https://dev-actoren.onroerenderfgoed.be'; + const getSsoToken = async () => 'vul hier bearer token in'; + return { api, getSsoToken }; + }, + template: ` +
+ +
+ `, + }), }; diff --git a/src/stories/smart-components/filter-gemeente.stories.ts b/src/stories/smart-components/filter-gemeente.stories.ts index 42f537f1..37e6a589 100644 --- a/src/stories/smart-components/filter-gemeente.stories.ts +++ b/src/stories/smart-components/filter-gemeente.stories.ts @@ -1,5 +1,6 @@ import '@/scss/main.scss'; import FilterGemeente from '../../components/smart/FilterGemeente.vue'; +import type { IGemeente } from '../../models'; import type { Meta, StoryObj } from '@storybook/vue3'; // More on how to set up stories at: https://storybook.js.org/docs/vue/writing-stories/introduction @@ -42,6 +43,25 @@ const meta: Meta = { }, }, }, + render: (args) => ({ + components: { FilterGemeente }, + inheritAttrs: false, + setup() { + return { args }; + }, + template: ` +
+ + + +
+ `, + methods: { + onUpdateGemeente(payload: IGemeente) { + args.value = payload.niscode; + }, + }, + }), }; export default meta; diff --git a/src/stories/smart-components/filter-provincie.stories.ts b/src/stories/smart-components/filter-provincie.stories.ts index 4b24a6b3..9339594f 100644 --- a/src/stories/smart-components/filter-provincie.stories.ts +++ b/src/stories/smart-components/filter-provincie.stories.ts @@ -1,5 +1,6 @@ import '@/scss/main.scss'; import FilterProvincie from '../../components/smart/FilterProvincie.vue'; +import type { IProvincie } from '../../models'; import type { Meta, StoryObj } from '@storybook/vue3'; // More on how to set up stories at: https://storybook.js.org/docs/vue/writing-stories/introduction @@ -42,6 +43,25 @@ const meta: Meta = { }, }, }, + render: (args) => ({ + components: { FilterProvincie }, + inheritAttrs: false, + setup() { + return { args }; + }, + template: ` +
+ + + +
+ `, + methods: { + onUpdateProvincie(payload: IProvincie) { + args.value = payload.niscode; + }, + }, + }), }; export default meta; From 0bee138c586dc70611d13b009822f6e2956d53a3 Mon Sep 17 00:00:00 2001 From: Vanderhaegen Cedrik Date: Mon, 13 Nov 2023 14:29:41 +0100 Subject: [PATCH 6/6] simplify return --- src/components/smart/FilterAanduidingsobject.vue | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/components/smart/FilterAanduidingsobject.vue b/src/components/smart/FilterAanduidingsobject.vue index f2de691a..20a296cb 100644 --- a/src/components/smart/FilterAanduidingsobject.vue +++ b/src/components/smart/FilterAanduidingsobject.vue @@ -45,14 +45,12 @@ const updateValue = (value: IAutocompleteOption) => { const performAutocompleteSearch = async (searchTerm: string): Promise => { try { aanduidingsobjecten.value = await inventarisApiService.getAanduidingsobjecten(`${searchTerm}*`); - const autocompleteData: IAutocompleteOption[] = aanduidingsobjecten.value.map((ao) => { + return aanduidingsobjecten.value.map((ao) => { return { title: ao.titel, value: ao.uri, }; }); - - return autocompleteData; } catch (error) { console.error('Error fetching autocomplete data:', error); return Promise.resolve([]);