Skip to content

Commit 3d49e38

Browse files
committed
Adapte à CAIDF
1 parent 84bf980 commit 3d49e38

10 files changed

+54
-6
lines changed

src/context/caidf/base-layout.vue

+7
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,16 @@
77
</template>
88

99
<script>
10+
import { useStore } from "@/stores"
11+
1012
export default {
1113
name: "BaseLayout",
1214
components: {},
15+
setup() {
16+
return {
17+
store: useStore(),
18+
}
19+
},
1320
created() {
1421
this.$router.isReady().then(() => {
1522
if (this.$route.query.debug === "parcours") {

src/context/caidf/components/breadcrumb.vue

+6
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,16 @@
3131
import ArrowRight from "@/context/caidf/icons/arrow-right"
3232
import Check from "@/context/caidf/icons/check-circle"
3333
import Chapters from "@/../lib/chapters"
34+
import { useStore } from "@/stores"
3435
3536
export default {
3637
name: "Breadcrumb",
3738
components: { Check, ArrowRight },
39+
setup() {
40+
return {
41+
store: useStore(),
42+
}
43+
},
3844
computed: {
3945
chapters() {
4046
return this.$state.chapters(

src/context/caidf/components/droits-details.vue

+3-1
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ import DroitMixin from "@/mixins/droit-mixin"
144144
import DroitHeader from "@/components/droit-header"
145145
import Check from "@/context/caidf/icons/check"
146146
import Export from "@/context/caidf/icons/export"
147+
import { useStore } from "@/stores"
147148
148149
export default {
149150
name: "DroitsDetails",
@@ -161,8 +162,9 @@ export default {
161162
patrimoineCaptured: Boolean,
162163
ressourcesYearMinusTwoCaptured: Boolean,
163164
},
164-
data() {
165+
setup() {
165166
return {
167+
store: useStore(),
166168
brokenLinkButtonState: "show",
167169
}
168170
},

src/context/caidf/components/titre-chapitre.vue

+6
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,15 @@
1515

1616
<script>
1717
import Chapters from "@/../lib/chapters"
18+
import { useStore } from "@/stores"
1819
1920
export default {
2021
name: "TitreChapitre",
22+
setup() {
23+
return {
24+
store: useStore(),
25+
}
26+
},
2127
computed: {
2228
title() {
2329
return this.getTitleByRoute(this.$route)

src/context/caidf/views/lieux.vue

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,17 @@ import {
2828
getEtablissements,
2929
} from "@/../lib/benefits/etablissements"
3030
import SmallBackButton from "@/context/caidf/components/small-back-button"
31+
import { useStore } from "@/stores"
3132
3233
export default {
3334
name: "Lieux",
3435
components: {
3536
SmallBackButton,
3637
Etablissement,
3738
},
38-
data: function () {
39+
setup() {
3940
return {
41+
store: useStore(),
4042
benefit: null,
4143
list: [],
4244
updating: true,

src/context/caidf/views/resultats/resultat-base.vue

+6
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import LoadingModal from "@/components/loading-modal"
3636
import ResultatsMixin from "@/mixins/resultats"
3737
import ProgressBar from "@/components/progress-bar"
3838
import Breadcrumb from "@/context/caidf/components/breadcrumb"
39+
import { useStore } from "@/stores"
3940
4041
export default {
4142
name: "ResultatBase",
@@ -45,6 +46,11 @@ export default {
4546
LoadingModal,
4647
},
4748
mixins: [ResultatsMixin],
49+
setup() {
50+
return {
51+
store: useStore(),
52+
}
53+
},
4854
computed: {
4955
situation: function () {
5056
return this.store.situation

src/context/caidf/views/resultats/resultats-detail.vue

+6
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import ResultatsMixin from "@/mixins/resultats"
2323
import StatisticsMixin from "@/mixins/statistics"
2424
import ResultatBase from "@/context/caidf/views/resultats/resultat-base"
2525
import SmallBackButton from "@/context/caidf/components/small-back-button"
26+
import { useStore } from "@/stores"
2627
2728
export default {
2829
name: "SimulationResultatsDetail",
@@ -32,6 +33,11 @@ export default {
3233
DroitsDetails,
3334
},
3435
mixins: [ResultatsMixin, StatisticsMixin],
36+
setup() {
37+
return {
38+
store: useStore(),
39+
}
40+
},
3541
computed: {
3642
situation: function () {
3743
return this.store.situation

src/context/caidf/views/resultats/resultats.vue

+6
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ import ErrorSaveBlock from "@/components/error-save-block"
7070
import ResultatsMixin from "@/mixins/resultats"
7171
import StatisticsMixin from "@/mixins/statistics"
7272
import ResultatBase from "@/context/caidf/views/resultats/resultat-base"
73+
import { useStore } from "@/stores"
7374
7475
export default {
7576
name: "SimulationResultats",
@@ -80,6 +81,11 @@ export default {
8081
ErrorSaveBlock,
8182
},
8283
mixins: [ResultatsMixin, StatisticsMixin],
84+
setup() {
85+
return {
86+
store: useStore(),
87+
}
88+
},
8389
mounted: function () {
8490
if (this.mock(this.$route.params.droitId)) {
8591
return

src/context/caidf/views/simulation.vue

+3-1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ import Breadcrumb from "@/context/caidf/components/breadcrumb"
5555
import ProgressBar from "@/components/progress-bar"
5656
import Hint from "@/lib/hint"
5757
import WarningMessage from "@/components/warning-message"
58+
import { useStore } from "@/stores"
5859
5960
export default {
6061
name: "Simulation",
@@ -65,7 +66,7 @@ export default {
6566
TitreChapitre,
6667
Progress,
6768
},
68-
data() {
69+
setup() {
6970
const helpingContentPerChapter = {
7071
profil: {
7172
text: `Ces informations sont nécessaires au traitement de votre demande. Vos données ne seront pas conservées à l’issue de la simulation.`,
@@ -96,6 +97,7 @@ export default {
9697
},
9798
}
9899
return {
100+
store: useStore(),
99101
helpingContentPerChapter,
100102
window,
101103
}

src/mixins/caidf/home-mixin.js

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
1+
import { useStore } from "@/stores"
2+
13
export default {
24
computed: {
35
hasExistingSituation: function () {
4-
return this.store.passSanityCheck
6+
const store = useStore()
7+
return store.passSanityCheck
58
},
69
},
710
methods: {
811
newSituation: function () {
9-
this.store.clear(this.$route.query.external_id)
12+
const store = useStore()
13+
store.clear(this.$route.query.external_id)
1014
this.next()
1115
},
1216
next: function () {
13-
this.store.verifyBenefitVariables()
17+
const store = useStore()
18+
store.verifyBenefitVariables()
1419
this.$push()
1520
},
1621
},

0 commit comments

Comments
 (0)