5469 search results sometimes show the wrong contextual path or no path at all master (#5567)
* use identifier from domain object to tell vue to rerender, also show object in annotations * fix annotation result clicks * use key string instead * add nice e2e test * add some more search types * added negative expect
This commit is contained in:
@@ -42,8 +42,9 @@
|
||||
</div>
|
||||
|
||||
<ObjectPath
|
||||
ref="location"
|
||||
:domain-object="domainObject"
|
||||
:read-only="false"
|
||||
:show-object-itself="true"
|
||||
/>
|
||||
|
||||
<div class="c-gsearch-result__tags">
|
||||
@@ -124,18 +125,15 @@ export default {
|
||||
return this.result.fullTagModels[0].foregroundColor;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
const selectionObject = {
|
||||
context: {
|
||||
item: this.domainObject
|
||||
}
|
||||
};
|
||||
this.$refs.location.updateSelection([[selectionObject]]);
|
||||
},
|
||||
methods: {
|
||||
clickedResult() {
|
||||
const objectPath = this.domainObject.originalPath;
|
||||
const resultUrl = objectPathToUrl(this.openmct, objectPath);
|
||||
let resultUrl = objectPathToUrl(this.openmct, objectPath);
|
||||
// get rid of ROOT if extant
|
||||
if (resultUrl.includes('/ROOT')) {
|
||||
resultUrl = resultUrl.split('/ROOT').join('');
|
||||
}
|
||||
|
||||
this.openmct.router.navigate(resultUrl);
|
||||
},
|
||||
isSearchMatched(tag) {
|
||||
|
||||
@@ -46,8 +46,8 @@
|
||||
</div>
|
||||
|
||||
<ObjectPath
|
||||
ref="objectpath"
|
||||
:read-only="false"
|
||||
:domain-object="result"
|
||||
/>
|
||||
</div>
|
||||
<div class="c-gsearch-result__more-options-button">
|
||||
@@ -88,12 +88,6 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
const selectionObject = {
|
||||
context: {
|
||||
item: this.result
|
||||
}
|
||||
};
|
||||
this.$refs.objectpath.updateSelection([[selectionObject]]);
|
||||
this.previewAction = new PreviewAction(this.openmct);
|
||||
this.previewAction.on('isVisible', this.togglePreviewState);
|
||||
},
|
||||
|
||||
@@ -39,8 +39,8 @@
|
||||
>
|
||||
<div class="c-gsearch__results-section-title">Object Results</div>
|
||||
<object-search-result
|
||||
v-for="(objectResult, index) in objectResults"
|
||||
:key="index"
|
||||
v-for="(objectResult) in objectResults"
|
||||
:key="openmct.objects.makeKeyString(objectResult.identifier)"
|
||||
:result="objectResult"
|
||||
@preview-changed="previewChanged"
|
||||
@click.native="selectedResult"
|
||||
@@ -52,8 +52,8 @@
|
||||
>
|
||||
<div class="c-gsearch__results-section-title">Annotation Results</div>
|
||||
<annotation-search-result
|
||||
v-for="(annotationResult, index) in annotationResults"
|
||||
:key="index"
|
||||
v-for="(annotationResult) in annotationResults"
|
||||
:key="openmct.objects.makeKeyString(annotationResult.identifier)"
|
||||
:result="annotationResult"
|
||||
@click.native="selectedResult"
|
||||
/>
|
||||
@@ -73,6 +73,7 @@ export default {
|
||||
AnnotationSearchResult,
|
||||
ObjectSearchResult
|
||||
},
|
||||
inject: ['openmct'],
|
||||
data() {
|
||||
return {
|
||||
resultsShown: false,
|
||||
|
||||
Reference in New Issue
Block a user