mirror of
https://github.com/nasa/openmct.git
synced 2025-04-23 10:23:43 +00:00
fix logical reporting overriding previous logical validation
This commit is contained in:
parent
1d655e5ccf
commit
51453c04d0
@ -178,9 +178,7 @@ export default {
|
||||
handleFormSubmission(shouldDismiss) {
|
||||
this.validateLimit();
|
||||
this.validateBounds();
|
||||
this.reportValidity('bounds');
|
||||
// report on this custom validity check last after more basic checks
|
||||
this.reportValidity('limit');
|
||||
this.reportLogicalValidity();
|
||||
|
||||
if (this.isValid) {
|
||||
this.setBoundsFromView(shouldDismiss);
|
||||
@ -224,7 +222,7 @@ export default {
|
||||
},
|
||||
reportValidity(refName) {
|
||||
const input = this.getInput(refName);
|
||||
const validationResult = this.inputValidityMap[refName] ?? this.logicalValidityMap[refName];
|
||||
const validationResult = this.inputValidityMap[refName];
|
||||
|
||||
if (validationResult.valid !== true) {
|
||||
input.setCustomValidity(validationResult.message);
|
||||
@ -236,6 +234,24 @@ export default {
|
||||
|
||||
this.$refs.fixedDeltaInput.reportValidity();
|
||||
},
|
||||
reportLogicalValidity() {
|
||||
const input = this.getInput();
|
||||
const boundsValidationResult = this.logicalValidityMap.bounds;
|
||||
const limitValidationResult = this.logicalValidityMap.limit;
|
||||
|
||||
if (boundsValidationResult.valid !== true) {
|
||||
input.setCustomValidity(boundsValidationResult.message);
|
||||
input.title = boundsValidationResult.message;
|
||||
} else if (limitValidationResult.valid !== true) {
|
||||
input.setCustomValidity(limitValidationResult.message);
|
||||
input.title = limitValidationResult.message;
|
||||
} else {
|
||||
input.setCustomValidity('');
|
||||
input.title = '';
|
||||
}
|
||||
|
||||
this.$refs.fixedDeltaInput.reportValidity();
|
||||
},
|
||||
getInput(refName) {
|
||||
if (Object.keys(this.inputValidityMap).includes(refName)) {
|
||||
return this.$refs[refName];
|
||||
|
Loading…
x
Reference in New Issue
Block a user