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

Commit 9cc60d6

Browse files
authored
Merge pull request #253 from FlowzPlatform/selected-subscription
some changes done
2 parents e8be2a4 + e17a3c9 commit 9cc60d6

File tree

3 files changed

+52
-4
lines changed

3 files changed

+52
-4
lines changed

client/src/components/Header.vue

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,16 +125,15 @@ export default {
125125
},
126126
setSelectedUser () {
127127
// let self = this
128+
console.log('cxalled.....')
128129
if (this.selected_user === '') {
130+
console.log('%%%%%%')
129131
if (this.$store.state.user_list.length !== 0) {
132+
console.log('########')
130133
this.selected_user = this.$store.state.user_list[0].label
131134
}
132135
}
133136
this.$store.state.selectedUserName = this.selected_user
134-
// if (this.$store.state.storedUsername !== '') {
135-
// console.log('^^^^^^^', this.$store.state.storedUsername)
136-
// self.$store.commit('SET_STOREDUSERNAME', this.$store.state.storedUsername)
137-
// }
138137
}
139138
},
140139
watch: {
@@ -166,10 +165,12 @@ export default {
166165
this.$store.state.user_list.splice(0, 0, {'value': 'All', 'label': 'All'})
167166
}
168167
if (this.$store.state.storedUsername !== '') {
168+
console.log('*********')
169169
this.selected_user = this.$store.state.storedUsername
170170
this.$store.state.storedUsername = this.selected_user
171171
this.$store.commit('SET_STOREDUSERNAME', this.selected_user)
172172
} else {
173+
console.log('^^^^^^')
173174
this.selected_user = this.$store.state.user_list[0].label
174175
this.$store.state.storedUsername = this.selected_user
175176
this.$store.commit('SET_STOREDUSERNAME', this.selected_user)

client/src/components/uploader.vue

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,29 @@ export default {
262262
}
263263
}
264264
}
265+
},
266+
'$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 = []
271+
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+
}
277+
}
278+
}
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
287+
}
265288
}
266289
// '$store.state.storedUsername': function (selectedUser) {
267290
// console.log('called.....')

client/src/components/uploader_landing.vue

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,11 +339,35 @@ export default {
339339
let subId = lodash.findIndex(this.$store.state.subscription_list, function (o) { return o.label === 'All' })
340340
if (subId !== -1) {
341341
this.$store.state.subscription_list.splice(subId, 1)
342+
console.log('atlast called....')
342343
// this.$store.state.fullSubscriptionList = lodash.cloneDeep(this.$store.state.subscription_list)
343344
}
344345
}
345346
}
346347
}
348+
},
349+
'$store.state.storedUsername': function (selectedUser) {
350+
console.log('called 777777777777.....')
351+
if (selectedUser !== 'All') {
352+
let filteredUser = lodash.filter(this.$store.state.user_detail_list, function (o) { return o.name === selectedUser })
353+
let subsArr = []
354+
355+
for (let userSubs in filteredUser) {
356+
for (let subs in this.$store.state.fullSubscriptionList) {
357+
if (filteredUser[userSubs].value === this.$store.state.fullSubscriptionList[subs].value) {
358+
subsArr.push(this.$store.state.fullSubscriptionList[subs])
359+
}
360+
}
361+
}
362+
this.$store.state.subscription_list = []
363+
this.$store.state.subscription_list = subsArr
364+
this.$store.state.storedSubscriptionName = subsArr[0].label
365+
} else {
366+
console.log('else called')
367+
this.$store.state.subscription_list = []
368+
this.$store.state.subscription_list = this.$store.state.fullSubscriptionList
369+
this.$store.state.storedSubscriptionName = this.$store.state.fullSubscriptionList[0].label
370+
}
347371
}
348372
// '$store.state.storedUsername': function (selectedUser) {
349373
// console.log('called.....')

0 commit comments

Comments
 (0)