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

Commit a2938f0

Browse files
authored
Merge pull request #585 from FlowzPlatform/issue-515-v1
Issue 515 v1
2 parents 6899133 + f792239 commit a2938f0

File tree

1 file changed

+71
-48
lines changed

1 file changed

+71
-48
lines changed

client/src/pages/flow/List.vue

Lines changed: 71 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
<template v-for="(field,fieldNumber) in fields[moduleName]">
3535
<td v-if="fieldNumber ==0" style="padding:10px;font-weight:bold;border-right: 3px solid #cdd0d4;">
3636
{{selectedFlowObject.processList[titleCase(item.service)].name}}
37+
<!-- {{item.service}}
38+
<br>
39+
<br>
40+
{{selectedFlowObject.processList[titleCase(item.service)]}} -->
3741
</td>
3842
<td v-else>
3943
<table class="table-bordered" style="width:100%">
@@ -162,7 +166,7 @@
162166
<script>
163167
import flowz from '@/api/flowz'
164168
import _ from 'lodash'
165-
// import finstanceModal from '@/api/finstance'
169+
import finstanceModal from '@/api/finstance'
166170
import axios from 'axios'
167171
import viewSVG from './viewSVG'
168172
import psl from 'psl'
@@ -180,7 +184,7 @@ import moment from 'moment'
180184
export default {
181185
name: 'Flowz',
182186
components: {
183-
viewSVG: (resolve) => { require(['./viewSVG'], resolve) },
187+
'viewSVG': (resolve) => { require(['./viewSVG'], resolve) },
184188
expandRow2: (resolve) => { require(['./assigned_invite_table-expand.vue'], resolve) },
185189
subscription: (resolve) => { require(['@/components/subscription'], resolve) }
186190
},
@@ -244,32 +248,32 @@ export default {
244248
align: 'center',
245249
render: (h, params) => {
246250
return h('div', [
247-
// h('Button', {
248-
// props: {
249-
// type: 'text',
250-
// size: 'large',
251-
// icon: 'arrow-right-b'
252-
// },
253-
// domProps: {
254-
// title: 'Start Instance'
255-
// },
256-
// style: {
257-
// marginRight: '3px',
258-
// padding: '0px',
259-
// fontSize: '20px',
260-
// color: '#2411c5'
261-
// },
262-
// on: {
263-
// click: () => {
264-
// this.createNewInstance(params.row.id)
265-
// }
266-
// }
267-
// }, ''),
268251
h('Button', {
269252
props: {
270253
type: 'text',
271254
size: 'large',
272-
icon: 'key'
255+
icon: 'arrow-right-b'
256+
},
257+
domProps: {
258+
title: 'Start Instance'
259+
},
260+
style: {
261+
marginRight: '3px',
262+
padding: '0px',
263+
fontSize: '20px',
264+
color: '#2411c5'
265+
},
266+
on: {
267+
click: () => {
268+
this.createNewInstance(params.row.id)
269+
}
270+
}
271+
}, ''),
272+
h('Button', {
273+
props: {
274+
type: 'text',
275+
size: 'large',
276+
icon: 'settings'
273277
},
274278
domProps: {
275279
title: 'Set Permission'
@@ -313,9 +317,6 @@ export default {
313317
size: 'large',
314318
icon: 'ios-personadd'
315319
},
316-
domProps: {
317-
title: 'Invite User'
318-
},
319320
style: {
320321
marginRight: '3px',
321322
padding: '0px',
@@ -333,9 +334,6 @@ export default {
333334
type: 'text',
334335
size: 'large'
335336
},
336-
domProps: {
337-
title: 'Field Permissions'
338-
},
339337
style: {
340338
marginRight: '3px',
341339
padding: '0px',
@@ -534,6 +532,32 @@ export default {
534532
console.log(error)
535533
})
536534
}
535+
},
536+
'flowz': {
537+
created (data) {
538+
// console.log(this.limit)
539+
if (this.total < this.limit) {
540+
this.flowzList.push(data)
541+
} else {
542+
this.total = ((this.total) + 1)
543+
}
544+
},
545+
updated (data) {
546+
if (this.flowzList < this.limit) {
547+
let inx = _.findIndex(this.flowzList, (o) => { return o.id === data.id })
548+
this.flowzList.splice(inx, 1)
549+
this.flowzList.push(data)
550+
}
551+
},
552+
removed (data) {
553+
// console.log('Removed Data: ', data)
554+
if (this.$store.state.role === 1) {
555+
// this.$store.state.flowz = []
556+
// this.init()
557+
let i = _.findIndex(this.flowzList, (o) => { return o.id === data.id })
558+
this.flowzList.splice(i, 1)
559+
}
560+
}
537561
}
538562
},
539563
methods: {
@@ -709,7 +733,6 @@ export default {
709733
this.init()
710734
},
711735
init () {
712-
// var string = '?$skip=' + this.skip + '&$limit=' + this.limit
713736
this.loading = true
714737
flowz.get(null, {
715738
$skip: this.skip,
@@ -722,26 +745,26 @@ export default {
722745
})
723746
.catch(error => {
724747
this.loading = false
725-
this.$Notice.error({duration: '3', title: error.message, desc: ''})
748+
this.$Notice({duration: '3', title: 'Network Error', desc: ''})
726749
console.log(error)
727750
})
728751
},
729-
// createNewInstance (item) {
730-
// this.$Loading.start()
731-
// let fheaders = null
732-
// finstanceModal.post({fid: item.id}, null, fheaders).then(res => {
733-
// this.$Notice.success({title: 'Instance Generated'})
734-
// this.$Loading.finish()
735-
// }).catch(e => {
736-
// this.$Loading.error()
737-
// console.log('error', e.response)
738-
// if (e.response.data.message) {
739-
// this.$Notice.error({title: 'Error', desc: e.response.data.message.toString()})
740-
// } else {
741-
// this.$Notice.error({title: 'Error', desc: 'Instace Not Generated'})
742-
// }
743-
// })
744-
// },
752+
createNewInstance (item) {
753+
this.$Loading.start()
754+
let fheaders = null
755+
finstanceModal.post({fid: item.id}, null, fheaders).then(res => {
756+
this.$Notice.success({title: 'Instance Generated'})
757+
this.$Loading.finish()
758+
}).catch(e => {
759+
this.$Loading.error()
760+
console.log('error', e.response)
761+
if (e.response.data.message) {
762+
this.$Notice.error({title: 'Error', desc: e.response.data.message.toString()})
763+
} else {
764+
this.$Notice.error({title: 'Error', desc: 'Instace Not Generated'})
765+
}
766+
})
767+
},
745768
addNewFlow () {
746769
this.$store.dispatch('removeXMLtoLocalStorage')
747770
this.$router.push({name: 'flow/new'})

0 commit comments

Comments
 (0)