11import uuid from '../utils/uuid' ;
2- import expandTreePath from '../utils/expandTreePath ' ;
3- import defaultRuleProperties from '../utils/defaultRuleProperties ' ;
4- import defaultGroupProperties from '../utils/defaultGroupProperties' ;
2+ import { expandTreePath } from '../utils/treeUtils ' ;
3+ import { defaultRuleProperties , defaultGroupProperties } from '../utils/defaultUtils ' ;
4+
55import * as constants from '../constants' ;
66import Immutable from 'immutable' ;
77
@@ -29,25 +29,25 @@ export const addRule = (config, path, properties) => ({
2929 properties : defaultRuleProperties ( config ) . merge ( properties || { } )
3030} ) ;
3131
32- /**
33- * @param {object } config
34- * @param {Immutable.List } path
35- */
36- export const removeRuleOld = ( config , path ) => {
37- return ( dispatch , getState ) => {
38- dispatch ( {
39- type : constants . REMOVE_RULE ,
40- path : path ,
41- config : config
42- } ) ;
43-
44- const { tree } = getState ( ) ;
45- const parentPath = path . slice ( 0 , - 1 ) ;
46- if ( ! hasChildren ( tree , parentPath ) ) {
47- dispatch ( addRule ( config , parentPath ) ) ;
48- }
49- } ;
50- } ;
32+ // / **
33+ // * @param {object } config
34+ // * @param {Immutable.List } path
35+ // */
36+ // export const removeRuleOld = (config, path) => {
37+ // return (dispatch, getState) => {
38+ // dispatch({
39+ // type: constants.REMOVE_RULE,
40+ // path: path,
41+ // config: config
42+ // });
43+
44+ // const { tree } = getState();
45+ // const parentPath = path.slice(0, -1);
46+ // if (!hasChildren(tree, parentPath)) {
47+ // dispatch(addRule(config, parentPath));
48+ // }
49+ // };
50+ // };
5151
5252/**
5353 * @param {object } config
@@ -60,28 +60,28 @@ export const removeRule = (config, path) => ({
6060} ) ;
6161
6262
63- /**
64- * @param {object } config
65- * @param {Immutable.List } path
66- * @param {object } properties
67- */
68- export const addGroupOld = ( config , path , properties ) => {
69- return ( dispatch ) => {
70- const groupUuid = uuid ( ) ;
71-
72- dispatch ( {
73- type : constants . ADD_GROUP ,
74- path : path ,
75- id : groupUuid ,
76- properties : defaultGroupProperties ( config ) . merge ( properties || { } ) ,
77- config : config
78- } ) ;
79-
80- const groupPath = path . push ( groupUuid ) ;
81- dispatch ( addRule ( config , groupPath ) ) ;
82- dispatch ( addRule ( config , groupPath ) ) ;
83- } ;
84- } ;
63+ // / **
64+ // * @param {object } config
65+ // * @param {Immutable.List } path
66+ // * @param {object } properties
67+ // */
68+ // export const addGroupOld = (config, path, properties) => {
69+ // return (dispatch) => {
70+ // const groupUuid = uuid();
71+
72+ // dispatch({
73+ // type: constants.ADD_GROUP,
74+ // path: path,
75+ // id: groupUuid,
76+ // properties: defaultGroupProperties(config).merge(properties || {}),
77+ // config: config
78+ // });
79+
80+ // const groupPath = path.push(groupUuid);
81+ // dispatch(addRule(config, groupPath));
82+ // dispatch(addRule(config, groupPath));
83+ // };
84+ // };
8585
8686/**
8787 * @param {object } config
@@ -97,25 +97,25 @@ export const addGroup = (config, path, properties) => ({
9797
9898
9999
100- /**
101- * @param {object } config
102- * @param {Immutable.List } path
103- */
104- export const removeGroupOld = ( config , path ) => {
105- return ( dispatch , getState ) => {
106- dispatch ( {
107- type : constants . REMOVE_GROUP ,
108- path : path ,
109- config : config
110- } ) ;
111-
112- const { tree } = getState ( ) ;
113- const parentPath = path . slice ( 0 , - 1 ) ;
114- if ( ! hasChildren ( tree , parentPath ) ) {
115- dispatch ( addRule ( config , parentPath ) ) ;
116- }
117- } ;
118- } ;
100+ // / **
101+ // * @param {object } config
102+ // * @param {Immutable.List } path
103+ // */
104+ // export const removeGroupOld = (config, path) => {
105+ // return (dispatch, getState) => {
106+ // dispatch({
107+ // type: constants.REMOVE_GROUP,
108+ // path: path,
109+ // config: config
110+ // });
111+
112+ // const { tree } = getState();
113+ // const parentPath = path.slice(0, -1);
114+ // if (!hasChildren(tree, parentPath)) {
115+ // dispatch(addRule(config, parentPath));
116+ // }
117+ // };
118+ // };
119119
120120/**
121121 * @param {object } config
0 commit comments