Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Filters] Fix view based filters when string input is enabled #7050

Merged
merged 11 commits into from
Oct 24, 2023
4 changes: 2 additions & 2 deletions src/plugins/filters/components/FilterField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
type="text"
:aria-label="label"
:disabled="useGlobal"
:value="persistedValue(filter)"
@change="updateFilterValueFromString($event, filter)"
:value="persistedValue(filter.comparator)"
@change="updateFilterValueFromString($event, filter.comparator)"
/>
</template>

Expand Down
5 changes: 3 additions & 2 deletions src/plugins/filters/components/FiltersView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@

<script>
import _ from 'lodash';
import { toRaw } from 'vue';

import FilterObject from './FilterObject.vue';
import GlobalFilters from './GlobalFilters.vue';
Expand Down Expand Up @@ -267,14 +268,14 @@ export default {
this.openmct.objects.mutate(
this.providedObject,
'configuration.filters',
this.persistedFilters
toRaw(this.persistedFilters)
);
},
mutateConfigurationGlobalFilters() {
this.openmct.objects.mutate(
this.providedObject,
'configuration.globalFilters',
this.globalFilters
toRaw(this.globalFilters)
);
}
}
Expand Down
17 changes: 11 additions & 6 deletions src/plugins/telemetryTable/components/TableFooterIndicator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,19 @@ export default {
},
getFilterLabels(filterObject, metadatum) {
let filterLabels = [];

Object.values(filterObject).forEach((comparator) => {
comparator.forEach((filterValue) => {
metadatum.filters[0].possibleValues.forEach((option) => {
if (option.value === filterValue) {
filterLabels.push(option.label);
}
if (typeof comparator !== 'string') {
comparator.forEach((filterValue) => {
metadatum.filters[0].possibleValues.forEach((option) => {
if (option.value === filterValue) {
filterLabels.push(option.label);
}
});
});
});
} else {
filterLabels.push(comparator);
}
});

return filterLabels;
Expand Down