Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Inspector Tabs] Updates #7987

Open
wants to merge 49 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
e196958
added getTypes to types api, modifying which tabs are shown, working …
jvigliotta Dec 20, 2024
128f482
moving hasNumericTelemetry to an api method
jvigliotta Dec 20, 2024
1326693
updated types api to return all types, updated annotations api to ret…
jvigliotta Dec 20, 2024
cded8fc
not sure if scatter plots are annotatable
jvigliotta Dec 20, 2024
bac8c80
added annotation tab conditions
jvigliotta Dec 30, 2024
3cba87d
clean up the new hasNumericTelemetry method in the telemetry api
jvigliotta Dec 30, 2024
cc99f19
moving to canView, since that is where the logic should be
jvigliotta Dec 31, 2024
0912f5f
anytime a selection is updated, select the first (top priority) tab
jvigliotta Jan 7, 2025
59f855a
Merge branch 'mct-7442' into mct-7959
jvigliotta Jan 15, 2025
ffa6ea6
Changes for tabs visibility and priority
charlesh88 Jan 16, 2025
9f1cac5
Changes for tabs visibility and priority
charlesh88 Jan 16, 2025
f199ce5
Changes for tabs visibility and priority
charlesh88 Jan 16, 2025
b09b9e0
Changes for tabs visibility and priority
charlesh88 Jan 16, 2025
97292d4
update selection views on edit state change
jvigliotta Jan 16, 2025
e7eb070
adding edit listener to inspector tabs component as well
jvigliotta Jan 16, 2025
7cd1517
intitializing display layouts with objectStyles properties, so styles…
jvigliotta Jan 16, 2025
4202de9
initialize and backfill object styles config prop for flex layouts
jvigliotta Jan 16, 2025
f4f010a
if editing and styles tab is selected and it exists for the next item…
jvigliotta Jan 16, 2025
3527e4e
Changes for tabs visibility and priority
charlesh88 Jan 17, 2025
087fbd3
Changes for tabs visibility and priority
charlesh88 Jan 17, 2025
1934aea
Show Annotations for Overlay and Stacked p
jvigliotta Jan 22, 2025
567aa69
fix error in lad table config component
jvigliotta Jan 22, 2025
f7d78c1
Properties tab should not show for non-domain objects
jvigliotta Jan 22, 2025
1d4353b
Notebook should only show Annotations tab when an entry is selected, …
jvigliotta Jan 22, 2025
91a9fa5
make sure older objects not initialized with object styles are checked
jvigliotta Jan 23, 2025
175befa
initalize tables with objectStyles
jvigliotta Jan 23, 2025
d92a2b7
initial e2e tests
jvigliotta Feb 10, 2025
9d92ba9
add clock to no styles objects, initialize event message generators w…
jvigliotta Feb 11, 2025
e985c08
removing styles for event message generators, they dont have edit mode
jvigliotta Feb 11, 2025
fffa773
only add missing object styles if table has configuration
jvigliotta Feb 11, 2025
310bd17
stopping point
jvigliotta Feb 12, 2025
efd7369
WIP
jvigliotta Feb 14, 2025
a207e97
finishing up main views tests and updating some providers to fix errors
jvigliotta Feb 21, 2025
243bc2b
couple changes
jvigliotta Feb 21, 2025
850c015
update comment
jvigliotta Feb 21, 2025
19ee3e5
update helper method name, simplify isAnnotatableType method
jvigliotta Mar 3, 2025
367e494
remove commented code
jvigliotta Mar 3, 2025
f530e99
adding condition widget styles get interceptor
jvigliotta Mar 3, 2025
439c3de
rename
jvigliotta Mar 3, 2025
c385c90
rename
jvigliotta Mar 3, 2025
97ae8db
add styles get interceptor for overlay plots
jvigliotta Mar 3, 2025
f98cabe
make missing object interceptor run first, so other interceptors dont…
jvigliotta Mar 3, 2025
8655434
update previous interceptors and add for stacked plot
jvigliotta Mar 3, 2025
1a59b89
adding styles interceptor for telemetry tables
jvigliotta Mar 3, 2025
4c0791f
remove targeted plugin styling exclusion in browse mode
jvigliotta Mar 5, 2025
07eaac2
Merge branch 'master' into mct-7442-7959
jvigliotta Mar 5, 2025
8b2d77c
lint fixes
jvigliotta Mar 5, 2025
5ee9b66
Merge branch 'mct-7442-7959' of https://github.com/nasa/openmct into …
jvigliotta Mar 5, 2025
0deb2bf
removed save from interceptors and kept missing object intercepter as is
jvigliotta Mar 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,8 @@
"darkmatter",
"Undeletes",
"SSSZ",
"pageerror"
"pageerror",
"annotatable"
],
"dictionaries": ["npm", "softwareTerms", "node", "html", "css", "bash", "en_US", "en-gb", "misc"],
"ignorePaths": [
Expand Down
64 changes: 8 additions & 56 deletions e2e/tests/functional/ui/inspector.e2e.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const viewsTabsMatrix = {
Browse: ['Properties', 'Annotations']
},
'Flexible Layout': {
Browse: ['Properties', 'Elements'],
Browse: ['Properties', 'Elements', 'Styles'],
Edit: ['Elements', 'Styles', 'Properties']
},
Folder: {
Expand All @@ -74,7 +74,7 @@ const viewsTabsMatrix = {
Edit: ['Elements', 'Styles', 'Properties']
},
Graph: {
Browse: ['Properties', 'Config', 'Elements'],
Browse: ['Properties', 'Config', 'Elements', 'Styles'],
Edit: ['Config', 'Elements', 'Styles', 'Properties']
},
Hyperlink: {
Expand All @@ -85,37 +85,37 @@ const viewsTabsMatrix = {
}
},
'LAD Table': {
Browse: ['Properties', 'Config', 'Elements'],
Browse: ['Properties', 'Config', 'Elements', 'Styles'],
Edit: ['Config', 'Elements', 'Styles', 'Properties']
},
'LAD Table Set': {
Browse: ['Properties', 'Config', 'Elements'],
Browse: ['Properties', 'Config', 'Elements', 'Styles'],
Edit: ['Config', 'Elements', 'Styles', 'Properties']
},
Notebook: {
Browse: ['Properties']
},
'Overlay Plot': {
Browse: ['Properties', 'Config', 'Annotations'],
Browse: ['Properties', 'Config', 'Annotations', 'Styles'],
Edit: ['Config', 'Elements', 'Styles', 'Filters', 'Properties']
},
'Scatter Plot': {
Browse: ['Properties', 'Config', 'Elements'],
Browse: ['Properties', 'Config', 'Elements', 'Styles'],
Edit: ['Config', 'Elements', 'Styles', 'Properties']
},
'Sine Wave Generator': {
Browse: ['Properties', 'Annotations']
},
'Stacked Plot': {
Browse: ['Properties', 'Config', 'Annotations', 'Elements'],
Browse: ['Properties', 'Config', 'Annotations', 'Elements', 'Styles'],
Edit: ['Config', 'Elements', 'Styles', 'Properties']
},
'Tabs View': {
Browse: ['Properties', 'Elements', 'Styles'],
Edit: ['Elements', 'Styles', 'Properties']
},
'Telemetry Table': {
Browse: ['Properties', 'Config', 'Elements'],
Browse: ['Properties', 'Config', 'Elements', 'Styles'],
Edit: ['Config', 'Elements', 'Styles', 'Filters', 'Properties']
},
'Time List': {
Expand All @@ -131,54 +131,6 @@ const viewsTabsMatrix = {
}
};

// TODO: need to implement uniqueItemMatrix tests
// const uniqueItemMatrix = {
// 'Display Layout Alphanumeric': {
// 'Browse': ['Properties', 'Styles', 'Format'],
// 'Edit': ['Styles', 'Format', 'Properties']
// },
// 'Display Layout Drawing object *': {
// 'Browse': ['Styles'],
// 'Edit': ['Styles']
// },
// 'Display Layout Child domain object': {
// 'Browse': ['']
// },
// 'Gantt Chart Activity': {
// 'Browse': ['Activity']
// },
// 'Notebook Entry': {
// 'Browse': ['Properties', 'Annotations']
// },
// Plan: {
// 'Browse': ['Properties']
// },
// 'Plan Activity': {
// 'Browse': ['Activity']
// },
// 'View-only Plot View': {
// 'Browse': ['Properties', 'Annotations']
// },
// 'Stacked Plot Child plot': {
// 'Browse': ['']
// },
// 'View-only Telemetry Table': {
// 'Browse': ['Properties']
// },
// 'Time List Activity': {
// 'Browse': ['Activity']
// },
// 'Time Strip Activity': {
// 'Browse': ['Activity']
// },
// 'Web Page': {
// Browse: ['Properties'],
// required: {
// url: 'http://www.google.com'
// }
// }
// };

test.describe('Inspector tests', () => {
test.beforeEach(async ({ page }) => {
await page.goto('./', { waitUntil: 'domcontentloaded' });
Expand Down
16 changes: 3 additions & 13 deletions src/api/annotation/AnnotationAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ export default class AnnotationAPI extends EventEmitter {
this.availableTags = {};
this.namespaceToSaveAnnotations = '';
this.#targetComparatorMap = new Map();
this.annotatableTypes = [];

this.ANNOTATION_TYPES = ANNOTATION_TYPES;
this.ANNOTATION_TYPE = ANNOTATION_TYPE;
Expand All @@ -116,17 +115,6 @@ export default class AnnotationAPI extends EventEmitter {
domainObject.annotationType = domainObject.annotationType || 'plotspatial';
}
});

this.openmct.on('start', () => {
const types = this.openmct.types.getTypes();
const typeKeys = Object.keys(types);

typeKeys.forEach((key) => {
if (types[key].definition.annotatable) {
this.annotatableTypes.push(key);
}
});
});
}
/**
* Creates an annotation on a given domain object (e.g., a plot) and a set of targets (e.g., telemetry objects)
Expand Down Expand Up @@ -601,6 +589,8 @@ export default class AnnotationAPI extends EventEmitter {
* @returns {boolean} Returns true if the type is annotatable
*/
isAnnotatableType(type) {
return this.annotatableTypes.some((annotatableType) => annotatableType === type);
const types = this.openmct.types.getAllTypes();

return types[type]?.definition?.annotatable;
}
}
2 changes: 1 addition & 1 deletion src/api/types/TypeRegistry.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export default class TypeRegistry {
* List all registered types.
* @returns {Type[]} all registered types
*/
getTypes() {
getAllTypes() {
return this.types;
}
/**
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/LADTable/components/LadTableConfiguration.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
</div>
<div class="c-inspect-properties__value">
<input
v-if="isEditing"
:id="key + 'ColumnControl'"
type="checkbox"
v-if="isEditing"
:checked="configuration.hiddenColumns[key] !== true"
@change="toggleColumn(key)"
/>
Expand Down Expand Up @@ -147,8 +147,8 @@
this.ladTableObjects.push(ladTable);

const composition = this.openmct.composition.get(ladTable.domainObject);
composition.on('add', this.addItem);
composition.on('remove', this.removeItem);

Check warning on line 151 in src/plugins/LADTable/components/LadTableConfiguration.vue

View check run for this annotation

Codecov / codecov/patch

src/plugins/LADTable/components/LadTableConfiguration.vue#L150-L151

Added lines #L150 - L151 were not covered by tests
composition.load();

this.compositions.push({
Expand Down
7 changes: 0 additions & 7 deletions src/plugins/conditionWidget/components/ConditionWidget.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,6 @@ export default {
},
mounted() {
if (this.domainObject) {
if (!this.domainObject.configuration) {
// older versions didn't initialize configuration
this.domainObject.configuration = {
objectStyles: {}
};
}

this.listenToConditionSetChanges();
}
},
Expand Down
40 changes: 40 additions & 0 deletions src/plugins/conditionWidget/conditionWidgetStylesInterceptor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2024, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/

export default function conditionWidgetStylesInterceptor(openmct) {
return {
appliesTo: (identifier, domainObject) => {
return domainObject?.type === 'conditionWidget' && !domainObject.configuration?.objectStyles;
},
invoke: (identifier, domainObject) => {
if (!domainObject.configuration) {
domainObject.configuration = {};

Check warning on line 30 in src/plugins/conditionWidget/conditionWidgetStylesInterceptor.js

View check run for this annotation

Codecov / codecov/patch

src/plugins/conditionWidget/conditionWidgetStylesInterceptor.js#L29-L30

Added lines #L29 - L30 were not covered by tests
}

domainObject.configuration.objectStyles = {};

Check warning on line 33 in src/plugins/conditionWidget/conditionWidgetStylesInterceptor.js

View check run for this annotation

Codecov / codecov/patch

src/plugins/conditionWidget/conditionWidgetStylesInterceptor.js#L33

Added line #L33 was not covered by tests

openmct.objects.save(domainObject);

Check warning on line 35 in src/plugins/conditionWidget/conditionWidgetStylesInterceptor.js

View check run for this annotation

Codecov / codecov/patch

src/plugins/conditionWidget/conditionWidgetStylesInterceptor.js#L35

Added line #L35 was not covered by tests

return domainObject;

Check warning on line 37 in src/plugins/conditionWidget/conditionWidgetStylesInterceptor.js

View check run for this annotation

Codecov / codecov/patch

src/plugins/conditionWidget/conditionWidgetStylesInterceptor.js#L37

Added line #L37 was not covered by tests
}
};
}
2 changes: 2 additions & 0 deletions src/plugins/conditionWidget/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/

import conditionWidgetStylesInterceptor from './conditionWidgetStylesInterceptor.js';
import ConditionWidgetViewProvider from './ConditionWidgetViewProvider.js';

export default function plugin() {
return function install(openmct) {
openmct.objectViews.addProvider(new ConditionWidgetViewProvider(openmct));
openmct.objects.addGetInterceptor(conditionWidgetStylesInterceptor(openmct));

openmct.types.addType('conditionWidget', {
key: 'conditionWidget',
Expand Down
17 changes: 0 additions & 17 deletions src/plugins/inspectorViews/styles/StylesInspectorViewProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,6 @@ export default function StylesInspectorViewProvider(openmct) {
},
view: function (selection) {
let _destroy = null;
const objectSelection = selection?.[0];
const objectContext = objectSelection?.[0]?.context;
const domainObject = objectContext?.item;
const onlyEditMode = [
'flexible-layout',
'LadTable',
'LadTableSet',
'table',
'telemetry.plot.bar-graph',
'telemetry.plot.overlay',
'telemetry.plot.stacked',
'telemetry.plot.scatter-plot'
].includes(domainObject?.type);

return {
show: function (element) {
Expand All @@ -124,10 +111,6 @@ export default function StylesInspectorViewProvider(openmct) {
_destroy = destroy;
},
showTab: function (isEditing) {
if (onlyEditMode && !isEditing) {
return false;
}

return true;
},
priority: function () {
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/interceptors/missingObjectInterceptor.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export default function MissingObjectInterceptor(openmct) {
}

return object;
}
},
priority: openmct.priority.HIGH + 1 // this should be the first interceptor to run
});
}
9 changes: 0 additions & 9 deletions src/plugins/plot/PlotView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,6 @@ export default {
created() {
eventHelpers.extend(this);
this.imageExporter = new ImageExporter(this.openmct);

// Initialize objectStyles for overlay plot if it doesn't exist
if (
this.domainObject.type === 'telemetry.plot.overlay' &&
!this.domainObject.configuration.objectStyles
) {
this.domainObject.configuration.objectStyles = {};
}

this.loadComposition();
this.setupClockChangedEvent((domainObject) => {
this.triggerUnsubscribeFromStaleness(domainObject);
Expand Down
43 changes: 43 additions & 0 deletions src/plugins/plot/overlayPlot/overlayPlotStylesInterceptor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2024, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/

export default function overlayPlotStylesInterceptor(openmct) {
return {
appliesTo: (identifier, domainObject) => {
return (
domainObject?.type === 'telemetry.plot.overlay' &&
!domainObject?.configuration?.objectStyles
);
},
invoke: (identifier, domainObject) => {
if (!domainObject.configuration) {
domainObject.configuration = {};

Check warning on line 33 in src/plugins/plot/overlayPlot/overlayPlotStylesInterceptor.js

View check run for this annotation

Codecov / codecov/patch

src/plugins/plot/overlayPlot/overlayPlotStylesInterceptor.js#L32-L33

Added lines #L32 - L33 were not covered by tests
}

domainObject.configuration.objectStyles = {};

Check warning on line 36 in src/plugins/plot/overlayPlot/overlayPlotStylesInterceptor.js

View check run for this annotation

Codecov / codecov/patch

src/plugins/plot/overlayPlot/overlayPlotStylesInterceptor.js#L36

Added line #L36 was not covered by tests

openmct.objects.save(domainObject);

Check warning on line 38 in src/plugins/plot/overlayPlot/overlayPlotStylesInterceptor.js

View check run for this annotation

Codecov / codecov/patch

src/plugins/plot/overlayPlot/overlayPlotStylesInterceptor.js#L38

Added line #L38 was not covered by tests

return domainObject;

Check warning on line 40 in src/plugins/plot/overlayPlot/overlayPlotStylesInterceptor.js

View check run for this annotation

Codecov / codecov/patch

src/plugins/plot/overlayPlot/overlayPlotStylesInterceptor.js#L40

Added line #L40 was not covered by tests
}
};
}
3 changes: 3 additions & 0 deletions src/plugins/plot/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import PlotViewActions from './actions/ViewActions.js';
import PlotsInspectorViewProvider from './inspector/PlotsInspectorViewProvider.js';
import StackedPlotsInspectorViewProvider from './inspector/StackedPlotsInspectorViewProvider.js';
import OverlayPlotCompositionPolicy from './overlayPlot/OverlayPlotCompositionPolicy.js';
import overlayPlotStylesInterceptor from './overlayPlot/overlayPlotStylesInterceptor.js';
import OverlayPlotViewProvider from './overlayPlot/OverlayPlotViewProvider.js';
import PlotViewProvider from './PlotViewProvider.js';
import StackedPlotCompositionPolicy from './stackedPlot/StackedPlotCompositionPolicy.js';
Expand Down Expand Up @@ -50,6 +51,8 @@ export default function () {
priority: 891
});

openmct.objects.addGetInterceptor(overlayPlotStylesInterceptor(openmct));

openmct.types.addType('telemetry.plot.stacked', {
key: 'telemetry.plot.stacked',
name: 'Stacked Plot',
Expand Down
5 changes: 0 additions & 5 deletions src/plugins/plot/stackedPlot/StackedPlot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,6 @@ export default {
this.config = this.getConfig(configId);
this.showLegendsForChildren = this.config.legend.get('showLegendsForChildren');

// Initialize objectStyles if it doesn't exist
if (!this.domainObject.configuration.objectStyles) {
this.domainObject.configuration.objectStyles = {};
}

this.loaded = true;
this.imageExporter = new ImageExporter(this.openmct);

Expand Down
Loading
Loading