Skip to content

Commit 0e42442

Browse files
author
cnouguier
committed
wip: Upgrade to Quasar 2 / Vue 3 #393
1 parent 2c29fbd commit 0e42442

File tree

4 files changed

+33
-28
lines changed

4 files changed

+33
-28
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,4 @@ jobs:
101101
before_script:
102102
- export -f travis_fold
103103
script:
104-
- bash .travis.ios.sh
104+
- travis_wait 30 bash .travis.ios.sh

src/components/EventEditor.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ export default {
176176
},
177177
getBaseQuery (object) {
178178
// Overriden to handle notification messages
179-
const query = editorMixin.methods.getBaseQuery.call(this)
179+
const query = kdkCoreMixins.baseEditor.methods.getBaseQuery.call(this)
180180
181181
// const notification = _.get(object, 'notification', true)
182182
// if (notification) {
@@ -196,6 +196,10 @@ export default {
196196
delete this.object.workflow
197197
}
198198
}
199+
},
200+
async apply () {
201+
await kdkCoreMixins.baseEditor.methods.apply.call(this)
202+
this.closeModal()
199203
}
200204
},
201205
async created () {

src/components/PlanEditor.vue

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<KModal
33
:title="editorTitle"
4-
:buttons="getButtons()"
4+
:buttons="buttons"
55
v-model="isModalOpened"
66
>
77
<KForm
@@ -31,13 +31,15 @@ export default {
3131
default: ''
3232
}
3333
},
34-
methods: {
35-
getButtons () {
34+
computed: {
35+
buttons() {
3636
return [
3737
{ id: 'close-button', label: 'CANCEL', renderer: 'form-button', outline: true, handler: () => this.closeModal() },
3838
{ id: 'apply-button', label: this.applyButton, renderer: 'form-button', handler: () => this.apply() }
3939
]
40-
},
40+
}
41+
},
42+
methods: {
4143
async loadObject () {
4244
// When a template is provided use it as reference for object
4345
if (this.templateId) {
@@ -53,6 +55,10 @@ export default {
5355
// Otherwise proceed as usual to load the event object
5456
return kdkCoreMixins.objectProxy.methods.loadObject.call(this)
5557
}
58+
},
59+
async apply () {
60+
await kdkCoreMixins.baseEditor.methods.apply.call(this)
61+
this.closeModal()
5662
}
5763
},
5864
async created () {

src/components/PlanObjectivesEditor.vue

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,19 @@
2020
/>
2121
</q-card-section>
2222
<q-card-section id="plan-objective-add" v-if="mode === 'add'">
23-
<div class="colum q-gutter-y-md">
24-
<KForm
25-
:ref="onAddFormReferenceCreated"
26-
:schema="objectiveSchema"
27-
style="min-width: 300px"
28-
/>
29-
</div>
23+
<KForm
24+
:ref="onAddFormReferenceCreated"
25+
:schema="objectiveSchema"
26+
style="min-width: 300px"
27+
/>
3028
</q-card-section>
3129
<q-card-section id="plan-objective-edit" v-if="mode === 'edit'">
32-
<div class="colum q-gutter-y-md">
33-
<KForm
34-
:ref="onEditFormReferenceCreated"
35-
:schema="objectiveSchema"
36-
style="min-width: 300px"
37-
/>
38-
</div>
30+
<KForm
31+
:ref="onEditFormReferenceCreated"
32+
:schema="objectiveSchema"
33+
style="min-width: 300px"
34+
@form-ready="onEditFormReady"
35+
/>
3936
</q-card-section>
4037
</div>
4138
</KModal>
@@ -160,11 +157,9 @@ export default {
160157
let objectivesStore = _.get(this.object, 'objectives', [])
161158
// Jump from array to map for in memory service
162159
objectivesStore = _.keyBy(objectivesStore, 'name')
163-
console.log(objectivesStore)
164160
const service = this.$api.getService('plan-objectives')
165161
// Update store with a fresh object otherwise it causes a weird bug in navigator
166-
console.log(service)
167-
//service.store = Object.assign({}, objectivesStore)
162+
// TODO: validate if still needed service.store = Object.assign({}, objectivesStore)
168163
service.store = objectivesStore
169164
},
170165
async updatePlanObjectives (objectives) {
@@ -219,11 +214,9 @@ export default {
219214
await this.updatePlanObjectives(objectives)
220215
}
221216
},
222-
async editPlanObjective (objective) {
217+
editPlanObjective (objective) {
218+
this.editedObjective = objective
223219
this.mode = 'edit'
224-
this.editedObjective = objective
225-
await this.editForm.build()
226-
this.editForm.fill(objective)
227220
},
228221
async removePlanObjective (objective) {
229222
// Update objectives in-memory and in DB
@@ -245,11 +238,13 @@ export default {
245238
if (reference) {
246239
this.editForm = reference
247240
}
241+
},
242+
onEditFormReady () {
243+
this.editForm.fill(this.editedObjective)
248244
}
249245
},
250246
async created () {
251247
await this.loadObject()
252-
console.log(this.object)
253248
// Extract objectives as we will map it using an in-memory service
254249
// so that we can use standard collection/form components
255250
this.updatePlanObjectivesServiceStore()

0 commit comments

Comments
 (0)