mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed jasmine test cases.
This commit is contained in:
parent
6b100b60f8
commit
7330b3520f
@ -4,12 +4,14 @@ import BaseUISchema from 'sources/SchemaView/base_schema.ui';
|
|||||||
import { emptyValidator, isEmptyString } from '../../../../../../../../static/js/validators';
|
import { emptyValidator, isEmptyString } from '../../../../../../../../static/js/validators';
|
||||||
|
|
||||||
export class PartitionKeysSchema extends BaseUISchema {
|
export class PartitionKeysSchema extends BaseUISchema {
|
||||||
constructor(columns=[]) {
|
constructor(columns=[], getCollations, getOperatorClass) {
|
||||||
super({
|
super({
|
||||||
key_type: 'column',
|
key_type: 'column',
|
||||||
});
|
});
|
||||||
this.columns = columns;
|
this.columns = columns;
|
||||||
this.columnsReloadBasis = false;
|
this.columnsReloadBasis = false;
|
||||||
|
this.getCollations = getCollations;
|
||||||
|
this.getOperatorClass = getOperatorClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
changeColumnOptions(columns) {
|
changeColumnOptions(columns) {
|
||||||
@ -69,7 +71,7 @@ export class PartitionKeysSchema extends BaseUISchema {
|
|||||||
},{
|
},{
|
||||||
id: 'collationame', label: gettext('Collation'), cell: 'select',
|
id: 'collationame', label: gettext('Collation'), cell: 'select',
|
||||||
type: 'select', group: gettext('partition'), deps:['key_type'],
|
type: 'select', group: gettext('partition'), deps:['key_type'],
|
||||||
options: obj.top.getCollations(), mode: ['create', 'properties', 'edit'],
|
options: obj.getCollations, mode: ['create', 'properties', 'edit'],
|
||||||
editable: function(state) {
|
editable: function(state) {
|
||||||
if(state.key_type == 'expression') {
|
if(state.key_type == 'expression') {
|
||||||
return false;
|
return false;
|
||||||
@ -88,7 +90,7 @@ export class PartitionKeysSchema extends BaseUISchema {
|
|||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
disabled: ()=>{return !(obj.isNew()); },
|
disabled: ()=>{return !(obj.isNew()); },
|
||||||
options: obj.top.getOperatorClass(), mode: ['create', 'properties', 'edit'],
|
options: obj.getOperatorClass, mode: ['create', 'properties', 'edit'],
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,7 +113,7 @@ export class PartitionKeysSchema extends BaseUISchema {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
export class PartitionsSchema extends BaseUISchema {
|
export class PartitionsSchema extends BaseUISchema {
|
||||||
constructor(nodeInfo) {
|
constructor(nodeInfo, getCollations, getOperatorClass) {
|
||||||
super({
|
super({
|
||||||
oid: undefined,
|
oid: undefined,
|
||||||
is_attach: false,
|
is_attach: false,
|
||||||
@ -126,7 +128,7 @@ export class PartitionsSchema extends BaseUISchema {
|
|||||||
sub_partition_type: 'range',
|
sub_partition_type: 'range',
|
||||||
});
|
});
|
||||||
|
|
||||||
this.subPartitionsObj = new PartitionKeysSchema();
|
this.subPartitionsObj = new PartitionKeysSchema([], getCollations, getOperatorClass);
|
||||||
this.nodeInfo = nodeInfo;
|
this.nodeInfo = nodeInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -309,14 +309,12 @@ export default class TableSchema extends BaseUISchema {
|
|||||||
this.getPrivilegeRoleSchema = getPrivilegeRoleSchema;
|
this.getPrivilegeRoleSchema = getPrivilegeRoleSchema;
|
||||||
this.nodeInfo = nodeInfo;
|
this.nodeInfo = nodeInfo;
|
||||||
this.getColumns = getColumns;
|
this.getColumns = getColumns;
|
||||||
this.getCollations = getCollations;
|
|
||||||
this.getOperatorClass = getOperatorClass;
|
|
||||||
|
|
||||||
this.partitionKeysObj = new PartitionKeysSchema();
|
this.partitionsObj = new PartitionsSchema(this.nodeInfo, getCollations, getOperatorClass);
|
||||||
this.partitionsObj = new PartitionsSchema(this.nodeInfo);
|
|
||||||
this.constraintsObj = this.schemas.constraints();
|
this.constraintsObj = this.schemas.constraints();
|
||||||
this.columnsSchema = this.schemas.columns();
|
this.columnsSchema = this.schemas.columns();
|
||||||
this.vacuumSettingsSchema = this.schemas.vacuum_settings();
|
this.vacuumSettingsSchema = this.schemas.vacuum_settings();
|
||||||
|
this.partitionKeysObj = new PartitionKeysSchema([], getCollations, getOperatorClass);
|
||||||
}
|
}
|
||||||
|
|
||||||
get idAttribute() {
|
get idAttribute() {
|
||||||
|
@ -46,9 +46,6 @@ describe('PartitionTableSchema', ()=>{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
schemaObj.top = schemaObj;
|
|
||||||
schemaObj.top.getCollations = ()=>Promise.resolve({});
|
|
||||||
schemaObj.top.getOperatorClass = ()=>Promise.resolve({});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
afterAll(() => {
|
afterAll(() => {
|
||||||
|
@ -55,10 +55,6 @@ describe('PartitionKeysSchema', ()=>{
|
|||||||
spyOn(nodeAjax, 'getNodeAjaxOptions').and.returnValue(Promise.resolve([]));
|
spyOn(nodeAjax, 'getNodeAjaxOptions').and.returnValue(Promise.resolve([]));
|
||||||
spyOn(nodeAjax, 'getNodeListByName').and.returnValue(Promise.resolve([]));
|
spyOn(nodeAjax, 'getNodeListByName').and.returnValue(Promise.resolve([]));
|
||||||
let partitionObj = new PartitionKeysSchema();
|
let partitionObj = new PartitionKeysSchema();
|
||||||
partitionObj.top = {
|
|
||||||
getCollations : ()=>{},
|
|
||||||
getOperatorClass : ()=>{},
|
|
||||||
};
|
|
||||||
schemaObj = new SchemaInColl(partitionObj);
|
schemaObj = new SchemaInColl(partitionObj);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -171,8 +167,6 @@ describe('PartitionsSchema', ()=>{
|
|||||||
spyOn(nodeAjax, 'getNodeListByName').and.returnValue(Promise.resolve([]));
|
spyOn(nodeAjax, 'getNodeListByName').and.returnValue(Promise.resolve([]));
|
||||||
schemaObj = new PartitionsSchema();
|
schemaObj = new PartitionsSchema();
|
||||||
schemaObj.top = schemaObj;
|
schemaObj.top = schemaObj;
|
||||||
schemaObj.top.getCollations = ()=>Promise.resolve({});
|
|
||||||
schemaObj.top.getOperatorClass = ()=>Promise.resolve({});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
afterAll(() => {
|
afterAll(() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user