PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.1.2
JetFormBuilder — Dynamic Blocks Form Builder v3.1.2
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 / editor / form-actions / base-action-component.js
jetformbuilder / assets / src / editor / form-actions Last commit date
call.hook 2 years ago call.webhook 2 years ago getresponse 2 years ago insert.post 2 years ago mailchimp 2 years ago redirect.to.page 2 years ago register.user 2 years ago save.record 2 years ago send.email 2 years ago update.user 2 years ago base-action-component.js 2 years ago integration-component.js 2 years ago
base-action-component.js
78 lines
1 export default class BaseActionComponent extends wp.element.Component {
2
3 addPlaceholderForSelect( array, label = '--' ) {
4 return [
5 { label },
6 ...array,
7 ];
8 }
9
10 onChangeSetting( value, key ) {
11 this.props.onChange( {
12 ...this.props.settings,
13 [ key ]: value,
14 } );
15 };
16
17 onChangeSettingObj( value ) {
18 this.props.onChange( {
19 ...this.props.settings,
20 ...value,
21 } );
22 };
23
24 getFieldDefault( name ) {
25 const source = 'fields_map';
26
27 return this.getFieldByName(
28 { name, source },
29 );
30 }
31
32 getFieldMeta( name ) {
33 const source = 'meta_fields_map';
34
35 return this.getFieldByName(
36 { name, source },
37 );
38 }
39
40 getFieldByName( { source, name } ) {
41 const settings = this.props.settings;
42
43 if ( typeof settings[ source ] !== 'undefined' && typeof settings[ source ][ name ] !== 'undefined' ) {
44 return settings[ source ][ name ];
45 }
46 return '';
47 }
48
49 onChangeFieldMap( value, nameField ) {
50 const source = 'fields_map';
51
52 this.changeFieldsMap(
53 { value, nameField, source },
54 );
55 };
56
57 onChangeMetaFieldMap( value, nameField ) {
58 const source = 'meta_fields_map';
59
60 this.changeFieldsMap(
61 { value, nameField, source },
62 );
63 };
64
65 changeFieldsMap( { source, nameField, value } ) {
66 const fieldsMap = Object.assign(
67 {},
68 this.props.settings[ source ],
69 { [ nameField ]: value },
70 );
71
72 this.props.onChange( {
73 ...this.props.settings,
74 [ source ]: fieldsMap,
75 } );
76 }
77
78 }