Skip to content

Commit

Permalink
Merge branch 'master' into bugfix/7873-time-conductor-input-validation
Browse files Browse the repository at this point in the history
  • Loading branch information
davetsay authored Oct 16, 2024
2 parents 8d4d57d + 890ddca commit af5702c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 23 deletions.
12 changes: 8 additions & 4 deletions src/api/faultmanagement/FaultManagementAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const DEFAULT_SHELVE_DURATIONS = [
value: 900000
},
{
name: 'Indefinite',
name: 'Unlimited',
value: null
}
];
Expand Down Expand Up @@ -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
*/

/**
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/faultManagement/FaultManagementView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 0 additions & 18 deletions src/plugins/faultManagement/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down

0 comments on commit af5702c

Please sign in to comment.