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

Commit e43195b

Browse files
authored
Merge pull request #258 from FlowzPlatform/develop
Develop
2 parents 240082e + 90bdf1d commit e43195b

File tree

7 files changed

+136
-181
lines changed

7 files changed

+136
-181
lines changed

client/src/components/Header.vue

Lines changed: 24 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,10 @@ export default {
165165
this.$store.state.user_list.splice(0, 0, {'value': 'All', 'label': 'All'})
166166
}
167167
if (this.$store.state.storedUsername !== '') {
168-
console.log('*********')
169168
this.selected_user = this.$store.state.storedUsername
170169
this.$store.state.storedUsername = this.selected_user
171170
this.$store.commit('SET_STOREDUSERNAME', this.selected_user)
172171
} else {
173-
console.log('^^^^^^')
174172
this.selected_user = this.$store.state.user_list[0].label
175173
this.$store.state.storedUsername = this.selected_user
176174
this.$store.commit('SET_STOREDUSERNAME', this.selected_user)
@@ -180,56 +178,12 @@ export default {
180178
},
181179
'selected_user': function (user) {
182180
console.log('user....', user)
183-
if (user !== '' && user !== 'All') {
181+
if (user !== '') {
184182
this.$store.state.storedUsername = this.selected_user
185183
console.log('this.$store.state.storedUsername', this.$store.state.storedUsername)
186184
this.$store.state.selectedUserName = user
187-
188-
let filteredUser = lodash.filter(this.$store.state.user_detail_list, function (o) { return o.name === user })
189-
let subsArr = []
190-
191-
for (let userSubs in filteredUser) {
192-
for (let subs in this.$store.state.fullSubscriptionList) {
193-
if (filteredUser[userSubs].value === this.$store.state.fullSubscriptionList[subs].value) {
194-
subsArr.push(this.$store.state.fullSubscriptionList[subs])
195-
}
196-
}
197-
}
198-
this.$store.state.subscription_list = []
199-
this.$store.state.subscription_list = subsArr
200-
this.$store.state.storedSubscriptionName = subsArr[0].label
201185
} else {
202-
this.$store.state.subscription_list = []
203-
this.$store.state.subscription_list = this.$store.state.fullSubscriptionList
204-
this.$store.state.storedSubscriptionName = this.$store.state.fullSubscriptionList[0].label
205186
}
206-
// if (user !== 'All') {
207-
// // let self = this
208-
// // let subArray = []
209-
// // let groupedlist = lodash.groupBy(this.$store.state.user_detail_list, 'name')
210-
// // lodash.forEach(groupedlist, (value, key) => {
211-
// // if (key === user) {
212-
// // for (let i = 0; i < value.length; i++) {
213-
// // subArray.push({'value': value[i].value})
214-
// // }
215-
// // }
216-
// // })
217-
218-
// // for (let i = 0; i < self.$store.state.subscription_list.length; i++) {
219-
// // if (subArray.length !== 0) {
220-
// // let idx1 = lodash.findIndex(subArray, function (o) { return o.value === self.$store.state.subscription_list[i].value })
221-
// // console.log('indx1....', idx1)
222-
// // if (idx1 === -1 && self.$store.state.subscription_list[i].value !== 'All') {
223-
// // console.log('caleed...... inside', self.$store.state.subscription_list[i])
224-
// // self.$store.state.subscription_list.splice(i, 1)
225-
// // }
226-
// // }
227-
// // }
228-
// } else {
229-
// if (this.selected_subscription_name === '') {
230-
// this.selected_subscription_name = this.$store.state.subscription_list[0].label
231-
// }
232-
// }
233187
},
234188
'$store.state.subscription_list': function (list) {
235189
let self = this
@@ -245,30 +199,30 @@ export default {
245199
self.$store.state.subscription_name = self.selected_subscription_name
246200
}
247201
}
248-
},
249-
'$store.state.storedUsername': function (selectedUser) {
250-
console.log('called.....')
251-
if (selectedUser !== 'All') {
252-
let filteredUser = lodash.filter(this.$store.state.user_detail_list, function (o) { return o.name === selectedUser })
253-
let subsArr = []
254-
255-
for (let userSubs in filteredUser) {
256-
for (let subs in this.$store.state.fullSubscriptionList) {
257-
if (filteredUser[userSubs].value === this.$store.state.fullSubscriptionList[subs].value) {
258-
subsArr.push(this.$store.state.fullSubscriptionList[subs])
259-
}
260-
}
261-
}
262-
this.$store.state.subscription_list = []
263-
this.$store.state.subscription_list = subsArr
264-
this.$store.state.storedSubscriptionName = subsArr[0].label
265-
} else {
266-
console.log('else called')
267-
this.$store.state.subscription_list = []
268-
this.$store.state.subscription_list = this.$store.state.fullSubscriptionList
269-
this.$store.state.storedSubscriptionName = this.$store.state.fullSubscriptionList[0].label
270-
}
271202
}
203+
// '$store.state.storedUsername': function (selectedUser) {
204+
// console.log('called.....')
205+
// if (selectedUser !== 'All') {
206+
// let filteredUser = lodash.filter(this.$store.state.user_detail_list, function (o) { return o.name === selectedUser })
207+
// let subsArr = []
208+
209+
// for (let userSubs in filteredUser) {
210+
// for (let subs in this.$store.state.fullSubscriptionList) {
211+
// if (filteredUser[userSubs].value === this.$store.state.fullSubscriptionList[subs].value) {
212+
// subsArr.push(this.$store.state.fullSubscriptionList[subs])
213+
// }
214+
// }
215+
// }
216+
// this.$store.state.subscription_list = []
217+
// this.$store.state.subscription_list = subsArr
218+
// this.$store.state.storedSubscriptionName = subsArr[0].label
219+
// } else {
220+
// console.log('else called')
221+
// this.$store.state.subscription_list = []
222+
// this.$store.state.subscription_list = this.$store.state.fullSubscriptionList
223+
// this.$store.state.storedSubscriptionName = this.$store.state.fullSubscriptionList[0].label
224+
// }
225+
// }
272226
273227
},
274228
mounted () {

client/src/components/mainUpload.vue

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3965,22 +3965,24 @@ export default {
39653965
watch: {
39663966
'image_batch': function (batch) {
39673967
let self = this
3968-
3969-
if (batch.length >= 10) {
3970-
let batchChunk = lodash.chunk(batch, 10)
3971-
3968+
console.log('batch called....', batch)
3969+
if (batch.length >= 2) {
3970+
let batchChunk = lodash.chunk(batch, 2)
3971+
console.log('batch Chunk....', batchChunk)
39723972
for (let i = 0; i < batchChunk.length; i++) {
3973-
socket.emit('pdmimages', batchChunk[i], (err, data) => {
3973+
socket.emit('images', batchChunk[i], (err, data) => {
3974+
console.log('data....', data)
39743975
if (err) {
39753976
39763977
}
39773978
})
3978-
self.image_batch.splice(0, 10)
39793979
}
3980+
self.image_batch.splice(0, 2)
39803981
}
39813982
3982-
if (isDone === true && batch.length < 10 && batch.length !== 0) {
3983-
socket.emit('pdmimages', batch, (err, data) => {
3983+
if (isDone === true && batch.length < 2 && batch.length !== 0) {
3984+
socket.emit('images', batch, (err, data) => {
3985+
console.log('emitted.....')
39843986
if (err) {
39853987
39863988
}
@@ -4105,6 +4107,7 @@ export default {
41054107
if (this.$store.state.disconnect === false) {
41064108
socket.emit('uploader-schema::find', {'subscriptionId': this.$store.state.subscription_id, 'import_tracker_id': id}, (e, res) => {
41074109
if (res) {
4110+
console.log('res......', res)
41084111
self.existingSchemaData = res.data[0]
41094112
let schemaNames = lodash.groupBy(res.data, 'tabname')
41104113
let schemavalue = lodash.isEmpty(schemaNames)
@@ -4233,12 +4236,15 @@ export default {
42334236
42344237
socket.on('img_res', (response) => {
42354238
for (let i = 0; i < response.length; i++) {
4239+
console.log('response....', response)
42364240
if (response[i].hasOwnProperty('iserror')) {
42374241
let index = lodash.findIndex(self.dirinfo, {name: response[i].filename})
4242+
console.log('err index.....', index)
42384243
self.dirinfo[index].status = 'error'
42394244
} else {
42404245
self.secure_url_arr.push({'file_name': response[i].file_name, 'secure_url': response[i].secure_url})
42414246
let index = lodash.findIndex(self.dirinfo, {name: response[i].file_name})
4247+
console.log('success index.....', index)
42424248
self.dirinfo[index].status = 'success'
42434249
self.img_no ++
42444250
}

client/src/components/newJobList.vue

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,28 @@ export default {
261261
},
262262
'$store.state.subscription_name': function (name) {
263263
// let self = this
264+
},
265+
'$store.state.storedUsername': function (selectedUser) {
266+
console.log('called.....', selectedUser)
267+
if (selectedUser !== 'All') {
268+
let filteredUser = lodash.filter(this.$store.state.user_detail_list, function (o) { return o.name === selectedUser })
269+
let subsArr = []
270+
271+
for (let userSubs in filteredUser) {
272+
for (let subs in this.$store.state.fullSubscriptionList) {
273+
if (filteredUser[userSubs].value === this.$store.state.fullSubscriptionList[subs].value) {
274+
subsArr.push(this.$store.state.fullSubscriptionList[subs])
275+
}
276+
}
277+
}
278+
this.$store.state.subscription_list = subsArr
279+
this.$store.state.storedSubscriptionName = subsArr[0].label
280+
} else {
281+
console.log('^^^^^^^^', this.$store.state.fullSubscriptionList)
282+
this.$store.state.subscription_list = []
283+
this.$store.state.subscription_list = this.$store.state.fullSubscriptionList
284+
this.$store.state.storedSubscriptionName = this.$store.state.fullSubscriptionList[0].label
285+
}
264286
}
265287
},
266288
mounted () {

client/src/components/uploader.vue

Lines changed: 43 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -200,45 +200,28 @@ export default {
200200
201201
if (this.$store.state.storedSubscriptionName !== '') {
202202
this.getData(this.$store.state.subscription_id)
203-
// let self = this
204-
// let subId = lodash.findIndex(self.$store.state.subscription_list, function (o) { return o.label === 'All' })
205-
// console.log('self.$store.state.subscription_list.....', self.$store.state.subscription_list, subId)
206-
// if (subId !== -1) {
207-
// console.log('called....')
208-
// self.$store.state.subscription_list.splice(subId, 1)
209-
// }
210-
211-
// let subscriptionObj1
212-
// subscriptionObj1 = lodash.filter(self.$store.state.subscription_list, function (o) {
213-
// if (o.label === self.$store.state.storedSubscriptionName) {
214-
// return o
215-
// }
216-
// })
217-
// console.log('subscriptionObj1 &&&&&&', subscriptionObj1)
218-
// if (subscriptionObj1.length !== 0) {
219-
// self.$store.state.subscription_id = subscriptionObj1[0].value
220-
// }
221-
// this.getData(this.$store.state.subscription_id)
222-
// } else {
223-
// let self = this
224-
// let subId = lodash.findIndex(self.$store.state.subscription_list, function (o) { return o.label === 'All' })
225-
// if (subId !== -1) {
226-
// self.$store.state.subscription_list.splice(subId, 1)
227-
// }
228-
// this.$store.state.subscription_id = this.$store.state.subscription_list[0].value
229-
// this.$store.state.subscription_name = this.$store.state.subscription_list[0].label
230-
// this.$store.state.storedSubscriptionName = this.$store.state.subscription_name
231-
// this.getData(this.$store.state.subscription_id)
232203
}
204+
console.log('this.$store.state.storedUsername uploader .....', this.$store.state.storedUsername, this.$store.state.user_detail_list)
205+
// let filteredUser = lodash.filter(this.$store.state.user_detail_list, function (o) { return o.name === this.$store.state.storedUsername })
206+
// console.log('&&&&&', filteredUser)
207+
// let subsArr = []
208+
209+
// for (let userSubs in filteredUser) {
210+
// for (let subs in this.$store.state.fullSubscriptionList) {
211+
// if (filteredUser[userSubs].value === this.$store.state.fullSubscriptionList[subs].value) {
212+
// subsArr.push(this.$store.state.fullSubscriptionList[subs])
213+
// }
214+
// }
215+
// }
216+
// this.$store.state.subscription_list = []
217+
// this.$store.state.subscription_list = subsArr
218+
// this.$store.state.storedSubscriptionName = subsArr[0].label
233219
},
234220
watch: {
235221
'$store.state.subscription_id': function (id) {
236222
console.log('$store')
237223
if (id === 'All') {
238224
this.loading = false
239-
// this.$Notice.error({
240-
// title: 'Please select a proper subscription id...'
241-
// })
242225
} else {
243226
if (this.showDiv === true) {
244227
this.showDiv = false
@@ -257,50 +240,45 @@ export default {
257240
let subId = lodash.findIndex(this.$store.state.subscription_list, function (o) { return o.label === 'All' })
258241
if (subId !== -1) {
259242
this.$store.state.subscription_list.splice(subId, 1)
260-
// this.$store.state.fullSubscriptionList = lodash.cloneDeep(this.$store.state.subscription_list)
243+
let self = this
244+
let filteredUser = lodash.filter(this.$store.state.user_detail_list, function (o) { return o.name === self.$store.state.storedUsername })
245+
console.log('&&&&&', filteredUser)
246+
let subsArr = []
247+
248+
if (filteredUser.length !== 0) {
249+
for (let userSubs in filteredUser) {
250+
for (let subs in self.$store.state.fullSubscriptionList) {
251+
if (filteredUser[userSubs].value === self.$store.state.fullSubscriptionList[subs].value) {
252+
subsArr.push(self.$store.state.fullSubscriptionList[subs])
253+
}
254+
}
255+
}
256+
self.$store.state.subscription_list = []
257+
self.$store.state.subscription_list = subsArr
258+
self.$store.state.storedSubscriptionName = subsArr[0].label
259+
console.log('subsArr....', subsArr)
260+
self.$store.state.subscription_id = subsArr[0].value
261+
}
261262
}
262263
}
263264
}
264265
}
265266
},
266267
'$store.state.storedUsername': function (selectedUser) {
267-
console.log('called 8888888....')
268-
if (selectedUser !== 'All') {
269-
let filteredUser = lodash.filter(this.$store.state.user_detail_list, function (o) { return o.name === selectedUser })
270-
let subsArr = []
268+
console.log('called.....')
269+
let filteredUser = lodash.filter(this.$store.state.user_detail_list, function (o) { return o.name === selectedUser })
270+
let subsArr = []
271271
272-
for (let userSubs in filteredUser) {
273-
for (let subs in this.$store.state.fullSubscriptionList) {
274-
if (filteredUser[userSubs].value === this.$store.state.fullSubscriptionList[subs].value) {
275-
subsArr.push(this.$store.state.fullSubscriptionList[subs])
276-
}
272+
for (let userSubs in filteredUser) {
273+
for (let subs in this.$store.state.fullSubscriptionList) {
274+
if (filteredUser[userSubs].value === this.$store.state.fullSubscriptionList[subs].value) {
275+
subsArr.push(this.$store.state.fullSubscriptionList[subs])
277276
}
278277
}
279-
this.$store.state.subscription_list = []
280-
this.$store.state.subscription_list = subsArr
281-
this.$store.state.storedSubscriptionName = subsArr[0].label
282-
} else {
283-
console.log('else called')
284-
this.$store.state.subscription_list = []
285-
this.$store.state.subscription_list = this.$store.state.fullSubscriptionList
286-
this.$store.state.storedSubscriptionName = this.$store.state.fullSubscriptionList[0].label
287278
}
279+
this.$store.state.subscription_list = subsArr
280+
this.$store.state.storedSubscriptionName = subsArr[0].label
288281
}
289-
// '$store.state.storedUsername': function (selectedUser) {
290-
// console.log('called.....')
291-
// let filteredUser = lodash.filter(this.$store.state.user_detail_list, function (o) { return o.name === selectedUser })
292-
// let subsArr = []
293-
294-
// for (let userSubs in filteredUser) {
295-
// for (let subs in this.$store.state.fullSubscriptionList) {
296-
// if (filteredUser[userSubs].value === this.$store.state.fullSubscriptionList[subs].value) {
297-
// subsArr.push(this.$store.state.fullSubscriptionList[subs])
298-
// }
299-
// }
300-
// }
301-
// this.$store.state.subscription_list = subsArr
302-
// this.$store.state.storedSubscriptionName = subsArr[0].label
303-
// }
304282
}
305283
}
306284
</script>

0 commit comments

Comments
 (0)