public inbox for [email protected]  
help / color / mirror / Atom feed
[pgAdmin][Patch]: 'Only Table' should be disabled unless table value is changed.
2+ messages / 2 participants
[nested] [flat]

* [pgAdmin][Patch]: 'Only Table' should be disabled unless table value is changed.
@ 2021-10-05 09:32  Pradip Parkale <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Pradip Parkale @ 2021-10-05 09:32 UTC (permalink / raw)
  To: pgadmin-hackers

Hi Hackers,

Please find the attached patch for below issues:

   1.  'Only Table' should be disabled unless table value is changed. Fixes
   #6862.
   2. 'ALTER' statement should not be generated every time a user updates
   the password in edit mode. Fixes #6835
   3. Connection timeout and sslmode value is getting updated
   after subscription update. Fixes #6835.


-- 
Thanks & Regards,
Pradip Parkale
Software Engineer | EnterpriseDB Corporation


Attachments:

  [application/octet-stream] RM6862.patch (5.1K, 3-RM6862.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/databases/publications/static/js/publication.ui.js b/web/pgadmin/browser/server_groups/servers/databases/publications/static/js/publication.ui.js
index 89507f038..c78fb75b0 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/publications/static/js/publication.ui.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/publications/static/js/publication.ui.js
@@ -8,6 +8,7 @@
 //////////////////////////////////////////////////////////////
 import gettext from 'sources/gettext';
 import BaseUISchema from 'sources/SchemaView/base_schema.ui';
+import _ from 'lodash';
 
 
 export class DefaultWithSchema extends BaseUISchema {
@@ -97,9 +98,10 @@ export default class PublicationSchema extends BaseUISchema {
       state.only_table = false;
       return true;
     }
-    if (!_.isUndefined(table) && table.length > 0){
+    if (!_.isUndefined(table) && table.length > 0 && !_.isEqual(this._origData.pubtable, state.pubtable)){
       return false;
     }
+    state.only_table = false;
     return true;
   }
 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/__init__.py
index e1fbdfb5b..13680b987 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/__init__.py
@@ -590,7 +590,7 @@ class SubscriptionView(PGChildNodeView, SchemaDiffObjectCompare):
         required_args = ['name']
 
         required_connection_args = ['host', 'port', 'username', 'db',
-                                    'connect_timeout', 'passfile']
+                                    'connect_timeout', 'passfile', 'sslmode']
 
         # Set connection time out to zero if initial set
         # value is replaced to ''
diff --git a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/static/js/subscription.ui.js b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/static/js/subscription.ui.js
index 635d6f46d..42ab8bbc2 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/static/js/subscription.ui.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/static/js/subscription.ui.js
@@ -163,7 +163,7 @@ export default class SubscriptionSchema extends BaseUISchema{
     {
       id: 'password', label: gettext('Password'), type: 'password', maxlength: null,
       group: gettext('Connection'),
-      mode: ['create', 'edit'],
+      mode: ['create', 'edit'], skipChange: true,
       deps: ['connect_now'],
     },
     {
diff --git a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/templates/subscriptions/sql/default/update.sql b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/templates/subscriptions/sql/default/update.sql
index 04c435a69..cbd2c43ca 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/templates/subscriptions/sql/default/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/templates/subscriptions/sql/default/update.sql
@@ -47,9 +47,9 @@ ALTER SUBSCRIPTION {{ conn|qtIdent(o_data.name) }}
 
 {% endif %}
 {###  Alter subscription connection info ###}
-{% if data.host or data.port or data.username or data.password  or data.db or data.connect_timeout or data.passfile or data.sslmode or data.sslcompression or data.sslcert or data.sslkey or data.sslrootcert or data.sslcrl %}
+{% if data.host or data.port or data.username or data.db or data.connect_timeout or data.passfile or data.sslmode or data.sslcompression or data.sslcert or data.sslkey or data.sslrootcert or data.sslcrl %}
 ALTER SUBSCRIPTION {{ conn|qtIdent(o_data.name) }}
-    CONNECTION 'host={{ o_data.host}} port={{ o_data.port }} user={{ o_data.username }} dbname={{ o_data.db }}{% if data.connect_timeout %} connect_timeout={{ o_data.connect_timeout }}{% endif %}{% if data.passfile %} passfile={{ o_data.passfile }}{% endif %}{% if data.password %} {% if dummy %}password=xxxxxx{% else %} password={{ data.password}}{% endif %}{% endif %}{% if data.sslmode %} sslmode={{ data.sslmode }}{% endif %}{% if data.sslcompression %} sslcompression={{ data.sslcompression }}{% endif %}{% if data.sslcert %} sslcert={{ data.sslcert }}{% endif %}{% if data.sslkey %} sslkey={{ data.sslkey }}{% endif %}{% if data.sslrootcert %} sslrootcert={{ data.sslrootcert }}{% endif %}{% if data.sslcrl %} sslcrl={{ data.sslcrl }}{% endif %}';
+    CONNECTION 'host={{ o_data.host}} port={{ o_data.port }} user={{ o_data.username }} dbname={{ o_data.db }} connect_timeout={{ o_data.connect_timeout }} {% if data.passfile %} passfile={{ o_data.passfile }}{% endif %} sslmode={{ o_data.sslmode }}{% if data.sslcompression %} sslcompression={{ data.sslcompression }}{% endif %}{% if data.sslcert %} sslcert={{ data.sslcert }}{% endif %}{% if data.sslkey %} sslkey={{ data.sslkey }}{% endif %}{% if data.sslrootcert %} sslrootcert={{ data.sslrootcert }}{% endif %}{% if data.sslcrl %} sslcrl={{ data.sslcrl }}{% endif %}';
 {% endif %}
 {###  Alter subscription name ###}
 {% if data.name and data.name != o_data.name %}


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: [pgAdmin][Patch]: 'Only Table' should be disabled unless table value is changed.
@ 2021-10-05 11:55  Akshay Joshi <[email protected]>
  parent: Pradip Parkale <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Akshay Joshi @ 2021-10-05 11:55 UTC (permalink / raw)
  To: Pradip Parkale <[email protected]>; +Cc: pgadmin-hackers

Thanks, the patch applied.

On Tue, Oct 5, 2021 at 3:02 PM Pradip Parkale <
[email protected]> wrote:

> Hi Hackers,
>
> Please find the attached patch for below issues:
>
>    1.  'Only Table' should be disabled unless table value is changed.
>    Fixes #6862.
>    2. 'ALTER' statement should not be generated every time a user updates
>    the password in edit mode. Fixes #6835
>    3. Connection timeout and sslmode value is getting updated
>    after subscription update. Fixes #6835.
>
>
> --
> Thanks & Regards,
> Pradip Parkale
> Software Engineer | EnterpriseDB Corporation
>


-- 
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Principal Software Architect*
*EDB Postgres <http://edbpostgres.com>*

*Mobile: +91 976-788-8246*


^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2021-10-05 11:55 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-10-05 09:32 [pgAdmin][Patch]: 'Only Table' should be disabled unless table value is changed. Pradip Parkale <[email protected]>
2021-10-05 11:55 ` Akshay Joshi <[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