mirror of
https://github.com/nasa/openmct.git
synced 2025-04-13 22:23:13 +00:00
fix broken limit check
This commit is contained in:
parent
e25bfb7291
commit
1d655e5ccf
@ -240,7 +240,7 @@ export default {
|
||||
this.clearAllValidation();
|
||||
|
||||
const inputType = refName.includes('Date') ? 'Date' : 'Time';
|
||||
const formatter = inputType === 'Date' ? this.timeFormatter : this.durationFormatter;
|
||||
const formatter = inputType === 'Date' ? this.timeSystemFormatter : this.durationFormatter;
|
||||
const validationResult = formatter.validate(this.formattedBounds[refName])
|
||||
? { valid: true }
|
||||
: { valid: false, message: `Invalid ${inputType}` };
|
||||
|
@ -94,6 +94,7 @@ export default {
|
||||
},
|
||||
inject: [
|
||||
'openmct',
|
||||
'configuration',
|
||||
'isTimeSystemUTCBased',
|
||||
'timeContext',
|
||||
'timeSystemKey',
|
||||
@ -176,9 +177,10 @@ export default {
|
||||
},
|
||||
handleFormSubmission(shouldDismiss) {
|
||||
this.validateLimit();
|
||||
this.reportValidity('limit');
|
||||
this.validateBounds();
|
||||
this.reportValidity('bounds');
|
||||
// report on this custom validity check last after more basic checks
|
||||
this.reportValidity('limit');
|
||||
|
||||
if (this.isValid) {
|
||||
this.setBoundsFromView(shouldDismiss);
|
||||
@ -201,7 +203,12 @@ export default {
|
||||
|
||||
this.logicalValidityMap.bounds = this.timeContext.validateBounds(bounds);
|
||||
},
|
||||
validateLimit(bounds) {
|
||||
validateLimit() {
|
||||
const bounds = {
|
||||
start: this.timeSystemFormatter.parse(this.formattedBounds.start),
|
||||
end: this.timeSystemFormatter.parse(this.formattedBounds.end)
|
||||
};
|
||||
|
||||
const limit = this.configuration?.menuOptions
|
||||
?.filter((option) => option.timeSystem === this.timeSystemKey)
|
||||
?.find((option) => option.limit)?.limit;
|
||||
|
Loading…
x
Reference in New Issue
Block a user