diff --git a/bitwpfi.php b/bitwpfi.php index ec10228c1..5db202ecc 100644 --- a/bitwpfi.php +++ b/bitwpfi.php @@ -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 290+ 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.6.5 + * Version: 2.6.6 * Author: Automation & Integration Plugin - Bit Apps * Author URI: https://bitapps.pro * Text Domain: bit-integrations @@ -24,7 +24,7 @@ $btcbi_db_version = '1.1'; // Define most essential constants. -define('BTCBI_VERSION', '2.6.5'); +define('BTCBI_VERSION', '2.6.6'); define('BTCBI_PLUGIN_MAIN_FILE', __FILE__); require_once plugin_dir_path(__FILE__) . 'includes/loader.php'; diff --git a/frontend-dev/src/components/AllIntegrations/MailerLite/EditMailerLite.jsx b/frontend-dev/src/components/AllIntegrations/MailerLite/EditMailerLite.jsx index 97f9da421..ad7edf948 100644 --- a/frontend-dev/src/components/AllIntegrations/MailerLite/EditMailerLite.jsx +++ b/frontend-dev/src/components/AllIntegrations/MailerLite/EditMailerLite.jsx @@ -21,6 +21,7 @@ function EditMailerLite({ allIntegURL }) { const [flow, setFlow] = useRecoilState($newFlow) const [mailerLiteConf, setMailerLiteConf] = useRecoilState($actionConf) const [isLoading, setIsLoading] = useState(false) + const [name, setName] = useState(mailerLiteConf?.name || '') const [loading, setLoading] = useState({ list: false, field: false, @@ -56,6 +57,16 @@ function EditMailerLite({ allIntegURL }) { } }, []) + const handleEditIntegName = e => { + setName(e.target.value) + + setMailerLiteConf(prevConf => + create(prevConf, draftConF => { + draftConF.name = e.target.value + }) + ) + } + return (
@@ -64,9 +75,9 @@ function EditMailerLite({ allIntegURL }) { {__('Integration Name:', 'bit-integrations')} handleInput(e, mailerLiteConf, setMailerLiteConf, loading, setLoading)} + onChange={handleEditIntegName} name="name" - value={mailerLiteConf.name} + value={name} type="text" placeholder={__('Integration Name...', 'bit-integrations')} /> diff --git a/frontend-dev/src/components/AllIntegrations/MailerLite/MailerLiteActions.jsx b/frontend-dev/src/components/AllIntegrations/MailerLite/MailerLiteActions.jsx index 8331a48bb..ebc49acba 100644 --- a/frontend-dev/src/components/AllIntegrations/MailerLite/MailerLiteActions.jsx +++ b/frontend-dev/src/components/AllIntegrations/MailerLite/MailerLiteActions.jsx @@ -9,26 +9,30 @@ import ConfirmModal from '../../Utilities/ConfirmModal' import TableCheckBox from '../../Utilities/TableCheckBox' import 'react-multiple-select-dropdown-lite/dist/index.css' import { getAllGroups } from './MailerLiteCommonFunc' +import { create } from 'mutative' export default function MailerLiteActions({ mailerLiteConf, setMailerLiteConf, loading, setLoading }) { const [actionMdl, setActionMdl] = useState({ show: false, action: () => {} }) const actionHandler = (e, type) => { - const newConf = { ...mailerLiteConf } - if (type === 'group') { getAllGroups(mailerLiteConf, setMailerLiteConf, loading, setLoading) } - if (e.target.checked) { - newConf.actions[type] = true - } else { - delete newConf.actions[type] - } - setActionMdl({ show: type }) - setMailerLiteConf({ ...newConf }) + setMailerLiteConf(prevConf => + create(prevConf, draftConf => { + draftConf.actions = { ...(draftConf.actions || {}) } + + if (e.target.checked) { + draftConf.actions[type] = true + } else { + delete draftConf.actions[type] + } + }) + ) } + const clsActionMdl = () => { setActionMdl({ show: false }) } diff --git a/frontend-dev/src/components/AllIntegrations/ZohoCRM/ZohoCRMActions.jsx b/frontend-dev/src/components/AllIntegrations/ZohoCRM/ZohoCRMActions.jsx index 56f7de155..d976d2c25 100644 --- a/frontend-dev/src/components/AllIntegrations/ZohoCRM/ZohoCRMActions.jsx +++ b/frontend-dev/src/components/AllIntegrations/ZohoCRM/ZohoCRMActions.jsx @@ -14,14 +14,7 @@ import Modal from '../../Utilities/Modal' import TitleModal from '../../Utilities/TitleModal' import { refreshAssigmentRules, refreshOwners, refreshTags } from './ZohoCRMCommonFunc' -export default function ZohoCRMActions({ - crmConf, - setCrmConf, - formFields, - tab, - formID, - setSnackbar -}) { +export default function ZohoCRMActions({ crmConf, setCrmConf, formFields, tab, formID, setSnackbar }) { const [upsertMdl, setUpsertMdl] = useState(false) const [isLoading, setIsLoading] = useState(false) const [actionMdl, setActionMdl] = useState({ show: false, action: () => {} }) @@ -181,13 +174,13 @@ export default function ZohoCRMActions({ ] if (crmConf.default.tags?.[module]) { - arr[0].childs = Object.values(crmConf.default.tags?.[module]).map((tagName) => ({ + arr[0].childs = Object.values(crmConf.default.tags?.[module]).map(tagName => ({ label: tagName, value: tagName })) } - arr[1].childs = formFields.map((itm) => ({ label: itm.label, value: `\${${itm.name}}` })) + arr[1].childs = formFields.map(itm => ({ label: itm.label, value: `\${${itm.name}}` })) return arr } @@ -248,100 +241,21 @@ export default function ZohoCRMActions({
actionHandler(e, 'workflow')} - checked={ - tab === 0 - ? 'workflow' in crmConf.actions - : 'workflow' in crmConf.relatedlists[tab - 1].actions - } - className="wdt-200 mt-4 mr-2" - value="Workflow" - title={__('Workflow', 'bit-integrations')} - subTitle={__('Trigger CRM workflows', 'bit-integrations')} - /> - setActionMdl({ show: 'attachment' })} - checked={ - tab === 0 - ? 'attachment' in crmConf.actions - : 'attachment' in crmConf.relatedlists[tab - 1].actions - } - className="wdt-200 mt-4 mr-2" - value="Attachment" - title={__('Attachment', 'bit-integrations')} - subTitle={__('Add attachments or signatures from Trigger to CRM', 'bit-integrations')} - /> - actionHandler(e, 'approval')} - checked={ - tab === 0 - ? 'approval' in crmConf.actions - : 'approval' in crmConf.relatedlists[tab - 1].actions - } - className="wdt-200 mt-4 mr-2" - value="Approval" - title={__('Approval', 'bit-integrations')} - subTitle={__('Send entries to CRM approval list', 'bit-integrations')} - /> - actionHandler(e, 'blueprint')} - checked={ - tab === 0 - ? 'blueprint' in crmConf.actions - : 'blueprint' in crmConf.relatedlists[tab - 1].actions - } - className="wdt-200 mt-4 mr-2" - value="Blueprint" - title={__('Blueprint', 'bit-integrations')} - subTitle={__('Trigger CRM Blueprint', 'bit-integrations')} - /> - actionHandler(e, 'gclid')} - checked={ - tab === 0 - ? 'gclid' in crmConf.actions - : 'gclid' in crmConf.relatedlists[tab - 1].actions - } - className="wdt-200 mt-4 mr-2" - value="Capture_GCLID" - title={__('Capture GCLID', 'bit-integrations')} - subTitle={__('Sends the click details of AdWords Ads to Zoho CRM', 'bit-integrations')} - /> - - actionHandler(e, 'upsert')} - checked={ - tab === 0 - ? 'upsert' in crmConf.actions - : 'upsert' in crmConf.relatedlists[tab - 1].actions - } - className="wdt-200 mt-4 mr-2" - value="Upsert_Record" - title={__('Upsert Records', 'bit-integrations')} - subTitle={__( - 'The record is updated if it already exists else it is inserted as a new record', - 'bit-integrations' - )} - /> - - setActionMdl({ show: 'tag_rec' })} checked={ - tab === 0 - ? 'tag_rec' in crmConf.actions - : 'tag_rec' in crmConf.relatedlists[tab - 1].actions + tab === 0 ? 'tag_rec' in crmConf.actions : 'tag_rec' in crmConf.relatedlists[tab - 1].actions } className="wdt-200 mt-4 mr-2" value="Tag_Records" @@ -349,17 +263,97 @@ export default function ZohoCRMActions({ subTitle={__('Add a tag to records pushed to Zoho CRM', 'bit-integrations')} /> setActionMdl({ show: 'attachment' })} checked={ tab === 0 - ? 'rec_owner' in crmConf.actions - : 'rec_owner' in crmConf.relatedlists[tab - 1].actions + ? 'attachment' in crmConf.actions + : 'attachment' in crmConf.relatedlists[tab - 1].actions } className="wdt-200 mt-4 mr-2" - value="Record_Owner" - title={__('Record Owner', 'bit-integrations')} - subTitle={__('Add a owner to records pushed to Zoho CRM', 'bit-integrations')} + value="Attachment" + title={__('Attachment', 'bit-integrations')} + subTitle={__('Add attachments or signatures from Trigger to CRM', 'bit-integrations')} /> + + {crmConf.module !== 'Tasks' && ( + <> + actionHandler(e, 'workflow')} + checked={ + tab === 0 + ? 'workflow' in crmConf.actions + : 'workflow' in crmConf.relatedlists[tab - 1].actions + } + className="wdt-200 mt-4 mr-2" + value="Workflow" + title={__('Workflow', 'bit-integrations')} + subTitle={__('Trigger CRM workflows', 'bit-integrations')} + /> + actionHandler(e, 'approval')} + checked={ + tab === 0 + ? 'approval' in crmConf.actions + : 'approval' in crmConf.relatedlists[tab - 1].actions + } + className="wdt-200 mt-4 mr-2" + value="Approval" + title={__('Approval', 'bit-integrations')} + subTitle={__('Send entries to CRM approval list', 'bit-integrations')} + /> + actionHandler(e, 'blueprint')} + checked={ + tab === 0 + ? 'blueprint' in crmConf.actions + : 'blueprint' in crmConf.relatedlists[tab - 1].actions + } + className="wdt-200 mt-4 mr-2" + value="Blueprint" + title={__('Blueprint', 'bit-integrations')} + subTitle={__('Trigger CRM Blueprint', 'bit-integrations')} + /> + actionHandler(e, 'gclid')} + checked={ + tab === 0 ? 'gclid' in crmConf.actions : 'gclid' in crmConf.relatedlists[tab - 1].actions + } + className="wdt-200 mt-4 mr-2" + value="Capture_GCLID" + title={__('Capture GCLID', 'bit-integrations')} + subTitle={__('Sends the click details of AdWords Ads to Zoho CRM', 'bit-integrations')} + /> + + actionHandler(e, 'upsert')} + checked={ + tab === 0 + ? 'upsert' in crmConf.actions + : 'upsert' in crmConf.relatedlists[tab - 1].actions + } + className="wdt-200 mt-4 mr-2" + value="Upsert_Record" + title={__('Upsert Records', 'bit-integrations')} + subTitle={__( + 'The record is updated if it already exists else it is inserted as a new record', + 'bit-integrations' + )} + /> + + + + )}
{__('Select File Upload Fields', 'bit-integrations')}
actionHandler(val, 'attachment')} + onChange={val => actionHandler(val, 'attachment')} options={formFields - .filter((itm) => itm.type === 'file') - .map((itm) => ({ label: itm.label, value: itm.name }))} + .filter(itm => itm.type === 'file') + .map(itm => ({ label: itm.label, value: itm.name }))} /> @@ -417,10 +409,10 @@ export default function ZohoCRMActions({ : crmConf.relatedlists[tab - 1].actions.assignment_rules } className="btcd-paper-inp" - onChange={(e) => actionHandler(e.target.value, 'assignment_rules')}> + onChange={e => actionHandler(e.target.value, 'assignment_rules')}> {crmConf?.default?.assignmentRules?.[module] && - Object.keys(crmConf.default.assignmentRules[module]).map((assignmentName) => ( + Object.keys(crmConf.default.assignmentRules[module]).map(assignmentName => (