mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Port preferences dialog to React. Fixes #7149
This commit is contained in:
committed by
Akshay Joshi
parent
3299b0c1b0
commit
74e794b416
@@ -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) {
|
||||
if(isValueEqual(_.get(origVal, id), _.get(sessVal, id)) && !force && (_.isObject(_.get(origVal, id)) && _.isEqual(_.get(origVal, id), _.get(sessData, id)))) {
|
||||
return;
|
||||
} else {
|
||||
change = change || _.get(sessVal, id);
|
||||
@@ -302,6 +302,7 @@ export const SCHEMA_STATE_ACTIONS = {
|
||||
RERENDER: 'rerender',
|
||||
CLEAR_DEFERRED_QUEUE: 'clear_deferred_queue',
|
||||
DEFERRED_DEPCHANGE: 'deferred_depchange',
|
||||
BULK_UPDATE: 'bulk_update'
|
||||
};
|
||||
|
||||
const getDepChange = (currPath, newState, oldState, action)=>{
|
||||
@@ -354,6 +355,13 @@ const sessDataReducer = (state, action)=>{
|
||||
case SCHEMA_STATE_ACTIONS.INIT:
|
||||
data = action.payload;
|
||||
break;
|
||||
case SCHEMA_STATE_ACTIONS.BULK_UPDATE:
|
||||
rows = (_.get(data, action.path)||[]);
|
||||
rows.forEach((row)=> {
|
||||
row[action.id] = false;
|
||||
});
|
||||
_.set(data, action.path, rows);
|
||||
break;
|
||||
case SCHEMA_STATE_ACTIONS.SET_VALUE:
|
||||
_.set(data, action.path, action.value);
|
||||
/* If there is any dep listeners get the changes */
|
||||
|
||||
Reference in New Issue
Block a user