From 7c5e245f541c5d2b4f37ba5da0840e4ae92ed0e0 Mon Sep 17 00:00:00 2001 From: vishalkanojiya Date: Tue, 25 Sep 2018 16:07:44 +0530 Subject: [PATCH 1/6] Socket fix in flows page --- client/src/pages/flow/List.vue | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/client/src/pages/flow/List.vue b/client/src/pages/flow/List.vue index 886a490..75e79da 100644 --- a/client/src/pages/flow/List.vue +++ b/client/src/pages/flow/List.vue @@ -375,6 +375,7 @@ export default { }, on: { click: () => { + // console.log(this.flowzList[params.index].id) this.deleteFlow(this.flowzList[params.index].id, params.index) } } @@ -522,15 +523,22 @@ export default { this.getDataOfSubscriptionUser() }, feathers: { - 'flowz-instance': { - created (data) { // update status using socket - flowz.get() - .then(response => { - this.flowzList = response.data.data - }) - .catch(error => { - console.log(error) - }) + 'flowz': { + created (data) { + console.log('data', data) + this.flowzList.push(data) + }, + updated (data) { + this.init() + }, + 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) + } } } }, @@ -748,9 +756,10 @@ export default { title: 'Confirm', content: '

Are you sure you want to delete?

', onOk: () => { + // console.log(id) flowz.delete(id) .then(response => { - // console.log('response.data', response.data) + console.log('response.data', response.data) this.$Notice.success({title: 'Success!!', desc: 'Flowz Deleted...'}) this.flowzList.splice(inx, 1) }) From 397eb7368dfdb4971680e8c6e6843df527d80b4c Mon Sep 17 00:00:00 2001 From: vishalkanojiya Date: Tue, 25 Sep 2018 17:33:38 +0530 Subject: [PATCH 2/6] schema and flowz list pagination issue --- client/src/pages/flow/List.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/client/src/pages/flow/List.vue b/client/src/pages/flow/List.vue index 75e79da..c50cff0 100644 --- a/client/src/pages/flow/List.vue +++ b/client/src/pages/flow/List.vue @@ -715,6 +715,7 @@ export default { this.init() }, init () { + this.loading = true // var string = '?$skip=' + this.skip + '&$limit=' + this.limit flowz.get(null, { $skip: this.skip, From df8d9f3d0ca4607b8b3c6653ed6924f8e1d44055 Mon Sep 17 00:00:00 2001 From: vishalkanojiya Date: Mon, 1 Oct 2018 11:24:11 +0530 Subject: [PATCH 3/6] add socket --- client/src/pages/flow/List.vue | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/client/src/pages/flow/List.vue b/client/src/pages/flow/List.vue index c50cff0..356827c 100644 --- a/client/src/pages/flow/List.vue +++ b/client/src/pages/flow/List.vue @@ -515,7 +515,8 @@ export default { return days + ' Days' } } - ] + ], + entriesTotal: 10 } }, mounted () { @@ -523,13 +524,31 @@ export default { this.getDataOfSubscriptionUser() }, feathers: { + 'flowz-instance': { + created (data) { // update status using socket + flowz.get() + .then(response => { + this.flowzList = response.data.data + }) + .catch(error => { + console.log(error) + }) + } + }, 'flowz': { created (data) { - console.log('data', data) - this.flowzList.push(data) + if (this.total < this.entriesTotal) { + this.flowzList.push(data) + } else { + this.total = ((this.total) + 1) + } }, updated (data) { - this.init() + if (this.flowzList < this.entriesTotal) { + 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) From ca409da36070b1029576399243ec906933aaf6cd Mon Sep 17 00:00:00 2001 From: vishal kanojiya <40787114+vishalkanojiya@users.noreply.github.com> Date: Mon, 1 Oct 2018 11:31:27 +0530 Subject: [PATCH 4/6] Update List.vue --- client/src/pages/flow/List.vue | 3 --- 1 file changed, 3 deletions(-) diff --git a/client/src/pages/flow/List.vue b/client/src/pages/flow/List.vue index 356827c..788a997 100644 --- a/client/src/pages/flow/List.vue +++ b/client/src/pages/flow/List.vue @@ -375,7 +375,6 @@ export default { }, on: { click: () => { - // console.log(this.flowzList[params.index].id) this.deleteFlow(this.flowzList[params.index].id, params.index) } } @@ -735,7 +734,6 @@ export default { }, init () { this.loading = true - // var string = '?$skip=' + this.skip + '&$limit=' + this.limit flowz.get(null, { $skip: this.skip, $limit: this.limit @@ -776,7 +774,6 @@ export default { title: 'Confirm', content: '

Are you sure you want to delete?

', onOk: () => { - // console.log(id) flowz.delete(id) .then(response => { console.log('response.data', response.data) From ee8b996a741a227f02aa1d9ef56fb0d3c8ed98f7 Mon Sep 17 00:00:00 2001 From: vishal kanojiya <40787114+vishalkanojiya@users.noreply.github.com> Date: Mon, 1 Oct 2018 11:32:42 +0530 Subject: [PATCH 5/6] Update List.vue --- client/src/pages/flow/List.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/client/src/pages/flow/List.vue b/client/src/pages/flow/List.vue index 788a997..b624620 100644 --- a/client/src/pages/flow/List.vue +++ b/client/src/pages/flow/List.vue @@ -776,7 +776,6 @@ export default { onOk: () => { flowz.delete(id) .then(response => { - console.log('response.data', response.data) this.$Notice.success({title: 'Success!!', desc: 'Flowz Deleted...'}) this.flowzList.splice(inx, 1) }) From 1bdbef767c02904da2547a94f78eb5397c9ad170 Mon Sep 17 00:00:00 2001 From: vishal kanojiya <40787114+vishalkanojiya@users.noreply.github.com> Date: Mon, 1 Oct 2018 11:34:41 +0530 Subject: [PATCH 6/6] Delete List.vue --- client/src/pages/flow/List.vue | 1159 -------------------------------- 1 file changed, 1159 deletions(-) delete mode 100644 client/src/pages/flow/List.vue diff --git a/client/src/pages/flow/List.vue b/client/src/pages/flow/List.vue deleted file mode 100644 index b624620..0000000 --- a/client/src/pages/flow/List.vue +++ /dev/null @@ -1,1159 +0,0 @@ - - -