diff --git a/src/api/faultmanagement/FaultManagementAPI.js b/src/api/faultmanagement/FaultManagementAPI.js index 2eb3673a61..652c158e94 100644 --- a/src/api/faultmanagement/FaultManagementAPI.js +++ b/src/api/faultmanagement/FaultManagementAPI.js @@ -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 */ /** diff --git a/src/plugins/faultManagement/FaultManagementView.vue b/src/plugins/faultManagement/FaultManagementView.vue index eae7b03ef9..8f9f3b8cb3 100644 --- a/src/plugins/faultManagement/FaultManagementView.vue +++ b/src/plugins/faultManagement/FaultManagementView.vue @@ -330,7 +330,8 @@ export default { } shelveData.comment = data.comment || ''; - shelveData.shelveDuration = data.shelveDuration ?? this.shelveDurations[0].value; + shelveData.shelveDuration = + data.shelveDuration === undefined ? this.shelveDurations[0].value : data.shelveDuration; } else { shelveData = { shelved: false diff --git a/src/plugins/faultManagement/constants.js b/src/plugins/faultManagement/constants.js index 583c6607b5..d4fe458eb4 100644 --- a/src/plugins/faultManagement/constants.js +++ b/src/plugins/faultManagement/constants.js @@ -42,24 +42,6 @@ export const FAULT_MANAGEMENT_TYPE = 'faultManagement'; export const FAULT_MANAGEMENT_INSPECTOR = 'faultManagementInspector'; export const FAULT_MANAGEMENT_ALARMS = 'alarms'; export const FAULT_MANAGEMENT_GLOBAL_ALARMS = 'global-alarm-status'; -export const FAULT_MANAGEMENT_SHELVE_DURATIONS_IN_MS = [ - { - name: '5 Minutes', - value: 300000 - }, - { - name: '10 Minutes', - value: 600000 - }, - { - name: '15 Minutes', - value: 900000 - }, - { - name: 'Indefinite', - value: 0 - } -]; export const FAULT_MANAGEMENT_VIEW = 'faultManagement.view'; export const FAULT_MANAGEMENT_NAMESPACE = 'faults.taxonomy'; export const FILTER_ITEMS = ['Standard View', 'Acknowledged', 'Unacknowledged', 'Shelved'];