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
0c32788
refactor: Buddyboss modules id
RishadAlam Dec 22, 2024
ecacaf1
refactor: BuddyBoss action module ids
RishadAlam Dec 23, 2024
27047b2
Merge branch 'main' into refactor/buddyboss_action
RishadAlam Dec 26, 2024
d08c9f2
refactor: BuddyBoss send private message action recipients
RishadAlam Dec 28, 2024
92eb5b0
refactor: BuddyBoss field fetch
RishadAlam Dec 28, 2024
c4713ae
update: readme trigger list
rahatyeasinemon Dec 29, 2024
218d071
docs: update readme file for missing info
rahatyeasinemon Jan 4, 2025
21c2fd7
Merge branch 'main' into emon-dev
rahatyeasinemon Jan 4, 2025
6454611
fix: GoogleSheet duplicate header data conflict issue fixed
RishadAlam Jan 5, 2025
dde0127
fix: WPForms empty upload file object issue
RishadAlam Jan 8, 2025
9eba3fd
chore: text domain fixed
RishadAlam Jan 8, 2025
187f017
docs: update the readme trigger's
rahatyeasinemon Jan 8, 2025
5327717
doc: update readme file
rahatyeasinemon Jan 9, 2025
ae4b5a2
refactor: Freshsales refresh module fields
RishadAlam Jan 11, 2025
4a4aa95
refactor: Freshsales contacts refresh
RishadAlam Jan 11, 2025
251f182
refactor: Freshsales account refresh
RishadAlam Jan 11, 2025
9a375d4
refactor: Freshsales change account view
RishadAlam Jan 11, 2025
ddbf4d9
refactor: freshsales fetch Meta data pagination added
RishadAlam Jan 11, 2025
a127f41
refactor: Freshsales refresh accounts & contacts id added
RishadAlam Jan 12, 2025
d88a622
doc: update the readme file
rahatyeasinemon Jan 12, 2025
4ff32f7
Merge branch 'refactor/buddyboss_action' into rishad-dev-tmp
RishadAlam Jan 12, 2025
3d4a842
Merge remote-tracking branch 'origin/emon-dev' into rishad-dev-tmp
RishadAlam Jan 12, 2025
00cb55f
update: Version Updated v2.4.3
RishadAlam Jan 12, 2025
7c659a3
refactor: BuddyBoss action variables
RishadAlam Jan 12, 2025
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
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,7 @@
"[javascript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
4 changes: 2 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 240+ 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.4.2
* Version: 2.4.3
* Author: Automation & Integration Plugin - Bit Apps
* Author URI: https://bitapps.pro
* Text Domain: bit-integrations
Expand All @@ -24,7 +24,7 @@
$btcbi_db_version = '1.1';

// Define most essential constants.
define('BTCBI_VERSION', '2.4.2');
define('BTCBI_VERSION', '2.4.3');
define('BTCBI_PLUGIN_MAIN_FILE', __FILE__);

require_once plugin_dir_path(__FILE__) . 'includes/loader.php';
Expand Down
298 changes: 153 additions & 145 deletions frontend-dev/src/components/AllIntegrations/BuddyBoss/BuddyBoss.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,112 +11,34 @@ import IntegrationStepThree from '../IntegrationHelpers/IntegrationStepThree'
import { handleInput, checkMappedFields } from './BuddyBossCommonFunc'
import BuddyBossAuthorization from './BuddyBossAuthorization'
import BuddyBossIntegLayout from './BuddyBossIntegLayout'
import {
ADD_POST_GRP_ACTIVITY_STREAM_PRO,
ADD_POST_SITE_WIDE_ACTIVITY_STREAM_PRO,
ADD_POST_USER_ACTIVITY_STREAM_PRO,
ADD_USER_GROUP,
CREATE_GROUP_PRO,
END_FRIENDSHIP_WITH_USER_PRO,
FOLLOW_USER_PRO,
isDisabled,
POST_REPLY_TOPIC_FORUM_PRO,
POST_TOPIC_FORUM_PRO,
REMOVE_USER_FROM_GROUP_PRO,
SEND_FRIENDSHIP_REQ_USER_PRO,
SEND_NOTIFICATION_MEMBER_GRP_PRO,
SEND_NOTIFICATION_USER_PRO,
SEND_PRIVATE_MSG_MEMBER_GRP_PRO,
SEND_PRIVATE_MSG_USER_PRO,
SET_USER_STATUS_PRO,
STOP_FOLLOWING_USER_PRO,
SUBSCRIBE_USER_FORUM_PRO
} from './IntegrationHelpers'

