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

Issue 515 v1 #585

Merged
merged 6 commits into from
Oct 1, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 71 additions & 48 deletions client/src/pages/flow/List.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
<template v-for="(field,fieldNumber) in fields[moduleName]">
<td v-if="fieldNumber ==0" style="padding:10px;font-weight:bold;border-right: 3px solid #cdd0d4;">
{{selectedFlowObject.processList[titleCase(item.service)].name}}
<!-- {{item.service}}
<br>
<br>
{{selectedFlowObject.processList[titleCase(item.service)]}} -->
</td>
<td v-else>
<table class="table-bordered" style="width:100%">
Expand Down Expand Up @@ -162,7 +166,7 @@
<script>
import flowz from '@/api/flowz'
import _ from 'lodash'
// import finstanceModal from '@/api/finstance'
import finstanceModal from '@/api/finstance'
import axios from 'axios'
import viewSVG from './viewSVG'
import psl from 'psl'
Expand All @@ -180,7 +184,7 @@ import moment from 'moment'
export default {
name: 'Flowz',
components: {
viewSVG: (resolve) => { require(['./viewSVG'], resolve) },
'viewSVG': (resolve) => { require(['./viewSVG'], resolve) },
expandRow2: (resolve) => { require(['./assigned_invite_table-expand.vue'], resolve) },
subscription: (resolve) => { require(['@/components/subscription'], resolve) }
},
Expand Down Expand Up @@ -244,32 +248,32 @@ export default {
align: 'center',
render: (h, params) => {
return h('div', [
// h('Button', {
// props: {
// type: 'text',
// size: 'large',
// icon: 'arrow-right-b'
// },
// domProps: {
// title: 'Start Instance'
// },
// style: {
// marginRight: '3px',
// padding: '0px',
// fontSize: '20px',
// color: '#2411c5'
// },
// on: {
// click: () => {
// this.createNewInstance(params.row.id)
// }
// }
// }, ''),
h('Button', {
props: {
type: 'text',
size: 'large',
icon: 'key'
icon: 'arrow-right-b'
},
domProps: {
title: 'Start Instance'
},
style: {
marginRight: '3px',
padding: '0px',
fontSize: '20px',
color: '#2411c5'
},
on: {
click: () => {
this.createNewInstance(params.row.id)
}
}
}, ''),
h('Button', {
props: {
type: 'text',
size: 'large',
icon: 'settings'
},
domProps: {
title: 'Set Permission'
Expand Down Expand Up @@ -313,9 +317,6 @@ export default {
size: 'large',
icon: 'ios-personadd'
},
domProps: {
title: 'Invite User'
},
style: {
marginRight: '3px',
padding: '0px',
Expand All @@ -333,9 +334,6 @@ export default {
type: 'text',
size: 'large'
},
domProps: {
title: 'Field Permissions'
},
style: {
marginRight: '3px',
padding: '0px',
Expand Down Expand Up @@ -534,6 +532,32 @@ export default {
console.log(error)
})
}
},
'flowz': {
created (data) {
// console.log(this.limit)
if (this.total < this.limit) {
this.flowzList.push(data)
} else {
this.total = ((this.total) + 1)
}
},
updated (data) {
if (this.flowzList < this.limit) {
let inx = _.findIndex(this.flowzList, (o) => { return o.id === data.id })
this.flowzList.splice(inx, 1)
this.flowzList.push(data)
}
},
removed (data) {
// console.log('Removed Data: ', data)
if (this.$store.state.role === 1) {
// this.$store.state.flowz = []
// this.init()
let i = _.findIndex(this.flowzList, (o) => { return o.id === data.id })
this.flowzList.splice(i, 1)
}
}
}
},
methods: {
Expand Down Expand Up @@ -709,7 +733,6 @@ export default {
this.init()
},
init () {
// var string = '?$skip=' + this.skip + '&$limit=' + this.limit
this.loading = true
flowz.get(null, {
$skip: this.skip,
Expand All @@ -722,26 +745,26 @@ export default {
})
.catch(error => {
this.loading = false
this.$Notice.error({duration: '3', title: error.message, desc: ''})
this.$Notice({duration: '3', title: 'Network Error', desc: ''})
console.log(error)
})
},
// createNewInstance (item) {
// this.$Loading.start()
// let fheaders = null
// finstanceModal.post({fid: item.id}, null, fheaders).then(res => {
// this.$Notice.success({title: 'Instance Generated'})
// this.$Loading.finish()
// }).catch(e => {
// this.$Loading.error()
// console.log('error', e.response)
// if (e.response.data.message) {
// this.$Notice.error({title: 'Error', desc: e.response.data.message.toString()})
// } else {
// this.$Notice.error({title: 'Error', desc: 'Instace Not Generated'})
// }
// })
// },
createNewInstance (item) {
this.$Loading.start()
let fheaders = null
finstanceModal.post({fid: item.id}, null, fheaders).then(res => {
this.$Notice.success({title: 'Instance Generated'})
this.$Loading.finish()
}).catch(e => {
this.$Loading.error()
console.log('error', e.response)
if (e.response.data.message) {
this.$Notice.error({title: 'Error', desc: e.response.data.message.toString()})
} else {
this.$Notice.error({title: 'Error', desc: 'Instace Not Generated'})
}
})
},
addNewFlow () {
this.$store.dispatch('removeXMLtoLocalStorage')
this.$router.push({name: 'flow/new'})
Expand Down