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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
externe Matthieu
Géocontrib Frontend
Commits
84391ccd
Commit
84391ccd
authored
Oct 4, 2021
by
Timothee P
Browse files
Options
Downloads
Patches
Plain Diff
check for irregular characters
parent
e9890953
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/feature_type/FeatureTypeCustomForm.vue
+19
-0
19 additions, 0 deletions
src/components/feature_type/FeatureTypeCustomForm.vue
src/views/feature_type/Feature_type_edit.vue
+0
-1
0 additions, 1 deletion
src/views/feature_type/Feature_type_edit.vue
with
19 additions
and
1 deletion
src/components/feature_type/FeatureTypeCustomForm.vue
+
19
−
0
View file @
84391ccd
...
...
@@ -249,12 +249,14 @@ export default {
}
this
.
updateStore
();
},
removeCustomForm
()
{
this
.
$store
.
commit
(
"
feature_type/REMOVE_CUSTOM_FORM
"
,
this
.
customForm
.
dataKey
);
},
updateStore
()
{
const
data
=
{
dataKey
:
this
.
customForm
.
dataKey
,
...
...
@@ -266,10 +268,21 @@ export default {
};
this
.
$store
.
commit
(
"
feature_type/UPDATE_CUSTOM_FORM
"
,
data
);
},
trimWhiteSpace
(
string
)
{
// TODO : supprimer les espaces pour chaque option au début et à la fin QUE à la validation
return
string
.
replace
(
/
\s
*,
\s
*/gi
,
"
,
"
);
},
hasRegularCharacters
(
input
)
{
for
(
let
char
of
input
)
{
if
(
!
/
[
a-zA-Z0-9-_
]
/
.
test
(
char
))
{
return
false
;
}
}
return
true
;
},
checkCustomForm
()
{
if
(
this
.
form
.
label
.
value
===
null
)
{
this
.
form
.
label
.
errors
=
[
"
Veuillez compléter ce champ.
"
];
...
...
@@ -278,6 +291,12 @@ export default {
this
.
form
.
name
.
errors
=
[
"
Veuillez compléter ce champ.
"
];
this
.
form
.
label
.
errors
=
[];
return
false
;
}
else
if
(
!
this
.
hasRegularCharacters
(
this
.
form
.
name
.
value
))
{
this
.
form
.
name
.
errors
=
[
"
Veuillez utiliser seulement les caratères autorisés.
"
,
];
this
.
form
.
label
.
errors
=
[];
return
false
;
}
this
.
form
.
label
.
errors
=
[];
this
.
form
.
name
.
errors
=
[];
...
...
...
...
This diff is collapsed.
Click to expand it.
src/views/feature_type/Feature_type_edit.vue
+
0
−
1
View file @
84391ccd
...
...
@@ -154,7 +154,6 @@
Créer et importer le(s) signalement(s) du geojson
</button>
<!-- // TODO: Add check script for form & other scripts // -->
</form>
</div>
</div>
...
...
...
...
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