mirror of
https://github.com/nasa/openmct.git
synced 2025-03-22 03:55:31 +00:00
Fix shelved alarms (#5479)
* Fix the logic around shelved alarms * Remove application router listener
This commit is contained in:
parent
0af7965021
commit
4246a597a9
@ -23,12 +23,7 @@
|
||||
<template>
|
||||
<div
|
||||
class="c-fault-mgmt__list data-selectable"
|
||||
:class="[
|
||||
{'is-selected': isSelected},
|
||||
{'is-unacknowledged': !fault.acknowledged},
|
||||
{'is-shelved': fault.shelved},
|
||||
{'is-acknowledged': fault.acknowledged}
|
||||
]"
|
||||
:class="classesFromState"
|
||||
>
|
||||
<div class="c-fault-mgmt-item c-fault-mgmt__list-checkbox">
|
||||
<input
|
||||
@ -113,6 +108,36 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
classesFromState() {
|
||||
const exclusiveStates = [
|
||||
{
|
||||
className: 'is-shelved',
|
||||
test: () => this.fault.shelved
|
||||
},
|
||||
{
|
||||
className: 'is-unacknowledged',
|
||||
test: () => !this.fault.acknowledged && !this.fault.shelved
|
||||
},
|
||||
{
|
||||
className: 'is-acknowledged',
|
||||
test: () => this.fault.acknowledged && !this.fault.shelved
|
||||
}
|
||||
];
|
||||
|
||||
const classes = [];
|
||||
|
||||
if (this.isSelected) {
|
||||
classes.push('is-selected');
|
||||
}
|
||||
|
||||
const matchingState = exclusiveStates.find(stateDefinition => stateDefinition.test());
|
||||
|
||||
if (matchingState !== undefined) {
|
||||
classes.push(matchingState.className);
|
||||
}
|
||||
|
||||
return classes;
|
||||
},
|
||||
liveValueClassname() {
|
||||
const currentValueInfo = this.fault?.currentValueInfo;
|
||||
if (!currentValueInfo || currentValueInfo.monitoringResult === 'IN_LIMITS') {
|
||||
|
@ -96,17 +96,19 @@ export default {
|
||||
computed: {
|
||||
filteredFaultsList() {
|
||||
const filterName = FILTER_ITEMS[this.filterIndex];
|
||||
let list = this.faultsList.filter(fault => !fault.shelved);
|
||||
let list = this.faultsList;
|
||||
|
||||
// Exclude shelved alarms from all views except the Shelved view
|
||||
if (filterName !== 'Shelved') {
|
||||
list = list.filter(fault => fault.shelved !== true);
|
||||
}
|
||||
|
||||
if (filterName === 'Acknowledged') {
|
||||
list = this.faultsList.filter(fault => fault.acknowledged);
|
||||
}
|
||||
|
||||
if (filterName === 'Unacknowledged') {
|
||||
list = this.faultsList.filter(fault => !fault.acknowledged);
|
||||
}
|
||||
|
||||
if (filterName === 'Shelved') {
|
||||
list = this.faultsList.filter(fault => fault.shelved);
|
||||
list = list.filter(fault => fault.acknowledged);
|
||||
} else if (filterName === 'Unacknowledged') {
|
||||
list = list.filter(fault => !fault.acknowledged);
|
||||
} else if (filterName === 'Shelved') {
|
||||
list = list.filter(fault => fault.shelved);
|
||||
}
|
||||
|
||||
if (this.searchTerm.length > 0) {
|
||||
|
@ -50,6 +50,10 @@ class ApplicationRouter extends EventEmitter {
|
||||
this.started = false;
|
||||
|
||||
this.setHash = _.debounce(this.setHash.bind(this), 300);
|
||||
|
||||
openmct.once('destroy', () => {
|
||||
this.destroy();
|
||||
});
|
||||
}
|
||||
|
||||
// Public Methods
|
||||
|
Loading…
x
Reference in New Issue
Block a user