public inbox for [email protected]
help / color / mirror / Atom feed[pgAdmin4][RM_2424]: Menu Items don't appear in tools menu for modules that are loaded using deps
2+ messages / 2 participants
[nested] [flat]
* [pgAdmin4][RM_2424]: Menu Items don't appear in tools menu for modules that are loaded using deps
@ 2017-05-29 07:52 Surinder Kumar <[email protected]>
2017-05-30 15:31 ` Re: [pgAdmin4][RM_2424]: Menu Items don't appear in tools menu for modules that are loaded using deps Dave Page <[email protected]>
0 siblings, 1 reply; 2+ messages in thread
From: Surinder Kumar @ 2017-05-29 07:52 UTC (permalink / raw)
To: pgadmin-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
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: [pgAdmin4][RM_2424]: Menu Items don't appear in tools menu for modules that are loaded using deps
2017-05-29 07:52 [pgAdmin4][RM_2424]: Menu Items don't appear in tools menu for modules that are loaded using deps Surinder Kumar <[email protected]>
@ 2017-05-30 15:31 ` Dave Page <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: Dave Page @ 2017-05-30 15:31 UTC (permalink / raw)
To: Surinder Kumar <[email protected]>; +Cc: pgadmin-hackers
Hi
On Mon, May 29, 2017 at 8:52 AM, Surinder Kumar
<[email protected]> wrote:
> 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.
Unfortunately I just realised why this change isn't so good - it
causes the menus to be built when JS is loaded. That's not good, as we
really want the Tools menu to list all items, all of the time - it's
important that menu stays consistent so that users don't get confused
when they find an option they expected to be there, isn't.
Is there any way you can think of to have the menu items added at
startup, but the rest of the code loaded as needed?
Of course, whatever we do with Grunt/webpack will make this moot
anyway, so don't spend much time on it..
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
--
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2017-05-30 15:31 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-05-29 07:52 [pgAdmin4][RM_2424]: Menu Items don't appear in tools menu for modules that are loaded using deps Surinder Kumar <[email protected]>
2017-05-30 15:31 ` Dave Page <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox