Skip to content

Commit c7802a7

Browse files
authored
Merge pull request #23 from Bit-Apps-Pro/niloy-dev
Version updated to 2.1.3
2 parents 0b88cd2 + f861603 commit c7802a7

File tree

19 files changed

+728
-1693
lines changed

19 files changed

+728
-1693
lines changed

bitwpfi.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Plugin Name: Bit Integrations
55
* Plugin URI: https://bitapps.pro/bit-integrations
66
* Description: Bit Integrations is a platform that integrates with over 200+ different platforms to help with various tasks on your WordPress site, like WooCommerce, Form builder, Page builder, LMS, Sales funnels, Bookings, CRM, Webhooks, Email marketing, Social media and Spreadsheets, etc
7-
* Version: 2.1.2
7+
* Version: 2.1.3
88
* Author: Automation & Integration Plugin - Bit Apps
99
* Author URI: https://bitapps.pro
1010
* Text Domain: bit-integrations
@@ -23,7 +23,7 @@
2323
$btcbi_db_version = '1.0';
2424

2525
// Define most essential constants.
26-
define('BTCBI_VERSION', '2.1.2');
26+
define('BTCBI_VERSION', '2.1.3');
2727
define('BTCBI_PLUGIN_MAIN_FILE', __FILE__);
2828

2929
require_once plugin_dir_path(__FILE__) . 'includes/loader.php';

