PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.1.3
JetFormBuilder — Dynamic Blocks Form Builder v3.1.3
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 / events / store / selectors.js
jetformbuilder / assets / src / package / events / 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
selectors.js
74 lines
1 const selectors = {
2 getTypeIndex( state, slug ) {
3 return state.types.findIndex( event => event.value === slug );
4 },
5 getTypes( state ) {
6 return state.types;
7 },
8 getGatewayTypes( state ) {
9 return state.types.filter( event => (
10 'gateway' in event
11 ) );
12 },
13 getAlwaysTypes( state ) {
14 return state.types.filter( event => (
15 'always' in event
16 ) );
17 },
18 getDynamicTypes( state ) {
19 return state.types.filter( ( { isDynamic } ) => isDynamic );
20 },
21 getType( state, slug ) {
22 const index = selectors.getTypeIndex( state, slug );
23
24 return state.types[ index ];
25 },
26 getUnsupported( state, actionId ) {
27 const action = state.lockedActions[ actionId ] ?? false;
28
29 if ( false === action ) {
30 return [];
31 }
32
33 return action.unsupported;
34 },
35 getSupported( state, actionId ) {
36 const action = state.lockedActions[ actionId ] ?? false;
37
38 if ( false === action ) {
39 return [];
40 }
41
42 return action.supported;
43 },
44 isValid( state, actionId, eventSlug ) {
45 const unsupported = selectors.getUnsupported( state, actionId );
46
47 if ( unsupported.length && unsupported.includes( eventSlug ) ) {
48 return false;
49 }
50
51 const supported = selectors.getSupported( state, actionId );
52
53 return (
54 !supported.length || supported.includes( eventSlug )
55 );
56 },
57 filterList( state, actionId, eventList ) {
58 return eventList.filter(
59 current => selectors.isValid( state, actionId, current ) );
60 },
61 getHelpMap( state ) {
62 const map = {};
63
64 for ( const { value, help } of state.types ) {
65 map[ value ] = help;
66 }
67
68 return map;
69 },
70 };
71
72 export default {
73 ...selectors,
74 };