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

* 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>
This commit is contained in:
Jamie V 2023-10-24 15:33:08 -07:00 committed by GitHub
parent 8f92cd4206
commit 7bf983210c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 10 deletions

View File

@ -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>

View File

@ -42,6 +42,7 @@
<script>
import _ from 'lodash';
import { toRaw } from 'vue';
import FilterObject from './FilterObject.vue';
import GlobalFilters from './GlobalFilters.vue';
@ -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)
);
}
}

View File

@ -157,7 +157,9 @@ export default {
},
getFilterLabels(filterObject, metadatum) {
let filterLabels = [];
Object.values(filterObject).forEach((comparator) => {
if (typeof comparator !== 'string') {
comparator.forEach((filterValue) => {
metadatum.filters[0].possibleValues.forEach((option) => {
if (option.value === filterValue) {
@ -165,6 +167,9 @@ export default {
}
});
});
} else {
filterLabels.push(comparator);
}
});
return filterLabels;