Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
0aeb50d
fix: ZohoCRM Pro modules and fields are brought in free
RishadAlam May 11, 2024
79bf2da
fix: ZohoCRM Pro Actions and Upload fields are brought in free
RishadAlam May 15, 2024
659717d
fix: Clickup Tagify input issue fixed
RishadAlam May 16, 2024
291400e
chore: Capabilities added.
NiloyDas789 May 16, 2024
b7a1938
feat: SystemeIO Contact Fields added
RishadAlam May 18, 2024
e9bfa37
fix: SystemeIO Contact Fields field mapping issue fixed
RishadAlam May 18, 2024
8cd1496
fix: MailerLite store name field issue fixed
RishadAlam May 18, 2024
821f698
chore: Capability bugs fixed.
NiloyDas789 May 18, 2024
1a50c68
Merge branch 'niloy-dev' into niloy-dev-tmp
NiloyDas789 May 19, 2024
0fe539f
fix: hubspot multiselect issue
FahimSakib May 19, 2024
39ed00f
fix: Google Calendar DateTime Convert issue fixed
RishadAlam May 19, 2024
7243135
fix: hubspot deal
FahimSakib May 19, 2024
06d90a2
refactor: ISO8601 date format helper function
RishadAlam May 20, 2024
fce76b7
fix: WooCommerce edit issue fixed
RishadAlam May 20, 2024
de6f8d9
fix: Capability Condition Bugs fixed.
NiloyDas789 May 20, 2024
932bee3
Merge remote-tracking branch 'origin/fahim-temp' into rishad-dev-tmp
RishadAlam May 20, 2024
41a6c0b
feat: FLuent Support Custom field fetched
RishadAlam May 20, 2024
a97bf7c
feat: Fluent Support Custom field added
RishadAlam May 20, 2024
1869e6e
update: Version updated to 2.0.4
NiloyDas789 May 21, 2024
9e62ce9
Merge branch 'rishad-dev-tmp' into niloy-dev
NiloyDas789 May 21, 2024
9b52c06
chore: Pipedrive changes added to changelog.
NiloyDas789 May 21, 2024
6d6fc58
chore: New Integ file Bug fixed.
NiloyDas789 May 21, 2024
26869d5
fix: spaces removed
NiloyDas789 May 21, 2024
82ad9bb
chore: requires atleast added.
NiloyDas789 May 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions bitwpfi.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin Name: Bit Integrations
* Plugin URI: https://bitapps.pro/bit-integrations
* 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
* Version: 2.0.3
* Version: 2.0.4
* Author: Automation & Integration Plugin - Bit Apps
* Author URI: https://bitapps.pro
* Text Domain: bit-integrations
Expand All @@ -23,7 +23,7 @@
$btcbi_db_version = '1.0';

// Define most essential constants.
define('BTCBI_VERSION', '2.0.3');
define('BTCBI_VERSION', '2.0.4');
define('BTCBI_PLUGIN_MAIN_FILE', __FILE__);

require_once plugin_dir_path(__FILE__) . 'includes/loader.php';
Expand All @@ -45,8 +45,28 @@ function btcbi_activate_plugin($network_wide)
do_action('btcbi_activation', $network_wide);
}

function btcbi_deactivate_plugin($network_wide)
{
global $wp_version;
if (version_compare($wp_version, '5.1', '<')) {
wp_die(
esc_html__('This plugin requires WordPress version 5.1 or higher.', 'bit-integrations'),
esc_html__('Error Deactivating', 'bit-integrations')
);
}
if (version_compare(PHP_VERSION, '7.0', '<')) {
wp_die(
esc_html__('Forms Integrationsw requires PHP version 7.0.', 'bit-integrations'),
esc_html__('Error Deactivating', 'bit-integrations')
);
}
do_action('btcbi_deactivation', $network_wide);
}

register_activation_hook(__FILE__, 'btcbi_activate_plugin');

register_deactivation_hook(__FILE__, 'btcbi_deactivate_plugin');

function btcbi_uninstall_plugin()
{
do_action('btcbi_uninstall');
Expand Down
2 changes: 1 addition & 1 deletion frontend-dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
"url-loader": "^4.1.1",
"vite": "^4.5.3"
},
"main": ".eslintrc.js",
"main": ".eslintrc.js",
"keywords": [],
"author": "",
"license": "ISC",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { SmartTagField } from '../../../Utils/StaticData/SmartTagField'
import { $btcbi } from '../../../GlobalStates'
import { generateMappedField } from './ClickupCommonFunc'
import CustomField from './CustomField'
import { handleCustomValue } from '../IntegrationHelpers/IntegrationHelpers'
import TagifyInput from '../../Utilities/TagifyInput'

