From d67c1bb0ebb3c80e33c7ca296416346204f79d80 Mon Sep 17 00:00:00 2001 From: solderq35 Date: Tue, 19 Dec 2023 17:08:57 -0800 Subject: [PATCH] more chart label research --- src/components/view/modals/edit_card.vue | 1 + src/store/block_modifiers/building_compare.mod.js | 12 ++++++++++++ src/store/chart.module.js | 4 ++++ 3 files changed, 17 insertions(+) diff --git a/src/components/view/modals/edit_card.vue b/src/components/view/modals/edit_card.vue index fb281008..0e70ecb8 100644 --- a/src/components/view/modals/edit_card.vue +++ b/src/components/view/modals/edit_card.vue @@ -363,6 +363,7 @@ export default { } const charts = this.$store.getters[blockPath + '/charts'] + console.log(charts) for (let index in this.form.sets) { if (index < charts.length) { diff --git a/src/store/block_modifiers/building_compare.mod.js b/src/store/block_modifiers/building_compare.mod.js index 8148f54b..e32ab7c0 100644 --- a/src/store/block_modifiers/building_compare.mod.js +++ b/src/store/block_modifiers/building_compare.mod.js @@ -120,8 +120,20 @@ export default class CompareModifier { module is block module, data is new incoming data. */ + console.log(this.data.buildingIds) + console.log(data.datasets) if (this.data.buildingIds[0]) { data.datasets[0].label = this.buildingName(store, this.data.buildingIds[0]) } + // along with the section in edit_card.vue, this also controls how the chart name is updated. + // comment it out for now just in case + /* + for (let i = 0; i < data.datasets.length;) { + if (this.data.buildingIds[i]) { + data.datasets[i].label = this.buildingName(store, this.data.buildingIds[i]) + i += 1 + } + } + */ } } diff --git a/src/store/chart.module.js b/src/store/chart.module.js index 5b18d3a3..79f2fd26 100644 --- a/src/store/chart.module.js +++ b/src/store/chart.module.js @@ -45,6 +45,10 @@ const actions = { // Grab the default value. Building page URL = `http://localhost:8080/#/compare/["16","29"] > building 16 is default // Need a better way of doing this in future + + // As noted in edit_card.vue line 371 ish, the chart name will change after editing the timeframe via the edit card + // web UI component. So we need a better way of distinguishing charts from each other, or rework how the rename + // system works. if (store.getters.name === 'Total Electricity') { reqPayload.dateStart = nov reqPayload.dateEnd = dec