Table node related fixes:

1. File select control sets the value for all other to last selected file. Fixes #6814
2. Vacuum parameters-related issues. Fixes #6777
3. Exclusion removes all columns if one row is removed. Fixes #6771
This commit is contained in:
Aditya Toshniwal
2021-10-01 12:57:04 +05:30
committed by Akshay Joshi
parent 5e0c113c7b
commit 357a020828
7 changed files with 32 additions and 29 deletions

View File

@@ -15,7 +15,7 @@ export function getNodeExclusionConstraintSchema(treeNodeInfo, itemNodeData, pgB
spcname: ()=>getNodeListByName('tablespace', treeNodeInfo, itemNodeData, {}, (m)=>{
return (m.label != 'pg_global');
}),
getOperClass: (urlParams)=>getNodeAjaxOptions('get_oper_class', tableNode, treeNodeInfo, itemNodeData, {urlParams: urlParams}, (data)=>{
getOperClass: (urlParams)=>getNodeAjaxOptions('get_oper_class', tableNode, treeNodeInfo, itemNodeData, {urlParams: urlParams, useCache:false}, (data)=>{
let res = [];
if (data && _.isArray(data)) {
_.each(data, function(d) {
@@ -24,7 +24,7 @@ export function getNodeExclusionConstraintSchema(treeNodeInfo, itemNodeData, pgB
}
return res;
}),
getOperator: (urlParams)=>getNodeAjaxOptions('get_operator', tableNode, treeNodeInfo, itemNodeData, {urlParams: urlParams}, (data)=>{
getOperator: (urlParams)=>getNodeAjaxOptions('get_operator', tableNode, treeNodeInfo, itemNodeData, {urlParams: urlParams, useCache:false}, (data)=>{
let res = [];
if (data && _.isArray(data)) {
_.each(data, function(d) {
@@ -33,7 +33,7 @@ export function getNodeExclusionConstraintSchema(treeNodeInfo, itemNodeData, pgB
}
return res;
}),
});
}, treeNodeInfo);
}
class ExclusionColHeaderSchema extends BaseUISchema {
@@ -168,9 +168,7 @@ class ExclusionColumnSchema extends BaseUISchema {
},{
id: 'operator', label: gettext('Operator'), type: 'select',
width: 95,
editable: function() {
return obj.isNewExCons;
},
editable: obj.isEditable,
cell: (state)=>{
return {
cell: 'select',
@@ -185,7 +183,7 @@ class ExclusionColumnSchema extends BaseUISchema {
}
export default class ExclusionConstraintSchema extends BaseUISchema {
constructor(fieldOptions={}, nodeInfo, getColumns) {
constructor(fieldOptions={}, nodeInfo) {
super({
name: undefined,
oid: undefined,
@@ -202,7 +200,7 @@ export default class ExclusionConstraintSchema extends BaseUISchema {
this.nodeInfo = nodeInfo;
this.fieldOptions = fieldOptions;
this.exHeaderSchema = new ExclusionColHeaderSchema(fieldOptions.columns, getColumns);
this.exHeaderSchema = new ExclusionColHeaderSchema(fieldOptions.columns);
this.exColumnSchema = new ExclusionColumnSchema(fieldOptions.getOperator);
this.exHeaderSchema.exColumnSchema = this.exColumnSchema;
}

View File

@@ -161,7 +161,7 @@ export class PartitionsSchema extends BaseUISchema {
return true;
},
},{
id: 'partition_name', label: gettext('Name'),
id: 'partition_name', label: gettext('Name'), deps: ['is_attach'],
type: (state)=>{
if(state.is_attach) {
return {

View File

@@ -2072,10 +2072,10 @@ class BaseTableView(PGChildNodeView, BasePartitionTable, VacuumSettings):
for old_data_row in old_data[vacuum_key]:
if data_row['name'] == old_data_row['name'] and \
'value' in data_row:
if data_row['value'] is not None:
if data_row['value'] is not None and \
data_row['value'] != '':
set_values.append(data_row)
elif data_row['value'] is None and \
'value' in old_data_row:
elif 'value' in old_data_row:
reset_values.append(data_row)
if len(set_values) > 0: