fixed filter field issue, and prevent elements pool from updating when selection has not changed (#2372)

This commit is contained in:
Deep Tailor 2019-04-10 15:56:08 -07:00 committed by Pegah Sarram
parent 9c9006d415
commit 548286bacd
3 changed files with 15 additions and 5 deletions

View File

@ -42,7 +42,10 @@
<!-- Checkbox list, NOT editing --> <!-- Checkbox list, NOT editing -->
<template v-if="filter.possibleValues && !isEditing"> <template v-if="filter.possibleValues && !isEditing">
<span>{{persistedFilters[filter.comparator].join(', ')}}</span> <span
v-if="persistedFilters[filter.comparator]">
{{persistedFilters[filter.comparator].join(', ')}}
</span>
</template> </template>
</div> </div>
</li> </li>

View File

@ -69,16 +69,17 @@ export default {
} }
} else { } else {
if (!this.updatedFilters[key]) { if (!this.updatedFilters[key]) {
this.updatedFilters[key] = {}; this.$set(this.updatedFilters, key, {});
} }
this.updatedFilters[key][comparator] = [value ? valueName : undefined]; this.$set(this.updatedFilters[key], comparator, [value ? valueName : undefined]);
} }
this.$emit('updateFilters', this.keyString, this.updatedFilters); this.$emit('updateFilters', this.keyString, this.updatedFilters);
}, },
updateTextFilter(key, comparator, value) { updateTextFilter(key, comparator, value) {
if (!this.updatedFilters[key]) { if (!this.updatedFilters[key]) {
this.updatedFilters[key] = {}; this.$set(this.updatedFilters, key, {});
this.$set(this.updatedFilters[key], comparator, '');
} }
this.updatedFilters[key][comparator] = value; this.updatedFilters[key][comparator] = value;
this.$emit('updateFilters', this.keyString, this.updatedFilters); this.$emit('updateFilters', this.keyString, this.updatedFilters);

View File

@ -67,6 +67,7 @@
} }
</style> </style>
<script> <script>
import _ from 'lodash';
import Search from '../components/search.vue'; import Search from '../components/search.vue';
import ObjectLabel from '../components/ObjectLabel.vue'; import ObjectLabel from '../components/ObjectLabel.vue';
@ -82,7 +83,8 @@ export default {
isEditing: this.openmct.editor.isEditing(), isEditing: this.openmct.editor.isEditing(),
parentObject: undefined, parentObject: undefined,
currentSearch: '', currentSearch: '',
isDragging: false isDragging: false,
selection: []
} }
}, },
mounted() { mounted() {
@ -99,6 +101,10 @@ export default {
this.showSelection(this.openmct.selection.get()); this.showSelection(this.openmct.selection.get());
}, },
showSelection(selection) { showSelection(selection) {
if (_.isEqual(this.selection, selection)) {
return;
}
this.selection = selection;
this.elements = []; this.elements = [];
this.elementsCache = {}; this.elementsCache = {};
this.listeners = []; this.listeners = [];