public inbox for [email protected]
help / color / mirror / Atom feedFrom: Surinder Kumar <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [pgAdmin4][RM_2424]: Menu Items don't appear in tools menu for modules that are loaded using deps
Date: Mon, 29 May 2017 13:22:00 +0530
Message-ID: <CAM5-9D86hMaWan8o5ram63dqEPPPkTO8YaaWV5H2fvp-2v2yag@mail.gmail.com> (raw)
List-Unsubscribe: <mailto:[email protected]?body=unsub%20pgadmin-hackers>
Hi
*Issue:*
If modules are loaded without any node dependency(i.e: on page load), the
function 'create_menu' is called implicitly to generate menu items.
But when the modules are loaded when its dependent node expands, the
function 'create_menus' has to explicitly call after 'add_menus' from
respective module's template files.
This patch is dependent on patch 'load_modules_js_when_required.patch'
Please find attached patch and review.
--
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers
Attachments:
[application/octet-stream] RM_2424.patch (3.9K, 3-RM_2424.patch)
download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/roles/templates/role/js/role.js b/web/pgadmin/browser/server_groups/servers/roles/templates/role/js/role.js
index a85416c..8180a60 100644
--- a/web/pgadmin/browser/server_groups/servers/roles/templates/role/js/role.js
+++ b/web/pgadmin/browser/server_groups/servers/roles/templates/role/js/role.js
@@ -375,6 +375,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify, Backform) {
icon: 'wcTabIcon icon-role', data: {action: 'create'},
enable: 'can_create_role'
}]);
+ pgBrowser.create_menus();
},
can_create_role: function(node, item) {
var treeData = this.getTreeNodeHierarchy(item),
diff --git a/web/pgadmin/tools/backup/templates/backup/js/backup.js b/web/pgadmin/tools/backup/templates/backup/js/backup.js
index 4c742f9..0b052e3 100644
--- a/web/pgadmin/tools/backup/templates/backup/js/backup.js
+++ b/web/pgadmin/tools/backup/templates/backup/js/backup.js
@@ -352,6 +352,7 @@ TODO LIST FOR BACKUP:
}
pgAdmin.Browser.add_menus(menus);
+ pgAdmin.Browser.create_menus();
return this;
},
start_backup_global: function(action, item) {
diff --git a/web/pgadmin/tools/datagrid/templates/datagrid/js/datagrid.js b/web/pgadmin/tools/datagrid/templates/datagrid/js/datagrid.js
index 2b35b7e..a111ca1 100644
--- a/web/pgadmin/tools/datagrid/templates/datagrid/js/datagrid.js
+++ b/web/pgadmin/tools/datagrid/templates/datagrid/js/datagrid.js
@@ -106,6 +106,7 @@ define(
pgAdmin.Browser.add_menu_category('view_data', '{{ _('View Data') }}', 100, 'fa fa-th');
pgAdmin.Browser.add_menus(menus);
+ pgAdmin.Browser.create_menus();
// Creating a new pgAdmin.Browser frame to show the data.
var dataGridFrameType = new pgAdmin.Browser.Frame({
diff --git a/web/pgadmin/tools/grant_wizard/templates/grant_wizard/js/grant_wizard.js b/web/pgadmin/tools/grant_wizard/templates/grant_wizard/js/grant_wizard.js
index db6cfd0..b72b4db 100644
--- a/web/pgadmin/tools/grant_wizard/templates/grant_wizard/js/grant_wizard.js
+++ b/web/pgadmin/tools/grant_wizard/templates/grant_wizard/js/grant_wizard.js
@@ -191,7 +191,7 @@ define([
});
}
pgAdmin.Browser.add_menus(menus);
-
+ pgAdmin.Browser.create_menus();
return this;
},
diff --git a/web/pgadmin/tools/import_export/templates/import_export/js/import_export.js b/web/pgadmin/tools/import_export/templates/import_export/js/import_export.js
index a300531..c29b9f1 100644
--- a/web/pgadmin/tools/import_export/templates/import_export/js/import_export.js
+++ b/web/pgadmin/tools/import_export/templates/import_export/js/import_export.js
@@ -292,6 +292,7 @@ define(
category: 'import', priority: 10, label: '{{ _('Import/Export...') }}',
icon: 'fa fa-shopping-cart', enable: menu_enabled
}]);
+ pgBrowser.create_menus();
},
/*
diff --git a/web/pgadmin/tools/maintenance/templates/maintenance/js/maintenance.js b/web/pgadmin/tools/maintenance/templates/maintenance/js/maintenance.js
index 3d2b51a..22931f8 100644
--- a/web/pgadmin/tools/maintenance/templates/maintenance/js/maintenance.js
+++ b/web/pgadmin/tools/maintenance/templates/maintenance/js/maintenance.js
@@ -189,6 +189,7 @@ define(
});
}
pgBrowser.add_menus(menus);
+ pgBrowser.create_menus();
},
/*
diff --git a/web/pgadmin/tools/restore/templates/restore/js/restore.js b/web/pgadmin/tools/restore/templates/restore/js/restore.js
index e17d9ce..5d2a8e8 100644
--- a/web/pgadmin/tools/restore/templates/restore/js/restore.js
+++ b/web/pgadmin/tools/restore/templates/restore/js/restore.js
@@ -290,6 +290,7 @@ define([
}
pgAdmin.Browser.add_menus(menus);
+ pgAdmin.Browser.create_menus();
return this;
},
// Callback to draw Backup Dialog for objects
view thread (2+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected]
Subject: Re: [pgAdmin4][RM_2424]: Menu Items don't appear in tools menu for modules that are loaded using deps
In-Reply-To: <CAM5-9D86hMaWan8o5ram63dqEPPPkTO8YaaWV5H2fvp-2v2yag@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox