PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.1.1
JetFormBuilder — Dynamic Blocks Form Builder v3.1.1
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 / integration-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
integration-component.js
81 lines
1 import BaseActionComponent from "./base-action-component";
2
3 const { getFormFieldsBlocks } = JetFBActions;
4
5 export default class IntegrationComponent extends BaseActionComponent {
6
7 constructor( props ) {
8 super( props );
9
10 this.validateAPIKey = this.validateAPIKey.bind( this );
11 this.getApiData = this.getApiData.bind( this );
12 this.getLists = this.getLists.bind( this );
13
14 this.formFieldsList = getFormFieldsBlocks( [], '--' );
15
16 this.state = {
17 className: [ this.getclassNameValidateButton() ],
18 };
19 }
20
21 validateAPIKey( customApiKey = false ) {
22 this.setState( { className: [ 'loading' ] } );
23
24 if ( customApiKey && 'string' === typeof customApiKey ) {
25 this.getApiData( customApiKey );
26 return;
27 }
28 const settings = this.props.settings;
29 this.getApiData( settings.api_key );
30 }
31
32 getApiData( apiKey ) {
33 const self = this;
34
35 if ( ! apiKey ) {
36 self.onChangeSetting( null, 'isValidAPI' );
37 self.setState( { className: [] } );
38 return;
39 }
40
41 jQuery.ajax( {
42 url: ajaxurl,
43 type: 'POST',
44 data: {
45 'action': this.props.source.action,
46 'api_key': apiKey
47 },
48 success: function ( response ) {
49 if ( response.success ) {
50 self.onChangeSettingObj( {
51 isValidAPI: true,
52 data: response.data
53 } );
54
55 self.setState( { className: [ 'is-valid' ] } );
56 }
57 else {
58 self.onChangeSettingObj( { isValidAPI: false } );
59 self.setState( { className: [ 'is-invalid' ] } );
60 }
61 },
62 error: function () {
63 self.onChangeSettingObj( { isValidAPI: false } );
64 self.setState( { className: [ 'is-invalid' ] } );
65 }
66 } );
67
68
69 }
70
71 getclassNameValidateButton() {
72 const settings = this.props.settings;
73
74 if ( true === settings.isValidAPI ) {
75 return 'is-valid';
76 }
77 else if ( false === settings.isValidAPI ) {
78 return 'is-invalid';
79 }
80 }
81 }