PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.1.0
JetFormBuilder — Dynamic Blocks Form Builder v3.1.0
3.6.5.2 3.6.5.1 3.6.5 3.6.4.2 3.6.4.1 3.6.4 3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / assets / src / package / actions / store / dispatchers.js
jetformbuilder / assets / src / package / actions / store Last commit date
actions.js 3 years ago constants.js 3 years ago default.state.js 3 years ago dispatchers.js 3 years ago functions.js 3 years ago index.js 3 years ago loading.state.js 3 years ago reducer.js 3 years ago selectors.js 3 years ago
dispatchers.js
117 lines
1 import constants from './constants';
2 import selectors from './selectors';
3 import functions from './functions';
4 import withActionLocalizeScript from '../helpers/withActionLocalizeScript';
5
6 export default {
7 [ constants.setCurrentAction ]: ( state, action ) => {
8 const update = {};
9
10 if ( 'function' === typeof action.item ) {
11 update.currentAction = action.item( state.currentAction );
12 }
13 else {
14 update.currentAction = action.item;
15 }
16
17 return {
18 ...state,
19 ...update,
20 };
21 },
22 [ constants.setMeta ]: ( state, action ) => (
23 {
24 ...state,
25 meta: {
26 ...action.item,
27 },
28 }
29 ),
30 [ constants.clearCurrent ]: ( state ) => (
31 {
32 ...state,
33 currentAction: {},
34 meta: {},
35 }
36 ),
37 [ constants.setLoading ]: ( state, action ) => {
38 const actionIndex = selectors.getLoadingIndex( state, action.state.id );
39 const loading = [ ...state.loadingState ];
40
41 if ( -1 !== actionIndex ) {
42 loading[ actionIndex ] = functions.getLoadingItem( action.state );
43 }
44 else {
45 loading.push( functions.getLoadingItem( action.state ) );
46 }
47
48 return {
49 ...state,
50 loadingState: loading,
51 };
52 },
53 [ constants.updateCurrentSettings ]: ( state, action ) => {
54 const { settings, type } = state.currentAction;
55
56 const updateSettings = {
57 ...selectors.getCurrentSettings( state ),
58 ...action.item,
59 };
60
61 return {
62 ...state,
63 currentAction: {
64 ...state.currentAction,
65 settings: {
66 ...settings,
67 [ type ]: updateSettings,
68 },
69 },
70 };
71 },
72 [ constants.updateCurrentConditions ]: ( state, action ) => {
73 const { conditions = [] } = state.currentAction;
74
75 const update = 'function' === typeof action.item ? action.item(
76 conditions ) : action.item;
77
78 return {
79 ...state,
80 currentAction: {
81 ...state.currentAction,
82 conditions: update,
83 },
84 };
85 },
86 [ constants.addCallback ]: ( state, action ) => (
87 {
88 ...state,
89 callbacks: {
90 ...state.callbacks,
91 [ action.actionType ]: withActionLocalizeScript(
92 action.actionType,
93 action.callback,
94 ),
95 },
96 }
97 ),
98 [ constants.addDetail ]: ( state, action ) => (
99 {
100 ...state,
101 details: {
102 ...state.details,
103 [ action.actionType ]: action.item,
104 },
105 }
106 ),
107 [ constants.addComputedField ]: ( state, action ) => (
108 {
109 ...state,
110 computedFields: [
111 ...state.computedFields,
112 action.field
113 ]
114 }
115 ),
116
117 };