mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fix an issue in NodeAjaxControl caching with cache-node field and add cache-node field in Trigger & Event trigger node so that whenever the user creates new Trigger Function we get new data from server in NodeAjaxControl. . Fixes #2242
This commit is contained in:
parent
93df5e3e54
commit
95f763463f
@ -67,7 +67,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
|||||||
source: undefined,
|
source: undefined,
|
||||||
language: undefined
|
language: undefined
|
||||||
},
|
},
|
||||||
|
|
||||||
// Default values!
|
// Default values!
|
||||||
initialize: function(attrs, args) {
|
initialize: function(attrs, args) {
|
||||||
var isNew = (_.size(attrs) === 0);
|
var isNew = (_.size(attrs) === 0);
|
||||||
@ -79,7 +79,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
|||||||
}
|
}
|
||||||
pgAdmin.Browser.Node.Model.prototype.initialize.apply(this, arguments);
|
pgAdmin.Browser.Node.Model.prototype.initialize.apply(this, arguments);
|
||||||
},
|
},
|
||||||
|
|
||||||
// Define the schema for the event trigger node
|
// Define the schema for the event trigger node
|
||||||
schema: [{
|
schema: [{
|
||||||
id: 'name', label: '{{ _('Name') }}', cell: 'string',
|
id: 'name', label: '{{ _('Name') }}', cell: 'string',
|
||||||
@ -105,7 +105,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
|||||||
},{
|
},{
|
||||||
id: 'eventfunname', label:'{{ _('Trigger function') }}',
|
id: 'eventfunname', label:'{{ _('Trigger function') }}',
|
||||||
type: 'text', control: 'node-ajax-options', group: "Definition",
|
type: 'text', control: 'node-ajax-options', group: "Definition",
|
||||||
url:'fopts'
|
url:'fopts', cache_node: 'trigger_function'
|
||||||
},{
|
},{
|
||||||
id: 'eventname', label:'{{ _('Events') }}',
|
id: 'eventname', label:'{{ _('Events') }}',
|
||||||
type:"radio", group: "Definition", cell: 'string',
|
type:"radio", group: "Definition", cell: 'string',
|
||||||
|
@ -283,7 +283,8 @@ function($, _, S, pgAdmin, pgBrowser, Backform, alertify) {
|
|||||||
id: 'tfunction', label:'{{ _('Trigger Function') }}',
|
id: 'tfunction', label:'{{ _('Trigger Function') }}',
|
||||||
type: 'text', disabled: 'inSchemaWithModelCheck',
|
type: 'text', disabled: 'inSchemaWithModelCheck',
|
||||||
mode: ['create','edit', 'properties'], group: '{{ _('Definition') }}',
|
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',
|
id: 'tgargs', label:'{{ _('Arguments') }}', cell: 'string',
|
||||||
group: '{{ _('Definition') }}',
|
group: '{{ _('Definition') }}',
|
||||||
|
@ -126,7 +126,7 @@ function($, _, pgAdmin, Backbone, Backform, Alertify, Node) {
|
|||||||
cache_level,
|
cache_level,
|
||||||
cache_node = this.field.get('cache_node');
|
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')) {
|
if (this.field.has('cache_level')) {
|
||||||
cache_level = this.field.get('cache_level');
|
cache_level = this.field.get('cache_level');
|
||||||
|
Loading…
Reference in New Issue
Block a user