PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.1.6
JetFormBuilder — Dynamic Blocks Form Builder v3.1.6
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 / gateways / store / dispatchers.js
jetformbuilder / assets / src / package / gateways / store Last commit date
actions.js 2 years ago constants.js 2 years ago dispatchers.js 2 years ago index.js 2 years ago reducer.js 2 years ago selectors.js 2 years ago
dispatchers.js
119 lines
1 import constants from './constants';
2 import selectors from './selectors';
3
4 export default {
5 [ constants.clearGateway ]: ( state, action ) => (
6 {
7 ...state,
8 currentGateway: {},
9 }
10 ),
11 [ constants.clearScenario ]: ( state, action ) => (
12 {
13 ...state,
14 currentScenario: {},
15 }
16 ),
17 [ constants.setScenario ]: ( state, action ) => (
18 {
19 ...state,
20 currentScenario: {
21 ...state.currentScenario,
22 ...(
23 action.item || {}
24 ),
25 },
26 }
27 ),
28 [ constants.setGateway ]: ( state, action ) => (
29 {
30 ...state,
31 currentGateway: {
32 ...state.currentGateway,
33 ...action.item,
34 },
35 }
36 ),
37 [ constants.setGatewaySpecific ]: ( state, action ) => (
38 {
39 ...state,
40 currentGateway: {
41 ...state.currentGateway,
42 [ state.currentGateway.gateway ]: {
43 ...selectors.getGatewaySpecific( state ),
44 ...action.item,
45 },
46 },
47 }
48 ),
49 [ constants.setGatewayInner ]: ( state, action ) => {
50 const { key, value } = action.item;
51 return {
52 ...state,
53 currentGateway: {
54 ...state.currentGateway,
55 [ key ]: {
56 ...(
57 state.currentGateway[ key ] || {}
58 ),
59 ...value,
60 },
61 },
62 };
63 },
64 [ constants.setRequest ]: ( state, action ) => {
65 const items = [ selectors.getGatewayId( state ), action.item?.id ].filter( value => value );
66 action.item.id = items.join( '/' );
67
68 return {
69 ...state,
70 currentRequest: action.item,
71 };
72 },
73 [ constants.setCurrentScenario ]: ( state, action ) => (
74 {
75 ...state,
76 currentScenario: {
77 ...state.currentScenario,
78 [ state.currentScenario?.id ]: {
79 ...(
80 state.currentScenario[ state.currentScenario?.id ] || {}
81 ),
82 ...(
83 action.item || {}
84 ),
85 },
86 },
87 }
88 ),
89 [ constants.hardSetGateway ]: ( state, action ) => {
90 if ( action.item ) {
91 state.currentGateway[ action.item ] = action.value;
92 }
93
94 return {
95 ...state,
96 };
97 },
98 [ constants.hardSetGatewaySpecific ]: ( state, action ) => {
99 if ( action.item && state.currentGateway?.gateway ) {
100 state.currentGateway[ state.currentGateway?.gateway ] = {};
101 state.currentGateway[ state.currentGateway?.gateway ][ action.item ] = action.value;
102 }
103
104 return {
105 ...state,
106 };
107 },
108 [ constants.registerEventType ]: ( state, action ) => {
109 const event = {
110 ...action.item,
111 gateway: action.item?.gateway ?? state.currentGateway?.gateway,
112 scenario: action.item?.scenario ?? state.currentScenario?.id,
113 };
114
115 state.eventTypes.push( event );
116
117 return state;
118 },
119 };