5853 plot annotations prototype (#6000)
* Implement new search and tagging for notebooks * Add inspector and plot annotations * Clean up inspector for plots and other views * Bump webpack defaults for windows * Notebook annotations are shown in inspector now * Only allow annotations if plot is paused or in fixed time. also do not mutate if immutable * Key off local events instead of remote (for now)
This commit is contained in:
@@ -131,6 +131,44 @@ export default {
|
||||
let resultUrl = identifierToString(this.openmct, objectPath);
|
||||
|
||||
this.openmct.router.navigate(resultUrl);
|
||||
if (this.result.annotationType === this.openmct.annotation.ANNOTATION_TYPES.PLOT_SPATIAL) {
|
||||
//wait a beat for the navigation
|
||||
setTimeout(() => {
|
||||
this.clickedPlotAnnotation();
|
||||
}, 100);
|
||||
}
|
||||
},
|
||||
clickedPlotAnnotation() {
|
||||
const targetDetails = {};
|
||||
const targetDomainObjects = {};
|
||||
Object.entries(this.result.targets).forEach(([key, value]) => {
|
||||
targetDetails[key] = value;
|
||||
});
|
||||
this.result.targetModels.forEach((targetModel) => {
|
||||
const keyString = this.openmct.objects.makeKeyString(targetModel.identifier);
|
||||
targetDomainObjects[keyString] = targetModel;
|
||||
});
|
||||
const selection =
|
||||
[
|
||||
{
|
||||
element: this.openmct.layout.$refs.browseObject.$el,
|
||||
context: {
|
||||
item: this.result
|
||||
}
|
||||
},
|
||||
{
|
||||
element: this.$el,
|
||||
context: {
|
||||
type: 'plot-points-selection',
|
||||
targetDetails,
|
||||
targetDomainObjects,
|
||||
annotations: [this.result],
|
||||
annotationType: this.openmct.annotation.ANNOTATION_TYPES.PLOT_SPATIAL,
|
||||
onAnnotationChange: () => {}
|
||||
}
|
||||
}
|
||||
];
|
||||
this.openmct.selection.select(selection, true);
|
||||
},
|
||||
isSearchMatched(tag) {
|
||||
if (this.result.matchingTagKeys) {
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
<div class="c-gsearch__results-section-title">Annotation Results</div>
|
||||
<annotation-search-result
|
||||
v-for="(annotationResult) in annotationResults"
|
||||
:key="openmct.objects.makeKeyString(annotationResult.identifier)"
|
||||
:key="makeKeyForAnnotationResult(annotationResult)"
|
||||
:result="annotationResult"
|
||||
@click.native="selectedResult"
|
||||
/>
|
||||
@@ -102,6 +102,12 @@ export default {
|
||||
this.resultsShown = false;
|
||||
}
|
||||
},
|
||||
makeKeyForAnnotationResult(annotationResult) {
|
||||
const annotationKeyString = this.openmct.objects.makeKeyString(annotationResult.identifier);
|
||||
const firstTargetKeyString = Object.keys(annotationResult.targets)[0];
|
||||
|
||||
return `${annotationKeyString}-${firstTargetKeyString}`;
|
||||
},
|
||||
previewChanged(changedPreviewState) {
|
||||
this.previewVisible = changedPreviewState;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user