public inbox for [email protected]  
help / color / mirror / Atom feed
From: Aditya Toshniwal <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [pgAdmin][patch] Exclusion constraint and vacuum related fixes
Date: Tue, 5 Oct 2021 13:17:29 +0530
Message-ID: <CAM9w-_k42ZhJzN8+g2X6YGYPxe2KVeBtvK=HQNbOp0M_ex6J8w@mail.gmail.com> (raw)

Hi Hackers,

Please review the attached patch which fixes:
1. Operators dropdown disabled. Fixes #6771.
2. Vacuum options value is not considered for M-SQL when creating. Fixes
#6781.

-- 
Thanks,
Aditya Toshniwal
pgAdmin Hacker | Software Architect | *edbpostgres.com*
<http://edbpostgres.com;
"Don't Complain about Heat, Plant a TREE"


Attachments:

  [application/octet-stream] RM6771_6781.patch (2.5K, 3-RM6771_6781.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/static/js/exclusion_constraint.ui.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/static/js/exclusion_constraint.ui.js
index 3362cd785..bf80244d5 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/static/js/exclusion_constraint.ui.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/static/js/exclusion_constraint.ui.js
@@ -169,7 +169,9 @@ class ExclusionColumnSchema extends BaseUISchema {
     },{
       id: 'operator', label: gettext('Operator'), type: 'select',
       width: 95,
-      editable: obj.isEditable,
+      editable: function() {
+        return obj.isNewExCons;
+      },
       cell: (state)=>{
         return {
           cell: 'select',
diff --git a/web/pgadmin/static/js/SchemaView/index.jsx b/web/pgadmin/static/js/SchemaView/index.jsx
index e5e82b8d7..0f3073e9e 100644
--- a/web/pgadmin/static/js/SchemaView/index.jsx
+++ b/web/pgadmin/static/js/SchemaView/index.jsx
@@ -114,7 +114,7 @@ const diffArrayOptions = {
   compareFunction: objectComparator,
 };
 
-function getChangedData(topSchema, viewHelperProps, sessData, stringify=false) {
+function getChangedData(topSchema, viewHelperProps, sessData, stringify=false, includeSkipChange=true) {
   let changedData = {};
   let isEdit = viewHelperProps.mode === 'edit';
 
@@ -147,8 +147,9 @@ function getChangedData(topSchema, viewHelperProps, sessData, stringify=false) {
       let {modeSupported} = getFieldMetaData(field, schema, {}, viewHelperProps, true);
 
       /* If skipChange is true, then field will not be considered for changed data,
+      This is helpful when Save or Reset should not be enabled on this field change alone.
       No change in other behaviour */
-      if(!modeSupported || field.skipChange) {
+      if(!modeSupported || (field.skipChange && !includeSkipChange)) {
         return;
       }
       if(typeof(field.type) == 'string' && field.type.startsWith('nested-')) {
@@ -477,7 +478,7 @@ function SchemaDialogView({
     if(!isNotValid) setFormErr({});
 
     /* check if anything changed */
-    let changedData = getChangedData(schema, viewHelperProps, sessData);
+    let changedData = getChangedData(schema, viewHelperProps, sessData, false, false);
     let isDataChanged = Object.keys(changedData).length > 0;
     setDirty(isDataChanged);
 


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: [pgAdmin][patch] Exclusion constraint and vacuum related fixes
  In-Reply-To: <CAM9w-_k42ZhJzN8+g2X6YGYPxe2KVeBtvK=HQNbOp0M_ex6J8w@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