public inbox for [email protected]  
help / color / mirror / Atom feed
[patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue
10+ messages / 2 participants
[nested] [flat]

* [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue
@ 2021-09-16 13:09 Rahul Shirsat <[email protected]>
  2021-09-17 15:25 ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Akshay Joshi <[email protected]>
  0 siblings, 1 reply; 10+ messages in thread

From: Rahul Shirsat @ 2021-09-16 13:09 UTC (permalink / raw)
  To: pgadmin-hackers

Hi Hackers,

Please find the attached patch which resolves the below issue:

1. Enum Type - Unable to delete rows for Enum type in Create Type dialogue.
2. Range Type - Loading icons are shown in different drop down tabs.

-- 
*Rahul Shirsat*
Senior Software Engineer | EnterpriseDB Corporation.


Attachments:

  [application/octet-stream] RM6744.patch (4.8K, 3-RM6744.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/static/js/catalog.ui.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/static/js/catalog.ui.js
index c31422185..e5afea0c2 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/static/js/catalog.ui.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/static/js/catalog.ui.js
@@ -9,7 +9,6 @@
 
 import gettext from 'sources/gettext';
 import BaseUISchema from 'sources/SchemaView/base_schema.ui';
-import SecLabelSchema from '../../../../static/js/sec_label.ui';
 
 export default class CatalogSchema extends BaseUISchema {
   constructor(fieldOptions = {}, initValues) {
@@ -51,14 +50,7 @@ export default class CatalogSchema extends BaseUISchema {
       },{
         id: 'description', label: gettext('Comment'), cell: 'string',
         type: 'multiline',
-      },{
-        id: 'seclabels', label: gettext('Security labels'),
-        schema: new SecLabelSchema(),
-        editable: false, type: 'collection',
-        group: gettext('Security'), mode: ['edit', 'create'],
-        min_version: 90200,
-        canAdd: false, canEdit: false, canDelete: false,
-      },
+      }
     ];
   }
 }
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.ui.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.ui.js
index 16d13816b..d989ce6e2 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.ui.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.ui.js
@@ -54,6 +54,8 @@ function getRangeSchema(nodeObj, treeNodeInfo, itemNodeData) {
             }).catch((err)=>{
               reject(err);
             });
+          } else {
+            resolve(data);
           }
         });
       },
@@ -80,6 +82,8 @@ function getRangeSchema(nodeObj, treeNodeInfo, itemNodeData) {
             }).catch((err)=>{
               reject(err);
             });
+          } else {
+            resolve(data);
           }
         });
       },
@@ -107,6 +111,8 @@ function getRangeSchema(nodeObj, treeNodeInfo, itemNodeData) {
             }).catch((err)=>{
               reject(err);
             });
+          } else {
+            resolve(data);
           }
         });
       },
@@ -157,11 +163,10 @@ class EnumerationSchema extends BaseUISchema {
     return [
       {
         id: 'label', label: gettext('Label'),
-        type: 'text',  cell: 'text',
-        cellHeaderClasses: 'width_percent_99',
-        readonly: function (state) {
-          return !obj.isNew(state);
-        },
+        type: 'text', cell: 'text', minWidth: 640,
+        editable: (state) => {
+          return _.isUndefined(obj.isNew) ? true : obj.isNew(state);
+        }
       }
     ];
   }
@@ -1313,6 +1318,24 @@ export default class TypeSchema extends BaseUISchema {
     this.nodeInfo = this.fieldOptions.node_info;
   }
 
+  isInvalidColumnAdded(state) {
+
+    let tempCol = _.map(state.enum, 'label');
+    let dontAddColumn = false;
+
+    if(tempCol.length == 1 && tempCol[0] == undefined) {
+      dontAddColumn = true;
+    } else {
+      tempCol.forEach(function(enumVal) {
+        if(enumVal == undefined) {
+          dontAddColumn = true;
+          return;
+        }
+      });
+    }
+    return dontAddColumn;
+  }
+
   schemaCheck(state) {
     if(this.fieldOptions.node_info && 'schema' in this.fieldOptions.node_info)
     {
@@ -1420,14 +1443,17 @@ export default class TypeSchema extends BaseUISchema {
     {
       id: 'enum', label: gettext('Enumeration type'),
       schema: new EnumerationSchema(),
-      editable: true,
       type: 'collection',
       group: gettext('Definition'), mode: ['edit', 'create'],
-      canAdd: true,  canEdit: false,
-      canDelete: function(state) {
+      canAddRow: function(state) {
+        return !obj.isInvalidColumnAdded(state);
+      },
+      canEdit: false,
+      canDeleteRow: function(state) {
         // We will disable it if it's in 'edit' mode
-        return !obj.isNew(state);
+        return obj.isNew(state);
       },
+      canEditRow: false,
       disabled: () => obj.inCatalog(),
       deps: ['typtype'],
       uniqueCol : ['label'],
diff --git a/web/pgadmin/browser/static/js/node_view.jsx b/web/pgadmin/browser/static/js/node_view.jsx
index cab909d1f..1aa8dc42b 100644
--- a/web/pgadmin/browser/static/js/node_view.jsx
+++ b/web/pgadmin/browser/static/js/node_view.jsx
@@ -173,7 +173,8 @@ export function getNodeView(nodeType, treeNodeInfo, actionType, itemNodeData, fo
 
   let schema = nodeObj.getSchema.call(nodeObj, treeNodeInfo, itemNodeData);
   // Show/Hide security group for nodes under the catalog
-  if('catalog' in treeNodeInfo) {
+  if('catalog' in treeNodeInfo
+    && formType !== 'tab') {
     schema.filterGroups = [gettext('Security')];
   }
 


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

* Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue
  2021-09-16 13:09 [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Rahul Shirsat <[email protected]>
@ 2021-09-17 15:25 ` Akshay Joshi <[email protected]>
  2021-09-20 07:36   ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Rahul Shirsat <[email protected]>
  0 siblings, 1 reply; 10+ messages in thread

From: Akshay Joshi @ 2021-09-17 15:25 UTC (permalink / raw)
  To: Rahul Shirsat <[email protected]>; +Cc: pgadmin-hackers

Hi Rahul

Patch not applied, rebase and send the patch again.

On Thu, Sep 16, 2021 at 6:39 PM Rahul Shirsat <
[email protected]> wrote:

> Hi Hackers,
>
> Please find the attached patch which resolves the below issue:
>
> 1. Enum Type - Unable to delete rows for Enum type in Create Type dialogue.
> 2. Range Type - Loading icons are shown in different drop down tabs.
>
> --
> *Rahul Shirsat*
> Senior 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] 10+ messages in thread

* Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue
  2021-09-16 13:09 [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Rahul Shirsat <[email protected]>
  2021-09-17 15:25 ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Akshay Joshi <[email protected]>
@ 2021-09-20 07:36   ` Rahul Shirsat <[email protected]>
  2021-09-20 07:43     ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Akshay Joshi <[email protected]>
  0 siblings, 1 reply; 10+ messages in thread

From: Rahul Shirsat @ 2021-09-20 07:36 UTC (permalink / raw)
  To: Akshay Joshi <[email protected]>; +Cc: pgadmin-hackers

Hi Akshay,

Please find the updated patch.

On Fri, Sep 17, 2021 at 8:55 PM Akshay Joshi <[email protected]>
wrote:

> Hi Rahul
>
> Patch not applied, rebase and send the patch again.
>
> On Thu, Sep 16, 2021 at 6:39 PM Rahul Shirsat <
> [email protected]> wrote:
>
>> Hi Hackers,
>>
>> Please find the attached patch which resolves the below issue:
>>
>> 1. Enum Type - Unable to delete rows for Enum type in Create Type
>> dialogue.
>> 2. Range Type - Loading icons are shown in different drop down tabs.
>>
>> --
>> *Rahul Shirsat*
>> Senior Software Engineer | EnterpriseDB Corporation.
>>
>
>
> --
> *Thanks & Regards*
> *Akshay Joshi*
> *pgAdmin Hacker | Principal Software Architect*
> *EDB Postgres <http://edbpostgres.com>*
>
> *Mobile: +91 976-788-8246*
>


-- 
*Rahul Shirsat*
Senior Software Engineer | EnterpriseDB Corporation.


Attachments:

  [application/x-patch] RM6744_v2.patch (3.0K, 3-RM6744_v2.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.ui.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.ui.js
index 16d13816b..d989ce6e2 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.ui.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.ui.js
@@ -54,6 +54,8 @@ function getRangeSchema(nodeObj, treeNodeInfo, itemNodeData) {
             }).catch((err)=>{
               reject(err);
             });
+          } else {
+            resolve(data);
           }
         });
       },
@@ -80,6 +82,8 @@ function getRangeSchema(nodeObj, treeNodeInfo, itemNodeData) {
             }).catch((err)=>{
               reject(err);
             });
+          } else {
+            resolve(data);
           }
         });
       },
