mirror of
https://github.com/nasa/openmct.git
synced 2025-06-16 06:08:11 +00:00
fix(vipergc-574): Use selected shelve duration for fault management (#7890)
* refactor: `Indefinite` -> `Unlimited` * refactor: remove unused const * fix: use the selected shelveDuration * fix: set and use default if none selected * fix: bad optional chaining * fix: handle the case of no provider * fix: don't assign defaults if no provider
This commit is contained in:
@ -35,7 +35,7 @@ export const DEFAULT_SHELVE_DURATIONS = [
|
||||
value: 900000
|
||||
},
|
||||
{
|
||||
name: 'Indefinite',
|
||||
name: 'Unlimited',
|
||||
value: null
|
||||
}
|
||||
];
|
||||
@ -136,17 +136,21 @@ export default class FaultManagementAPI {
|
||||
/**
|
||||
* Retrieves the available shelve durations from the provider, or the default durations if the
|
||||
* provider does not provide any.
|
||||
* @returns {ShelveDuration[]}
|
||||
* @returns {ShelveDuration[] | undefined}
|
||||
*/
|
||||
getShelveDurations() {
|
||||
return this.provider?.getShelveDurations() ?? DEFAULT_SHELVE_DURATIONS;
|
||||
if (!this.provider) {
|
||||
return;
|
||||
}
|
||||
|
||||
return this.provider.getShelveDurations?.() ?? DEFAULT_SHELVE_DURATIONS;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} ShelveDuration
|
||||
* @property {string} name - The name of the shelve duration
|
||||
* @property {number|null} value - The value of the shelve duration in milliseconds, or null for indefinite
|
||||
* @property {number|null} value - The value of the shelve duration in milliseconds, or null for unlimited
|
||||
*/
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user