diff --git a/CHANGELOG.md b/CHANGELOG.md index e357f0b9d..36f1c955b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ ## UNRELEASED +### Changed + +- ([#91](https://github.com/demos-europe/demosplan-ui/pull/91)) Pass routes as props ([@ahmad-demos](https://github.com/ahmad-demos)) + + ### Fixed - ([#100](https://github.com/demos-europe/demosplan-ui/pull/100)) Set correct value for `aria-live` in DpNotifyContainer when document becomes visible ([@spiess-demos](https://github.com/spiess-demos)) diff --git a/src/components/core/DpAutocomplete.vue b/src/components/core/DpAutocomplete.vue index 7f7c6cf5c..eea1f5b22 100644 --- a/src/components/core/DpAutocomplete.vue +++ b/src/components/core/DpAutocomplete.vue @@ -33,12 +33,6 @@ export default { mixins: [prefixClassMixin], props: { - additionalRouteParams: { - type: Object, - required: false, - default: () => ({}) - }, - height: { type: String, required: false, @@ -63,14 +57,8 @@ export default { default: () => Translator.trans('search') }, - queryParam: { - type: String, - required: false, - default: 'query' - }, - - route: { - type: String, + routeGenerator: { + type: Function, required: true }, @@ -110,7 +98,8 @@ export default { async fetchOptions (searchString) { this.isLoading = true try { - const response = await dpApi.get(Routing.generate(this.route, { ...this.additionalRouteParams, [this.queryParam]: searchString })) + const route = this.routeGenerator(searchString) + const response = await dpApi.get(route) // Only emit results that match the current search -> prevents race conditions if (this.currentQuerry === searchString) this.$emit('search-changed', response) this.isLoading = false diff --git a/src/components/core/DpEditor/DpBoilerPlateModal.vue b/src/components/core/DpEditor/DpBoilerPlateModal.vue index 7a80df813..7d826ca8d 100644 --- a/src/components/core/DpEditor/DpBoilerPlateModal.vue +++ b/src/components/core/DpEditor/DpBoilerPlateModal.vue @@ -14,8 +14,9 @@ @boilerplate-text-added="addBoilerplateText" />