function BuddyBoss({ formFields, setFlow, flow, allIntegURL, isInfo, edit }) {
const navigate = useNavigate()
const { formID } = useParams()
const [isLoading, setIsLoading] = useState(false)
const [step, setStep] = useState(1)
const [snack, setSnackbar] = useState({ show: false })

const allActions = [
{ key: '1', label: __('Create Group Pro', 'bit-integrations') },
{ key: '2', label: __('Add the user to a group', 'bit-integrations') },
{ key: '3', label: __('End friendship with a user Pro', 'bit-integrations') },
{ key: '4', label: __('Follow a user Pro', 'bit-integrations') },
{ key: '5', label: __('Post a topic in a forum Pro', 'bit-integrations') },
{ key: '6', label: __('Remove user from a group Pro', 'bit-integrations') },
{ key: '7', label: __('Send a friendship request to a user Pro', 'bit-integrations') },
{
key: '8',
label: __('Send a notification to all members of a group Pro', 'bit-integrations')
},
{
key: '9',
label: __('Send a private message to all members of a group Pro', 'bit-integrations')
},
{ key: '10', label: __('Send a private message to a user Pro', 'bit-integrations') },
{ key: '11', label: __('Send a notification to a user Pro', 'bit-integrations') },
{ key: '12', label: __('Stop following a user Pro', 'bit-integrations') },
{ key: '13', label: __('Subscribe the user to a forum Pro', 'bit-integrations') },
{
key: '14',
label: __('Add a post to the activity stream of a group Pro', 'bit-integrations')
},
{ key: '15', label: __('Add a post to the site wide activity stream Pro', 'bit-integrations') },
{ key: '16', label: __("Add a post to the user's activity stream Pro", 'bit-integrations') },
{ key: '17', label: __('Post a reply to a topic in a forum', 'bit-integrations') },
{ key: '18', label: __("Set the user's status to a specific status", 'bit-integrations') }
]

// for action 1
const createGroupFields = [
{ key: 'group_name', label: __('Group Name', 'bit-integrations'), required: true }
]

// for action 5
const topicInForumFields = [
{ key: 'topic_content', label: __('Topic Content', 'bit-integrations'), required: true },
{ key: 'topic_title', label: __('Topic Title', 'bit-integrations'), required: false }
]

// for action 8

const sendAllUserNotificationFields = [
{
key: 'notification_content',
label: __('Notification Content', 'bit-integrations'),
required: true
},
{
key: 'notification_link',
label: __('Notification Link', 'bit-integrations'),
required: false
}
]

// for action 9
const sendAllGroupPrivateMessageFields = [
{ key: 'message_content', label: __('Message Content', 'bit-integrations'), required: true },
{ key: 'message_subject', label: __('Message subject', 'bit-integrations'), required: false }
]

// for action 14

const addPostToGroupFields = [
{ key: 'activity_action', label: __('activity_action', 'bit-integrations'), required: true },
{ key: 'activity_content', label: __('activity_content', 'bit-integrations'), required: true }
]

// for action 15

const addPostSiteWideActivityStreamFields = [
{ key: 'activity_action', label: __('activity_action', 'bit-integrations'), required: false },
{
key: 'activity_action_link',
label: __('activity_action_link', 'bit-integrations'),
required: false
},
{ key: 'activity_content', label: __('activity_content', 'bit-integrations'), required: true }
]

// for action 17
const postReplyTopicForumFields = [
{ key: 'reply_content', label: __('Reply Content', 'bit-integrations'), required: true }
]

const groupPrivacyOptions = [
{ key: '1', label: __('Public', 'bit-integrations') },
{ key: '2', label: __('Private', 'bit-integrations') },
{ key: '3', label: __('Hidden', 'bit-integrations') }
]

// for action 18
const userStatusOptions = [
{ key: '1', label: __('Active', 'bit-integrations') },
{ key: '2', label: __('Suspend', 'bit-integrations') }
]

const [buddyBossConf, setBuddyBossConf] = useState({
name: 'BuddyBoss',
type: 'BuddyBoss',
Expand All @@ -138,10 +60,7 @@ function BuddyBoss({ formFields, setFlow, flow, allIntegURL, isInfo, edit }) {
setTimeout(() => {
document.getElementById('btcd-settings-wrp').scrollTop = 0
}, 300)
if (
['1', '5', '8', '9', '10', '11', '14', '15', '16', '17'].includes(buddyBossConf.mainAction) &&
!checkMappedFields(buddyBossConf)
) {
if (!checkMappedFields(buddyBossConf)) {
setSnackbar({ show: true, msg: __('Please map fields to continue.', 'bit-integrations') })
return
}
Expand All @@ -150,47 +69,6 @@ function BuddyBoss({ formFields, setFlow, flow, allIntegURL, isInfo, edit }) {
}
}

function isDisabled() {
switch (buddyBossConf.mainAction) {
case '1':
return buddyBossConf.privacyId === undefined
case '2':
return buddyBossConf.groupId === undefined
case '3':
return buddyBossConf.friendId === undefined
case '4':
return buddyBossConf.friendId === undefined
case '5':
return buddyBossConf.forumId === undefined
case '6':
return buddyBossConf.groupId === undefined
case '7':
return buddyBossConf.friendId === undefined
case '8':
return buddyBossConf.groupId === undefined || buddyBossConf.friendId === undefined
case '9':
return buddyBossConf.groupId === undefined || buddyBossConf.friendId === undefined
case '10':
return buddyBossConf.friendId === undefined
case '12':
return buddyBossConf.friendId === undefined
case '13':
return buddyBossConf.forumId === undefined
case '14':
return buddyBossConf.groupId === undefined || buddyBossConf.friendId === undefined
case '15':
return buddyBossConf.friendId === undefined
case '16':
return buddyBossConf.friendId === undefined
case '17':
return buddyBossConf.topicId === undefined || buddyBossConf.forumId === undefined
case '18':
return buddyBossConf.userStatusId === undefined
default:
return false
}
}

return (
<div>
<SnackMsg snack={snack} setSnackbar={setSnackbar} />
Expand Down Expand Up @@ -231,7 +109,12 @@ function BuddyBoss({ formFields, setFlow, flow, allIntegURL, isInfo, edit }) {

<button
onClick={() => nextPage(3)}
disabled={!buddyBossConf.mainAction || isLoading || isDisabled()}
disabled={
!buddyBossConf.mainAction ||
!checkMappedFields(buddyBossConf) ||
isLoading ||
isDisabled(buddyBossConf)
}
className="btn f-right btcd-btn-lg purple sh-sm flx"
type="button">
{__('Next', 'bit-integrations')}
Expand Down Expand Up @@ -264,3 +147,128 @@ function BuddyBoss({ formFields, setFlow, flow, allIntegURL, isInfo, edit }) {
}

export default BuddyBoss

const allActions = [
{ key: CREATE_GROUP_PRO, label: __('Create Group Pro', 'bit-integrations') },
{ key: ADD_USER_GROUP, label: __('Add the user to a group', 'bit-integrations') },
{
key: END_FRIENDSHIP_WITH_USER_PRO,
label: __('End friendship with a user Pro', 'bit-integrations')
},
{ key: FOLLOW_USER_PRO, label: __('Follow a user Pro', 'bit-integrations') },
{ key: POST_TOPIC_FORUM_PRO, label: __('Post a topic in a forum Pro', 'bit-integrations') },
{ key: REMOVE_USER_FROM_GROUP_PRO, label: __('Remove user from a group Pro', 'bit-integrations') },
{
key: SEND_FRIENDSHIP_REQ_USER_PRO,
label: __('Send a friendship request to a user Pro', 'bit-integrations')
},
{
key: SEND_NOTIFICATION_MEMBER_GRP_PRO,
label: __('Send a notification to all members of a group Pro', 'bit-integrations')
},
{
key: SEND_PRIVATE_MSG_MEMBER_GRP_PRO,
label: __('Send a private message to all members of a group Pro', 'bit-integrations')
},
{
key: SEND_PRIVATE_MSG_USER_PRO,
label: __('Send a private message to a user Pro', 'bit-integrations')
},
{
key: SEND_NOTIFICATION_USER_PRO,
label: __('Send a notification to a user Pro', 'bit-integrations')
},
{ key: STOP_FOLLOWING_USER_PRO, label: __('Stop following a user Pro', 'bit-integrations') },
{
key: SUBSCRIBE_USER_FORUM_PRO,
label: __('Subscribe the user to a forum Pro', 'bit-integrations')
},
{
key: ADD_POST_GRP_ACTIVITY_STREAM_PRO,
label: __('Add a post to the activity stream of a group Pro', 'bit-integrations')
},
{
key: ADD_POST_SITE_WIDE_ACTIVITY_STREAM_PRO,
label: __('Add a post to the site wide activity stream Pro', 'bit-integrations')
},
{
key: ADD_POST_USER_ACTIVITY_STREAM_PRO,
label: __("Add a post to the user's activity stream Pro", 'bit-integrations')
},
{
key: POST_REPLY_TOPIC_FORUM_PRO,
label: __('Post a reply to a topic in a forum', 'bit-integrations')
},
{
key: SET_USER_STATUS_PRO,
label: __("Set the user's status to a specific status", 'bit-integrations')
}
]

// for action 1
const createGroupFields = [
{ key: 'group_name', label: __('Group Name', 'bit-integrations'), required: true }
]

// for action 5
const topicInForumFields = [
{ key: 'topic_content', label: __('Topic Content', 'bit-integrations'), required: true },
{ key: 'topic_title', label: __('Topic Title', 'bit-integrations'), required: false }
]

// for action 8

const sendAllUserNotificationFields = [
{
key: 'notification_content',
label: __('Notification Content', 'bit-integrations'),
required: true
},
{
key: 'notification_link',
label: __('Notification Link', 'bit-integrations'),
required: false
}
]

// for action 9
const sendAllGroupPrivateMessageFields = [
{ key: 'message_content', label: __('Message Content', 'bit-integrations'), required: true },
{ key: 'message_subject', label: __('Message subject', 'bit-integrations'), required: false }
]

// for action 14

const addPostToGroupFields = [
{ key: 'activity_action', label: __('activity_action', 'bit-integrations'), required: true },
{ key: 'activity_content', label: __('activity_content', 'bit-integrations'), required: true }
]

// for action 15

const addPostSiteWideActivityStreamFields = [
{ key: 'activity_action', label: __('activity_action', 'bit-integrations'), required: false },
{
key: 'activity_action_link',
label: __('activity_action_link', 'bit-integrations'),
required: false
},
{ key: 'activity_content', label: __('activity_content', 'bit-integrations'), required: true }
]

// for action 17
const postReplyTopicForumFields = [
{ key: 'reply_content', label: __('Reply Content', 'bit-integrations'), required: true }
]

const groupPrivacyOptions = [
{ key: '1', label: __('Public', 'bit-integrations') },
{ key: '2', label: __('Private', 'bit-integrations') },
{ key: '3', label: __('Hidden', 'bit-integrations') }
]

// for action 18
const userStatusOptions = [
{ key: '1', label: __('Active', 'bit-integrations') },
{ key: '2', label: __('Suspend', 'bit-integrations') }
]
Loading