Skip to content

Commit

Permalink
Upgrade react-table from v7 to v8. pgadmin-org#7419
Browse files Browse the repository at this point in the history
  • Loading branch information
adityatoshniwal committed May 6, 2024
1 parent 3e0ade5 commit 73ee4b1
Show file tree
Hide file tree
Showing 31 changed files with 1,491 additions and 1,506 deletions.
3 changes: 2 additions & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@
"@projectstorm/react-diagrams": "^6.6.1",
"@simonwep/pickr": "^1.5.1",
"@szhsin/react-menu": "^2.2.0",
"@tanstack/react-table": "^8.16.0",
"@tanstack/react-virtual": "^3.4.0",
"@types/classnames": "^2.2.6",
"@types/react": "^17.0.80",
"@types/react-dom": "^17.0.25",
Expand Down Expand Up @@ -143,7 +145,6 @@
"react-resize-detector": "^9.1.0",
"react-rnd": "^10.3.5",
"react-select": "^5.7.2",
"react-table": "^7.6.3",
"react-timer-hook": "^3.0.5",
"react-virtualized-auto-sizer": "^1.0.6",
"react-window": "^1.8.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ export class ColumnSchema extends BaseUISchema {
},{
id: 'max_val_attlen', skipChange: true, visible: false, type: '',
},{
id: 'attprecision', label: gettext('Scale'), width: 60, disableResizing: true,
id: 'attprecision', label: gettext('Scale'), width: 60, enableResizing: false,
deps: ['cltype'], type: 'int', group: gettext('Definition'),
cell: (state)=>{
return obj.attCell(state);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export default class ColumnSchema extends BaseUISchema {
// 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', width: 100, disableResizing: true, deps:['name', ['primary_key']],
cell: 'switch', type: 'switch', width: 100, enableResizing: false, deps:['name', ['primary_key']],
visible: ()=>{
return obj.top?.nodeInfo && _.isUndefined(
obj.top.nodeInfo['table'] || obj.top.nodeInfo['view'] ||
Expand Down Expand Up @@ -280,7 +280,7 @@ export default class ColumnSchema extends BaseUISchema {
},
},{
id: 'attlen', label: gettext('Length/Precision'),
deps: ['cltype'], type: 'int', group: gettext('Definition'), width: 120, disableResizing: true,
deps: ['cltype'], type: 'int', group: gettext('Definition'), width: 120, enableResizing: false,
cell: (state)=>{
return obj.attCell(state);
},
Expand Down Expand Up @@ -311,7 +311,7 @@ export default class ColumnSchema extends BaseUISchema {
},{
id: 'max_val_attlen', skipChange: true, visible: false, type: '',
},{
id: 'attprecision', label: gettext('Scale'), width: 60, disableResizing: true,
id: 'attprecision', label: gettext('Scale'), width: 60, enableResizing: false,
deps: ['cltype'], type: 'int', group: gettext('Definition'),
cell: (state)=>{
return obj.attCell(state);
Expand Down Expand Up @@ -439,7 +439,7 @@ export default class ColumnSchema extends BaseUISchema {
},
},{
id: 'attnotnull', label: gettext('Not NULL?'), cell: 'switch',
type: 'switch', width: 80, disableResizing: true,
type: 'switch', width: 80, enableResizing: false,
group: gettext('Constraints'), editable: this.editableCheckForTable,
deps: ['colconstype'],
readonly: (state) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class ExclusionColumnSchema extends BaseUISchema {
let obj = this;
return [{
id: 'is_exp', label: '', type:'', cell: '', editable: false, width: 20,
disableResizing: true,
enableResizing: false,
controlProps: {
formatter: {
fromRaw: function (rawValue) {
Expand All @@ -162,7 +162,7 @@ class ExclusionColumnSchema extends BaseUISchema {
{label: 'ASC', value: true},
{label: 'DESC', value: false},
],
editable: obj.isEditable, width: 110, disableResizing: true,
editable: obj.isEditable, width: 110, enableResizing: false,
controlProps: {
allowClear: false,
},
Expand All @@ -172,7 +172,7 @@ class ExclusionColumnSchema extends BaseUISchema {
{label: 'FIRST', value: true},
{label: 'LAST', value: false},
], controlProps: {allowClear: false},
editable: obj.isEditable, width: 110, disableResizing: true,
editable: obj.isEditable, width: 110, enableResizing: false,
},{
id: 'operator', label: gettext('Operator'), type: 'select',
width: 95,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class IndexColumnSchema extends BaseUISchema {
return [
{
id: 'is_exp', label: '', type:'', cell: '', editable: false, width: 20,
disableResizing: true,
enableResizing: false,
controlProps: {
formatter: {
fromRaw: function (rawValue) {
Expand Down Expand Up @@ -182,7 +182,7 @@ class IndexColumnSchema extends BaseUISchema {
{label: 'ASC', value: false},
{label: 'DESC', value: true},
],
width: 110, disableResizing: true,
width: 110, enableResizing: false,
controlProps: {
allowClear: false,
},
Expand Down Expand Up @@ -211,7 +211,7 @@ class IndexColumnSchema extends BaseUISchema {
{label: 'FIRST', value: true},
{label: 'LAST', value: false},
], controlProps: {allowClear: false},
width: 110, disableResizing: true,
width: 110, enableResizing: false,
editable: function(state) {
return obj.isEditable(state);
},
Expand Down Expand Up @@ -243,7 +243,7 @@ export class WithSchema extends BaseUISchema {
super({});
this.node_info = node_info;
}

get baseFields() {
let withSchemaObj = this;
return [
Expand Down Expand Up @@ -308,7 +308,7 @@ export class WithSchema extends BaseUISchema {
depChange: (state, source) => {
if (state.amname !== 'btree') {
return {deduplicate_items:undefined};
} else if (state.amname === 'btree' && source[0] !== 'deduplicate_items' &&
} else if (state.amname === 'btree' && source[0] !== 'deduplicate_items' &&
withSchemaObj.node_info.server.version >= 130000) {
return {deduplicate_items: true};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export class PartitionsSchema extends BaseUISchema {
mode: ['properties'],
},{
id: 'is_attach', label:gettext('Operation'), cell: 'select', type: 'select',
width: 120, disableResizing: true, options: [
width: 120, enableResizing: false, options: [
{label: gettext('Attach'), value: true},
{label: gettext('Create'), value: false},
], controlProps: {allowClear: false},
Expand Down Expand Up @@ -225,7 +225,7 @@ export class PartitionsSchema extends BaseUISchema {
},
},{
id: 'is_default', label: gettext('Default'), type: 'switch', cell:'switch',
width: 55, disableResizing: true, min_version: 110000,
width: 55, enableResizing: false, min_version: 110000,
editable: function(state) {
return (obj.top && (obj.top.sessData.partition_type == 'range' ||
obj.top.sessData.partition_type == 'list') && obj.isNew(state)
Expand Down

0 comments on commit 73ee4b1

Please sign in to comment.