diff --git a/resources/js/components/Evaluations/Single/Components/Step3/AttackGraph.vue b/resources/js/components/Evaluations/Single/Components/Step3/AttackGraph.vue index 78627422f1aa24f92d2da1345a3e60ebb34f4154..0bfe9049eb0a8447b5c10c891f9aa52f796e1c43 100644 --- a/resources/js/components/Evaluations/Single/Components/Step3/AttackGraph.vue +++ b/resources/js/components/Evaluations/Single/Components/Step3/AttackGraph.vue @@ -21,7 +21,7 @@ export default { props: ['evaluation', 'maxHeight'], data() { return { - loaded: this.$store.state.graphs[this.evaluation.id], + loaded: this.$store.state.graphs[this.evaluation.id] && this.$store.state.graphs[this.evaluation.id].attack, options: { plugins: { legend: { diff --git a/resources/js/components/Evaluations/Single/Components/Step3/ExpositionGraph.vue b/resources/js/components/Evaluations/Single/Components/Step3/ExpositionGraph.vue index 731f33fbc8a16dd051b89a97791a16c3729e5101..00d44d81098807453087a6683b7903353fa64d94 100644 --- a/resources/js/components/Evaluations/Single/Components/Step3/ExpositionGraph.vue +++ b/resources/js/components/Evaluations/Single/Components/Step3/ExpositionGraph.vue @@ -19,7 +19,7 @@ export default { props: ['evaluation'], data() { return { - loaded: this.$store.state.graphs[this.evaluation.id], + loaded: this.$store.state.graphs[this.evaluation.id] && this.$store.state.graphs[this.evaluation.id].exposition, options: { plugins: { legend: { diff --git a/resources/js/components/Evaluations/Single/Components/Step3/MeasuresGraph.vue b/resources/js/components/Evaluations/Single/Components/Step3/MeasuresGraph.vue index 08e8461e5943245fd636a43e461e28d4a0e4249e..3287171b7474f96ca4bf2cf91937ee0fc7f2ddd2 100644 --- a/resources/js/components/Evaluations/Single/Components/Step3/MeasuresGraph.vue +++ b/resources/js/components/Evaluations/Single/Components/Step3/MeasuresGraph.vue @@ -1,7 +1,9 @@ <template> - <Radar v-if="loaded && chartData" :chart-data="chartData" :chart-options="options" /> - <div v-else class=" text-center"> - <i class="fas fa-spin fa-spinner"></i> + <div> + <Radar v-if="loaded && chartData" :chart-data="chartData" :chart-options="options" /> + <div v-else class=" text-center"> + <i class="fas fa-spin fa-spinner"></i> + </div> </div> </template> @@ -19,7 +21,7 @@ export default { props: ['evaluation'], data() { return { - loaded: this.$store.state.graphs[this.evaluation.id], + loaded: this.$store.state.graphs[this.evaluation.id] && this.$store.state.graphs[this.evaluation.id].measures, options: { plugins: { legend: { @@ -53,6 +55,7 @@ export default { if (!this.$store.state.graphs[this.evaluation.id] || !this.$store.state.graphs[this.evaluation.id].measures) { return null; } + const labels = this.$store.state.graphs[this.evaluation.id].measures.labels; const data = this.$store.state.graphs[this.evaluation.id].measures.data; diff --git a/resources/js/components/Evaluations/Single/Components/Step3/RiskGraph.vue b/resources/js/components/Evaluations/Single/Components/Step3/RiskGraph.vue index efd3ab98cae803b689eaabbe36246bc3f3b99ce2..34c72a560494dc5f6b292a77a318c047e3ec385a 100644 --- a/resources/js/components/Evaluations/Single/Components/Step3/RiskGraph.vue +++ b/resources/js/components/Evaluations/Single/Components/Step3/RiskGraph.vue @@ -19,7 +19,7 @@ export default { props: ['evaluation'], data() { return { - loaded: this.$store.state.graphs[this.evaluation.id], + loaded: this.$store.state.graphs[this.evaluation.id] && this.$store.state.graphs[this.evaluation.id].risks, options: { plugins: { legend: { diff --git a/resources/js/components/Evaluations/Single/Components/Step4/CyberRiskyGraph.vue b/resources/js/components/Evaluations/Single/Components/Step4/CyberRiskyGraph.vue index 2b73b01f486f6e2afe2308bfae9ee45135123b6b..a5bd82dd8687d4139a125267cf0f21d2f270ae4e 100644 --- a/resources/js/components/Evaluations/Single/Components/Step4/CyberRiskyGraph.vue +++ b/resources/js/components/Evaluations/Single/Components/Step4/CyberRiskyGraph.vue @@ -32,7 +32,7 @@ export default { props: ['evaluation'], data() { return { - loaded: this.$store.state.graphs[this.evaluation.id], + loaded: this.$store.state.graphs[this.evaluation.id] && this.$store.state.graphs[this.evaluation.id].risks && this.$store.state.graphs[this.evaluation.id].futurerisks, } }, computed: { diff --git a/resources/js/components/Evaluations/Single/Steps/Step2.vue b/resources/js/components/Evaluations/Single/Steps/Step2.vue index 12df7651fbb27768f56e74ce58b9a2d9ea6752de..ae0463ec5d64b2174ad8f9a354b07dd8571265cf 100644 --- a/resources/js/components/Evaluations/Single/Steps/Step2.vue +++ b/resources/js/components/Evaluations/Single/Steps/Step2.vue @@ -12,8 +12,8 @@ <MeasureLevelChooser v-for="(measure, index) in measures" :key="measure.id" - :index="index" :ref="`Measure${measure.id}`" + :index="index" :measure="measure" :evaluation="evaluation" :is-editable="isEditable" diff --git a/resources/js/stores/graphs.js b/resources/js/stores/graphs.js index a84be566ea2f412d2a0d6e496852c53a826695d1..4aeb6a455fdc69b2bf5351d248ea044599894480 100755 --- a/resources/js/stores/graphs.js +++ b/resources/js/stores/graphs.js @@ -7,7 +7,8 @@ export default { if (typeof state[id] === 'undefined') { state[id] = {}; } - state[id][name] = data + + state[id] = {...state[id], [name]: data} }, removeGraphData (state, {id}) { if (typeof state[id] !== 'undefined') { @@ -17,9 +18,7 @@ export default { }, actions: { async getGraphForEvaluation ({ commit }, {name, id}) { - console.log('getting graph data'); const req = await axios.get(`/api/evaluations/${id}/graphs/${name}`) - console.log('got graph data', req); commit('setGraphData', { name, data: req.data, id }) return req.data }