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:
committed by
Akshay Joshi
parent
2f37f0ca51
commit
7f2e87b27d
@@ -93,7 +93,7 @@ function isValueEqual(val1, val2) {
|
||||
return (_.isEqual(val1, val2)
|
||||
|| ((val1 === null || _.isUndefined(val1)) && val2 === '')
|
||||
|| ((val1 === null || _.isUndefined(val1)) && typeof(val2) === 'boolean' && !val2)
|
||||
|| (attrDefined ? _.isEqual(val1.toString(), val2.toString()) : false
|
||||
|| (attrDefined ? (!_.isObject(val1) && _.isEqual(val1.toString(), val2.toString())) : false
|
||||
));
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ function getChangedData(topSchema, viewHelperProps, sessData, stringify=false, i
|
||||
|
||||
/* The comparator and setter */
|
||||
const attrChanged = (id, change, force=false)=>{
|
||||
if(isValueEqual(_.get(origVal, id), _.get(sessVal, id)) && !force && (_.isObject(_.get(origVal, id)) && _.isEqual(_.get(origVal, id), _.get(sessData, id)))) {
|
||||
if(isValueEqual(_.get(origVal, id), _.get(sessVal, id)) && !force) {
|
||||
return;
|
||||
} else {
|
||||
change = change || _.get(sessVal, id);
|
||||
|
||||
@@ -28,16 +28,13 @@ export default function SelectThemes({onChange, ...props}) {
|
||||
props.options.forEach((opt)=> {
|
||||
if(opt.value == e) {
|
||||
setPreviewSrc(opt.preview_src);
|
||||
}
|
||||
}
|
||||
});
|
||||
onChange(e);
|
||||
};
|
||||
|
||||
return (
|
||||
<Grid
|
||||
container
|
||||
direction="column"
|
||||
justifyContent="center">
|
||||
<Grid container direction="column">
|
||||
<Grid item lg={12} md={12} sm={12} xs={12}>
|
||||
<InputSelect ref={props.inputRef} onChange={themeChange} {...props} />
|
||||
</Grid>
|
||||
@@ -55,4 +52,4 @@ SelectThemes.propTypes = {
|
||||
fields: PropTypes.array,
|
||||
options: PropTypes.array,
|
||||
inputRef: CustomPropTypes.ref
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user