Skip to content

Commit

Permalink
chasse
Browse files Browse the repository at this point in the history
  • Loading branch information
joelclems committed Jun 7, 2021
1 parent 521a5b5 commit ffd4f57
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
34 changes: 18 additions & 16 deletions frontend/src/components/form/chained-form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@
<help :code="config.help"></help>
</p>

<fil-arianne :config="config" :keySession="keySession" :baseModel="config.value"></fil-arianne>

{{config.value}}
<fil-arianne
:config="config"
:keySession="keySession"
:baseModel="config.value"
></fil-arianne>

<generic-form :config="configSession(keySession)">
<div slot="success">
<slot name="success"></slot>
Expand Down Expand Up @@ -39,14 +42,14 @@ export default {
components: {
filArianne,
help,
genericForm,
genericForm
},
data: () => ({
declaration: null,
validForms: {},
initialized: false,
freeze: null,
freeze: null
}),
computed: {
Expand All @@ -65,7 +68,7 @@ export default {
// retourne la clé de session courrante
keySession() {
return this.$route.query.keySession || this.firstSession;
},
}
},
methods: {
Expand All @@ -80,7 +83,6 @@ export default {
// si c'est la dernière session validation = requete
if (sessionFunctions.lastSession(this.config) == keySession) {
sessionDef.action = this.config.action;
// sinon on passe au formulaire suivant
Expand All @@ -89,7 +91,7 @@ export default {
sessionDef.action = {
label: "Suivant",
process: ({ $router, config }) => {
return new Promise((resolve) => {
return new Promise(resolve => {
const nextSession = sessionFunctions.nextSession(
config,
config.keySession
Expand All @@ -98,11 +100,11 @@ export default {
// ici indispensable sinon bug et valide à l'avant dernière !!!!!
setTimeout(() => {
$router.push({ query: { keySession: nextSession } });
}, 200)
}, 200);
}
resolve();
});
},
}
};
}
}
Expand All @@ -119,7 +121,7 @@ export default {
.preloadData({
$store: this.$store,
id: this.id,
config: this.config,
config: this.config
})
.then(() => {
this.initialized = true;
Expand All @@ -129,20 +131,20 @@ export default {
}
},
showSession: function (keySession) {
showSession: function(keySession) {
return this.keySession === "all" || this.keySession == keySession;
},
showGroupSession: function (keySessionGroup) {
showGroupSession: function(keySessionGroup) {
return (
this.keySession === "all" ||
this.keySession in this.config.sessionGroups[keySessionGroup].sessions
);
},
}
},
created: function () {
created: function() {
this.initChainedForm();
},
}
};
</script>

Expand Down
2 changes: 2 additions & 0 deletions frontend/src/components/form/generic-form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<i>champs obligatoires.</i>
</div>
</div>

<template v-if="!displayValue">
<v-btn
v-if="config.action"
Expand All @@ -30,6 +31,7 @@
>{{ config.action.label || "Valider" }}</v-btn
>
</template>

<v-btn
v-if="switchDisplay"
color="primary"
Expand Down

0 comments on commit ffd4f57

Please sign in to comment.