From d137c20e666c8d6415e587d77e36b86fc1e01ac8 Mon Sep 17 00:00:00 2001
From: David <dmendez@ebi.ac.uk>
Date: Wed, 11 Aug 2021 06:24:28 -0500
Subject: [PATCH] Fix bug of ghost dispatches between report cards

---
 .../chemical_probe/ChemicalProbeReportCard.vue         | 10 ++++++++--
 components/report_cards/target/TargetReportCard.vue    | 10 ++++++++--
 store/{reportCard.js => probeReportCard.js}            |  0
 store/targetReportCard.js                              |  3 +++
 web-components-submodule                               |  2 +-
 5 files changed, 20 insertions(+), 5 deletions(-)
 rename store/{reportCard.js => probeReportCard.js} (100%)
 create mode 100644 store/targetReportCard.js

diff --git a/components/report_cards/chemical_probe/ChemicalProbeReportCard.vue b/components/report_cards/chemical_probe/ChemicalProbeReportCard.vue
index 25caad0..8c5363c 100644
--- a/components/report_cards/chemical_probe/ChemicalProbeReportCard.vue
+++ b/components/report_cards/chemical_probe/ChemicalProbeReportCard.vue
@@ -2,6 +2,7 @@
   <EntityReportCard
     :report-card-structure="reportCardStructure"
     :item-i-d="itemID"
+    :store-module-name="storeModuleName"
   />
 </template>
 
@@ -20,15 +21,20 @@ export default {
       default: () => undefined,
     },
   },
+  data() {
+    return {
+      storeModuleName: 'probeReportCard',
+    }
+  },
   computed: mapState({
-    reportCardStructure: (state) => state.reportCard.reportCardStructure,
+    reportCardStructure: (state) => state.probeReportCard.reportCardStructure,
   }),
   mounted() {
     const reportCardStructure = CompoundReportCardGenerator.generateReportCardStructure(
       this.itemID
     )
     this.$store.dispatch(
-      'reportCard/setReportCardStructure',
+      'probeReportCard/setReportCardStructure',
       reportCardStructure
     )
   },
diff --git a/components/report_cards/target/TargetReportCard.vue b/components/report_cards/target/TargetReportCard.vue
index 7579080..564c582 100644
--- a/components/report_cards/target/TargetReportCard.vue
+++ b/components/report_cards/target/TargetReportCard.vue
@@ -2,6 +2,7 @@
   <EntityReportCard
     :report-card-structure="reportCardStructure"
     :item-i-d="itemID"
+    :store-module-name="storeModuleName"
   />
 </template>
 
@@ -20,15 +21,20 @@ export default {
       default: () => undefined,
     },
   },
+  data() {
+    return {
+      storeModuleName: 'targetReportCard',
+    }
+  },
   computed: mapState({
-    reportCardStructure: (state) => state.reportCard.reportCardStructure,
+    reportCardStructure: (state) => state.targetReportCard.reportCardStructure,
   }),
   mounted() {
     const reportCardStructure = TargetReportCardGenerator.generateReportCardStructure(
       this.itemID
     )
     this.$store.dispatch(
-      'reportCard/setReportCardStructure',
+      'targetReportCard/setReportCardStructure',
       reportCardStructure
     )
   },
diff --git a/store/reportCard.js b/store/probeReportCard.js
similarity index 100%
rename from store/reportCard.js
rename to store/probeReportCard.js
diff --git a/store/targetReportCard.js b/store/targetReportCard.js
new file mode 100644
index 0000000..a71c0fb
--- /dev/null
+++ b/store/targetReportCard.js
@@ -0,0 +1,3 @@
+import reportCard from '~/web-components-submodule/store/reportCard.js'
+
+export default reportCard
diff --git a/web-components-submodule b/web-components-submodule
index 42317d9..45ca7d0 160000
--- a/web-components-submodule
+++ b/web-components-submodule
@@ -1 +1 @@
-Subproject commit 42317d9dd9d635fb3cd5e851eac9b0f1695a09c9
+Subproject commit 45ca7d0e6680285eed746345a713e6858d50ae37
-- 
GitLab