mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 08:17:09 +00:00
Refresh comparisons when notified of changes
This commit is contained in:
@@ -252,6 +252,14 @@ export default {
|
|||||||
this.comparisons = await this.api([url]);
|
this.comparisons = await this.api([url]);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// TODO Should this go in a Vuex action rather?
|
||||||
|
async refreshComparisons () {
|
||||||
|
await this.getGroups();
|
||||||
|
if (this.groupFound) {
|
||||||
|
await this.getComparisons();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
/*
|
/*
|
||||||
async getComparison () {
|
async getComparison () {
|
||||||
if (this.baseline && this.monitor) {
|
if (this.baseline && this.monitor) {
|
||||||
@@ -264,27 +272,34 @@ export default {
|
|||||||
},
|
},
|
||||||
*/
|
*/
|
||||||
|
|
||||||
...mapActions(["api", "getGroups"])
|
handleComparisons (context, {payload}) {
|
||||||
|
this.refreshComparisons();
|
||||||
|
},
|
||||||
|
|
||||||
|
registerNotificationHandlers (action = "registerHandler") {
|
||||||
|
|
||||||
|
this.$store.dispatch(action, {
|
||||||
|
table: 'comparisons',
|
||||||
|
handler: this.handleComparisons
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
unregisterNotificationHandlers () {
|
||||||
|
return this.registerNotificationHandlers("unregisterHandler");
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
...mapActions(["api", "getGroups", "refreshProjects"])
|
||||||
},
|
},
|
||||||
|
|
||||||
async mounted () {
|
async mounted () {
|
||||||
await this.getGroups();
|
this.registerNotificationHandlers();
|
||||||
if (this.groupFound) {
|
this.refreshComparisons()
|
||||||
this.getComparisons();
|
|
||||||
/*
|
|
||||||
this.registerNotificationHandlers();
|
|
||||||
|
|
||||||
this.refreshLines();
|
|
||||||
this.refreshSequences();
|
|
||||||
this.refreshEvents();
|
|
||||||
this.refreshLabels();
|
|
||||||
this.refreshPlan();
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeDestroy () {
|
beforeDestroy () {
|
||||||
//this.unregisterNotificationHandlers();
|
this.unregisterNotificationHandlers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user