public inbox for [email protected]  
help / color / mirror / Atom feed
From: Khushboo Vashi <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [pgAdmin4][Patch] RM 3899 - Unable to Drop Rules for table and foreign table through properties section
Date: Thu, 31 Jan 2019 11:45:44 +0530
Message-ID: <CAFOhELeJnxQD8UAFMMTdOc8i5ojdPzqaKPR1yRRJYAhf+E_odQ@mail.gmail.com> (raw)

Hi,

Please find the attached patch to fix the RM 3899 - Unable to Drop Rules
for table and foreign table through properties section.

Another minor issue fixed with this patch is - while adding/editing the
foreign table, the foreign server cache level has not getting updated that
has been fixed now.

Thanks,
Khushboo


Attachments:

  [application/octet-stream] RM_3899.patch (2.1K, 3-RM_3899.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/static/js/foreign_table.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/static/js/foreign_table.js
index 57b3912e..168da53d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/static/js/foreign_table.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/static/js/foreign_table.js
@@ -523,6 +523,7 @@ define('pgadmin.node.foreign_table', [
 
       },
       model: pgBrowser.Node.Model.extend({
+        idAttribute: 'oid',
         initialize: function(attrs, args) {
           var isNew = (_.size(attrs) === 0);
           if (isNew) {
@@ -571,7 +572,8 @@ define('pgadmin.node.foreign_table', [
           type: 'multiline',
         },{
           id: 'ftsrvname', label: gettext('Foreign server'), cell: 'string', control: 'node-ajax-options',
-          type: 'text', group: gettext('Definition'), url: 'get_foreign_servers', disabled: function(m) { return !m.isNew(); },
+          type: 'text', group: gettext('Definition'), url: 'get_foreign_servers',
+          disabled: function(m) { return !m.isNew(); }, cache_node: 'database',
         },{
           id: 'inherits', label: gettext('Inherits'), group: gettext('Definition'),
           type: 'array', min_version: 90500, control: NodeAjaxOptionsMultipleControl,
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/rules/static/js/rule.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/rules/static/js/rule.js
index 3016f042..1e3d0111 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/rules/static/js/rule.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/rules/static/js/rule.js
@@ -125,6 +125,7 @@ define('pgadmin.node.rule', [
         properties of the model in schema.
        */
       model: pgAdmin.Browser.Node.Model.extend({
+        idAttribute: 'oid',
         schema: [{
           id: 'name', label: gettext('Name'),
           type: 'text', disabled: function(m) {


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][Patch] RM 3899 - Unable to Drop Rules for table and foreign table through properties section
  In-Reply-To: <CAFOhELeJnxQD8UAFMMTdOc8i5ojdPzqaKPR1yRRJYAhf+E_odQ@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