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 22, 2022
1 parent 2c29fbd commit 0e42442
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ jobs:
before_script:
- export -f travis_fold
script:
- bash .travis.ios.sh
- travis_wait 30 bash .travis.ios.sh
6 changes: 5 additions & 1 deletion src/components/EventEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export default {
},
getBaseQuery (object) {
// Overriden to handle notification messages
const query = editorMixin.methods.getBaseQuery.call(this)
const query = kdkCoreMixins.baseEditor.methods.getBaseQuery.call(this)
// const notification = _.get(object, 'notification', true)
// if (notification) {
Expand All @@ -196,6 +196,10 @@ export default {
delete this.object.workflow
}
}
},
async apply () {
await kdkCoreMixins.baseEditor.methods.apply.call(this)
this.closeModal()
}
},
async created () {
Expand Down
14 changes: 10 additions & 4 deletions src/components/PlanEditor.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<KModal
:title="editorTitle"
:buttons="getButtons()"
:buttons="buttons"
v-model="isModalOpened"
>
<KForm
Expand Down Expand Up @@ -31,13 +31,15 @@ export default {
default: ''
}
},
methods: {
getButtons () {
computed: {
buttons() {
return [
{ id: 'close-button', label: 'CANCEL', renderer: 'form-button', outline: true, handler: () => this.closeModal() },
{ id: 'apply-button', label: this.applyButton, renderer: 'form-button', handler: () => this.apply() }
]
},
}
},
methods: {
async loadObject () {
// When a template is provided use it as reference for object
if (this.templateId) {
Expand All @@ -53,6 +55,10 @@ export default {
// Otherwise proceed as usual to load the event object
return kdkCoreMixins.objectProxy.methods.loadObject.call(this)
}
},
async apply () {
await kdkCoreMixins.baseEditor.methods.apply.call(this)
this.closeModal()
}
},
async created () {
Expand Down
39 changes: 17 additions & 22 deletions src/components/PlanObjectivesEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,19 @@
/>
</q-card-section>
<q-card-section id="plan-objective-add" v-if="mode === 'add'">
<div class="colum q-gutter-y-md">
<KForm
:ref="onAddFormReferenceCreated"
:schema="objectiveSchema"
style="min-width: 300px"
/>
</div>
<KForm
:ref="onAddFormReferenceCreated"
:schema="objectiveSchema"
style="min-width: 300px"
/>
</q-card-section>
<q-card-section id="plan-objective-edit" v-if="mode === 'edit'">
<div class="colum q-gutter-y-md">
<KForm
:ref="onEditFormReferenceCreated"
:schema="objectiveSchema"
style="min-width: 300px"
/>
</div>
<KForm
:ref="onEditFormReferenceCreated"
:schema="objectiveSchema"
style="min-width: 300px"
@form-ready="onEditFormReady"
/>
</q-card-section>
</div>
</KModal>
Expand Down Expand Up @@ -160,11 +157,9 @@ export default {
let objectivesStore = _.get(this.object, 'objectives', [])
// Jump from array to map for in memory service
objectivesStore = _.keyBy(objectivesStore, 'name')
console.log(objectivesStore)
const service = this.$api.getService('plan-objectives')
// Update store with a fresh object otherwise it causes a weird bug in navigator
console.log(service)
//service.store = Object.assign({}, objectivesStore)
// TODO: validate if still needed service.store = Object.assign({}, objectivesStore)
service.store = objectivesStore
},
async updatePlanObjectives (objectives) {
Expand Down Expand Up @@ -219,11 +214,9 @@ export default {
await this.updatePlanObjectives(objectives)
}
},
async editPlanObjective (objective) {
editPlanObjective (objective) {
this.editedObjective = objective
this.mode = 'edit'
this.editedObjective = objective
await this.editForm.build()
this.editForm.fill(objective)
},
async removePlanObjective (objective) {
// Update objectives in-memory and in DB
Expand All @@ -245,11 +238,13 @@ export default {
if (reference) {
this.editForm = reference
}
},
onEditFormReady () {
this.editForm.fill(this.editedObjective)
}
},
async created () {
await this.loadObject()
console.log(this.object)
// Extract objectives as we will map it using an in-memory service
// so that we can use standard collection/form components
this.updatePlanObjectivesServiceStore()
Expand Down

0 comments on commit 0e42442

Please sign in to comment.