mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Handle standard menu items defined by Nodes in the browser.
The File menu now includes a "Create" submenu, and Delete/Rename options. Nodes can offer Delete/Rename functionality, and the options on the menu are automatically enabled/disabled based on the selected node. Each node can also offer Create functionality, and specify a list of node types (including itself) from which the option should be made available. The menu is dynamically generated based on the selected node. The Context menu on the treeview works in a similar way, except that nodes can offer any context menu items (we don't allow this on the top menu, as that should stay consistent to avoid user confusion).
This commit is contained in:
@@ -146,6 +146,16 @@ The hook points currently defined for nodes are:
|
||||
|
||||
def get_context_menu_items():
|
||||
"""Return a (set) of dicts of content menu items with name, label, priority and JS"""
|
||||
|
||||
def get_create_menu_items():
|
||||
"""Return a (set) of dicts of create menu items, with a Javascript array of
|
||||
object types on which the option should appear, name, label. priority and
|
||||
the function name (no parens) to call on click."""
|
||||
|
||||
def get_standard_menu_items():
|
||||
"""Return a (set) of dicts of standard menu items (drop/rename), with
|
||||
object type, action, priority and the function name (no parens) to call
|
||||
on click."""
|
||||
|
||||
def get_script_snippets():
|
||||
"""Return the script snippets needed to handle treeview node operations."""
|
||||
|
||||
Reference in New Issue
Block a user