Skip to content

Commit

Permalink
wip: Upgrade to Quasar 2 / Vue 3 #393
Browse files Browse the repository at this point in the history
  • Loading branch information
cnouguier committed Aug 23, 2022
1 parent 0e42442 commit 652c40a
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 49 deletions.
6 changes: 5 additions & 1 deletion api/src/services/members/members.hooks.js
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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: [],
Expand Down
3 changes: 2 additions & 1 deletion api/src/services/tags/tags.hooks.js
Original file line number Diff line number Diff line change
@@ -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: [],
Expand Down
2 changes: 1 addition & 1 deletion config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/components/ArchivedEventCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand Down
10 changes: 5 additions & 5 deletions src/components/ArchivedPlanCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
:context="$props"
:dense="dense"
>
<k-chips-pane v-if="item.objectives" class="q-pl-sm" :chips="item.objectives" :value-path="'name'" />
<KChipsPane v-if="item.objectives" class="q-pl-sm" :chips="item.objectives" :value-path="'name'" />
<KStamp v-else :text="'ArchivedPlanCard.NO_OBJECTIVES_LABEL'" direction="horizontal" />
</KCardSection>
<!-- location section -->
Expand All @@ -38,7 +38,7 @@
v-if="isExpanded"
:title="$t('ArchivedPlanCard.COORDINATORS_SECTION')"
:context="$props">
<k-chips-pane class="q-pl-sm" :chips="item.coordinators" :valuePath="['profile.name', 'value', 'name']" />
<KChipsPane class="q-pl-sm" :chips="item.coordinators" :valuePath="['profile.name', 'value', 'name']" />
</KCardSection>
<!-- Timestamps section -->
<KCardSection
Expand All @@ -63,11 +63,11 @@

<script>
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,
Expand All @@ -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
},
Expand Down
8 changes: 3 additions & 5 deletions src/components/EventEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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 () {
Expand All @@ -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
}
}
Expand Down
6 changes: 2 additions & 4 deletions src/components/EventFilter.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<k-action
<KAction
id="event-filter"
icon="las la-filter"
:color="filters.length > 0 ? 'accent' : 'grey-7'">
Expand All @@ -15,7 +15,7 @@
type="toggle" />
</q-popup-proxy>
</template>
</k-action>
</KAction>
</template>

<script>
Expand All @@ -38,8 +38,6 @@ export default {
}
},
async created () {
// Load the required components
this.$options.components['k-action'] = this.$load('frame/KAction')
// Intiializes the options
this.options = [
{ label: this.$t('EventFilter.OPEN'), value: 'open' },
Expand Down
3 changes: 3 additions & 0 deletions src/components/EventTemplateEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ export default {
async onWorkflow (copyWorkflow) {
if (copyWorkflow) this.object.workflow = _.cloneDeep(this.template.workflow)
else delete this.object.workflow
},
async apply () {
if (await kdkCoreMixins.baseEditor.methods.apply.call(this)) this.closeModal()
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/components/PlanEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,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 () {
Expand Down
34 changes: 9 additions & 25 deletions src/schemas/events.create.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,6 @@
"draw": true
}
},
"expireAt": {
"type": "string",
"group": "schemas.EVENTS_ADVANCED_SETTINGS",
"format": "date-time",
"field": {
"component": "form/KDatetimeField",
"label": "schemas.EVENTS_EXPIRE_AT_FIELD_LABEL",
"type": "datetime",
"defaultOffset": 604800
}
},
"participants": {
"type": "array",
"multiselect": true,
Expand Down Expand Up @@ -131,19 +120,15 @@
"label": "schemas.EVENTS_COORDINATORS_FIELD_CREATE_LABEL"
}
},
"attachments": {
"type": "array",
"expireAt": {
"type": "string",
"group": "schemas.EVENTS_ADVANCED_SETTINGS",
"format": "date-time",
"field": {
"component": "form/KAttachmentField",
"label": "schemas.EVENTS_ATTACHMENTS_FIELD_LABEL",
"service": "storage",
"acceptedFiles": "image/*,application/pdf",
"multiple": true,
"maxFilesize": 10,
"autoProcessQueue": false,
"resourcesService": "events",
"storagePath": "<%= id %>/<%= file.name %>"
"component": "form/KDatetimeField",
"label": "schemas.EVENTS_EXPIRE_AT_FIELD_LABEL",
"type": "datetime",
"defaultOffset": 604800
}
},
"hasWorkflow": {
Expand All @@ -152,11 +137,10 @@
"default": true,
"field": {
"component": "form/KToggleField",
"label": "schemas.EVENTS_HAS_WORKFLOW_FIELD_LABEL",
"icon": "fa-retweet"
"label": "schemas.EVENTS_HAS_WORKFLOW_FIELD_LABEL"
}
}
},
"required": ["name", "hasWorkflow"]
"required": ["name"]
}

7 changes: 4 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12880,9 +12880,10 @@ [email protected]:
hash-sum "^1.0.2"
loader-utils "^1.0.2"

"vue3-tour@https://github.com/alexandreDavid/vue3-tour":
version "0.3.1"
resolved "https://github.com/alexandreDavid/vue3-tour#08ffb81faea35d790433efae5ba12d15163ba644"
vue3-tour@^0.3.2:
version "0.3.2"
resolved "https://registry.yarnpkg.com/vue3-tour/-/vue3-tour-0.3.2.tgz#a262e742dd6ebbe4f5afbd5cf573d3603a8f412c"
integrity sha512-A/s2wYoHQEG0BCLuQkZM5+GoLMC32zD9y+d+JSeFJ6kbKTUmAoYhp0FNEgWzK0dOj8bgl8x77bxIXB61oM4NWA==
dependencies:
"@popperjs/core" "^2.11.5"
hash-sum "^2.0.0"
Expand Down

0 comments on commit 652c40a

Please sign in to comment.