Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Géocontrib Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GéoContrib
Géocontrib Frontend
Commits
a19d89ae
Commit
a19d89ae
authored
1 year ago
by
Timothee P
Browse files
Options
Downloads
Patches
Plain Diff
display more informative message on option field
parent
4ec40331
No related branches found
No related tags found
1 merge request
!587
REDMINE_ISSUE-17413 | Nouveau formulaire de création des listes de valeurs
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/FeatureType/FeatureTypeCustomForm.vue
+9
-6
9 additions, 6 deletions
src/components/FeatureType/FeatureTypeCustomForm.vue
with
9 additions
and
6 deletions
src/components/FeatureType/FeatureTypeCustomForm.vue
+
9
−
6
View file @
a19d89ae
...
...
@@ -490,20 +490,23 @@ export default {
return
occurences
.
length
===
1
;
},
checkListOptions
()
{
if
(
!
[
'
list
'
,
'
pre_recorded_list
'
].
includes
(
this
.
form
.
field_type
.
value
))
return
true
;
checkOptions
()
{
if
(
this
.
form
.
field_type
.
value
===
'
list
'
)
{
return
this
.
form
.
options
.
value
.
length
>=
2
&&
!
this
.
form
.
options
.
value
.
includes
(
''
);
return
this
.
form
.
options
.
value
.
length
>=
2
&&
!
this
.
form
.
options
.
value
.
includes
(
''
)
?
''
:
'
Veuillez renseigner au moins 2 options.
'
;
}
if
(
this
.
form
.
field_type
.
value
===
'
pre_recorded_list
'
)
{
return
this
.
form
.
options
.
value
.
length
===
1
;
return
this
.
form
.
options
.
value
.
length
===
1
?
''
:
'
Veuillez renseigner une option.
'
;
}
return
''
;
},
checkCustomForm
()
{
this
.
form
.
label
.
errors
=
[];
this
.
form
.
name
.
errors
=
[];
this
.
form
.
options
.
errors
=
[];
const
optionError
=
this
.
checkOptions
();
let
isValid
=
true
;
if
(
!
this
.
form
.
label
.
value
)
{
//* vérifier que le label est renseigné
...
...
@@ -525,9 +528,9 @@ export default {
'
Les champs personnalisés ne peuvent pas avoir des noms similaires.
'
,
];
isValid
=
false
;
}
else
if
(
!
this
.
checkListOptions
()
)
{
}
else
if
(
optionError
)
{
//* s'il s'agit d'un type liste, vérifier que le champ option est bien renseigné
this
.
form
.
options
.
errors
=
[
'
Veuillez compléter ce champ.
'
];
this
.
form
.
options
.
errors
=
[
optionError
];
isValid
=
false
;
}
else
if
(
this
.
hasDuplicateOptions
())
{
//* pour le cas d'options dupliqués
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment