Skip to content

Commit a60b4e1

Browse files
authored
Merge pull request #10 from Bit-Apps-Pro/niloy-dev
Version updated to 2.0.2
2 parents 2865ddf + fad9e23 commit a60b4e1

31 files changed

+458
-314
lines changed

bitwpfi.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,26 @@
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.0.1
7+
* Version: 2.0.2
88
* Author: Automation & Integration Plugin - Bit Apps
99
* Author URI: https://bitapps.pro
1010
* Text Domain: bit-integrations
1111
* Requires PHP: 7.0
1212
* Requires at least: 5.1
13-
* Tested up to: 6.4.3
13+
* Tested up to: 6.5.3
1414
* Domain Path: /languages
15-
* License: gpl2+
15+
* License: GPLv2 or later
1616
*/
1717

18-
/***
19-
* If try to direct access plugin folder it will Exit
20-
**/
18+
// If try to direct access plugin folder it will Exit
2119
if (!defined('ABSPATH')) {
2220
exit;
2321
}
2422
global $btcbi_db_version;
2523
$btcbi_db_version = '1.0';
2624

2725
// Define most essential constants.
28-
define('BTCBI_VERSION', '2.0.1');
26+
define('BTCBI_VERSION', '2.0.2');
2927
define('BTCBI_PLUGIN_MAIN_FILE', __FILE__);
3028

3129
require_once plugin_dir_path(__FILE__) . 'includes/loader.php';
@@ -38,9 +36,9 @@ function btcbi_activate_plugin($network_wide)
3836
esc_html__('Error Activating', 'bit-integrations')
3937
);
4038
}
41-
if (version_compare(PHP_VERSION, '5.6.0', '<')) {
39+
if (version_compare(PHP_VERSION, '7.0', '<')) {
4240
wp_die(
43-
esc_html__('Forms Integrationsw requires PHP version 5.6.', 'bit-integrations'),
41+
esc_html__('Forms Integrationsw requires PHP version 7.0.', 'bit-integrations'),
4442
esc_html__('Error Activating', 'bit-integrations')
4543
);
4644
}

frontend-dev/src/App.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,10 @@ function App() {
9090
<a
9191
target="_blank"
9292
href="https://wordpress.org/plugins/bit-integrations/#reviews"
93-
className="app-link"
93+
className="app-link green blink"
9494
rel="noreferrer"
9595
>
96+
{/* <marquee behavior="scroll" direction="up"></marquee> */}
9697
{__('Review us', 'bit-integrations')}
9798
</a>
9899

frontend-dev/src/components/AllIntegrations/Clickup/ClickupActions.jsx

Lines changed: 13 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,9 @@ import TableCheckBox from '../../Utilities/TableCheckBox'
88
import 'react-multiple-select-dropdown-lite/dist/index.css'
99
import Loader from '../../Loaders/Loader'
1010

11-
export default function ClickupActions({ clickupConf, setClickupConf, loading, setLoading }) {
11+
export default function ClickupActions({ clickupConf, setClickupConf, formFields, loading, setLoading }) {
1212
const [actionMdl, setActionMdl] = useState({ show: false, action: () => { } })
1313

14-
const followUps = [
15-
{ label: 'Yes', value: 'yes' },
16-
{ label: 'No', value: 'no' },
17-
]
18-
19-
const taskTypes = [
20-
{ label: 'New Business', value: 'New Business' },
21-
{ label: 'Existing Business', value: 'Existing Business' },
22-
]
23-
24-
const actionHandler = (e, type) => {
25-
const newConf = { ...clickupConf }
26-
27-
if (type === 'tag') {
28-
if (e.target?.checked) {
29-
getAllTags(clickupConf, setClickupConf, setLoading)
30-
newConf.actions.tag = true
31-
} else {
32-
setActionMdl({ show: false })
33-
delete newConf.actions.tag
34-
}
35-
}
36-
37-
setActionMdl({ show: type })
38-
setClickupConf({ ...newConf })
39-
}
40-
4114
const clsActionMdl = () => {
4215
setActionMdl({ show: false })
4316
}
@@ -51,50 +24,27 @@ export default function ClickupActions({ clickupConf, setClickupConf, loading, s
5124

5225
return (
5326
<div className="pos-rel d-flx flx-wrp">
54-
{(clickupConf.actionName === 'task') && <TableCheckBox checked={clickupConf?.selectedTag?.length || false} onChange={(e) => actionHandler(e, 'tag')} className="wdt-200 mt-4 mr-2" value="tag" title={__('Add Tag', 'bit - integrations')} subTitle={__('Add an tag')} />}
55-
{/* {(clickupConf.actionName === 'deal') && <TableCheckBox checked={clickupConf?.selectedTeam?.length || false} onChange={(e) => actionHandler(e, 'team')} className="wdt-200 mt-4 mr-2" value="team" title={__('Add Team', 'bit - integrations')} subTitle={__('Add an team')} />} */}
56-
{/* {(clickupConf.actionName === 'task') && <TableCheckBox checked={clickupConf?.selectedCurrency?.length || false} onChange={(e) => actionHandler(e, 'currency')} className="wdt-200 mt-4 mr-2" value="currency" title={__('Add Currency', 'bit - integrations')} subTitle={__('Add a currency')} />} */}
57-
{/* {(clickupConf.actionName === 'deal') && <TableCheckBox checked={clickupConf?.selectedStage?.length || false} onChange={(e) => actionHandler(e, 'stage')} className="wdt-200 mt-4 mr-2" value="stage" title={__('Add Stage', 'bit - integrations')} subTitle={__('Add a stage')} />} */}
27+
{<TableCheckBox checked={clickupConf?.attachment || false} onChange={() => setActionMdl({ show: 'attachment' })} className="wdt-200 mt-4 mr-2" value="attachment" title={__('Add Attachment', 'bit - integrations')} subTitle={__('Add attachment in the task')} />}
5828

5929
<ConfirmModal
6030
className="custom-conf-mdl"
6131
mainMdlCls="o-v"
6232
btnClass="blue"
6333
btnTxt={__('Ok', 'bit-integrations')}
64-
show={actionMdl.show === 'tag'}
34+
show={actionMdl.show === 'attachment'}
6535
close={clsActionMdl}
6636
action={clsActionMdl}
67-
title={__('Tags', 'bit-integrations')}
37+
title={__('Select file upload field', 'bit-integrations')}
6838
>
69-
<div className="btcd-hr mt-2 mb-2" />
70-
<div className="mt-2">
71-
{__('Select Tag', 'bit-integrations')}
72-
</div>
73-
74-
{
75-
loading.tags ? (
76-
<Loader style={{
77-
display: 'flex',
78-
justifyContent: 'center',
79-
alignItems: 'center',
80-
height: 45,
81-
transform: 'scale(0.5)',
82-
}}
83-
/>
84-
)
85-
: (
86-
<div className="flx flx-between mt-2">
87-
<MultiSelect
88-
options={clickupConf?.tags?.map(tag => ({ label: tag.name, value: tag.id }))}
89-
className="msl-wrp-options"
90-
defaultValue={clickupConf?.selectedTag}
91-
onChange={val => setChanges(val, 'selectedTag')}
92-
singleSelect
93-
/>
94-
<button onClick={() => getAllTags(clickupConf, setClickupConf, setLoading)} className="icn-btn sh-sm ml-2 mr-2 tooltip" style={{ '--tooltip-txt': `${__('Refresh Tags', 'bit-integrations')}'` }} type="button">&#x21BB;</button>
95-
</div>
96-
)
97-
}
39+
<div className="btcd-hr mt-2" />
40+
<div className="mt-2">{__('Select file upload field', 'bit-integrations')}</div>
41+
<MultiSelect
42+
defaultValue={clickupConf?.attachment}
43+
className="mt-2 w-9"
44+
onChange={(val) => setChanges(val, 'attachment')}
45+
options={formFields.filter(itm => (itm.type === 'file')).map(itm => ({ label: itm.label, value: itm.name }))}
46+
closeOnSelect
47+
/>
9848
</ConfirmModal>
9949

10050
</div>

frontend-dev/src/components/AllIntegrations/Clickup/ClickupCommonFunc.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,6 @@ export const getCustomFields = (confTmp, setConf, setLoading) => {
9595

9696
bitsFetch(requestParams, "clickup_fetch_custom_fields").then((result) => {
9797
if (result && result.success) {
98-
// const newConf = { ...confTmp };
99-
// if (result.data) {
100-
// newConf.customFields = result.data;
101-
// }
102-
// setConf(newConf);
10398
setConf((oldConf) => {
10499
const newConf = { ...oldConf };
105100
if (!newConf.default) {

frontend-dev/src/components/AllIntegrations/Clickup/ClickupIntegLayout.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,15 +222,15 @@ export default function ClickupIntegLayout({ formFields, handleInput, clickupCon
222222
<div className="txt-center btcbi-field-map-button mt-2"><button onClick={() => addFieldMap(clickupConf.field_map.length, clickupConf, setClickupConf, false)} className="icn-btn sh-sm" type="button">+</button></div>
223223
<br />
224224
<br />
225-
{/* <div className="mt-4"><b className="wdt-100">{__('Actions', 'bit-integrations')}</b></div>
225+
<div className="mt-4"><b className="wdt-100">{__('Actions', 'bit-integrations')}</b></div>
226226
<div className="btcd-hr mt-1" />
227227
<ClickupActions
228228
clickupConf={clickupConf}
229229
setClickupConf={setClickupConf}
230230
formFields={formFields}
231231
loading={loading}
232232
setLoading={setLoading}
233-
/> */}
233+
/>
234234
</div>
235235
)}
236236
</>

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

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import { getAllThriveApprenticeCourse, getAllThriveApprenticeLesson, getAllThriv
2727
import { getAllUMrole } from '../Triggers/TriggerHelpers/UltimateMemberHelper/UltimatedMemberCommonFunction'
2828
import { getAllGroundhoggTags } from '../Triggers/TriggerHelpers/GroundhoggHelper/GroundhoggCommonFunction'
2929
import { create } from 'mutative'
30+
import { getFluentBookingEvents } from '../Triggers/TriggerHelpers/FluentBookingHelper/FluentBookingCommonFunction.js'
3031

3132
function EditFormInteg({ setSnackbar, className = '' }) {
3233
const [forms, setForms] = useState([])
@@ -43,7 +44,7 @@ function EditFormInteg({ setSnackbar, className = '' }) {
4344
draftFlow.flow_details[type] = val
4445
}))
4546
}
46-
// console.log(flow.flow_details)
47+
4748
const handle = (e) => {
4849
const tmpInteg = { ...flow }
4950
const { name, value } = e.target
@@ -62,17 +63,19 @@ function EditFormInteg({ setSnackbar, className = '' }) {
6263
baseDataLoad(flow.triggered_entity, tmpInteg)
6364
}
6465

65-
const loadFormFields = bitsFetch(queryData, `${flow.triggered_entity.toLowerCase()}/get/form`).then((res) => {
66-
if (res.success) {
67-
setFormFields(res.data.fields)
68-
}
69-
return res.data
70-
})
71-
toast.promise(loadFormFields, {
72-
success: __('Form fields Refresh successfully', 'bit-integrations'),
73-
error: __('Error Occurred', 'bit-integrations'),
74-
loading: __('Loading Form Fields...'),
75-
})
66+
if (flow.triggered_entity !== 'FluentBooking') {
67+
const loadFormFields = bitsFetch(queryData, `${flow.triggered_entity.toLowerCase()}/get/form`).then((res) => {
68+
if (res.success) {
69+
setFormFields(res.data.fields)
70+
}
71+
return res.data
72+
})
73+
toast.promise(loadFormFields, {
74+
success: __('Form fields Refresh successfully', 'bit-integrations'),
75+
error: __('Error Occurred', 'bit-integrations'),
76+
loading: __('Loading Form Fields...'),
77+
})
78+
}
7679
}
7780

7881
const baseDataLoad = (trigger, data) => {
@@ -236,6 +239,9 @@ function EditFormInteg({ setSnackbar, className = '' }) {
236239
getAllUMrole(data, setFlow)
237240
}
238241
}
242+
if (trigger = 'fluentBooking') {
243+
getFluentBookingEvents(data, setFlow)
244+
}
239245
}
240246

241247
useEffect(() => {

frontend-dev/src/components/AllIntegrations/IntegrationHelpers/IntegrationHelpers.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
UltimateMemberStateIH,
2121
affiliateStateIH,
2222
buddybossStateIH,
23+
fluentBookingStateIH,
2324
fluentCrmStateIH,
2425
groundhoggStateIH,
2526
jetEngineStateIH,
@@ -82,6 +83,9 @@ export const saveIntegConfig = async (
8283
} else if (flow.triggered_entity === "TutorLms") {
8384
const dataFlow = edit ? flow?.flow_details : flow?.triggerData;
8485
tmpConf = tutorlmsStateIH(tmpConf, dataFlow);
86+
} else if (flow.triggered_entity === "FluentBooking") {
87+
const dataFlow = edit ? flow?.flow_details : flow?.triggerData;
88+
tmpConf = fluentBookingStateIH(tmpConf, dataFlow, flow.triggered_entity_id);
8589
} else if (flow.triggered_entity === "WC") {
8690
const dataFlow = edit ? flow?.flow_details : flow?.triggerData;
8791
tmpConf = wooCommerceStateIH(tmpConf, dataFlow);
@@ -247,6 +251,9 @@ export const saveActionConf = async ({
247251
} else if (flow.triggered_entity === "TutorLms") {
248252
const dataFlow = edit ? flow?.flow_details : flow?.triggerData;
249253
tmpConf = tutorlmsStateIH(tmpConf, dataFlow);
254+
} else if (flow.triggered_entity === "FluentBooking") {
255+
const dataFlow = edit ? flow?.flow_details : flow?.triggerData;
256+
tmpConf = fluentBookingStateIH(tmpConf, dataFlow, flow.triggered_entity_id);
250257
} else if (flow.triggered_entity === "WC") {
251258
const dataFlow = edit ? flow?.flow_details : flow?.triggerData;
252259
tmpConf = wooCommerceStateIH(tmpConf, dataFlow);
@@ -428,13 +435,11 @@ export const handleAuthorize = (
428435
return;
429436
}
430437
setIsLoading(true);
431-
const apiEndpoint = `https://accounts.zoho.${
432-
confTmp.dataCenter
433-
}/oauth/v2/auth?scope=${scopes}&response_type=code&client_id=${
434-
confTmp.clientId
435-
}&prompt=Consent&access_type=offline&state=${encodeURIComponent(
436-
window.location.href
437-
)}/redirect&redirect_uri=${encodeURIComponent(`${btcbi.api.base}`)}/redirect`;
438+
const apiEndpoint = `https://accounts.zoho.${confTmp.dataCenter
439+
}/oauth/v2/auth?scope=${scopes}&response_type=code&client_id=${confTmp.clientId
440+
}&prompt=Consent&access_type=offline&state=${encodeURIComponent(
441+
window.location.href
442+
)}/redirect&redirect_uri=${encodeURIComponent(`${btcbi.api.base}`)}/redirect`;
438443
const authWindow = window.open(
439444
apiEndpoint,
440445
integ,
@@ -521,9 +526,8 @@ const tokenHelper = (
521526
) {
522527
setSnackbar({
523528
show: true,
524-
msg: `${__("Authorization failed Cause:", "bit-integrations")}${
525-
result.data.data || result.data
526-
}. ${__("please try again", "bit-integrations")}`,
529+
msg: `${__("Authorization failed Cause:", "bit-integrations")}${result.data.data || result.data
530+
}. ${__("please try again", "bit-integrations")}`,
527531
});
528532
} else {
529533
setSnackbar({

frontend-dev/src/components/Flow/New/SelectTrigger.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export default function SelectTrigger() {
138138
>
139139
{(allTriggers?.data[inte]?.isPro && !isPro) && (
140140
<div className="pro-filter">
141-
<span className="txt-pro"><a href="https://bitapps.pro/bit-integrations" target="_blank" rel="noreferrer">{__('Premium', 'bit-integrations')}</a></span>
141+
<span className="txt-pro"><a href="https://bitapps.pro/bit-integrations" target="_blank" rel="noreferrer">{__('Pro', 'bit-integrations')}</a></span>
142142
</div>
143143
)}
144144
<GetLogo name={inte} extension="webp" />

frontend-dev/src/components/Triggers/ActionHook.jsx

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,20 @@ const ActionHook = () => {
177177
}
178178
}
179179

180-
const info = `<h4>Setup Action Hook</h4>
181-
<a className="btcd-link" href="https://bitapps.pro/docs/bit-integrations/trigger-hooks" target="_blank" rel="noreferrer">${__('Bit Integrations Trigger Hooks', 'bit-integrations')}</a>
182-
<br />
183-
<a className="btcd-link" href="https://bitapps.pro/docs/bit-integrations/trigger/action-hook-integrations" target="_blank" rel="noreferrer">${__('Details on Documentation', 'bit-integrations')}</a>
180+
const info = `<h4>Please follow the simple steps below to setup Action Hook</h4>
184181
<ul>
185-
<li>Click on the <b>Fetch</b> button & Submit your <b>Form</b> to get the form data</li>
186-
</ul>`
182+
<li>Click <b>Fetch</b></li>
183+
<li>Submit <b>Integrable Form</b></li>
184+
<li>Click <b>Next</b> and <b>Go</b></b></li>
185+
</ul>
186+
<h5>
187+
<a className="btcd-link" href="https://bitapps.pro/docs/bit-integrations/trigger-hooks" target="_blank" rel="noreferrer">${__('Bit Integrations Trigger Hooks', 'bit-integrations')}</a>
188+
<br />
189+
More Details on
190+
<a className="btcd-link" href="https://bitapps.pro/docs/bit-integrations/trigger/action-hook-integrations" target="_blank" rel="noreferrer">${__('Documentation', 'bit-integrations')}</a>
191+
or
192+
<a className="btcd-link" href="#" target="_blank" rel="noreferrer">${__('Youtube Tutorials', 'bit-integrations')}</a>
193+
</h5>`
187194

188195
return (
189196
<div className="trigger-custom-width">

frontend-dev/src/components/Triggers/CustomFormSubmission.jsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,18 @@ const CustomFormSubmission = () => {
127127
}
128128
}, [])
129129

130-
const info = `<h4>Setup ${newFlow?.triggerDetail?.name}</h4>
131-
<a className="btcd-link" href=${newFlow?.triggerDetail?.documentation_url} target="_blank" rel="noreferrer">${__('More Details on Documentation', 'bit-integrations')}</a>
130+
const info = `<h4>Please follow the simple steps below to setup ${newFlow?.triggerDetail?.name}</h4>
132131
<ul>
133-
<li>Click on the <b>Fetch</b> button then Submit your <b>Form</b> to get the form data</li>
134-
</ul>`
132+
<li>Click <b>Fetch</b></li>
133+
<li>Submit <b>The Form</b></li>
134+
<li>Click <b>Next</b> and <b>Go</b></b></li>
135+
</ul>
136+
<h5>
137+
More Details on
138+
<a className="btcd-link" href=${newFlow?.triggerDetail?.documentation_url} target="_blank" rel="noreferrer">${__('Documentation', 'bit-integrations')}</a>
139+
or
140+
<a className="btcd-link" href=${newFlow?.triggerDetail?.tutorial_url} target="_blank" rel="noreferrer">${__('Youtube Tutorials', 'bit-integrations')}</a>
141+
</h5>`
135142

136143
return (
137144
<div className="trigger-custom-width">

0 commit comments

Comments
 (0)