@@ -107,6 +111,8 @@ function getRangeSchema(nodeObj, treeNodeInfo, itemNodeData) {
             }).catch((err)=>{
               reject(err);
             });
+          } else {
+            resolve(data);
           }
         });
       },
@@ -157,11 +163,10 @@ class EnumerationSchema extends BaseUISchema {
     return [
       {
         id: 'label', label: gettext('Label'),
-        type: 'text',  cell: 'text',
-        cellHeaderClasses: 'width_percent_99',
-        readonly: function (state) {
-          return !obj.isNew(state);
-        },
+        type: 'text', cell: 'text', minWidth: 640,
+        editable: (state) => {
+          return _.isUndefined(obj.isNew) ? true : obj.isNew(state);
+        }
       }
     ];
   }
@@ -1313,6 +1318,24 @@ export default class TypeSchema extends BaseUISchema {
     this.nodeInfo = this.fieldOptions.node_info;
   }
 
+  isInvalidColumnAdded(state) {
+
+    let tempCol = _.map(state.enum, 'label');
+    let dontAddColumn = false;
+
+    if(tempCol.length == 1 && tempCol[0] == undefined) {
+      dontAddColumn = true;
+    } else {
+      tempCol.forEach(function(enumVal) {
+        if(enumVal == undefined) {
+          dontAddColumn = true;
+          return;
+        }
+      });
+    }
+    return dontAddColumn;
+  }
+
   schemaCheck(state) {
     if(this.fieldOptions.node_info && 'schema' in this.fieldOptions.node_info)
     {
@@ -1420,14 +1443,17 @@ export default class TypeSchema extends BaseUISchema {
     {
       id: 'enum', label: gettext('Enumeration type'),
       schema: new EnumerationSchema(),
-      editable: true,
       type: 'collection',
       group: gettext('Definition'), mode: ['edit', 'create'],
-      canAdd: true,  canEdit: false,
-      canDelete: function(state) {
+      canAddRow: function(state) {
+        return !obj.isInvalidColumnAdded(state);
+      },
+      canEdit: false,
+      canDeleteRow: function(state) {
         // We will disable it if it's in 'edit' mode
-        return !obj.isNew(state);
+        return obj.isNew(state);
       },
+      canEditRow: false,
       disabled: () => obj.inCatalog(),
       deps: ['typtype'],
       uniqueCol : ['label'],


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

* Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue
  2021-09-16 13:09 [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Rahul Shirsat <[email protected]>
  2021-09-17 15:25 ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Akshay Joshi <[email protected]>
  2021-09-20 07:36   ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Rahul Shirsat <[email protected]>
@ 2021-09-20 07:43     ` Akshay Joshi <[email protected]>
  2021-09-30 08:15       ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Rahul Shirsat <[email protected]>
  0 siblings, 1 reply; 10+ messages in thread

From: Akshay Joshi @ 2021-09-20 07:43 UTC (permalink / raw)
  To: Rahul Shirsat <[email protected]>; +Cc: pgadmin-hackers

Thanks, the patch applied.

On Mon, Sep 20, 2021 at 1:06 PM Rahul Shirsat <
[email protected]> wrote:

> Hi Akshay,
>
> Please find the updated patch.
>
> On Fri, Sep 17, 2021 at 8:55 PM Akshay Joshi <
> [email protected]> wrote:
>
>> Hi Rahul
>>
>> Patch not applied, rebase and send the patch again.
>>
>> On Thu, Sep 16, 2021 at 6:39 PM Rahul Shirsat <
>> [email protected]> wrote:
>>
>>> Hi Hackers,
>>>
>>> Please find the attached patch which resolves the below issue:
>>>
>>> 1. Enum Type - Unable to delete rows for Enum type in Create Type
>>> dialogue.
>>> 2. Range Type - Loading icons are shown in different drop down tabs.
>>>
>>> --
>>> *Rahul Shirsat*
>>> Senior Software Engineer | EnterpriseDB Corporation.
>>>
>>
>>
>> --
>> *Thanks & Regards*
>> *Akshay Joshi*
>> *pgAdmin Hacker | Principal Software Architect*
>> *EDB Postgres <http://edbpostgres.com>*
>>
>> *Mobile: +91 976-788-8246*
>>
>
>
> --
> *Rahul Shirsat*
> Senior 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] 10+ messages in thread

* Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue
  2021-09-16 13:09 [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Rahul Shirsat <[email protected]>
  2021-09-17 15:25 ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Akshay Joshi <[email protected]>
  2021-09-20 07:36   ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Rahul Shirsat <[email protected]>
  2021-09-20 07:43     ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Akshay Joshi <[email protected]>
@ 2021-09-30 08:15       ` Rahul Shirsat <[email protected]>
  2021-09-30 10:02         ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Akshay Joshi <[email protected]>
  0 siblings, 1 reply; 10+ messages in thread

From: Rahul Shirsat @ 2021-09-30 08:15 UTC (permalink / raw)
  To: Akshay Joshi <[email protected]>; +Cc: pgadmin-hackers

Hi Hackers,

Please find the attached patch for fixing some additional issues.

On Mon, Sep 20, 2021 at 1:13 PM Akshay Joshi <[email protected]>
wrote:

> Thanks, the patch applied.
>
> On Mon, Sep 20, 2021 at 1:06 PM Rahul Shirsat <
> [email protected]> wrote:
>
>> Hi Akshay,
>>
>> Please find the updated patch.
>>
>> On Fri, Sep 17, 2021 at 8:55 PM Akshay Joshi <
>> [email protected]> wrote:
>>
>>> Hi Rahul
>>>
>>> Patch not applied, rebase and send the patch again.
>>>
>>> On Thu, Sep 16, 2021 at 6:39 PM Rahul Shirsat <
>>> [email protected]> wrote:
>>>
>>>> Hi Hackers,
>>>>
>>>> Please find the attached patch which resolves the below issue:
>>>>
>>>> 1. Enum Type - Unable to delete rows for Enum type in Create Type
>>>> dialogue.
>>>> 2. Range Type - Loading icons are shown in different drop down tabs.
>>>>
>>>> --
>>>> *Rahul Shirsat*
>>>> Senior Software Engineer | EnterpriseDB Corporation.
>>>>
>>>
>>>
>>> --
>>> *Thanks & Regards*
>>> *Akshay Joshi*
>>> *pgAdmin Hacker | Principal Software Architect*
>>> *EDB Postgres <http://edbpostgres.com>*
>>>
>>> *Mobile: +91 976-788-8246*
>>>
>>
>>
>> --
>> *Rahul Shirsat*
>> Senior Software Engineer | EnterpriseDB Corporation.
>>
>
>
> --
> *Thanks & Regards*
> *Akshay Joshi*
> *pgAdmin Hacker | Principal Software Architect*
> *EDB Postgres <http://edbpostgres.com>*
>
> *Mobile: +91 976-788-8246*
>


-- 
*Rahul Shirsat*
Senior Software Engineer | EnterpriseDB Corporation.


Attachments:

  [application/octet-stream] RM6744_v3.patch (7.9K, 3-RM6744_v3.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.ui.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.ui.js
index bf8ba3d54..14e385f76 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.ui.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.ui.js
@@ -14,7 +14,7 @@ import SecLabelSchema from '../../../../../static/js/sec_label.ui';
 import { getNodeAjaxOptions } from '../../../../../../../static/js/node_ajax';
 import _ from 'underscore';
 import getApiInstance from 'sources/api_instance';
-import { isEmptyString, integerValidator } from 'sources/validators';
+import { isEmptyString } from 'sources/validators';
 
 
 function getCompositeSchema(nodeObj, treeNodeInfo, itemNodeData) {
@@ -69,9 +69,9 @@ function getRangeSchema(nodeObj, treeNodeInfo, itemNodeData) {
               null, 'get_canonical', itemNodeData, false,
               treeNodeInfo,
             ]);
-          var data;
+          var data = [];
 
-          if(!_.isUndefined(name) && name != ''){
+          if(!_.isUndefined(name) && name != '' && name != null){
             api.get(_url, {
               params: {
                 'name' : name
@@ -1051,35 +1051,10 @@ class CompositeSchema extends BaseUISchema {
       setError('type', errmsg);
       return true;
     }
-    if(state.is_tlength) {
-
-      if (state.tlength < state.min_val) {
-        errmsg = gettext('Length/Precision should not be less than %s.', state.min_val);
-      }
-      else if (state.tlength > state.max_val) {
-        errmsg = gettext('Length/Precision should not be greater than %s.', state.max_val);
-      }
-      if(_.isUndefined(errmsg) || errmsg == null)
-        errmsg = integerValidator('Length/Precision', state.tlength);
-      // If we have any error set then throw it to user
-      if(!_.isUndefined(errmsg) && errmsg != null) {
-        setError('tlength', errmsg);
-        return true;
-      }
-    }
-    if(state.is_precision) {
-      errmsg = integerValidator('Scale', state.precision);
-      if(!_.isUndefined(errmsg) && errmsg != null) {
-        setError('precision', errmsg);
-        return true;
-      }
-    }
     if(_.isUndefined(errmsg) || errmsg == null) {
       errmsg = null;
       setError('member_name', errmsg);
       setError('type', errmsg);
-      setError('tlength', errmsg);
-      setError('precision', errmsg);
     }
     return false;
   }
@@ -1122,7 +1097,7 @@ class DataTypeSchema extends BaseUISchema {
       id: 'type',
       label: gettext('Data Type'),
       group: gettext('Definition'),
-      mode: ['edit', 'create','properties'],
+      mode: ['edit', 'create'],
       disabled: false,
       readonly: function (state) {
         return !dataTypeObj.isNew(state);
@@ -1158,7 +1133,7 @@ class DataTypeSchema extends BaseUISchema {
       type: 'int',
       deps: ['typtype'],
       cell: 'int',
-      mode: ['create', 'edit','properties'],
+      mode: ['create', 'edit'],
       readonly: function (state) {
         return !dataTypeObj.isNew(state);
       },
@@ -1172,7 +1147,7 @@ class DataTypeSchema extends BaseUISchema {
       id: 'tlength',
       group: gettext('Data Type'),
       label: gettext('Length/Precision'),
-      mode: ['edit', 'create','properties'],
+      mode: ['edit', 'create'],
       deps: ['type'],
       type: 'text',
       cell: 'int',
@@ -1234,7 +1209,7 @@ class DataTypeSchema extends BaseUISchema {
       id: 'precision',
       group: gettext('Data Type'),
       label: gettext('Scale'),
-      mode: ['edit', 'create','properties'],
+      mode: ['edit', 'create'],
       deps: ['type'],
       type: 'text',
       readonly: function (state) {
@@ -1465,7 +1440,7 @@ export default class TypeSchema extends BaseUISchema {
       group: gettext('Definition'),
       label: '',
       deps: ['typtype'],
-      mode: ['edit', 'create', 'properties'],
+      mode: ['edit', 'create'],
       visible: function(state) {
         return state.typtype === 'N' || state.typtype === 'V';
       },
@@ -1594,6 +1569,50 @@ export default class TypeSchema extends BaseUISchema {
         return false;
       },
     },
+    {
+      id: 'type', label: gettext('Data Type'), cell: 'string',
+      type: 'text', mode: ['properties'], group: gettext('Definition'),
+      disabled: () => obj.inCatalog(),
+      visible: function(state) {
+        if(state.typtype === 'N' || state.typtype === 'V') {
+          return true;
+        }
+        return false;
+      }
+    },
+    {
+      id: 'tlength', label: gettext('Length/Precision'), cell: 'string',
+      type: 'text', mode: ['properties'], group: gettext('Definition'),
+      disabled: () => obj.inCatalog(),
+      visible: function(state) {
+        if(state.typtype === 'N') {
+          return true;
+        }
+        return false;
+      }
+    },
+    {
+      id: 'precision', label: gettext('Scale'), cell: 'string',
+      type: 'text', mode: ['properties'], group: gettext('Definition'),
+      disabled: () => obj.inCatalog(),
+      visible: function(state) {
+        if(state.typtype === 'N') {
+          return true;
+        }
+        return false;
+      }
+    },
+    {
+      id: 'maxsize', label: gettext('Size'), cell: 'string',
+      type: 'text', mode: ['properties'], group: gettext('Definition'),
+      disabled: () => obj.inCatalog(),
+      visible: function(state) {
+        if(state.typtype === 'V') {
+          return true;
+        }
+        return false;
+      }
+    },
     {
       id: 'type_acl', label: gettext('Privileges'), cell: 'string',
       type: 'text', mode: ['properties'], group: gettext('Security'),
diff --git a/web/regression/javascript/schema_ui_files/type.ui.spec.js b/web/regression/javascript/schema_ui_files/type.ui.spec.js
index 33998f09a..70188aca8 100644
--- a/web/regression/javascript/schema_ui_files/type.ui.spec.js
+++ b/web/regression/javascript/schema_ui_files/type.ui.spec.js
@@ -15,8 +15,6 @@ import {messages} from '../fake_messages';
 import { createMount } from '@material-ui/core/test-utils';
 import SchemaView from '../../../pgadmin/static/js/SchemaView';
 import * as nodeAjax from '../../../pgadmin/browser/static/js/node_ajax';
-import gettext from 'sources/gettext';
-import { integerValidator } from 'sources/validators';
 import { getNodePrivilegeRoleSchema } from '../../../pgadmin/browser/server_groups/servers/static/js/privilege.ui';
 
 import TypeSchema, { EnumerationSchema, getCompositeSchema, getExternalSchema, getRangeSchema, getDataTypeSchema } from '../../../pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.ui';
@@ -105,32 +103,6 @@ describe('TypeSchema', ()=>{
       state.member_name = 'demo_member';
       compositeCollObj.validate(state, setError);
       expect(setError).toHaveBeenCalledWith('type', 'Please specify the type.');
-
-      state.type = 'char';
-      state.min_val = 10;
-      state.max_val = 100;
-      state.is_tlength = true;
-      state.tlength = 9;
-      compositeCollObj.validate(state, setError);
-      expect(setError).toHaveBeenCalledWith('tlength', gettext('Length/Precision should not be less than %s.', state.min_val));
-
-      state.tlength = 200;
-      compositeCollObj.validate(state, setError);
-      expect(setError).toHaveBeenCalledWith('tlength', gettext('Length/Precision should not be greater than %s.', state.max_val));
-
-      state.tlength = 'ert';
-      compositeCollObj.validate(state, setError);
-      expect(setError).toHaveBeenCalledWith('tlength', integerValidator('Length/Precision', state.tlength));
-
-      state.tlength = 90;
-      state.is_precision = true;
-      state.precision = 'ert';
-      compositeCollObj.validate(state, setError);
-      expect(setError).toHaveBeenCalledWith('precision', integerValidator('Scale', state.precision));
-
-      state.precision = 9;
-      compositeCollObj.validate(state, setError);
-      expect(setError).toHaveBeenCalled();
     });
 
     it('tlength editable', ()=>{


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

* Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue
  2021-09-16 13:09 [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Rahul Shirsat <[email protected]>
  2021-09-17 15:25 ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Akshay Joshi <[email protected]>
  2021-09-20 07:36   ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Rahul Shirsat <[email protected]>
  2021-09-20 07:43     ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Akshay Joshi <[email protected]>
  2021-09-30 08:15       ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Rahul Shirsat <[email protected]>
@ 2021-09-30 10:02         ` Akshay Joshi <[email protected]>
  2021-10-04 13:04           ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Rahul Shirsat <[email protected]>
  0 siblings, 1 reply; 10+ messages in thread

From: Akshay Joshi @ 2021-09-30 10:02 UTC (permalink / raw)
  To: Rahul Shirsat <[email protected]>; +Cc: pgadmin-hackers

Thanks, the patch applied.

On Thu, Sep 30, 2021 at 1:46 PM Rahul Shirsat <
[email protected]> wrote:

> Hi Hackers,
>
> Please find the attached patch for fixing some additional issues.
>
> On Mon, Sep 20, 2021 at 1:13 PM Akshay Joshi <
> [email protected]> wrote:
>
>> Thanks, the patch applied.
>>
>> On Mon, Sep 20, 2021 at 1:06 PM Rahul Shirsat <
>> [email protected]> wrote:
>>
>>> Hi Akshay,
>>>
>>> Please find the updated patch.
>>>
>>> On Fri, Sep 17, 2021 at 8:55 PM Akshay Joshi <
>>> [email protected]> wrote:
>>>
>>>> Hi Rahul
>>>>
>>>> Patch not applied, rebase and send the patch again.
>>>>
>>>> On Thu, Sep 16, 2021 at 6:39 PM Rahul Shirsat <
>>>> [email protected]> wrote:
>>>>
>>>>> Hi Hackers,
>>>>>
>>>>> Please find the attached patch which resolves the below issue:
>>>>>
>>>>> 1. Enum Type - Unable to delete rows for Enum type in Create Type
>>>>> dialogue.
>>>>> 2. Range Type - Loading icons are shown in different drop down tabs.
>>>>>
>>>>> --
>>>>> *Rahul Shirsat*
>>>>> Senior Software Engineer | EnterpriseDB Corporation.
>>>>>
>>>>
>>>>
>>>> --
>>>> *Thanks & Regards*
>>>> *Akshay Joshi*
>>>> *pgAdmin Hacker | Principal Software Architect*
>>>> *EDB Postgres <http://edbpostgres.com>*
>>>>
>>>> *Mobile: +91 976-788-8246*
>>>>
>>>
>>>
>>> --
>>> *Rahul Shirsat*
>>> Senior Software Engineer | EnterpriseDB Corporation.
>>>
>>
>>
>> --
>> *Thanks & Regards*
>> *Akshay Joshi*
>> *pgAdmin Hacker | Principal Software Architect*
>> *EDB Postgres <http://edbpostgres.com>*
>>
>> *Mobile: +91 976-788-8246*
>>
>
>
> --
> *Rahul Shirsat*
> Senior 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] 10+ messages in thread

* Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue
  2021-09-16 13:09 [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Rahul Shirsat <[email protected]>
  2021-09-17 15:25 ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Akshay Joshi <[email protected]>
  2021-09-20 07:36   ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Rahul Shirsat <[email protected]>
  2021-09-20 07:43     ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Akshay Joshi <[email protected]>
  2021-09-30 08:15       ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Rahul Shirsat <[email protected]>
  2021-09-30 10:02         ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Akshay Joshi <[email protected]>
@ 2021-10-04 13:04           ` Rahul Shirsat <[email protected]>
  2021-10-04 14:11             ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Akshay Joshi <[email protected]>
  0 siblings, 1 reply; 10+ messages in thread

From: Rahul Shirsat @ 2021-10-04 13:04 UTC (permalink / raw)
  To: Akshay Joshi <[email protected]>; +Cc: pgadmin-hackers

Hi Hackers,

Please find the attached patch which resolves one more additional issue
reported by Aditya.

On Thu, Sep 30, 2021 at 3:32 PM Akshay Joshi <[email protected]>
wrote:

> Thanks, the patch applied.
>
> On Thu, Sep 30, 2021 at 1:46 PM Rahul Shirsat <
> [email protected]> wrote:
>
>> Hi Hackers,
>>
>> Please find the attached patch for fixing some additional issues.
>>
>> On Mon, Sep 20, 2021 at 1:13 PM Akshay Joshi <
>> [email protected]> wrote:
>>
>>> Thanks, the patch applied.
>>>
>>> On Mon, Sep 20, 2021 at 1:06 PM Rahul Shirsat <
>>> [email protected]> wrote:
>>>
>>>> Hi Akshay,
>>>>
>>>> Please find the updated patch.
>>>>
>>>> On Fri, Sep 17, 2021 at 8:55 PM Akshay Joshi <
>>>> [email protected]> wrote:
>>>>
>>>>> Hi Rahul
>>>>>
>>>>> Patch not applied, rebase and send the patch again.
>>>>>
>>>>> On Thu, Sep 16, 2021 at 6:39 PM Rahul Shirsat <
>>>>> [email protected]> wrote:
>>>>>
>>>>>> Hi Hackers,
>>>>>>
>>>>>> Please find the attached patch which resolves the below issue:
>>>>>>
>>>>>> 1. Enum Type - Unable to delete rows for Enum type in Create Type
>>>>>> dialogue.
>>>>>> 2. Range Type - Loading icons are shown in different drop down tabs.
>>>>>>
>>>>>> --
>>>>>> *Rahul Shirsat*
>>>>>> Senior Software Engineer | EnterpriseDB Corporation.
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> *Thanks & Regards*
>>>>> *Akshay Joshi*
>>>>> *pgAdmin Hacker | Principal Software Architect*
>>>>> *EDB Postgres <http://edbpostgres.com>*
>>>>>
>>>>> *Mobile: +91 976-788-8246*
>>>>>
>>>>
>>>>
>>>> --
>>>> *Rahul Shirsat*
>>>> Senior Software Engineer | EnterpriseDB Corporation.
>>>>
>>>
>>>
>>> --
>>> *Thanks & Regards*
>>> *Akshay Joshi*
>>> *pgAdmin Hacker | Principal Software Architect*
>>> *EDB Postgres <http://edbpostgres.com>*
>>>
>>> *Mobile: +91 976-788-8246*
>>>
>>
>>
>> --
>> *Rahul Shirsat*
>> Senior Software Engineer | EnterpriseDB Corporation.
>>
>
>
> --
> *Thanks & Regards*
> *Akshay Joshi*
> *pgAdmin Hacker | Principal Software Architect*
> *EDB Postgres <http://edbpostgres.com>*
>
> *Mobile: +91 976-788-8246*
>


-- 
*Rahul Shirsat*
Senior Software Engineer | EnterpriseDB Corporation.


Attachments:

  [application/octet-stream] RM6744_v4.patch (724B, 3-RM6744_v4.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.ui.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.ui.js
index 14e385f76..bb9f82a7f 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.ui.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.ui.js
@@ -1640,7 +1640,7 @@ export default class TypeSchema extends BaseUISchema {
         if (state.typtype === 'p') {
           var acl = state.typacl;
           if(acl && acl.length > 0)
-            acl.reset();
+            acl.splice(0, acl.length);
         }
         return (state.typtype !== 'p');
       },


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

* Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue
  2021-09-16 13:09 [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Rahul Shirsat <[email protected]>
  2021-09-17 15:25 ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Akshay Joshi <[email protected]>
  2021-09-20 07:36   ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Rahul Shirsat <[email protected]>
  2021-09-20 07:43     ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Akshay Joshi <[email protected]>
  2021-09-30 08:15       ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Rahul Shirsat <[email protected]>
  2021-09-30 10:02         ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Akshay Joshi <[email protected]>
  2021-10-04 13:04           ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Rahul Shirsat <[email protected]>
@ 2021-10-04 14:11             ` Akshay Joshi <[email protected]>
  2021-10-05 10:42               ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Rahul Shirsat <[email protected]>
  0 siblings, 1 reply; 10+ messages in thread

From: Akshay Joshi @ 2021-10-04 14:11 UTC (permalink / raw)
  To: Rahul Shirsat <[email protected]>; +Cc: pgadmin-hackers

Thanks, the patch applied.

On Mon, Oct 4, 2021 at 6:34 PM Rahul Shirsat <[email protected]>
wrote:

> Hi Hackers,
>
> Please find the attached patch which resolves one more additional issue
> reported by Aditya.
>
> On Thu, Sep 30, 2021 at 3:32 PM Akshay Joshi <
> [email protected]> wrote:
>
>> Thanks, the patch applied.
>>
>> On Thu, Sep 30, 2021 at 1:46 PM Rahul Shirsat <
>> [email protected]> wrote:
>>
>>> Hi Hackers,
>>>
>>> Please find the attached patch for fixing some additional issues.
>>>
>>> On Mon, Sep 20, 2021 at 1:13 PM Akshay Joshi <
>>> [email protected]> wrote:
>>>
>>>> Thanks, the patch applied.
>>>>
>>>> On Mon, Sep 20, 2021 at 1:06 PM Rahul Shirsat <
>>>> [email protected]> wrote:
>>>>
>>>>> Hi Akshay,
>>>>>
>>>>> Please find the updated patch.
>>>>>
>>>>> On Fri, Sep 17, 2021 at 8:55 PM Akshay Joshi <
>>>>> [email protected]> wrote:
>>>>>
>>>>>> Hi Rahul
>>>>>>
>>>>>> Patch not applied, rebase and send the patch again.
>>>>>>
>>>>>> On Thu, Sep 16, 2021 at 6:39 PM Rahul Shirsat <
>>>>>> [email protected]> wrote:
>>>>>>
>>>>>>> Hi Hackers,
>>>>>>>
>>>>>>> Please find the attached patch which resolves the below issue:
>>>>>>>
>>>>>>> 1. Enum Type - Unable to delete rows for Enum type in Create Type
>>>>>>> dialogue.
>>>>>>> 2. Range Type - Loading icons are shown in different drop down tabs.
>>>>>>>
>>>>>>> --
>>>>>>> *Rahul Shirsat*
>>>>>>> Senior Software Engineer | EnterpriseDB Corporation.
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> *Thanks & Regards*
>>>>>> *Akshay Joshi*
>>>>>> *pgAdmin Hacker | Principal Software Architect*
>>>>>> *EDB Postgres <http://edbpostgres.com>*
>>>>>>
>>>>>> *Mobile: +91 976-788-8246*
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> *Rahul Shirsat*
>>>>> Senior Software Engineer | EnterpriseDB Corporation.
>>>>>
>>>>
>>>>
>>>> --
>>>> *Thanks & Regards*
>>>> *Akshay Joshi*
>>>> *pgAdmin Hacker | Principal Software Architect*
>>>> *EDB Postgres <http://edbpostgres.com>*
>>>>
>>>> *Mobile: +91 976-788-8246*
>>>>
>>>
>>>
>>> --
>>> *Rahul Shirsat*
>>> Senior Software Engineer | EnterpriseDB Corporation.
>>>
>>
>>
>> --
>> *Thanks & Regards*
>> *Akshay Joshi*
>> *pgAdmin Hacker | Principal Software Architect*
>> *EDB Postgres <http://edbpostgres.com>*
>>
>> *Mobile: +91 976-788-8246*
>>
>
>
> --
> *Rahul Shirsat*
> Senior 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] 10+ messages in thread

* Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue
  2021-09-16 13:09 [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Rahul Shirsat <[email protected]>
  2021-09-17 15:25 ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Akshay Joshi <[email protected]>
  2021-09-20 07:36   ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Rahul Shirsat <[email protected]>
  2021-09-20 07:43     ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Akshay Joshi <[email protected]>
  2021-09-30 08:15       ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Rahul Shirsat <[email protected]>
  2021-09-30 10:02         ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Akshay Joshi <[email protected]>
  2021-10-04 13:04           ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Rahul Shirsat <[email protected]>
  2021-10-04 14:11             ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Akshay Joshi <[email protected]>
@ 2021-10-05 10:42               ` Rahul Shirsat <[email protected]>
  2021-10-05 11:54                 ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Akshay Joshi <[email protected]>
  0 siblings, 1 reply; 10+ messages in thread

From: Rahul Shirsat @ 2021-10-05 10:42 UTC (permalink / raw)
  To: Akshay Joshi <[email protected]>; +Cc: pgadmin-hackers

Hi Hackers,

Please find the attached patch which resolves the issues sec label & type
changing issue.

Additionally, while testing the workflow, fixed one issue related to
composite type added with minimum one type and then changing the Type.

On Mon, Oct 4, 2021 at 7:41 PM Akshay Joshi <[email protected]>
wrote:

> Thanks, the patch applied.
>
> On Mon, Oct 4, 2021 at 6:34 PM Rahul Shirsat <
> [email protected]> wrote:
>
>> Hi Hackers,
>>
>> Please find the attached patch which resolves one more additional issue
>> reported by Aditya.
>>
>> On Thu, Sep 30, 2021 at 3:32 PM Akshay Joshi <
>> [email protected]> wrote:
>>
>>> Thanks, the patch applied.
>>>
>>> On Thu, Sep 30, 2021 at 1:46 PM Rahul Shirsat <
>>> [email protected]> wrote:
>>>
>>>> Hi Hackers,
>>>>
>>>> Please find the attached patch for fixing some additional issues.
>>>>
>>>> On Mon, Sep 20, 2021 at 1:13 PM Akshay Joshi <
>>>> [email protected]> wrote:
>>>>
>>>>> Thanks, the patch applied.
>>>>>
>>>>> On Mon, Sep 20, 2021 at 1:06 PM Rahul Shirsat <
>>>>> [email protected]> wrote:
>>>>>
>>>>>> Hi Akshay,
>>>>>>
>>>>>> Please find the updated patch.
>>>>>>
>>>>>> On Fri, Sep 17, 2021 at 8:55 PM Akshay Joshi <
>>>>>> [email protected]> wrote:
>>>>>>
>>>>>>> Hi Rahul
>>>>>>>
>>>>>>> Patch not applied, rebase and send the patch again.
>>>>>>>
>>>>>>> On Thu, Sep 16, 2021 at 6:39 PM Rahul Shirsat <
>>>>>>> [email protected]> wrote:
>>>>>>>
>>>>>>>> Hi Hackers,
>>>>>>>>
>>>>>>>> Please find the attached patch which resolves the below issue:
>>>>>>>>
>>>>>>>> 1. Enum Type - Unable to delete rows for Enum type in Create Type
>>>>>>>> dialogue.
>>>>>>>> 2. Range Type - Loading icons are shown in different drop down tabs.
>>>>>>>>
>>>>>>>> --
>>>>>>>> *Rahul Shirsat*
>>>>>>>> Senior Software Engineer | EnterpriseDB Corporation.
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> *Thanks & Regards*
>>>>>>> *Akshay Joshi*
>>>>>>> *pgAdmin Hacker | Principal Software Architect*
>>>>>>> *EDB Postgres <http://edbpostgres.com>*
>>>>>>>
>>>>>>> *Mobile: +91 976-788-8246*
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> *Rahul Shirsat*
>>>>>> Senior Software Engineer | EnterpriseDB Corporation.
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> *Thanks & Regards*
>>>>> *Akshay Joshi*
>>>>> *pgAdmin Hacker | Principal Software Architect*
>>>>> *EDB Postgres <http://edbpostgres.com>*
>>>>>
>>>>> *Mobile: +91 976-788-8246*
>>>>>
>>>>
>>>>
>>>> --
>>>> *Rahul Shirsat*
>>>> Senior Software Engineer | EnterpriseDB Corporation.
>>>>
>>>
>>>
>>> --
>>> *Thanks & Regards*
>>> *Akshay Joshi*
>>> *pgAdmin Hacker | Principal Software Architect*
>>> *EDB Postgres <http://edbpostgres.com>*
>>>
>>> *Mobile: +91 976-788-8246*
>>>
>>
>>
>> --
>> *Rahul Shirsat*
>> Senior Software Engineer | EnterpriseDB Corporation.
>>
>
>
> --
> *Thanks & Regards*
> *Akshay Joshi*
> *pgAdmin Hacker | Principal Software Architect*
> *EDB Postgres <http://edbpostgres.com>*
>
> *Mobile: +91 976-788-8246*
>


-- 
*Rahul Shirsat*
Senior Software Engineer | EnterpriseDB Corporation.


Attachments:

  [application/octet-stream] RM6744_v5.patch (3.8K, 3-RM6744_v5.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.ui.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.ui.js
index bb9f82a7f..1cc3cde88 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.ui.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.ui.js
@@ -1040,21 +1040,24 @@ class CompositeSchema extends BaseUISchema {
 
   validate(state, setError) {
 
-    let errmsg = null;
-
-    if (isEmptyString(state.member_name)) {
-      errmsg = gettext('Please specify the value for member name.');
-      setError('member_name', errmsg);
-      return true;
-    } else if(isEmptyString(state.type)) {
-      errmsg = gettext('Please specify the type.');
-      setError('type', errmsg);
-      return true;
-    }
-    if(_.isUndefined(errmsg) || errmsg == null) {
+    let self = this,
       errmsg = null;
-      setError('member_name', errmsg);
-      setError('type', errmsg);
+
+    if(self.top && self.top.sessData && self.top.sessData.typtype === 'c') {
+      if (isEmptyString(state.member_name)) {
+        errmsg = gettext('Please specify the value for member name.');
+        setError('member_name', errmsg);
+        return true;
+      } else if(isEmptyString(state.type)) {
+        errmsg = gettext('Please specify the type.');
+        setError('type', errmsg);
+        return true;
+      }
+      if(_.isUndefined(errmsg) || errmsg == null) {
+        errmsg = null;
+        setError('member_name', errmsg);
+        setError('type', errmsg);
+      }
     }
     return false;
   }
@@ -1286,7 +1289,7 @@ export default class TypeSchema extends BaseUISchema {
       ...fieldOptions
     };
     this.getPrivilegeRoleSchema = getPrivilegeRoleSchema;
-    this.getCompositeSchema = getCompositeSchema;
+    this.compositeSchema = getCompositeSchema(); // create only once the composite schema to avoid initializing the current (i.e. top)
     this.getRangeSchema = getRangeSchema;
     this.getExternalSchema = getExternalSchema;
     this.getDataTypeSchema = getDataTypeSchema;
@@ -1409,8 +1412,13 @@ export default class TypeSchema extends BaseUISchema {
       uniqueCol : ['member_name'],
       canAdd: true,  canEdit: false, canDelete: true,
       disabled: () => obj.inCatalog(),
-      schema: obj.getCompositeSchema(),
+      schema: obj.compositeSchema,
       deps: ['typtype'],
+      depChange: (state)=>{
+        if(_.isArray(state.composite) && state.composite.length > 0 && state.typtype !== 'c') {
+          state.composite.splice(0, state.composite.length);
+        }
+      },
       visible: (state) => {
         return state.typtype === 'c';
       },
@@ -1658,7 +1666,7 @@ export default class TypeSchema extends BaseUISchema {
         if (state.typtype === 'p') {
           var secLabs = state.seclabels;
           if(secLabs && secLabs.length > 0)
-            secLabs.reset();
+            secLabs.splice(0, secLabs.length);
         }
         return (state.typtype !== 'p');
       },
diff --git a/web/regression/javascript/schema_ui_files/type.ui.spec.js b/web/regression/javascript/schema_ui_files/type.ui.spec.js
index 70188aca8..bb648780b 100644
--- a/web/regression/javascript/schema_ui_files/type.ui.spec.js
+++ b/web/regression/javascript/schema_ui_files/type.ui.spec.js
@@ -96,6 +96,9 @@ describe('TypeSchema', ()=>{
     it('composite validate', () => {
       let state = { typtype: 'b' }; //validating for ExternalSchema which is distinguish as r
       let setError = jasmine.createSpy('setError');
+      compositeCollObj.top = {
+        'sessData': { 'typtype':'c' }
+      };
 
       compositeCollObj.validate(state, setError);
       expect(setError).toHaveBeenCalledWith('member_name', 'Please specify the value for member name.');


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

* Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue
  2021-09-16 13:09 [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Rahul Shirsat <[email protected]>
  2021-09-17 15:25 ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Akshay Joshi <[email protected]>
  2021-09-20 07:36   ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Rahul Shirsat <[email protected]>
  2021-09-20 07:43     ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Akshay Joshi <[email protected]>
  2021-09-30 08:15       ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Rahul Shirsat <[email protected]>
  2021-09-30 10:02         ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Akshay Joshi <[email protected]>
  2021-10-04 13:04           ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Rahul Shirsat <[email protected]>
  2021-10-04 14:11             ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Akshay Joshi <[email protected]>
  2021-10-05 10:42               ` Re: [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Rahul Shirsat <[email protected]>
@ 2021-10-05 11:54                 ` Akshay Joshi <[email protected]>
  0 siblings, 0 replies; 10+ messages in thread

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

Thanks, the patch applied.

On Tue, Oct 5, 2021 at 4:12 PM Rahul Shirsat <[email protected]>
wrote:

> Hi Hackers,
>
> Please find the attached patch which resolves the issues sec label & type
> changing issue.
>
> Additionally, while testing the workflow, fixed one issue related to
> composite type added with minimum one type and then changing the Type.
>
> On Mon, Oct 4, 2021 at 7:41 PM Akshay Joshi <[email protected]>
> wrote:
>
>> Thanks, the patch applied.
>>
>> On Mon, Oct 4, 2021 at 6:34 PM Rahul Shirsat <
>> [email protected]> wrote:
>>
>>> Hi Hackers,
>>>
>>> Please find the attached patch which resolves one more additional issue
>>> reported by Aditya.
>>>
>>> On Thu, Sep 30, 2021 at 3:32 PM Akshay Joshi <
>>> [email protected]> wrote:
>>>
>>>> Thanks, the patch applied.
>>>>
>>>> On Thu, Sep 30, 2021 at 1:46 PM Rahul Shirsat <
>>>> [email protected]> wrote:
>>>>
>>>>> Hi Hackers,
>>>>>
>>>>> Please find the attached patch for fixing some additional issues.
>>>>>
>>>>> On Mon, Sep 20, 2021 at 1:13 PM Akshay Joshi <
>>>>> [email protected]> wrote:
>>>>>
>>>>>> Thanks, the patch applied.
>>>>>>
>>>>>> On Mon, Sep 20, 2021 at 1:06 PM Rahul Shirsat <
>>>>>> [email protected]> wrote:
>>>>>>
>>>>>>> Hi Akshay,
>>>>>>>
>>>>>>> Please find the updated patch.
>>>>>>>
>>>>>>> On Fri, Sep 17, 2021 at 8:55 PM Akshay Joshi <
>>>>>>> [email protected]> wrote:
>>>>>>>
>>>>>>>> Hi Rahul
>>>>>>>>
>>>>>>>> Patch not applied, rebase and send the patch again.
>>>>>>>>
>>>>>>>> On Thu, Sep 16, 2021 at 6:39 PM Rahul Shirsat <
>>>>>>>> [email protected]> wrote:
>>>>>>>>
>>>>>>>>> Hi Hackers,
>>>>>>>>>
>>>>>>>>> Please find the attached patch which resolves the below issue:
>>>>>>>>>
>>>>>>>>> 1. Enum Type - Unable to delete rows for Enum type in Create Type
>>>>>>>>> dialogue.
>>>>>>>>> 2. Range Type - Loading icons are shown in different drop down
>>>>>>>>> tabs.
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> *Rahul Shirsat*
>>>>>>>>> Senior Software Engineer | EnterpriseDB Corporation.
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> *Thanks & Regards*
>>>>>>>> *Akshay Joshi*
>>>>>>>> *pgAdmin Hacker | Principal Software Architect*
>>>>>>>> *EDB Postgres <http://edbpostgres.com>*
>>>>>>>>
>>>>>>>> *Mobile: +91 976-788-8246*
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> *Rahul Shirsat*
>>>>>>> Senior Software Engineer | EnterpriseDB Corporation.
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> *Thanks & Regards*
>>>>>> *Akshay Joshi*
>>>>>> *pgAdmin Hacker | Principal Software Architect*
>>>>>> *EDB Postgres <http://edbpostgres.com>*
>>>>>>
>>>>>> *Mobile: +91 976-788-8246*
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> *Rahul Shirsat*
>>>>> Senior Software Engineer | EnterpriseDB Corporation.
>>>>>
>>>>
>>>>
>>>> --
>>>> *Thanks & Regards*
>>>> *Akshay Joshi*
>>>> *pgAdmin Hacker | Principal Software Architect*
>>>> *EDB Postgres <http://edbpostgres.com>*
>>>>
>>>> *Mobile: +91 976-788-8246*
>>>>
>>>
>>>
>>> --
>>> *Rahul Shirsat*
>>> Senior Software Engineer | EnterpriseDB Corporation.
>>>
>>
>>
>> --
>> *Thanks & Regards*
>> *Akshay Joshi*
>> *pgAdmin Hacker | Principal Software Architect*
>> *EDB Postgres <http://edbpostgres.com>*
>>
>> *Mobile: +91 976-788-8246*
>>
>
>
> --
> *Rahul Shirsat*
> Senior 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] 10+ messages in thread


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

Thread overview: 10+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-09-16 13:09 [patch][pgAdmin] RM6744 Unable to delete rows for Enum type in Create Type dialogue Rahul Shirsat <[email protected]>
2021-09-17 15:25 ` Akshay Joshi <[email protected]>
2021-09-20 07:36   ` Rahul Shirsat <[email protected]>
2021-09-20 07:43     ` Akshay Joshi <[email protected]>
2021-09-30 08:15       ` Rahul Shirsat <[email protected]>
2021-09-30 10:02         ` Akshay Joshi <[email protected]>
2021-10-04 13:04           ` Rahul Shirsat <[email protected]>
2021-10-04 14:11             ` Akshay Joshi <[email protected]>
2021-10-05 10:42               ` Rahul Shirsat <[email protected]>
2021-10-05 11:54                 ` 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