Commit add8bee4 authored by Rémy Marronnier's avatar Rémy Marronnier

Fixes and filters work

parent 29d31e99
...@@ -27,6 +27,15 @@ export default { ...@@ -27,6 +27,15 @@ export default {
// contracts: {} // contracts: {}
// }; // };
// }, // },
methods: {
// hasOneTrueFilter(aid) {
// let values = [];
// aid.filters.forEach(filter => {
// values.push(filter.value);
// });
// return values.include(true);
// }
},
computed: { computed: {
contracts() { contracts() {
return this.$store.state.results.eligible; return this.$store.state.results.eligible;
......
...@@ -28,8 +28,13 @@ export default { ...@@ -28,8 +28,13 @@ export default {
allocation_type: "" allocation_type: ""
}), }),
computed: { computed: {
filters() { filters: {
return this.store.state.results.filters; get() {
return this.$store.state.results.filters;
},
set(value) {
this.$store.commit("updateFilters", value);
}
} }
} }
}; };
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<v-list-item-subtitle>{{aid.short_description}}</v-list-item-subtitle> <v-list-item-subtitle>{{aid.short_description}}</v-list-item-subtitle>
<v-chip v-for="filter in filters" :key="filter.desciption">{{filter.description}}</v-chip> <v-chip v-for="filter in filters" :key="filter.desciption">{{filter.description}}</v-chip>
<v-btn right> <v-btn right>
<v-icon left>mdi-eye</v-icon>Voir <v-icon left>mdi-eye</v-icon>En savoir plus
</v-btn> </v-btn>
</v-list-item-content> </v-list-item-content>
</v-list-item> </v-list-item>
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
<v-expansion-panels> <v-expansion-panels>
<v-expansion-panel> <v-expansion-panel>
<v-expansion-panel-header> <v-expansion-panel-header>
{{aids.length}} {{aids.length | filtered}}
<v-img src="@/assets/contracts/alternance.svg"></v-img> <v-img src="@/assets/contracts/alternance.svg"></v-img>
{{ contractType }} {{ contractType }}
</v-expansion-panel-header> </v-expansion-panel-header>
<v-expansion-panel-content> <v-expansion-panel-content>
<AidSummary v-for="aid in aids" :key="aid.name" v-bind:aid="aid"></AidSummary> <AidSummary v-for="aid in aids" :key="aid.name" v-bind:aid="aid | filtered"></AidSummary>
</v-expansion-panel-content> </v-expansion-panel-content>
</v-expansion-panel> </v-expansion-panel>
</v-expansion-panels> </v-expansion-panels>
...@@ -25,6 +25,19 @@ export default { ...@@ -25,6 +25,19 @@ export default {
aids: { aids: {
type: Array type: Array
} }
},
filters: {
filtered(aid) {
let values = [];
aid.filters.forEach(filter => {
values.push(filter.value);
});
if (values.includes(true)) {
return aid;
} else {
return null;
}
}
} }
}; };
</script> </script>
......
...@@ -66,7 +66,7 @@ export function filtersService() { ...@@ -66,7 +66,7 @@ export function filtersService() {
{ {
name: "travailler-en-alternance", name: "travailler-en-alternance",
description: "Travailler en alternance", description: "Travailler en alternance",
value: false value: true
}, },
{ {
name: "s-informer-sur-contrats-specifiques", name: "s-informer-sur-contrats-specifiques",
...@@ -111,7 +111,7 @@ export function filtersService() { ...@@ -111,7 +111,7 @@ export function filtersService() {
{ {
name: "se-former-valoriser-ses-competences", name: "se-former-valoriser-ses-competences",
description: "Financer une formation, obtenir un diplôme", description: "Financer une formation, obtenir un diplôme",
value: false value: true
} }
]; ];
......