Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
Simulateur Clara
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
claravue
Simulateur Clara
Commits
3e0f9d1a
Commit
3e0f9d1a
authored
Dec 19, 2019
by
Rémy Marronnier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Validation WIP
parent
2aeb92a6
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
98 additions
and
75 deletions
+98
-75
src/views/questions/ARE.vue
src/views/questions/ARE.vue
+31
-8
src/views/questions/Address.vue
src/views/questions/Address.vue
+5
-5
src/views/questions/Age.vue
src/views/questions/Age.vue
+25
-28
src/views/questions/Allocation.vue
src/views/questions/Allocation.vue
+2
-5
src/views/questions/Category.vue
src/views/questions/Category.vue
+2
-5
src/views/questions/Grade.vue
src/views/questions/Grade.vue
+29
-14
src/views/questions/Inscription.vue
src/views/questions/Inscription.vue
+2
-5
src/views/questions/Other.vue
src/views/questions/Other.vue
+2
-5
No files found.
src/views/questions/ARE.vue
View file @
3e0f9d1a
<
template
>
<v-form>
<v-form
@
submit.prevent=
"submitARE"
ref=
"formARE"
v-model=
"validity"
:lazy-validation=
"lazy"
>
Quel est le montant de cette allocation ?
<v-text-field
single-line
type=
"number"
label=
"Montant par mois"
></v-text-field>
<QuestionButtons
@
submit=
"submit"
></QuestionButtons>
<v-text-field
v-model.number=
"monthly_allocation_value"
autofocus
required
:rules=
"rules"
min=
"0"
type=
"number"
label=
"Montant par mois"
></v-text-field>
<v-btn
@
click=
"back"
>
Revenir
</v-btn>
<v-btn
v-bind:disabled=
"!validity"
type=
"submit"
>
Continuer
</v-btn>
</v-form>
</
template
>
<
script
>
import
QuestionButtons
from
"
@/components/QuestionButtons
"
;
export
default
{
components
:
{
QuestionButtons
},
name
:
"
ARE
"
,
created
()
{
this
.
monthly_allocation_value
=
this
.
$store
.
state
.
situation
.
monthly_allocation_value
;
},
data
:
()
=>
({
monthly_allocation_value
:
null
,
validity
:
false
,
rules
:
[
v
=>
!!
v
||
"
doit être renseignée
"
]
}),
methods
:
{
submit
()
{
validate
()
{
if
(
this
.
$refs
.
formARE
.
validate
())
{
this
.
validity
=
true
;
}
},
back
()
{
this
.
$router
.
go
(
-
1
);
},
submitARE
()
{
this
.
validate
();
this
.
$store
.
dispatch
(
"
submitARE
"
,
this
.
monthly_allocation_value
);
this
.
$router
.
push
(
"
votre-age
"
);
}
}
...
...
src/views/questions/Address.vue
View file @
3e0f9d1a
...
...
@@ -4,18 +4,18 @@
Code postal - facultatif
**Plus que 2 questions avant d'obtenir vos résultats**
<v-text-field
single-line
type=
"number"
label=
"Exemple : 44220"
></v-text-field>
<QuestionButtons
@
submit=
"submit"
></QuestionButtons>
<v-btn
@
click=
"back"
>
Revenir
</v-btn>
<v-btn
v-bind:disabled=
"!validity"
type=
"submit"
>
Continuer
</v-btn>
</v-form>
</
template
>
<
script
>
import
QuestionButtons
from
"
@/components/QuestionButtons
"
;
export
default
{
components
:
{
QuestionButtons
},
name
:
"
Address
"
,
methods
:
{
back
()
{
this
.
$router
.
go
(
-
1
);
},
submit
()
{
//this.$store.dispatch("submitAddress", this.??);
this
.
$router
.
push
(
"
autres-situations
"
);
...
...
src/views/questions/Age.vue
View file @
3e0f9d1a
<
template
>
<v-form>
<v-form
@
submit.prevent=
"submitAge"
ref=
"form"
v-model=
"validity"
:lazy-validation=
"lazy"
>
Quel est votre âge ?
<v-text-field
required
autofocus
v-model.number=
"age"
single-line
type=
"number"
v-validate=
"'required|min:16'
"
:rules=
"
rules
"
min=
"0
"
:rules=
"
[rules.min]
"
></v-text-field>
<QuestionButtons
@
submit=
"submit"
></QuestionButtons>
<v-btn
@
click=
"back"
>
Revenir
</v-btn>
<v-btn
v-bind:disabled=
"!validity"
type=
"submit"
>
Continuer
</v-btn>
</v-form>
</
template
>
<
script
>
import
QuestionButtons
from
"
@/components/QuestionButtons
"
;
export
default
{
name
:
"
Age
"
,
components
:
{
QuestionButtons
},
computed
:
{
age
:
{
get
()
{
return
this
.
$store
.
state
.
situation
.
age
;
},
set
(
value
)
{
this
.
$store
.
dispatch
(
"
submitAge
"
,
value
);
}
}
created
()
{
this
.
age
=
this
.
$store
.
state
.
situation
.
age
;
},
data
:
()
=>
({
rules
:
[
value
=>
!!
value
||
"
Required.
"
// value => value || >= 15 || 'doit être supérieur ou égal à 16',
// value => {
// const pattern = /^(([^
<>
()[
\
]
\\
.,;:
\
s
@
"
]+(
\
.[^<>()[
\
]
\\
.,;:
\
s@
"
]
+
)
*
)
|
(
"
.+
"
))@((
\
[[
0
-
9
]{
1
,
3
}
\
.[
0
-
9
]{
1
,
3
}
\
.[
0
-
9
]{
1
,
3
}
\
.[
0
-
9
]{
1
,
3
}])
|
(([
a
-
zA
-
Z
\
-
0
-
9
]
+
\
.)
+
[
a
-
zA
-
Z
]{
2
,}))
$
/
// return pattern.test(value) || 'Invalid e-mail.'
//},
]
age
:
0
,
validity
:
false
,
rules
:
{
min
:
v
=>
v
>=
16
||
"
doit être supérieur ou égal à 16
"
}
}),
methods
:
{
submit
()
{
//this.$store.dispatch("submitAge", this.age);
validate
()
{
if
(
this
.
$refs
.
form
.
validate
())
{
this
.
validity
=
true
;
}
},
back
()
{
this
.
$router
.
go
(
-
1
);
},
submitAge
()
{
this
.
validate
();
this
.
$store
.
dispatch
(
"
submitAge
"
,
this
.
age
);
this
.
$router
.
push
(
"
votre-diplome
"
);
}
}
...
...
src/views/questions/Allocation.vue
View file @
3e0f9d1a
...
...
@@ -9,16 +9,13 @@
<v-radio
label=
"Choix 5"
value=
"radio-5"
></v-radio>
<v-radio
label=
"Choix 6"
value=
"radio-6"
></v-radio>
</v-radio-group>
<QuestionButtons
@
submit=
"submit"
></QuestionButtons>
<v-btn
@
click=
"back"
>
Revenir
</v-btn>
<v-btn
v-bind:disabled=
"!validity"
type=
"submit"
>
Continuer
</v-btn>
</v-form>
</
template
>