export default function ClickupFieldMap({ i, formFields, field, clickupConf, setClickupConf }) {
let allFields = []
Expand Down Expand Up @@ -55,17 +57,7 @@ export default function ClickupFieldMap({ i, formFields, field, clickupConf, set
</optgroup>
</select>

{field.formField === 'custom' && (
<CustomField
field={field}
index={i}
conf={clickupConf}
setConf={setClickupConf}
fieldValue="customValue"
fieldLabel="Custom Value"
className="mr-2"
/>
)}
{field.formField === 'custom' && <TagifyInput onChange={e => handleCustomValue(e, i, clickupConf, setClickupConf)} label={__('Custom Value', 'bit-integrations')} className="mr-2" type="text" value={field.customValue} placeholder={__('Custom Value', 'bit-integrations')} formFields={formFields} />}

<select className="btcd-paper-inp" disabled={i < requiredFields.length} name="clickupFormField" value={i < requiredFields ? (requiredFields[i].label || '') : (field.clickupFormField || '')} onChange={(ev) => handleFieldMapping(ev, i, clickupConf, setClickupConf)}>
<option value="">{__('Select Field', 'bit-integrations')}</option>
Expand Down
5 changes: 0 additions & 5 deletions frontend-dev/src/components/AllIntegrations/EditFormInteg.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ function EditFormInteg({ setSnackbar, className = '' }) {
const [flow, setFlow] = useRecoilState($newFlow)
const setFormFields = useSetRecoilState($formFields)
const setFlowData = (val, type) => {
// const tmpFlow = deepCopy(flow)
// const tmpFlow = { ...flow }
// tmpFlow.flow_details[type] = val
// console.log(tmpFlow.flow_details)
// setFlow({ ...tmpFlow })
setFlow(prevFlow => create(prevFlow, (draftFlow) => {
draftFlow.flow_details[type] = val
}))
Expand Down
2 changes: 1 addition & 1 deletion frontend-dev/src/components/AllIntegrations/EditInteg.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export default function EditInteg({ allIntegURL }) {
}

if (!data.success) {
return <div style={loaderStyle}>{data.data}</div>
return <div style={loaderStyle}><h1 className="txt-center mt-5">{data?.data}</h1></div>
}
return (
<div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function FluentSupport({ formFields, setFlow, flow, allIntegURL }) {
const [isLoading, setIsLoading] = useState(false)
const [step, setstep] = useState(1)
const [snack, setSnackbar] = useState({ show: false })
const fluentSupportFields = [
const basicFields = [
{ key: 'title', label: 'Title', required: true },
{ key: 'content', label: 'Content', required: true },
{ key: 'first_name', label: 'First Name', required: true },
Expand All @@ -36,7 +36,8 @@ function FluentSupport({ formFields, setFlow, flow, allIntegURL }) {
field_map: [
{ formField: '', fluentSupportFormField: '' },
],
fluentSupportFields,
basicFields,
fluentSupportFields: [],
address_field: [],
actions: {},
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useState } from 'react'
import { __ } from '../../../Utils/i18nwrap'
import LoaderSm from '../../Loaders/LoaderSm'
import { handleAuthorize } from './FluentSupportCommonFunc'
import { getCustomFields, handleAuthorize } from './FluentSupportCommonFunc'
import tutorialLinks from '../../../Utils/StaticData/tutorialLinks'
import TutorialLink from '../../Utilities/TutorialLink'

Expand All @@ -23,6 +23,7 @@ export default function FluentSupportAuthorization({ formID,
document.getElementById('btcd-settings-wrp').scrollTop = 0
}, 300)

getCustomFields(fluentSupportConf, setFluentSupportConf, setIsLoading, setSnackbar)
setstep(2)
}
const handleInput = (e) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import bitsFetch from "../../../Utils/bitsFetch";
import { deepCopy } from "../../../Utils/Helpers";
import { sprintf, __ } from "../../../Utils/i18nwrap";
import { create } from "mutative";

export const handleInput = (
e,
Expand Down Expand Up @@ -68,6 +69,57 @@ export const supportStaff = (
.catch(() => setIsLoading(false));
};

export const getCustomFields = (
fluentSupportConf,
setFluentSupportConf,
setIsLoading,
setSnackbar
) => {
setIsLoading(true);

bitsFetch(null, "fluent_support_get_custom_fields")
.then((result) => {
setFluentSupportConf((prevConf) =>
create(prevConf, (draftConf) => {
if (result && result.success&&result.data) {
draftConf.fluentSupportFields = [
...draftConf.basicFields,
...result.data,
];
draftConf.field_map = generateMappedField([
...draftConf.basicFields,
...result.data,
]);

result.data.length > 0
? setSnackbar({
show: true,
msg: __("Custom Ticket Fields refreshed", "bit-integrations"),
})
: setSnackbar({
show: true,
msg: __("Custom Ticket Fields not found!", "bit-integrations"),
});
}else{
draftConf.fluentSupportFields = draftConf.basicFields;
draftConf.field_map = generateMappedField(draftConf.basicFields);

setSnackbar({
show: true,
msg: __(
result?.data||"Custom Ticket Fields failed. please try again",
"bit-integrations"
),
});
}
})
);

setIsLoading(false);
})
.catch(() => setIsLoading(false));
};

export const getAllBusinessInboxes = (
formID,
fluentSupportConf,
Expand All @@ -76,8 +128,8 @@ export const getAllBusinessInboxes = (
setSnackbar
) => {
setIsLoading(true);
bitsFetch('',"fluent_support_get_all_business_inboxes")

bitsFetch("", "fluent_support_get_all_business_inboxes")
.then((result) => {
if (result && result.success) {
const newConf = { ...fluentSupportConf };
Expand Down Expand Up @@ -106,8 +158,9 @@ export const getAllBusinessInboxes = (
.catch(() => setIsLoading(false));
};

export const generateMappedField = (fluentSupportConf) => {
const requiredFlds = fluentSupportConf?.fluentSupportFields.filter(
export const generateMappedField = (fluentSupportFields) => {
console.log(fluentSupportFields);
const requiredFlds = fluentSupportFields.filter(
(fld) => fld.required === true
);
return requiredFlds.length > 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,8 @@ import TagifyInput from '../../Utilities/TagifyInput'
import { handleCustomValue } from '../IntegrationHelpers/IntegrationHelpers'

export default function FluentSupportFieldMap({ i, formFields, field, fluentSupportConf, setFluentSupportConf }) {
if (fluentSupportConf?.field_map?.length === 1 && field.fluentSupportFormField === '') {
const newConf = { ...fluentSupportConf }
const tmp = generateMappedField(newConf)
newConf.field_map = tmp
setFluentSupportConf(newConf)
}

const requiredFlds = fluentSupportConf?.fluentSupportFields.filter(fld => fld.required === true) || []
const nonRequiredFlds = fluentSupportConf?.fluentSupportFields.filter(fld => fld.required === false) || []

const btcbi = useRecoilValue($btcbi)
const { isPro } = btcbi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { __ } from '../../../Utils/i18nwrap'
import Loader from '../../Loaders/Loader'
import { addFieldMap } from '../IntegrationHelpers/IntegrationHelpers'
import FluentSupportActions from './FluentSupportActions'
import { } from './FluentSupportCommonFunc'
import { getCustomFields } from './FluentSupportCommonFunc'
import FluentSupportFieldMap from './FluentSupportFieldMap'

export default function FluentSupportIntegLayout({ formID, formFields, handleInput, fluentSupportConf, setFluentSupportConf, isLoading, setIsLoading, setSnackbar }) {
Expand All @@ -21,8 +21,21 @@ export default function FluentSupportIntegLayout({ formID, formFields, handleInp
/>
)}

{fluentSupportConf.field_map && (
{!isLoading && fluentSupportConf.field_map && (
<>
<div className="mt-4">
<b className="wdt-100">{__('Map Fields', 'bit-integrations')}</b>
<button
onClick={() => getCustomFields(fluentSupportConf, setFluentSupportConf, setIsLoading, setSnackbar)}
className="icn-btn sh-sm ml-2 mr-2 tooltip"
style={{ '--tooltip-txt': `'${__('Refresh Custom Ticket Fields', 'bit-integrations')}'` }}
type="button"
disabled={isLoading}
>
&#x21BB;
</button>
</div>
<div className="btcd-hr mt-1" />
<div className="flx flx-around mt-2 mb-2 btcbi-field-map-label">
<div className="txt-dp"><b>{__('Form Fields', 'bit-integrations')}</b></div>
<div className="txt-dp"><b>{__('fluentSupport Fields', 'bit-integrations')}</b></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import toast from 'react-hot-toast'
import { sprintf, __ } from '../../../Utils/i18nwrap'
import bitsFetch from '../../../Utils/bitsFetch'
import { create } from 'mutative'

export const handleInput = (e, hubspotConf, setHubspotConf, setIsLoading) => {
const newConf = { ...hubspotConf }
Expand Down Expand Up @@ -62,22 +63,23 @@ export const getAllPipelines = (confTmp, setConf, setLoading, type, loading) =>

bitsFetch(requestParams, 'hubspot_pipeline')
.then(result => {
if (result && result.success) {
const newConf = { ...confTmp }
if (result.data) {
if (!newConf.default) newConf.default = {}
newConf.default.pipelines = result.data
newConf.actionName = type
getFields(newConf, setConf, setLoading, type, loading)
}
setConf(newConf)
setLoading({ ...setLoading, pipelines: false })
if (result.data) {
setConf(prevConf => create(prevConf, draftConf => {
if (!draftConf.default) draftConf.default = {}

draftConf.default.pipelines = result.data
draftConf.actionName = type

getFields(draftConf, setConf, setLoading, type, loading)
}))

setLoading({ ...setLoading, pipelines: false })
toast.success(__('pipelines fetched successfully', 'bit-integrations'))
return
} else {
setLoading({ ...setLoading, pipelines: false })
toast.error(__('pipelines fetching failed', 'bit-integrations'))
}
setLoading({ ...setLoading, pipelines: false })
toast.error(__('pipelines fetching failed', 'bit-integrations'))
})
}

Expand Down Expand Up @@ -161,12 +163,14 @@ export const getFields = (confTmp, setConf, setLoading, type, loading, refreshCu
bitsFetch(requestParams, 'getFields')
.then(result => {
if (result && result.success) {
const newConf = { ...confTmp }
if (result.data) {
newConf.hubSpotFields = result.data
newConf.actionName = type
setConf(prevConf => create(prevConf, draftConf => {
draftConf.hubSpotFields = result.data
draftConf.actionName = type
draftConf.field_map = generateMappedField(draftConf)
}))
}
setConf(newConf)

setLoading({ ...setLoading, customFields: false })
setLoading({ ...setLoading, hubSpotFields: true })

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@ import { handleCustomValue } from '../IntegrationHelpers/IntegrationHelpers'
import { sortByField } from '../../../Utils/Helpers'

export default function HubspotFieldMap({ i, formFields, field, hubspotConf, setHubspotConf }) {
if (hubspotConf?.field_map?.length === 1 && field.hubspotField === '') {
const newConf = { ...hubspotConf }
const tmp = generateMappedField(newConf)
newConf.field_map = tmp
setHubspotConf(newConf)
}

const requiredFlds = hubspotConf?.hubSpotFields?.filter(fld => fld.required === true) || []
const nonRequiredFlds = hubspotConf?.hubSpotFields?.filter(fld => fld.required === false) || []

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import HubspotFieldMap from './HubspotFieldMap'
import { getAllPipelines, getFields } from './HubspotCommonFunc'
import HubspotActions from './HubspotActions'
import Loader from '../../Loaders/Loader'
import { create } from 'mutative'

export default function HubspotIntegLayout({ formFields, handleInput, hubspotConf, setHubspotConf, setSnackbar, loading, setLoading }) {
const action = [
Expand All @@ -25,15 +26,14 @@ export default function HubspotIntegLayout({ formFields, handleInput, hubspotCon
}

if (e.target.name === 'pipeline') {
const newConf = { ...hubspotConf }
if (e.target.value !== '') {
newConf[e.target.name] = e.target.value
} else {
delete newConf[e.target.name]
}
const stagesTmp = hubspotConf?.default?.pipelines.filter(({ pipelineId }) => pipelineId === e.target.value).map(({ stages }) => stages)
newConf.stageTmp = stagesTmp
setHubspotConf({ ...newConf })
setHubspotConf(prevConf => create(prevConf, draftConf => {
if (e.target.value !== '') {
draftConf[e.target.name] = e.target.value
} else {
delete draftConf[e.target.name]
}
draftConf.stageTmp = hubspotConf?.default?.pipelines.filter(({ pipelineId }) => pipelineId === e.target.value).map(({ stages }) => stages)
}))
}
}

Expand Down
Loading