tidy new project component a little
This commit is contained in:
parent
97f3816627
commit
95afcc69dd
@ -74,7 +74,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
validateAndOpenModal: function (modalName) {
|
validateAndOpenModal: function (modalName) {
|
||||||
const childrenValid = this.$children.reduce((previous, newVal) => {
|
let isValid = this.$children.reduce((previous, newVal) => {
|
||||||
// display textInput error if it is not valid
|
// display textInput error if it is not valid
|
||||||
if (!newVal.showValid) {
|
if (!newVal.showValid) {
|
||||||
newVal.showError = true
|
newVal.showError = true
|
||||||
@ -83,18 +83,17 @@ export default {
|
|||||||
return newVal.showValid && previous
|
return newVal.showValid && previous
|
||||||
}, true)
|
}, true)
|
||||||
|
|
||||||
const hasNames = this.environmentsHaveNames()
|
if (!this.environmentsHaveNames()) {
|
||||||
const uniqNames = this.envNamesAreUnique()
|
isValid = false
|
||||||
|
|
||||||
if (!hasNames) {
|
|
||||||
this.showMissingError = true
|
this.showMissingError = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!uniqNames) {
|
if (!this.envNamesAreUnique()) {
|
||||||
|
isValid = false
|
||||||
this.showUniqueError = true
|
this.showUniqueError = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if (childrenValid && hasNames && uniqNames) {
|
if (isValid) {
|
||||||
this.openModal(modalName)
|
this.openModal(modalName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user