Skip to content

Commit

Permalink
#1504 Context toolbar not appearing for selected canvas (#1505)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomlyn authored Jun 22, 2023
1 parent c0b72e1 commit f868ce0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
3 changes: 2 additions & 1 deletion canvas_modules/harness/src/client/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -1388,7 +1388,8 @@ class App extends React.Component {
let defMenu = defaultMenu;
// Add custom menu items at proper positions: open, preview & execute
if (source.type === "node" &&
(source.selectedObjectIds.length === 1 || this.canvasController.isContextMenuForNonSelectedObj())) {
(source.selectedObjectIds.length === 1 ||
this.canvasController.isContextMenuForNonSelectedObj(source))) {
defMenu.unshift({ action: "editNode", label: this.getLabel("node_editNode", "CMI: Open") });
defMenu.splice(2, 0, { action: "previewNode", label: this.getLabel("node_previewNode", "CMI: Preview") });
defMenu.splice(8, 0, { action: "executeNode", label: this.getLabel("node_executeNode", "CMI: Execute") });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export default class FlowsCanvas extends React.Component {
enableLinkReplaceOnNewConnection: true,
paletteInitialState: true,
enableDropZoneOnExternalDrag: true,
enableContextToolbar: true,
enableHighlightNodeOnNewLinkDrag: true,
tipConfig: {
palette: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export default class DetachedCanvas extends React.Component {
enableAutoLinkOnlyFromSelNodes: true,
enableSingleOutputPortDisplay: true,
enableMarkdownInComments: true,
enableContextToolbar: true,
enableResizableNodes: true,
enableNarrowPalette: false,
paletteInitialState: true,
Expand Down Expand Up @@ -242,11 +243,6 @@ export default class DetachedCanvas extends React.Component {
);
}

if (source.selectedObjectIds.length === 1) {
return newMenu.concat([
{ divider: true }, { action: "addPort", label: "Add port" }
]);
}
return newMenu;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export default class DetachedCanvas extends React.Component {
enableAutoLinkOnlyFromSelNodes: true,
enableSingleOutputPortDisplay: true,
enableMarkdownInComments: true,
enableContextToolbar: true,
enableResizableNodes: true,
enableNarrowPalette: false,
paletteInitialState: true,
Expand Down Expand Up @@ -200,11 +201,6 @@ export default class DetachedCanvas extends React.Component {
);
}

if (source.type === "node" && source.selectedObjectIds.length === 1) {
newMenu.push(
{ divider: true }, { action: "addPort", label: "Add port" }
);
}
return newMenu;
}

Expand Down

0 comments on commit f868ce0

Please sign in to comment.