Skip to content
This repository was archived by the owner on Oct 30, 2023. It is now read-only.

Commit e138491

Browse files
authored
Merge pull request #521 from FlowzPlatform/issue-469-n5
Issue 469 n5
2 parents 42112c1 + c1a91b3 commit e138491

File tree

4 files changed

+37
-21
lines changed

4 files changed

+37
-21
lines changed

client/src/components/SchemaSubForm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ export default {
565565
}
566566
},
567567
mounted () {
568-
this.oldFiles = this.schemainstance.data[0].Fileattachment.length
568+
// this.oldFiles = this.schemainstance.data[0].Fileattachment.length
569569
},
570570
created () {}
571571
}

client/src/components/SchemaView.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
</div>
131131
</div>
132132
</TabPane>
133-
<TabPane v-if="this.$store.state.role === 2" :label="'Data ('+ dataData2.length + ')'" icon="lock-combination">
133+
<TabPane v-if="this.$store.state.role === 2" :label="'Work Pool ('+ dataData2.length + ')'" icon="lock-combination">
134134
<schemalist :schema="dataSchema" :datashow="'dataU'" :pageno="pageno" v-on:on-paginate="pagination" v-on:on-handlepage="handlepage" :limit="limit" :skip="skip" :dataTotal="dataTotal" :data="dataData2" :configuration="configuration" :instanceEntries="instanceEntries" :dynamicData="dynamicData" v-on:setValues="setValues" :flowzData="flowzData" v-on:sort-data="sortData" v-on:search-data="searchData"></schemalist>
135135
</TabPane>
136136
<TabPane v-if="this.$store.state.role === 2" :label="'In Progress ('+ dataClaim.length + ')'" icon="lock-combination">

client/src/pages/flow/New.vue

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@
7878
xml: '',
7979
svg: '',
8080
first: ''
81-
}
81+
},
82+
oldFlow: {}
8283
}
8384
},
8485
methods: {
@@ -229,22 +230,36 @@
229230
subscriptionNew.moduleResource.registerAppModule = registerAppModuleNew
230231
subscriptionNew.moduleResource.appRoles = userRolesArr
231232
subscriptionNew.registeredAppModulesRole().then(resp => {
232-
let result = null
233+
// let result = null
233234
if (this.$route.params.id !== undefined) {
234-
result = flowz.put(this.$route.params.id, this.flowObject)
235+
// if (this.flowObject.schema === this.oldFlow.schema) {
236+
// console.log('...........')
237+
// } else {
238+
// this.$Notice.warning({title: 'You\'ve change schema of <b>' + this.flowObject.name + '</b>', desc: '<a>Click Here</a> Set permissions', duration: 0})
239+
// }
240+
// this.btnLoading = false
241+
flowz.put(this.$route.params.id, this.flowObject).then(response => {
242+
this.$Notice.success({title: 'Success..!', desc: 'Flow Updated..'})
243+
this.$router.push({name: 'flow/list'})
244+
localStorage.removeItem('BPMNXml')
245+
this.btnLoading = false
246+
}).catch(error => {
247+
console.log(error)
248+
this.$Notice.error({title: 'Error..!', desc: 'Flow Not Updated...'})
249+
this.btnLoading = false
250+
})
235251
} else {
236-
result = flowz.post(this.flowObject)
252+
flowz.post(this.flowObject).then(response => {
253+
this.$Notice.success({title: 'Success..!', desc: 'Flow Saved..'})
254+
this.$router.push({name: 'flow/list'})
255+
localStorage.removeItem('BPMNXml')
256+
this.btnLoading = false
257+
}).catch(error => {
258+
console.log(error)
259+
this.$Notice.error({title: 'Error..!', desc: 'Flow Not Saved...'})
260+
this.btnLoading = false
261+
})
237262
}
238-
result.then(response => {
239-
this.$Notice.success({title: 'Success..!', desc: 'Flow Saved..'})
240-
this.$router.push({name: 'flow/list'})
241-
localStorage.removeItem('BPMNXml')
242-
this.btnLoading = false
243-
}).catch(error => {
244-
console.log(error)
245-
this.$Notice.error({title: 'Error..!', desc: 'Flow Not Saved...'})
246-
this.btnLoading = false
247-
})
248263
}).catch(err => {
249264
this.$Notice.error({title: 'Error..!', desc: 'Flow Not Saved. Try again.'})
250265
console.log('Error: ', err)
@@ -387,8 +402,9 @@
387402
Promise.all(this.processVar).then(async (response) => {
388403
if (this.$route.params.id !== undefined) {
389404
this.bpmnXML = flowz.get(this.$route.params.id).then(async (result) => {
405+
this.oldFlow = result.data
390406
this.bpmnXML = result.data.xml
391-
await this.initBPMN({
407+
this.initBPMN({
392408
userId: this.$store.state.user._id,
393409
emailTemplate: tempVar,
394410
cdata: result.data,
@@ -405,7 +421,7 @@
405421
}) // Create bpmn
406422
})
407423
} else {
408-
await this.initBPMN({
424+
this.initBPMN({
409425
userId: this.$store.state.user._id,
410426
emailTemplate: tempVar,
411427
schema: response[0],

service/src/services/flowzdata/flowzdata.hooks.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ function afterCreate (hook) {
6161
return hook.app.service('flowz').get(hook.data.fid, {query}).then(res => {
6262
// let cuurentObj = _.find(res.json.processList, {id: hook.data.state});
6363
let cuurentObj = res.processList[hook.data.state];
64-
console.log('________________________________________________cuurentObj', cuurentObj)
64+
// console.log('________________________________________________cuurentObj', cuurentObj)
6565
// let nextTargetObj = getNextTarget(res.json.processList, cuurentObj.target[0].id);
6666
let nextTargetObj = res.processList[cuurentObj.target[0].id];
67-
console.log('________________________________________________nextTargetObj', nextTargetObj)
67+
// console.log('________________________________________________nextTargetObj', nextTargetObj)
6868
return hook.app.service('finstance').get(hook.data.iid).then(finstRes => {
6969
let mdata = {
7070
currentStatus: nextTargetObj.id,
@@ -104,7 +104,7 @@ function afterCreate (hook) {
104104
if (nextTargetObj.type === 'endevent') {
105105
mdata.mainStatus = 'completed';
106106
}
107-
return hook.app.service('finstance').patch(hook.data.iid, mdata).then(pRes => {
107+
return hook.app.service('finstance').patch(hook.data.iid, mdata, hook.params).then(pRes => {
108108
return hook;
109109
}).catch(err => {
110110
throw new errors.BadRequest('Error', {

0 commit comments

Comments
 (0)