frontend-dev/src/components/AllIntegrations/ActiveCampaign/ActiveCampaign.jsx

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ function ActiveCampaign({ formFields, setFlow, flow, allIntegURL }) {
2121
const [activeCampaingConf, setActiveCampaingConf] = useState({
2222
name: 'Active Campaign',
2323
type: 'ActiveCampaign',
24-
api_url: process.env.NODE_ENV === 'development' ? 'https://bitcode.api-us1.com' : '',
25-
api_key: process.env.NODE_ENV === 'development' ? 'ff38f360de82ec99e1ac0fc5d83cbb5404ade1ab3a62c723ce089e2ad4da3f6cd362e779' : '',
26-
field_map: [
27-
{ formField: '', activeCampaignField: '' },
28-
],
29-
actions: {},
24+
api_url: process.env.NODE_ENV === 'development' ? 'https://furnato.activehosted.com' : '',
25+
api_key:
26+
process.env.NODE_ENV === 'development'
27+
? 'b2b11fa4ba55b77e5d31bcc7f1ce36461efc523c3fe1536d0f37e05892c15a924e705a5f'
28+
: '',
29+
field_map: [{ formField: '', activeCampaignField: '' }],
30+
actions: {}
3031
})
3132
const nextPage = (val) => {
3233
// setIsLoading(true)
@@ -50,7 +51,9 @@ function ActiveCampaign({ formFields, setFlow, flow, allIntegURL }) {
5051
return (
5152
<div>
5253
<SnackMsg snack={snack} setSnackbar={setSnackbar} />
53-
<div className="txt-center mt-2"><Steps step={3} active={step} /></div>
54+
<div className="txt-center mt-2">
55+
<Steps step={3} active={step} />
56+
</div>
5457

5558
{/* STEP 1 */}
5659
<ActiveCampaignAuthorization
@@ -64,8 +67,9 @@ function ActiveCampaign({ formFields, setFlow, flow, allIntegURL }) {
6467
setSnackbar={setSnackbar}
6568
/>
6669
{/* STEP 2 */}
67-
<div className="btcd-stp-page" style={{ width: step === 2 && 900, height: step === 2 && 'auto' }}>
68-
70+
<div
71+
className="btcd-stp-page"
72+
style={{ width: step === 2 && 900, height: step === 2 && 'auto' }}>
6973
<ActiveCampaignIntegLayout
7074
formID={formID}
7175
formFields={formFields}
@@ -79,20 +83,27 @@ function ActiveCampaign({ formFields, setFlow, flow, allIntegURL }) {
7983
onClick={() => nextPage(3)}
8084
disabled={!activeCampaingConf?.listId || activeCampaingConf.field_map.length < 1}
8185
className="btn f-right btcd-btn-lg purple sh-sm flx"
82-
type="button"
83-
>
84-
{__('Next', 'bit-integrations')}
85-
{' '}
86-
&nbsp;
86+
type="button">
87+
{__('Next', 'bit-integrations')} &nbsp;
8788
<BackIcn className="ml-1 rev-icn" />
8889
</button>
89-
9090
</div>
9191

9292
{/* STEP 3 */}
9393
<IntegrationStepThree
9494
step={step}
95-
saveConfig={() => saveIntegConfig(flow, setFlow, allIntegURL, activeCampaingConf, navigate, '', '', setIsLoading)}
95+
saveConfig={() =>
96+
saveIntegConfig(
97+
flow,
98+
setFlow,
99+
allIntegURL,
100+
activeCampaingConf,
101+
navigate,
102+
'',
103+
'',
104+
setIsLoading
105+
)
106+
}
96107
isLoading={isLoading}
97108
dataConf={activeCampaingConf}
98109
setDataConf={setActiveCampaingConf}

frontend-dev/src/components/AllIntegrations/FreshSales/EditFreshSales.jsx

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ import { useRecoilState, useRecoilValue } from 'recoil'
77
import { $actionConf, $formFields, $newFlow } from '../../../GlobalStates'
88
import { __ } from '../../../Utils/i18nwrap'
99
import SnackMsg from '../../Utilities/SnackMsg'
10-
import EditFormInteg from '../EditFormInteg'
11-
import SetEditIntegComponents from '../IntegrationHelpers/SetEditIntegComponents'
1210
import { saveActionConf } from '../IntegrationHelpers/IntegrationHelpers'
13-
import EditWebhookInteg from '../EditWebhookInteg'
1411
import IntegrationStepThree from '../IntegrationHelpers/IntegrationStepThree'
12+
import SetEditIntegComponents from '../IntegrationHelpers/SetEditIntegComponents'
1513
import { checkMappedFields, checkRequired, handleInput } from './FreshSalesCommonFunc'
1614
import FreshSalesIntegLayout from './FreshSalesIntegLayout'
1715

@@ -22,28 +20,16 @@ function EditFreshSales({ allIntegURL }) {
2220
const [flow, setFlow] = useRecoilState($newFlow)
2321
const [isLoading, setIsLoading] = useState(false)
2422
const [snack, setSnackbar] = useState({ show: false })
25-
const [tab, settab] = useState(0)
2623
const formFields = useRecoilValue($formFields)
2724

28-
const setIntegName = (e, recordTab, freshSalesConf, setFreshSalesConf) => {
25+
const setIntegName = (e, freshSalesConf, setFreshSalesConf) => {
2926
const newConf = { ...freshSalesConf }
3027
const { name } = e.target
3128

32-
if (recordTab === 0) {
33-
if (e.target.value !== '') {
34-
newConf[name] = e.target.value
35-
} else {
36-
delete newConf[name]
37-
}
29+
if (e.target.value !== '') {
30+
newConf[name] = e.target.value
3831
} else {
39-
if (!newConf.relatedlists) {
40-
newConf.relatedlists = [];
41-
}
42-
if (e.target.value !== "") {
43-
newConf.relatedlists[recordTab - 1][e.target.name] = e.target.value
44-
} else {
45-
delete newConf.relatedlists[recordTab - 1][e.target.name];
46-
}
32+
delete newConf[name]
4733
}
4834
setFreshSalesConf({ ...newConf })
4935
}
@@ -55,35 +41,54 @@ function EditFreshSales({ allIntegURL }) {
5541
}
5642
if (!checkRequired(freshSalesConf)) {
5743
if (['Deal', 'Contact'].includes(freshSalesConf.moduleData.module)) {
58-
setSnackbar({ show: true, msg: __('Please select a account or a contact', 'bit-integrations') })
44+
setSnackbar({
45+
show: true,
46+
msg: __('Please select a account or a contact', 'bit-integrations')
47+
})
5948
}
6049
if (freshSalesConf.moduleData.module === 'Contacts') {
6150
setSnackbar({ show: true, msg: __('Please select a account', 'bit-integrations') })
6251
}
6352
return
6453
}
6554

66-
saveActionConf({ flow, setFlow, allIntegURL, conf: freshSalesConf, navigate, id, edit: 1, setIsLoading, setSnackbar })
55+
saveActionConf({
56+
flow,
57+
setFlow,
58+
allIntegURL,
59+
conf: freshSalesConf,
60+
navigate,
61+
id,
62+
edit: 1,
63+
setIsLoading,
64+
setSnackbar
65+
})
6766
}
6867
return (
6968
<div style={{ width: 900 }}>
7069
<SnackMsg snack={snack} setSnackbar={setSnackbar} />
7170

7271
<div className="flx mt-3">
7372
<b className="wdt-200 ">{__('Integration Name:', 'bit-integrations')}</b>
74-
<input className="btcd-paper-inp w-5" onChange={e => setIntegName(e, tab, freshSalesConf, setFreshSalesConf)} name="name" value={freshSalesConf.name} type="text" placeholder={__('Integration Name...', 'bit-integrations')} />
73+
<input
74+
className="btcd-paper-inp w-5"
75+
onChange={(e) => setIntegName(e, freshSalesConf, setFreshSalesConf)}
76+
name="name"
77+
value={freshSalesConf.name}
78+
type="text"
79+
placeholder={__('Integration Name...', 'bit-integrations')}
80+
/>
7581
</div>
7682
<br />
7783

78-
7984
<SetEditIntegComponents entity={flow.triggered_entity} setSnackbar={setSnackbar} />
8085

8186
<FreshSalesIntegLayout
82-
tab={tab}
83-
settab={settab}
8487
formID={flow.triggered_entity_id}
8588
formFields={formFields}
86-
handleInput={(e) => handleInput(e, tab, freshSalesConf, setFreshSalesConf, setIsLoading, setSnackbar)}
89+
handleInput={(e) =>
90+
handleInput(e, freshSalesConf, setFreshSalesConf, setIsLoading, setSnackbar)
91+
}
8792
freshSalesConf={freshSalesConf}
8893
setFreshSalesConf={setFreshSalesConf}
8994
isLoading={isLoading}

frontend-dev/src/components/AllIntegrations/FreshSales/FreshSales.jsx

Lines changed: 38 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -17,49 +17,51 @@ function FreshSales({ formFields, setFlow, flow, allIntegURL }) {
1717
const [isLoading, setIsLoading] = useState(false)
1818
const [step, setstep] = useState(1)
1919
const [snack, setSnackbar] = useState({ show: false })
20-
const [tab, settab] = useState(0)
2120

2221
const [freshSalesConf, setFreshSalesConf] = useState({
2322
name: 'FreshSales',
2423
type: 'FreshSales',
25-
api_key: process.env.NODE_ENV === 'development' ? '6Vs6MISKGGdRldxh9qrPGA' : '',
26-
bundle_alias: process.env.NODE_ENV === 'development' ? 'atc1-533599418831228470.myfreshworks.com/crm/sales' : '',
27-
default:
28-
{
24+
api_key: process.env.NODE_ENV === 'development' ? '6nF6wAQj5EukXP0JLcysrA' : '',
25+
bundle_alias:
26+
process.env.NODE_ENV === 'development'
27+
? 'bitapps-728497918782196505.myfreshworks.com/crm/sales'
28+
: '',
29+
default: {
2930
modules: {
3031
Account: {
3132
required: true,
32-
requiredFields: [
33-
],
33+
requiredFields: []
3434
},
3535
Deal: {
3636
required: true,
37-
requiredFields: [
38-
],
37+
requiredFields: []
3938
},
4039
Contact: {
4140
required: true,
42-
requiredFields: [
43-
],
41+
requiredFields: []
4442
},
4543
Product: {
4644
requiredFields: [
4745
// 'name',
48-
],
49-
},
50-
51-
},
46+
]
47+
}
48+
}
5249
},
5350
moduleData: { module: '' },
54-
field_map: [
55-
{ formField: '', freshSalesFormField: '' },
56-
],
57-
relatedlists: [],
58-
actions: {},
51+
field_map: [{ formField: '', freshSalesFormField: '' }],
52+
actions: {}
5953
})
6054

6155
const saveConfig = () => {
62-
saveActionConf({ flow, setFlow, allIntegURL, conf: freshSalesConf, navigate, setIsLoading, setSnackbar })
56+
saveActionConf({
57+
flow,
58+
setFlow,
59+
allIntegURL,
60+
conf: freshSalesConf,
61+
navigate,
62+
setIsLoading,
63+
setSnackbar
64+
})
6365
}
6466
const nextPage = (pageNo) => {
6567
setTimeout(() => {
@@ -72,7 +74,10 @@ function FreshSales({ formFields, setFlow, flow, allIntegURL }) {
7274
}
7375
if (!checkRequired(freshSalesConf)) {
7476
if (['Deal', 'Contact'].includes(freshSalesConf.moduleData.module)) {
75-
setSnackbar({ show: true, msg: __('Please select a account or a contact', 'bit-integrations') })
77+
setSnackbar({
78+
show: true,
79+
msg: __('Please select a account or a contact', 'bit-integrations')
80+
})
7681
}
7782
if (freshSalesConf.moduleData.module === 'Contacts') {
7883
setSnackbar({ show: true, msg: __('Please select a account', 'bit-integrations') })
@@ -85,7 +90,9 @@ function FreshSales({ formFields, setFlow, flow, allIntegURL }) {
8590
return (
8691
<div>
8792
<SnackMsg snack={snack} setSnackbar={setSnackbar} />
88-
<div className="txt-center mt-2"><Steps step={3} active={step} /></div>
93+
<div className="txt-center mt-2">
94+
<Steps step={3} active={step} />
95+
</div>
8996

9097
{/* STEP 1 */}
9198
<FreshSalesAuthorization
@@ -100,14 +107,15 @@ function FreshSales({ formFields, setFlow, flow, allIntegURL }) {
100107
/>
101108

102109
{/* STEP 2 */}
103-
<div className="btcd-stp-page" style={{ ...(step === 2 && { width: 900, height: 'auto', overflow: 'visible' }) }}>
104-
110+
<div
111+
className="btcd-stp-page"
112+
style={{ ...(step === 2 && { width: 900, height: 'auto', overflow: 'visible' }) }}>
105113
<FreshSalesIntegLayout
106-
tab={tab}
107-
settab={settab}
108114
formID={formID}
109115
formFields={formFields}
110-
handleInput={(e) => handleInput(e, tab, freshSalesConf, setFreshSalesConf, formID, setIsLoading, setSnackbar)}
116+
handleInput={(e) =>
117+
handleInput(e, freshSalesConf, setFreshSalesConf, formID, setIsLoading, setSnackbar)
118+
}
111119
freshSalesConf={freshSalesConf}
112120
setFreshSalesConf={setFreshSalesConf}
113121
isLoading={isLoading}
@@ -119,11 +127,8 @@ function FreshSales({ formFields, setFlow, flow, allIntegURL }) {
119127
onClick={() => nextPage(3)}
120128
disabled={freshSalesConf.moduleData.module === '' || freshSalesConf.field_map.length < 1}
121129
className="btn f-right btcd-btn-lg purple sh-sm flx"
122-
type="button"
123-
>
124-
{__('Next', 'bit-integrations')}
125-
{' '}
126-
&nbsp;
130+
type="button">
131+
{__('Next', 'bit-integrations')} &nbsp;
127132
<div className="btcd-icn icn-arrow_back rev-icn d-in-b" />
128133
</button>
129134
</div>

0 commit comments

Comments
 (0)