support dashboards associated to the selected role (#280)
parent
63944c9815
commit
16f74a429e
|
@ -28,6 +28,14 @@ export default {
|
||||||
computed: {
|
computed: {
|
||||||
getterDashboard() {
|
getterDashboard() {
|
||||||
return this.$store.getters.getDashboardByRole(this.roleUuid)
|
return this.$store.getters.getDashboardByRole(this.roleUuid)
|
||||||
|
},
|
||||||
|
getterRol() {
|
||||||
|
return this.$store.getters.getRoleUuid
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
getterRol(value) {
|
||||||
|
this.getDashboardListFromServer()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -35,14 +43,11 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getDashboardListFromServer() {
|
getDashboardListFromServer() {
|
||||||
if (this.getterDashboard) {
|
this.$store.dispatch('listDashboard')
|
||||||
this.dashboardList = this.getterDashboard.dashboardList
|
.then(response => {
|
||||||
} else {
|
this.dashboardList = response.dashboardsList
|
||||||
this.$store.dispatch('listDashboard', this.roleUuid)
|
this.$forceUpdate()
|
||||||
.then(response => {
|
})
|
||||||
this.dashboardList = response.dashboardsList
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,6 +62,7 @@ export default {
|
||||||
})
|
})
|
||||||
this.$store.dispatch('user/changeRoles', valueSelected)
|
this.$store.dispatch('user/changeRoles', valueSelected)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
|
this.$store.dispatch('listDashboard', response.uuid)
|
||||||
this.showMessage({
|
this.showMessage({
|
||||||
message: this.$t('notifications.successChangeRole'),
|
message: this.$t('notifications.successChangeRole'),
|
||||||
type: 'success'
|
type: 'success'
|
||||||
|
|
Loading…
Reference in New Issue