mirror of
https://github.com/nasa/openmct.git
synced 2025-06-17 22:58:14 +00:00
Context-Menu for Tables (#2424)
* add context menu capability to table rows, add view switcher to preview * add an option to limit context menu actions to the ones requested, and modify preview action to also include a view historical data action * extend preview action into view historical data action * add context menu to LAD Table * add keys to context menu actions, allow tables to conditionally attach context menu handler * working switch y axis label * New vertical select element for Y axis configuration in plots - CSS for vertically rotated selects for Y axis label selection; - New theme constants; - Removed themedSelect theme mixins; - New SASS svgColorFromHex function; * use keys in lad table context menu options * show historical view context menu on alpha-numerics * make reviewer requested changes * pass contextual object path from object view down etc * made reviewer requested changes: removed options object, pass in object path instead * remove redundant function from LADRow.vue
This commit is contained in:
committed by
Andrew Henry
parent
768d99d928
commit
97230bb21f
@ -49,6 +49,9 @@ class ContextMenuAPI {
|
||||
* a single sentence or short paragraph) of this kind of view
|
||||
* @property {string} cssClass the CSS class to apply to labels for this
|
||||
* view (to add icons, for instance)
|
||||
* @property {string} key unique key to identify the context menu action
|
||||
* (used in custom context menu eg table rows, to identify which actions to include)
|
||||
* @property {boolean} hideInDefaultMenu optional flag to hide action from showing in the default context menu (tree item)
|
||||
*/
|
||||
/**
|
||||
* @method appliesTo
|
||||
@ -72,12 +75,21 @@ class ContextMenuAPI {
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
_showContextMenuForObjectPath(objectPath, x, y) {
|
||||
_showContextMenuForObjectPath(objectPath, x, y, actionsToBeIncluded) {
|
||||
|
||||
let applicableActions = this._allActions.filter((action) => {
|
||||
if (action.appliesTo === undefined) {
|
||||
return true;
|
||||
|
||||
if (actionsToBeIncluded) {
|
||||
if (action.appliesTo === undefined && actionsToBeIncluded.includes(action.key)) {
|
||||
return true;
|
||||
}
|
||||
return action.appliesTo(objectPath, actionsToBeIncluded) && actionsToBeIncluded.includes(action.key);
|
||||
} else {
|
||||
if (action.appliesTo === undefined) {
|
||||
return true;
|
||||
}
|
||||
return action.appliesTo(objectPath) && !action.hideInDefaultMenu;
|
||||
}
|
||||
return action.appliesTo(objectPath);
|
||||
});
|
||||
|
||||
if (this._activeContextMenu) {
|
||||
|
Reference in New Issue
Block a user