From 652c40ab81fccfc3ffea4e1572e3dfbcabea22c8 Mon Sep 17 00:00:00 2001 From: cnouguier Date: Tue, 23 Aug 2022 11:24:38 +0200 Subject: [PATCH] wip: Upgrade to Quasar 2 / Vue 3 #393 --- api/src/services/members/members.hooks.js | 6 +++- api/src/services/tags/tags.hooks.js | 3 +- config/default.js | 2 +- package.json | 2 +- src/components/ArchivedEventCard.vue | 2 +- src/components/ArchivedPlanCard.vue | 10 +++---- src/components/EventEditor.vue | 8 ++---- src/components/EventFilter.vue | 6 ++-- src/components/EventTemplateEditor.vue | 3 ++ src/components/PlanEditor.vue | 3 +- src/schemas/events.create.json | 34 ++++++----------------- yarn.lock | 7 +++-- 12 files changed, 37 insertions(+), 49 deletions(-) diff --git a/api/src/services/members/members.hooks.js b/api/src/services/members/members.hooks.js index 8a62c5d2..ccc3a879 100644 --- a/api/src/services/members/members.hooks.js +++ b/api/src/services/members/members.hooks.js @@ -1,5 +1,6 @@ import _ from 'lodash' import commonHooks from 'feathers-hooks-common' +import fuzzySearch from 'feathers-mongodb-fuzzy-search' import { hooks as coreHooks, createObjectID } from '@kalisio/kdk/core.api.js' // Fix for https://github.com/kalisio/aktnmap/issues/217 @@ -19,7 +20,10 @@ function itemContextMatch (hook) { export default { before: { all: [], - find: [commonHooks.when(hasItemContext, itemContextMatch)], + find: [ + commonHooks.when(hasItemContext, itemContextMatch), + fuzzySearch({ fields: ['profile.name'] }), + ], get: [], create: [], update: [], diff --git a/api/src/services/tags/tags.hooks.js b/api/src/services/tags/tags.hooks.js index fe78b14b..97ef6ec6 100644 --- a/api/src/services/tags/tags.hooks.js +++ b/api/src/services/tags/tags.hooks.js @@ -1,11 +1,12 @@ import commonHooks from 'feathers-hooks-common' +import fuzzySearch from 'feathers-mongodb-fuzzy-search' import { hooks as coreHooks } from '@kalisio/kdk/core.api.js' import { updateEventTemplateResource } from '../../hooks/index.js' export default { before: { all: [], - find: [], + find: [fuzzySearch({ fields: ['value'] })], get: [], create: [], update: [], diff --git a/config/default.js b/config/default.js index b6024cee..d03fd4a3 100644 --- a/config/default.js +++ b/config/default.js @@ -1101,7 +1101,7 @@ module.exports = { filter: { id: { $in: ['layer-actions', 'zoom-to'] } } }, restore: { view: false, layers: false }, - featuresChunkSize: 5000 // TODO: here or in mapEngine ? + featuresChunkSize: 5000 }, routes: require('../src/router/routes') diff --git a/package.json b/package.json index c12dac8e..0a86fcbb 100644 --- a/package.json +++ b/package.json @@ -174,7 +174,7 @@ "vue-i18n": "^9.2.0-beta.35", "vue-router": "^4.0.0", "vue-slider-component": "next", - "vue3-tour": "https://github.com/alexandreDavid/vue3-tour", + "vue3-tour": "^0.3.2", "whatwg-fetch": "^2.0.3", "xml2js": "^0.4.23", "yallist": "^4.0.0" diff --git a/src/components/ArchivedEventCard.vue b/src/components/ArchivedEventCard.vue index cb36b45f..1396e553 100644 --- a/src/components/ArchivedEventCard.vue +++ b/src/components/ArchivedEventCard.vue @@ -145,7 +145,7 @@ export default { size: '0.75rem' }) } - components.push({ component: 'QSpace ' }) + components.push({ component: 'QSpace' }) components.concat(_.filter(this.itemActions, { scope: 'header' })) return components }, diff --git a/src/components/ArchivedPlanCard.vue b/src/components/ArchivedPlanCard.vue index 36c5deb7..16db5422 100644 --- a/src/components/ArchivedPlanCard.vue +++ b/src/components/ArchivedPlanCard.vue @@ -20,7 +20,7 @@ :context="$props" :dense="dense" > - + @@ -38,7 +38,7 @@ v-if="isExpanded" :title="$t('ArchivedPlanCard.COORDINATORS_SECTION')" :context="$props"> - + import _ from 'lodash' -import { mixins as kCoreMixins } from '@kalisio/kdk/core.client' +import { mixins as kdkCoreMixins } from '@kalisio/kdk/core.client' export default { name: 'archived-plan-card', - mixins: [kCoreMixins.baseItem], + mixins: [kdkCoreMixins.baseItem], props: { dense: { type: Boolean, @@ -82,7 +82,7 @@ export default { } else { components.push({ component: 'QBadge', label: this.$t('ArchivedPlanCard.OPENED_LABEL'), color: 'green-7' }) } - components.push({ component: 'QSpace ' }) + components.push({ component: 'QSpace' }) components.concat(_.filter(this.itemActions, { scope: 'header' })) return components }, diff --git a/src/components/EventEditor.vue b/src/components/EventEditor.vue index 2bcb9069..4f609baa 100644 --- a/src/components/EventEditor.vue +++ b/src/components/EventEditor.vue @@ -177,11 +177,10 @@ export default { getBaseQuery (object) { // Overriden to handle notification messages const query = kdkCoreMixins.baseEditor.methods.getBaseQuery.call(this) - // const notification = _.get(object, 'notification', true) // if (notification) { if (this.notify) { - if (this.getEditorMode() === 'create') query.notification = this.$t('EventNotifications.CREATE') + if (this.editorMode === 'create') query.notification = this.$t('EventNotifications.CREATE') else query.notification = this.$t('EventNotifications.UPDATE') } // _.unset(object, 'notification') @@ -198,8 +197,7 @@ export default { } }, async apply () { - await kdkCoreMixins.baseEditor.methods.apply.call(this) - this.closeModal() + if (await kdkCoreMixins.baseEditor.methods.apply.call(this)) this.closeModal() } }, async created () { @@ -208,7 +206,7 @@ export default { if (!this.hasPlan()) this.refresh() else this.loadPlan() // Setup notify option - if (this.getEditorMode() === 'create') this.notify = true + if (this.editorMode === 'create') this.notify = true else this.notify = false } } diff --git a/src/components/EventFilter.vue b/src/components/EventFilter.vue index 60464eb5..252dc62f 100644 --- a/src/components/EventFilter.vue +++ b/src/components/EventFilter.vue @@ -1,5 +1,5 @@ - +