diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/static/js/column.ui.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/static/js/column.ui.js index 337c5a0fa..ea6ba8bc9 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/static/js/column.ui.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/static/js/column.ui.js @@ -154,12 +154,12 @@ export default class ColumnSchema extends BaseUISchema { id: 'name', label: gettext('Name'), cell: 'text', type: 'text', readonly: obj.inSchemaWithColumnCheck, editable: this.editableCheckForTable, noEmpty: true, - minWidth: 115, + width: 115, },{ // Need to show this field only when creating new table // [in SubNode control] id: 'is_primary_key', label: gettext('Primary key?'), - cell: 'switch', type: 'switch', minWidth: 100, deps:['name'], + cell: 'switch', type: 'switch', width: 100, disableResizing: true, deps:['name'], visible: ()=>{ return obj.top?.nodeInfo && _.isUndefined( obj.top.nodeInfo['table'] || obj.top.nodeInfo['view'] || @@ -226,7 +226,7 @@ export default class ColumnSchema extends BaseUISchema { type: 'text', disabled: this.inCatalog, mode: ['properties'], },{ id: 'cltype', label: gettext('Data type'), - readonly: obj.inSchemaWithColumnCheck, minWidth: 150, + readonly: obj.inSchemaWithColumnCheck, width: 150, group: gettext('Definition'), noEmpty: true, editable: this.editableCheckForTable, options: this.cltypeOptions, optionsLoaded: (options)=>{obj.datatypes = options;}, @@ -276,7 +276,7 @@ export default class ColumnSchema extends BaseUISchema { }, },{ id: 'attlen', label: gettext('Length/Precision'), cell: 'int', - deps: ['cltype'], type: 'int', group: gettext('Definition'), width: 120, minWidth: 120, + deps: ['cltype'], type: 'int', group: gettext('Definition'), width: 120, disableResizing: true, depChange: (state)=>{ let range = this.attlenRange(state); if(range) { @@ -300,7 +300,7 @@ export default class ColumnSchema extends BaseUISchema { return Boolean(obj.attlenRange(state)); }, },{ - id: 'attprecision', label: gettext('Scale'), cell: 'int', minWidth: 60, + id: 'attprecision', label: gettext('Scale'), cell: 'int', width: 60, disableResizing: true, deps: ['cltype'], type: 'int', group: gettext('Definition'), depChange: (state)=>{ let range = this.attprecisionRange(state); @@ -386,7 +386,7 @@ export default class ColumnSchema extends BaseUISchema { }, },{ id: 'attnotnull', label: gettext('Not NULL?'), cell: 'switch', - type: 'switch', minWidth: 80, + type: 'switch', width: 80, disableResizing: true, group: gettext('Constraints'), editable: this.editableCheckForTable, deps: ['colconstype'], readonly: (state) => { 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 260f1e791..a1bf0c589 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 @@ -128,7 +128,8 @@ class ExclusionColumnSchema extends BaseUISchema { get baseFields() { let obj = this; return [{ - id: 'is_exp', label: '', type:'', editable: false, minWidth: 20, + id: 'is_exp', label: '', type:'', editable: false, width: 20, + disableResizing: true, controlProps: { formatter: { fromRaw: function (rawValue) { @@ -138,11 +139,11 @@ class ExclusionColumnSchema extends BaseUISchema { }, visible: false, },{ id: 'column', label: gettext('Col/Exp'), type:'', editable: false, - cell:'', minWidth: 125, + cell:'', width: 125, },{ id: 'oper_class', label: gettext('Operator class'), cell:'select', options: this.operClassOptions, - minWidth: 185, + width: 185, editable: obj.isEditable, controlProps: { allowClear: true, placeholder: gettext('Select the operator class'), @@ -153,7 +154,7 @@ class ExclusionColumnSchema extends BaseUISchema { {label: 'ASC', value: true}, {label: 'DESC', value: false}, ], - editable: obj.isEditable, minWidth: 110, + editable: obj.isEditable, width: 110, disableResizing: true, controlProps: { allowClear: false, }, @@ -163,10 +164,10 @@ class ExclusionColumnSchema extends BaseUISchema { {label: 'FIRST', value: true}, {label: 'LAST', value: false}, ], controlProps: {allowClear: false}, - editable: obj.isEditable, minWidth: 110, + editable: obj.isEditable, width: 110, disableResizing: true, },{ id: 'operator', label: gettext('Operator'), type: 'select', - minWidth: 95, + width: 95, editable: function() { return obj.isNewExCons; }, @@ -353,20 +354,11 @@ export default class ExclusionConstraintSchema extends BaseUISchema { controlProps: { formatter: { fromRaw: (rawValue)=>{ - var cols = [], - remoteCols = []; - if (rawValue?.length > 0) { - rawValue.forEach((col)=>{ - cols.push(col.local_column); - remoteCols.push(col.referenced); - }); - return '('+cols.join(', ')+') -> ('+ remoteCols.join(', ')+')'; - } - return ''; + return _.map(rawValue || [], 'column').join(', '); }, } }, - minWidth: 245, + width: 245, }), deps: ()=>{ let ret = []; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/static/js/foreign_key.ui.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/static/js/foreign_key.ui.js index 2b76f9ffa..b8136d83e 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/static/js/foreign_key.ui.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/static/js/foreign_key.ui.js @@ -282,14 +282,20 @@ export default class ForeignKeySchema extends BaseUISchema { readonly: this.isReadonly, },{ id: 'references_table_name', label: gettext('Referenced Table'), - type: 'text', group: gettext('Columns'), editable: false, visible:false, - cell: '', deps: ['columns'], - depChange: (state)=>{ - if(state.columns?.length > 0) { - return {references_table_name: _.join(_.map(state.columns, 'references_table_name'), ',')}; + type: 'text', group: gettext('Columns'), editable: false, visible:false, deps: ['columns'], + cell: (state)=>({ + cell: '', + controlProps: { + formatter: { + fromRaw: ()=>{ + if(state.columns?.length > 0) { + return _.join(_.map(state.columns, 'references_table_name'), ','); + } + return ''; + } + } } - return {references_table_name: undefined}; - } + }), },{ id: 'columns', label: gettext('Columns'), group: gettext('Columns'), type: 'collection', diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/primary_key.ui.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/primary_key.ui.js index a6feea08c..8eb67b2cb 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/primary_key.ui.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/primary_key.ui.js @@ -156,8 +156,8 @@ export default class PrimaryKeySchema extends BaseUISchema { return false; }, deps: ['index'], - readonly: function() { - if(!obj.isNew()) { + readonly: function(state) { + if(!obj.isNew(state)) { return true; } }, @@ -223,8 +223,8 @@ export default class PrimaryKeySchema extends BaseUISchema { },{ id: 'condeferrable', label: gettext('Deferrable?'), type: 'switch', group: gettext('Definition'), deps: ['index'], - readonly: function() { - if(!obj.isNew()) { + readonly: function(state) { + if(!obj.isNew(state)) { return true; } return false; @@ -244,18 +244,20 @@ export default class PrimaryKeySchema extends BaseUISchema { id: 'condeferred', label: gettext('Deferred?'), type: 'switch', group: gettext('Definition'), deps: ['condeferrable'], - readonly: function() { - if(!obj.isNew()) { + readonly: function(state) { + if(!obj.isNew(state)) { return true; } return false; }, disabled: function(state) { // Disable if index is selected. - return !(_.isUndefined(state.index) || state.index == ''); + return !(_.isUndefined(state.index) || state.index == '') || !state.condeferrable; }, depChange: (state)=>{ - if(_.isUndefined(state.index) || state.index == '') { + if(!state.condeferrable) { + return {condeferred: false}; + } else if(_.isUndefined(state.index) || state.index == '') { return {}; } else { return {condeferred: false}; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/unique_constraint.ui.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/unique_constraint.ui.js index 055679108..9ba447a60 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/unique_constraint.ui.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/unique_constraint.ui.js @@ -158,8 +158,8 @@ export default class UniqueConstraintSchema extends BaseUISchema { return false; }, deps: ['index'], - readonly: function() { - if(!obj.isNew()) { + readonly: function(state) { + if(!obj.isNew(state)) { return true; } }, @@ -225,8 +225,8 @@ export default class UniqueConstraintSchema extends BaseUISchema { },{ id: 'condeferrable', label: gettext('Deferrable?'), type: 'switch', group: gettext('Definition'), deps: ['index'], - readonly: function() { - if(!obj.isNew()) { + readonly: function(state) { + if(!obj.isNew(state)) { return true; } return false; @@ -246,18 +246,20 @@ export default class UniqueConstraintSchema extends BaseUISchema { id: 'condeferred', label: gettext('Deferred?'), type: 'switch', group: gettext('Definition'), deps: ['condeferrable'], - readonly: function() { - if(!obj.isNew()) { + readonly: function(state) { + if(!obj.isNew(state)) { return true; } return false; }, disabled: function(state) { // Disable if index is selected. - return !(_.isUndefined(state.index) || state.index == ''); + return !(_.isUndefined(state.index) || state.index == '') || !state.condeferrable; }, depChange: (state)=>{ - if(_.isUndefined(state.index) || state.index == '') { + if(!state.condeferrable) { + return {condeferred: false}; + } else if(_.isUndefined(state.index) || state.index == '') { return {}; } else { return {condeferred: false}; diff --git a/web/pgadmin/browser/server_groups/servers/static/js/vacuum.ui.js b/web/pgadmin/browser/server_groups/servers/static/js/vacuum.ui.js index 5d23d8d39..bfe6ea13d 100644 --- a/web/pgadmin/browser/server_groups/servers/static/js/vacuum.ui.js +++ b/web/pgadmin/browser/server_groups/servers/static/js/vacuum.ui.js @@ -64,7 +64,7 @@ export default class VacuumSettingsSchema extends BaseUISchema { var obj = this; return [{ id: 'autovacuum_custom', label: gettext('Custom auto-vacuum?'), - group: gettext('Table'), mode: ['edit', 'create'], + group: gettext('Table'), mode: ['edit', 'create'], skipChange: true, type: 'switch', disabled: function(state) { if(state.is_partitioned) { return true; diff --git a/web/pgadmin/static/js/SchemaView/DataGridView.jsx b/web/pgadmin/static/js/SchemaView/DataGridView.jsx index 4405ada36..103bca91f 100644 --- a/web/pgadmin/static/js/SchemaView/DataGridView.jsx +++ b/web/pgadmin/static/js/SchemaView/DataGridView.jsx @@ -134,7 +134,7 @@ function DataTableHeader({headerGroups}) { : ''} - {column.resizable && + {!column.disableResizing &&