mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-11-22 00:37:36 -06:00
- Fix Jasmine test cases failing in framework. - More stability fixes and enhancements.
This commit is contained in:
parent
351cb3e6ca
commit
9274df0f11
@ -65,7 +65,7 @@ export default class PrivilegeRoleSchema extends BaseUISchema {
|
||||
},
|
||||
{
|
||||
id: 'grantor', label: gettext('Grantor'), type: 'text', readonly: true,
|
||||
cell: ()=>({cell: 'select', options: obj.grantorOptions}),
|
||||
cell: ()=>({cell: 'select', options: obj.grantorOptions}), minWidth: 150,
|
||||
}];
|
||||
}
|
||||
|
||||
|
@ -140,6 +140,7 @@ export function getNodeListById(nodeObj, treeNodeInfo, itemNodeData, params={},
|
||||
/* Get the nodes list based on node name passed */
|
||||
export function getNodeListByName(node, treeNodeInfo, itemNodeData, params={}, filter=()=>true, postTransform=(res)=>res) {
|
||||
let nodeObj = pgAdmin.Browser.Nodes[node];
|
||||
let {includeItemKeys} = params;
|
||||
/* Transform the result to add image details */
|
||||
const transform = (rows) => {
|
||||
var res = [];
|
||||
@ -157,6 +158,7 @@ export function getNodeListByName(node, treeNodeInfo, itemNodeData, params={}, f
|
||||
'value': r.label,
|
||||
'image': image,
|
||||
'label': l,
|
||||
..._.pick(r, includeItemKeys),
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -322,7 +322,7 @@ export default function DataGridView({
|
||||
return props.columns.indexOf(firstF.id) < props.columns.indexOf(secondF.id) ? -1 : 1;
|
||||
}
|
||||
return 0;
|
||||
}).map((field)=>{
|
||||
}).map((field, fieldIdx)=>{
|
||||
let colInfo = {
|
||||
Header: field.label||<> </>,
|
||||
accessor: field.id,
|
||||
@ -332,6 +332,9 @@ export default function DataGridView({
|
||||
...(field.minWidth ? {minWidth: field.minWidth} : {}),
|
||||
...(field.width ? {width: field.width} : {}),
|
||||
Cell: ({value, row, ...other}) => {
|
||||
/* Make sure to take the latest field info from schema */
|
||||
field = schemaRef.current.fields[fieldIdx];
|
||||
|
||||
let {visible, editable, readonly, ..._field} = field;
|
||||
|
||||
let verInLimit = (_.isUndefined(viewHelperProps.serverInfo) ? true :
|
||||
|
@ -123,12 +123,12 @@ export default class BaseUISchema {
|
||||
getNewData(data={}) {
|
||||
let newRow = {};
|
||||
this.fields.forEach((field)=>{
|
||||
if(!_.isUndefined(data[field.id])){
|
||||
newRow[field.id] = data[field.id];
|
||||
} else {
|
||||
newRow[field.id] = this.defaults[field.id];
|
||||
}
|
||||
newRow[field.id] = this.defaults[field.id];
|
||||
});
|
||||
newRow = {
|
||||
...newRow,
|
||||
...data,
|
||||
};
|
||||
return newRow;
|
||||
}
|
||||
|
||||
|
@ -764,8 +764,9 @@ function SchemaPropertiesView({
|
||||
accessPath={[]}
|
||||
formErr={{}}
|
||||
controlClassName={classes.controlRow}
|
||||
{...field}
|
||||
visible={visible}
|
||||
{...field} />
|
||||
/>
|
||||
);
|
||||
} else if(field.type === 'collection') {
|
||||
tabs[group].push(
|
||||
@ -792,10 +793,10 @@ function SchemaPropertiesView({
|
||||
state={origData}
|
||||
name={field.id}
|
||||
value={origData[field.id]}
|
||||
{...field}
|
||||
readonly={readonly}
|
||||
disabled={disabled}
|
||||
visible={visible}
|
||||
{...field}
|
||||
className={classes.controlRow}
|
||||
/>
|
||||
);
|
||||
|
@ -264,7 +264,7 @@ describe('SchemaView', ()=>{
|
||||
ctrl.update();
|
||||
expect(ctrl.find('DefaultButton[data-test="Reset"]').prop('disabled')).toBeTrue();
|
||||
expect(ctrl.find('PrimaryButton[data-test="Save"]').prop('disabled')).toBeTrue();
|
||||
expect(onDataChange).toHaveBeenCalledWith(false);
|
||||
expect(onDataChange).toHaveBeenCalledWith(false, {});
|
||||
done();
|
||||
}, 0);
|
||||
});
|
||||
@ -298,7 +298,7 @@ describe('SchemaView', ()=>{
|
||||
expect(confirmSpy).not.toHaveBeenCalled();
|
||||
expect(ctrl.find('DefaultButton[data-test="Reset"]').prop('disabled')).toBeTrue();
|
||||
expect(ctrl.find('PrimaryButton[data-test="Save"]').prop('disabled')).toBeTrue();
|
||||
expect(onDataChange).toHaveBeenCalledWith(false);
|
||||
expect(onDataChange).toHaveBeenCalledWith(false, {});
|
||||
done();
|
||||
}, 0);
|
||||
});
|
||||
@ -411,7 +411,7 @@ describe('SchemaView', ()=>{
|
||||
ctrl.update();
|
||||
expect(ctrl.find('DefaultButton[data-test="Reset"]').prop('disabled')).toBeTrue();
|
||||
expect(ctrl.find('PrimaryButton[data-test="Save"]').prop('disabled')).toBeTrue();
|
||||
expect(onDataChange).toHaveBeenCalledWith(false);
|
||||
expect(onDataChange).toHaveBeenCalledWith(false, {});
|
||||
done();
|
||||
}, 0);
|
||||
}, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user