Skip to content
Snippets Groups Projects
Commit 26182477 authored by Sébastien DA ROCHA's avatar Sébastien DA ROCHA :bicyclist:
Browse files

Merge branch 'redmine-issues/11955' into 'develop'

REDMINE_ISSUE-11955

See merge request !88
parents 70cd9c28 69f0f200
No related branches found
No related tags found
1 merge request!88REDMINE_ISSUE-11955
......@@ -264,6 +264,11 @@ footer {
flex-direction: column;
justify-content: center;
}
.leaflet-container {
background: white !important;
}
@media screen and (min-width: 560px) {
.mobile {
display: none !important;
......
......@@ -283,6 +283,28 @@ export default {
return true;
},
checkUniqueName() {
console.log(this.$store);
console.log(this.$store.state);
console.log(this.$store.state.feature_type);
if (this.form.name.value) {
const occurences = this.$store.state.feature_type.customForms
.map((el) => el.name)
.filter((el) => el === this.form.name.value);
console.log("occurences", occurences);
console.log(occurences.length);
if (occurences.length > 1) {
console.log("duplicate", this.form.name.value);
this.form.name.errors = [
"Les champs personnalisés ne peuvent pas avoir des noms similaires.",
];
return false;
}
}
this.form.name.errors = [];
return true;
},
checkCustomForm() {
if (this.form.label.value === null) {
this.form.label.errors = ["Veuillez compléter ce champ."];
......@@ -297,10 +319,11 @@ export default {
];
this.form.label.errors = [];
return false;
} else if (this.checkUniqueName()) {
this.form.label.errors = [];
this.form.name.errors = [];
return true;
}
this.form.label.errors = [];
this.form.name.errors = [];
return true;
},
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment