public inbox for [email protected]
help / color / mirror / Atom feed[pgAdmin4][PATCH] To fix the issue with NodeAjaxControl data caching
2+ messages / 2 participants
[nested] [flat]
* [pgAdmin4][PATCH] To fix the issue with NodeAjaxControl data caching
@ 2017-05-03 13:05 Murtuza Zabuawala <[email protected]>
0 siblings, 1 reply; 2+ messages in thread
From: Murtuza Zabuawala @ 2017-05-03 13:05 UTC (permalink / raw)
To: pgadmin-hackers
Hi,
PFA patch to fix the issue in NodeAjaxControl caching with cache-node field
and I've also added cache-node field in Trigger & Event trigger node so
that whenever user creates new Trigger Function we get new data from server
in NodeAjaxControl.
RM#2242
Please review.
--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/templates/event_triggers/js/event_trigger.js b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/templates/event_triggers/js/event_trigger.js
index 3a5a259..d2b6923 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/templates/event_triggers/js/event_trigger.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/templates/event_triggers/js/event_trigger.js
@@ -67,7 +67,6 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
source: undefined,
language: undefined
},
-
// Default values!
initialize: function(attrs, args) {
var isNew = (_.size(attrs) === 0);
@@ -79,7 +78,6 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
}
pgAdmin.Browser.Node.Model.prototype.initialize.apply(this, arguments);
},
-
// Define the schema for the event trigger node
schema: [{
id: 'name', label: '{{ _('Name') }}', cell: 'string',
@@ -105,7 +103,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
},{
id: 'eventfunname', label:'{{ _('Trigger function') }}',
type: 'text', control: 'node-ajax-options', group: "Definition",
- url:'fopts'
+ url:'fopts', cache_node: 'trigger_function'
},{
id: 'eventname', label:'{{ _('Events') }}',
type:"radio", group: "Definition", cell: 'string',
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/templates/trigger/js/trigger.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/templates/trigger/js/trigger.js
index 42ace44..3f44e7e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/templates/trigger/js/trigger.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/templates/trigger/js/trigger.js
@@ -283,7 +283,8 @@ function($, _, S, pgAdmin, pgBrowser, Backform, alertify) {
id: 'tfunction', label:'{{ _('Trigger Function') }}',
type: 'text', disabled: 'inSchemaWithModelCheck',
mode: ['create','edit', 'properties'], group: '{{ _('Definition') }}',
- control: 'node-ajax-options', url: 'get_triggerfunctions'
+ control: 'node-ajax-options', url: 'get_triggerfunctions',
+ cache_node: 'trigger_function'
},{
id: 'tgargs', label:'{{ _('Arguments') }}', cell: 'string',
group: '{{ _('Definition') }}',
diff --git a/web/pgadmin/browser/static/js/node.ui.js b/web/pgadmin/browser/static/js/node.ui.js
index 695e413..8e9ffce 100644
--- a/web/pgadmin/browser/static/js/node.ui.js
+++ b/web/pgadmin/browser/static/js/node.ui.js
@@ -126,7 +126,7 @@ function($, _, pgAdmin, Backbone, Backform, Alertify, Node) {
cache_level,
cache_node = this.field.get('cache_node');
- cache_node = (cache_node && pgAdmin.Browser.Nodes['cache_node']) || node;
+ cache_node = (cache_node && pgAdmin.Browser.Nodes[cache_node]) || node;
if (this.field.has('cache_level')) {
cache_level = this.field.get('cache_level');
--
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers
Attachments:
[text/plain] RM_2242.diff (3.2K, 3-RM_2242.diff)
download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/templates/event_triggers/js/event_trigger.js b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/templates/event_triggers/js/event_trigger.js
index 3a5a259..d2b6923 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/templates/event_triggers/js/event_trigger.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/templates/event_triggers/js/event_trigger.js
@@ -67,7 +67,6 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
source: undefined,
language: undefined
},
-
// Default values!
initialize: function(attrs, args) {
var isNew = (_.size(attrs) === 0);
@@ -79,7 +78,6 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
}
pgAdmin.Browser.Node.Model.prototype.initialize.apply(this, arguments);
},
-
// Define the schema for the event trigger node
schema: [{
id: 'name', label: '{{ _('Name') }}', cell: 'string',
@@ -105,7 +103,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
},{
id: 'eventfunname', label:'{{ _('Trigger function') }}',
type: 'text', control: 'node-ajax-options', group: "Definition",
- url:'fopts'
+ url:'fopts', cache_node: 'trigger_function'
},{
id: 'eventname', label:'{{ _('Events') }}',
type:"radio", group: "Definition", cell: 'string',
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/templates/trigger/js/trigger.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/templates/trigger/js/trigger.js
index 42ace44..3f44e7e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/templates/trigger/js/trigger.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/templates/trigger/js/trigger.js
@@ -283,7 +283,8 @@ function($, _, S, pgAdmin, pgBrowser, Backform, alertify) {
id: 'tfunction', label:'{{ _('Trigger Function') }}',
type: 'text', disabled: 'inSchemaWithModelCheck',
mode: ['create','edit', 'properties'], group: '{{ _('Definition') }}',
- control: 'node-ajax-options', url: 'get_triggerfunctions'
+ control: 'node-ajax-options', url: 'get_triggerfunctions',
+ cache_node: 'trigger_function'
},{
id: 'tgargs', label:'{{ _('Arguments') }}', cell: 'string',
group: '{{ _('Definition') }}',
diff --git a/web/pgadmin/browser/static/js/node.ui.js b/web/pgadmin/browser/static/js/node.ui.js
index 695e413..8e9ffce 100644
--- a/web/pgadmin/browser/static/js/node.ui.js
+++ b/web/pgadmin/browser/static/js/node.ui.js
@@ -126,7 +126,7 @@ function($, _, pgAdmin, Backbone, Backform, Alertify, Node) {
cache_level,
cache_node = this.field.get('cache_node');
- cache_node = (cache_node && pgAdmin.Browser.Nodes['cache_node']) || node;
+ cache_node = (cache_node && pgAdmin.Browser.Nodes[cache_node]) || node;
if (this.field.has('cache_level')) {
cache_level = this.field.get('cache_level');
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: [pgAdmin4][PATCH] To fix the issue with NodeAjaxControl data caching
@ 2017-05-04 15:02 Dave Page <[email protected]>
parent: Murtuza Zabuawala <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: Dave Page @ 2017-05-04 15:02 UTC (permalink / raw)
To: Murtuza Zabuawala <[email protected]>; +Cc: pgadmin-hackers
Thanks, applied.
On Wed, May 3, 2017 at 2:05 PM, Murtuza Zabuawala <
[email protected]> wrote:
> Hi,
>
> PFA patch to fix the issue in NodeAjaxControl caching with cache-node
> field and I've also added cache-node field in Trigger & Event trigger node
> so that whenever user creates new Trigger Function we get new data from
> server in NodeAjaxControl.
> RM#2242
>
> Please review.
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: 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
>
>
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2017-05-04 15:02 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-05-03 13:05 [pgAdmin4][PATCH] To fix the issue with NodeAjaxControl data caching Murtuza Zabuawala <[email protected]>
2017-05-04 15:02 ` 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