Skip to content

Commit

Permalink
[Filters] Fix view based filters when string input is enabled (#7050)
Browse files Browse the repository at this point in the history
* de-reactifying some objects for clarity, handling strings for filters, some vue 3 formatting

* removing debug, fixing string value persistence

* remove unnecessary change

* removing vue utils from non vue files

* nipping proxy objects in the bud

* linting

---------

Co-authored-by: Jesse Mazzella <ozyx@users.noreply.github.com>
  • Loading branch information
jvigliotta and ozyx committed Oct 24, 2023
1 parent 8f92cd4 commit 7bf9832
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
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

0 comments on commit 7bf9832

Please sign in to comment.