From 46dd15ea758e000b74a5a1f8d7d128f65cd5df58 Mon Sep 17 00:00:00 2001 From: PRADO SEBASTIEN Date: Mon, 24 Jun 2024 15:21:34 +0200 Subject: [PATCH] fix(interface): dashboard metrics improvment and interface fixes OpenSILEX/opensilex-dev!1233 --- opensilex-front/front/opensilex.front.yml | 3 - .../common/forms/CustomTreeselect.vue | 6 +- .../components/common/forms/FormSelector.vue | 10 +- .../home/dashboard/DataMonitoring.vue | 355 +++++++++--------- .../components/variables/VariablesView.vue | 6 + 5 files changed, 196 insertions(+), 184 deletions(-) diff --git a/opensilex-front/front/opensilex.front.yml b/opensilex-front/front/opensilex.front.yml index a94d6fb2c..ad81e4916 100644 --- a/opensilex-front/front/opensilex.front.yml +++ b/opensilex-front/front/opensilex.front.yml @@ -87,9 +87,6 @@ menu: component: opensilex-VariablesView credentials: - variable-access - icon: fa#vials - title: VariableView.title - description: VariableView.description - id: germplasm label: component.menu.experimentalDesign.germplasm icon: ik-cloud-rain diff --git a/opensilex-front/front/src/components/common/forms/CustomTreeselect.vue b/opensilex-front/front/src/components/common/forms/CustomTreeselect.vue index b3a04dfcf..313f22663 100644 --- a/opensilex-front/front/src/components/common/forms/CustomTreeselect.vue +++ b/opensilex-front/front/src/components/common/forms/CustomTreeselect.vue @@ -240,8 +240,10 @@ conversionMethod: (dto: NamedResourceDTO) => SelectableItem; if(this.countCache.has(searchQuery)){ this.resultCount = this.countCache.get(searchQuery).result; this.totalCount = this.countCache.get(searchQuery).total; - this.$emit('counts', { totalCount: this.totalCount, resultCount: this.resultCount }); - } + } + + this.$emit('totalCount', this.totalCount); + this.$emit('resultCount', this.resultCount); this.lastSearchQuery = searchQuery; } //#endregion diff --git a/opensilex-front/front/src/components/common/forms/FormSelector.vue b/opensilex-front/front/src/components/common/forms/FormSelector.vue index 5b0407ec1..11c526dd7 100644 --- a/opensilex-front/front/src/components/common/forms/FormSelector.vue +++ b/opensilex-front/front/src/components/common/forms/FormSelector.vue @@ -227,12 +227,18 @@ export default class FormSelector extends Vue { this.$emit("deselect", value) } + /** + * Use Vue.set to ensure reactivity (target, key, value ) + * target is the object of array to update + * key is the key or the index to modify + * value is the new value to give to this key or index + */ updateTotalCount(totalCountUpdate){ - this.totalCount = totalCountUpdate; + this.$set(this, 'totalCount', totalCountUpdate); } updateResultCount(resultCountUpdate){ - this.resultCount = resultCountUpdate; + this.$set(this, 'resultCount', resultCountUpdate); } //#endregion } diff --git a/opensilex-front/front/src/components/home/dashboard/DataMonitoring.vue b/opensilex-front/front/src/components/home/dashboard/DataMonitoring.vue index 5155df418..74c74866e 100644 --- a/opensilex-front/front/src/components/home/dashboard/DataMonitoring.vue +++ b/opensilex-front/front/src/components/home/dashboard/DataMonitoring.vue @@ -1,154 +1,156 @@