From 1a4fd6baa742f7c449b9f74ce0dc4e9e4ca492c1 Mon Sep 17 00:00:00 2001
From: Rishad Alam <101513331+RishadAlam@users.noreply.github.com>
Date: Thu, 2 Apr 2026 13:14:42 +0600
Subject: [PATCH 1/3] feat: asgaros new action init
---
.../AsgarosForum/AsgarosForumController.php | 32 +++++
.../Actions/AsgarosForum/RecordApiHelper.php | 111 ++++++++++++++++
backend/Actions/AsgarosForum/Routes.php | 6 +
.../AsgarosForum/AsgarosForum.jsx | 105 +++++++++++++++
.../AsgarosForumAuthorization.jsx | 81 ++++++++++++
.../AsgarosForum/AsgarosForumCommonFunc.js | 89 +++++++++++++
.../AsgarosForum/AsgarosForumFieldMap.jsx | 111 ++++++++++++++++
.../AsgarosForum/AsgarosForumIntegLayout.jsx | 120 ++++++++++++++++++
.../AsgarosForum/EditAsgarosForum.jsx | 76 +++++++++++
.../AsgarosForum/staticData.js | 48 +++++++
.../components/AllIntegrations/EditInteg.jsx | 7 +
.../components/AllIntegrations/IntegInfo.jsx | 4 +
.../components/AllIntegrations/NewInteg.jsx | 14 ++
.../src/components/Flow/New/SelectAction.jsx | 5 +-
14 files changed, 806 insertions(+), 3 deletions(-)
create mode 100644 backend/Actions/AsgarosForum/AsgarosForumController.php
create mode 100644 backend/Actions/AsgarosForum/RecordApiHelper.php
create mode 100644 backend/Actions/AsgarosForum/Routes.php
create mode 100644 frontend/src/components/AllIntegrations/AsgarosForum/AsgarosForum.jsx
create mode 100644 frontend/src/components/AllIntegrations/AsgarosForum/AsgarosForumAuthorization.jsx
create mode 100644 frontend/src/components/AllIntegrations/AsgarosForum/AsgarosForumCommonFunc.js
create mode 100644 frontend/src/components/AllIntegrations/AsgarosForum/AsgarosForumFieldMap.jsx
create mode 100644 frontend/src/components/AllIntegrations/AsgarosForum/AsgarosForumIntegLayout.jsx
create mode 100644 frontend/src/components/AllIntegrations/AsgarosForum/EditAsgarosForum.jsx
create mode 100644 frontend/src/components/AllIntegrations/AsgarosForum/staticData.js
diff --git a/backend/Actions/AsgarosForum/AsgarosForumController.php b/backend/Actions/AsgarosForum/AsgarosForumController.php
new file mode 100644
index 00000000..051948f2
--- /dev/null
+++ b/backend/Actions/AsgarosForum/AsgarosForumController.php
@@ -0,0 +1,32 @@
+flow_details;
+ $fieldMap = $integrationDetails->field_map ?? [];
+
+ $recordApiHelper = new RecordApiHelper($integrationDetails, $integrationData->id);
+
+ return $recordApiHelper->execute($fieldValues, $fieldMap);
+ }
+
+ private static function checkPluginExists()
+ {
+ if (!class_exists('AsgarosForum')) {
+ wp_send_json_error(__('Asgaros Forum is not activated or not installed', 'bit-integrations'), 400);
+ }
+ }
+}
diff --git a/backend/Actions/AsgarosForum/RecordApiHelper.php b/backend/Actions/AsgarosForum/RecordApiHelper.php
new file mode 100644
index 00000000..db3128f1
--- /dev/null
+++ b/backend/Actions/AsgarosForum/RecordApiHelper.php
@@ -0,0 +1,111 @@
+_integrationDetails = $integrationDetails;
+ $this->_integrationID = $integId;
+ }
+
+ public function execute($fieldValues, $fieldMap)
+ {
+ if (!class_exists('AsgarosForum')) {
+ $response = [
+ 'success' => false,
+ 'message' => __('Asgaros Forum is not installed or activated', 'bit-integrations'),
+ ];
+
+ LogHandler::save($this->_integrationID, ['type' => 'Asgaros Forum', 'type_name' => 'check'], 'error', $response);
+
+ return $response;
+ }
+
+ $mainAction = $this->_integrationDetails->mainAction ?? '';
+ $payload = $this->generateReqDataFromFieldMap($fieldMap, $fieldValues);
+
+ $defaultResponse = [
+ 'success' => false,
+ // translators: %s is the plugin name.
+ 'message' => wp_sprintf(__('%s plugin is not installed or activated', 'bit-integrations'), 'Bit Integrations Pro'),
+ ];
+
+ switch ($mainAction) {
+ case 'create_topic':
+ $response = Hooks::apply(Config::withPrefix('asgaros_forum_create_topic'), $defaultResponse, $payload);
+ $actionType = 'create_topic';
+
+ break;
+
+ case 'create_forum':
+ $response = Hooks::apply(Config::withPrefix('asgaros_forum_create_forum'), $defaultResponse, $payload);
+ $actionType = 'create_forum';
+
+ break;
+
+ case 'post_reply_in_topic':
+ $response = Hooks::apply(Config::withPrefix('asgaros_forum_post_reply_in_topic'), $defaultResponse, $payload);
+ $actionType = 'post_reply_in_topic';
+
+ break;
+
+ case 'subscribe_user_in_forum':
+ $response = Hooks::apply(Config::withPrefix('asgaros_forum_subscribe_user_in_forum'), $defaultResponse, $payload);
+ $actionType = 'subscribe_user_in_forum';
+
+ break;
+
+ default:
+ $response = [
+ 'success' => false,
+ 'message' => __('Invalid action', 'bit-integrations'),
+ ];
+ $actionType = 'unknown';
+
+ break;
+ }
+
+ $responseType = !empty($response['success']) ? 'success' : 'error';
+ LogHandler::save($this->_integrationID, ['type' => 'Asgaros Forum', 'type_name' => $actionType], $responseType, $response);
+
+ return $response;
+ }
+
+ private function generateReqDataFromFieldMap($fieldMap, $fieldValues)
+ {
+ $dataFinal = [];
+
+ if (!\is_array($fieldMap)) {
+ return $dataFinal;
+ }
+
+ foreach ($fieldMap as $item) {
+ $triggerValue = $item->formField ?? '';
+ $actionValue = $item->asgarosForumField ?? '';
+
+ if (empty($actionValue)) {
+ continue;
+ }
+
+ $dataFinal[$actionValue] = $triggerValue === 'custom' && isset($item->customValue)
+ ? Common::replaceFieldWithValue($item->customValue, $fieldValues)
+ : ($fieldValues[$triggerValue] ?? '');
+ }
+
+ return $dataFinal;
+ }
+}
diff --git a/backend/Actions/AsgarosForum/Routes.php b/backend/Actions/AsgarosForum/Routes.php
new file mode 100644
index 00000000..59ef87c0
--- /dev/null
+++ b/backend/Actions/AsgarosForum/Routes.php
@@ -0,0 +1,6 @@
+ {
+ setTimeout(() => {
+ document.getElementById('btcd-settings-wrp').scrollTop = 0
+ }, 300)
+
+ if (val === 3) {
+ if (!checkMappedFields(asgarosForumConf)) {
+ setSnackbar({
+ show: true,
+ msg: __('Please complete all required fields to continue.', 'bit-integrations')
+ })
+ return
+ }
+
+ if (asgarosForumConf.name !== '') {
+ setStep(val)
+ }
+ return
+ }
+
+ setStep(val)
+ }
+
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ saveIntegConfig(flow, setFlow, allIntegURL, asgarosForumConf, navigate, '', '', setIsLoading)
+ }
+ isLoading={isLoading}
+ />
+
+ )
+}
diff --git a/frontend/src/components/AllIntegrations/AsgarosForum/AsgarosForumAuthorization.jsx b/frontend/src/components/AllIntegrations/AsgarosForum/AsgarosForumAuthorization.jsx
new file mode 100644
index 00000000..5423524c
--- /dev/null
+++ b/frontend/src/components/AllIntegrations/AsgarosForum/AsgarosForumAuthorization.jsx
@@ -0,0 +1,81 @@
+import { useState } from 'react'
+import { __ } from '../../../Utils/i18nwrap'
+import LoaderSm from '../../Loaders/LoaderSm'
+import Note from '../../Utilities/Note'
+import { asgarosForumAuthentication } from './AsgarosForumCommonFunc'
+
+export default function AsgarosForumAuthorization({
+ asgarosForumConf,
+ setAsgarosForumConf,
+ step,
+ nextPage,
+ isLoading,
+ setIsLoading,
+ isInfo
+}) {
+ const [isAuthorized, setIsAuthorized] = useState(false)
+ const [error, setError] = useState({ name: '' })
+
+ const handleInput = e => {
+ const newConf = { ...asgarosForumConf }
+ newConf[e.target.name] = e.target.value
+ setAsgarosForumConf(newConf)
+ }
+
+ return (
+
+
+ {__('Integration Name:', 'bit-integrations')}
+
+
+
{error.name}
+
+
+
+ {!isInfo && (
+ <>
+
+
+
+ >
+ )}
+
+ )
+}
diff --git a/frontend/src/components/AllIntegrations/AsgarosForum/AsgarosForumCommonFunc.js b/frontend/src/components/AllIntegrations/AsgarosForum/AsgarosForumCommonFunc.js
new file mode 100644
index 00000000..41ec3ba5
--- /dev/null
+++ b/frontend/src/components/AllIntegrations/AsgarosForum/AsgarosForumCommonFunc.js
@@ -0,0 +1,89 @@
+import { create } from 'mutative'
+import bitsFetch from '../../../Utils/bitsFetch'
+import { __ } from '../../../Utils/i18nwrap'
+import { asgarosForumActionFields } from './staticData'
+
+export const handleInput = (e, asgarosForumConf, setAsgarosForumConf) => {
+ const newConf = create(asgarosForumConf, draftConf => {
+ draftConf[e.target.name] = e.target.value
+ })
+ setAsgarosForumConf(newConf)
+}
+
+export const getActionFields = action => asgarosForumActionFields[action] || []
+
+export const generateMappedField = allFields => {
+ if (!allFields?.length) {
+ return []
+ }
+
+ const requiredFlds = allFields.filter(fld => fld.required === true)
+ return requiredFlds.length > 0
+ ? requiredFlds.map(field => ({ formField: '', asgarosForumField: field.key }))
+ : [{ formField: '', asgarosForumField: '' }]
+}
+
+export const checkMappedFields = asgarosForumConf => {
+ const { mainAction, field_map: fieldMap = [] } = asgarosForumConf || {}
+
+ if (!mainAction) {
+ return false
+ }
+
+ const requiredFields = getActionFields(mainAction).filter(field => field.required)
+
+ if (!requiredFields.length) {
+ return true
+ }
+
+ return requiredFields.every(requiredField =>
+ fieldMap.some(
+ mappedField =>
+ mappedField?.asgarosForumField === requiredField.key &&
+ mappedField?.formField &&
+ (mappedField.formField !== 'custom' || mappedField?.customValue)
+ )
+ )
+}
+
+export const asgarosForumAuthentication = (
+ confTmp,
+ setAsgarosForumConf,
+ setError,
+ setIsAuthorized,
+ setIsLoading
+) => {
+ if (!confTmp?.name) {
+ setError({
+ name: __("Integration name can't be empty", 'bit-integrations')
+ })
+ return
+ }
+
+ setError({})
+ setIsLoading(true)
+
+ bitsFetch({ name: confTmp.name }, 'asgaros_forum_authorize')
+ .then(result => {
+ if (result?.success) {
+ setIsAuthorized(true)
+ setAsgarosForumConf(prevConf =>
+ create(prevConf, draftConf => {
+ draftConf.name = confTmp.name
+ })
+ )
+ } else {
+ setError({
+ name: result?.data || __('Authorization failed', 'bit-integrations')
+ })
+ }
+ })
+ .catch(() => {
+ setError({
+ name: __('Authorization failed', 'bit-integrations')
+ })
+ })
+ .finally(() => {
+ setIsLoading(false)
+ })
+}
diff --git a/frontend/src/components/AllIntegrations/AsgarosForum/AsgarosForumFieldMap.jsx b/frontend/src/components/AllIntegrations/AsgarosForum/AsgarosForumFieldMap.jsx
new file mode 100644
index 00000000..9fe0013e
--- /dev/null
+++ b/frontend/src/components/AllIntegrations/AsgarosForum/AsgarosForumFieldMap.jsx
@@ -0,0 +1,111 @@
+import { useRecoilValue } from 'recoil'
+import { $appConfigState } from '../../../GlobalStates'
+import { __, sprintf } from '../../../Utils/i18nwrap'
+import { SmartTagField } from '../../../Utils/StaticData/SmartTagField'
+import TagifyInput from '../../Utilities/TagifyInput'
+import {
+ addFieldMap,
+ delFieldMap,
+ handleCustomValue,
+ handleFieldMapping
+} from '../GlobalIntegrationHelper'
+
+export default function AsgarosForumFieldMap({
+ i,
+ formFields,
+ field,
+ asgarosForumConf,
+ setAsgarosForumConf
+}) {
+ const btcbi = useRecoilValue($appConfigState)
+ const { isPro } = btcbi
+
+ const requiredFlds = asgarosForumConf?.asgarosForumFields?.filter(fld => fld.required === true) || []
+ const nonRequiredFlds =
+ asgarosForumConf?.asgarosForumFields?.filter(fld => fld?.required === false) || []
+
+ return (
+
+
+
+
+
+ {field.formField === 'custom' && (
+ handleCustomValue(e, i, asgarosForumConf, setAsgarosForumConf)}
+ label={__('Custom Value', 'bit-integrations')}
+ className="mr-2"
+ type="text"
+ value={field.customValue}
+ placeholder={__('Custom Value', 'bit-integrations')}
+ formFields={formFields}
+ />
+ )}
+
+
+
+ {i >= requiredFlds.length && (
+ <>
+
+
+ >
+ )}
+
+
+ )
+}
diff --git a/frontend/src/components/AllIntegrations/AsgarosForum/AsgarosForumIntegLayout.jsx b/frontend/src/components/AllIntegrations/AsgarosForum/AsgarosForumIntegLayout.jsx
new file mode 100644
index 00000000..090e2733
--- /dev/null
+++ b/frontend/src/components/AllIntegrations/AsgarosForum/AsgarosForumIntegLayout.jsx
@@ -0,0 +1,120 @@
+import { create } from 'mutative'
+import MultiSelect from 'react-multiple-select-dropdown-lite'
+import { useRecoilValue } from 'recoil'
+import { $appConfigState } from '../../../GlobalStates'
+import { __ } from '../../../Utils/i18nwrap'
+import Note from '../../Utilities/Note'
+import { checkIsPro, getProLabel } from '../../Utilities/ProUtilHelpers'
+import { addFieldMap } from '../IntegrationHelpers/IntegrationHelpers'
+import AsgarosForumFieldMap from './AsgarosForumFieldMap'
+import { checkMappedFields, generateMappedField, getActionFields } from './AsgarosForumCommonFunc'
+import { modules } from './staticData'
+
+export default function AsgarosForumIntegLayout({ formFields, asgarosForumConf, setAsgarosForumConf }) {
+ const btcbi = useRecoilValue($appConfigState)
+ const { isPro } = btcbi
+
+ const handleMainAction = value => {
+ const actionFields = getActionFields(value)
+
+ setAsgarosForumConf(prevConf =>
+ create(prevConf, draftConf => {
+ draftConf.mainAction = value
+ draftConf.asgarosForumFields = actionFields
+ draftConf.field_map = generateMappedField(actionFields)
+ })
+ )
+ }
+
+ return (
+ <>
+
+
+ {__('Action:', 'bit-integrations')}
+ handleMainAction(value)}
+ options={modules?.map(action => ({
+ label: checkIsPro(isPro, action.is_pro) ? action.label : getProLabel(action.label),
+ value: action.name,
+ disabled: !checkIsPro(isPro, action.is_pro)
+ }))}
+ singleSelect
+ closeOnSelect
+ />
+
+
+ {!!asgarosForumConf?.asgarosForumFields?.length && !!asgarosForumConf?.field_map?.length && (
+
+
{__('Map Fields', 'bit-integrations')}
+
+
+
+ {__('Form Fields', 'bit-integrations')}
+
+
+ {__('Asgaros Forum Fields', 'bit-integrations')}
+
+
+
+ {asgarosForumConf?.field_map?.map((itm, i) => (
+
+ ))}
+
+
+
+
+
+ )}
+
+ {['create_topic', 'post_reply_in_topic'].includes(asgarosForumConf?.mainAction) && (
+ <>
+
+
+ >
+ )}
+
+ {asgarosForumConf?.mainAction === 'create_forum' && (
+ <>
+
+
+ >
+ )}
+
+ {!checkMappedFields(asgarosForumConf) && !!asgarosForumConf?.mainAction && (
+ <>
+
+
+ >
+ )}
+ >
+ )
+}
diff --git a/frontend/src/components/AllIntegrations/AsgarosForum/EditAsgarosForum.jsx b/frontend/src/components/AllIntegrations/AsgarosForum/EditAsgarosForum.jsx
new file mode 100644
index 00000000..488a1bac
--- /dev/null
+++ b/frontend/src/components/AllIntegrations/AsgarosForum/EditAsgarosForum.jsx
@@ -0,0 +1,76 @@
+import { useState } from 'react'
+import { useNavigate, useParams } from 'react-router-dom'
+import { useRecoilState, useRecoilValue } from 'recoil'
+import { $actionConf, $formFields, $newFlow } from '../../../GlobalStates'
+import { __ } from '../../../Utils/i18nwrap'
+import SnackMsg from '../../Utilities/SnackMsg'
+import { saveActionConf } from '../IntegrationHelpers/IntegrationHelpers'
+import IntegrationStepThree from '../IntegrationHelpers/IntegrationStepThree'
+import SetEditIntegComponents from '../IntegrationHelpers/SetEditIntegComponents'
+import { checkMappedFields, handleInput } from './AsgarosForumCommonFunc'
+import AsgarosForumIntegLayout from './AsgarosForumIntegLayout'
+
+export default function EditAsgarosForum({ allIntegURL }) {
+ const navigate = useNavigate()
+ const { id, formID } = useParams()
+
+ const [asgarosForumConf, setAsgarosForumConf] = useRecoilState($actionConf)
+ const [flow, setFlow] = useRecoilState($newFlow)
+ const formFields = useRecoilValue($formFields)
+ const [isLoading, setIsLoading] = useState(false)
+ const [snack, setSnackbar] = useState({ show: false })
+
+ return (
+
+
+
+
+ {__('Integration Name:', 'bit-integrations')}
+ handleInput(e, asgarosForumConf, setAsgarosForumConf)}
+ name="name"
+ value={asgarosForumConf.name}
+ type="text"
+ placeholder={__('Integration Name...', 'bit-integrations')}
+ />
+
+
+
+
+
+
+
+
+ saveActionConf({
+ flow,
+ setFlow,
+ allIntegURL,
+ conf: asgarosForumConf,
+ navigate,
+ id,
+ edit: 1,
+ setIsLoading,
+ setSnackbar
+ })
+ }
+ disabled={!checkMappedFields(asgarosForumConf)}
+ isLoading={isLoading}
+ dataConf={asgarosForumConf}
+ setDataConf={setAsgarosForumConf}
+ formFields={formFields}
+ />
+
+
+ )
+}
diff --git a/frontend/src/components/AllIntegrations/AsgarosForum/staticData.js b/frontend/src/components/AllIntegrations/AsgarosForum/staticData.js
new file mode 100644
index 00000000..e0319ad3
--- /dev/null
+++ b/frontend/src/components/AllIntegrations/AsgarosForum/staticData.js
@@ -0,0 +1,48 @@
+import { __ } from '../../../Utils/i18nwrap'
+
+export const modules = [
+ {
+ label: __('Create Topic', 'bit-integrations'),
+ name: 'create_topic',
+ is_pro: true
+ },
+ {
+ label: __('Create Forum', 'bit-integrations'),
+ name: 'create_forum',
+ is_pro: true
+ },
+ {
+ label: __('Post Reply In Topic', 'bit-integrations'),
+ name: 'post_reply_in_topic',
+ is_pro: true
+ },
+ {
+ label: __('Subscribe User In Forum', 'bit-integrations'),
+ name: 'subscribe_user_in_forum',
+ is_pro: true
+ }
+]
+
+export const asgarosForumActionFields = {
+ create_topic: [
+ { key: 'forum_id', label: __('Forum ID', 'bit-integrations'), required: true },
+ { key: 'topic_name', label: __('Topic Name', 'bit-integrations'), required: true },
+ { key: 'topic_content', label: __('Topic Content', 'bit-integrations'), required: true },
+ { key: 'author_id', label: __('Author ID', 'bit-integrations'), required: false }
+ ],
+ create_forum: [
+ { key: 'parent_id', label: __('Parent ID', 'bit-integrations'), required: true },
+ { key: 'forum_name', label: __('Forum Name', 'bit-integrations'), required: true },
+ { key: 'forum_description', label: __('Forum Description', 'bit-integrations'), required: false },
+ { key: 'forum_icon', label: __('Forum Icon', 'bit-integrations'), required: false }
+ ],
+ post_reply_in_topic: [
+ { key: 'topic_id', label: __('Topic ID', 'bit-integrations'), required: true },
+ { key: 'reply_content', label: __('Reply Content', 'bit-integrations'), required: true },
+ { key: 'author_id', label: __('Author ID', 'bit-integrations'), required: false }
+ ],
+ subscribe_user_in_forum: [
+ { key: 'user_id', label: __('User ID', 'bit-integrations'), required: true },
+ { key: 'forum_id', label: __('Forum ID', 'bit-integrations'), required: true }
+ ]
+}
diff --git a/frontend/src/components/AllIntegrations/EditInteg.jsx b/frontend/src/components/AllIntegrations/EditInteg.jsx
index 9f03f770..35e45a7a 100644
--- a/frontend/src/components/AllIntegrations/EditInteg.jsx
+++ b/frontend/src/components/AllIntegrations/EditInteg.jsx
@@ -175,6 +175,10 @@ const EditNotificationX = lazy(() => import('./NotificationX/EditNotificationX')
const EditTeamsForWooCommerceMemberships = lazy(() =>
import('./TeamsForWooCommerceMemberships/EditTeamsForWooCommerceMemberships')
)
+const EditAsgarosForum = lazy(() => import('./AsgarosForum/EditAsgarosForum'))
+const EditTeamsForWooCommerceMemberships = lazy(
+ () => import('./TeamsForWooCommerceMemberships/EditTeamsForWooCommerceMemberships')
+)
const EditSeoPress = lazy(() => import('./SeoPress/EditSeoPress'))
const EditUserRegistrationMembership = lazy(
() => import('./UserRegistrationMembership/EditUserRegistrationMembership')
@@ -587,6 +591,9 @@ const IntegType = memo(({ allIntegURL, flow }) => {
return
case 'NotificationX':
return
+ case 'Asgaros Forum':
+ case 'AsgarosForum':
+ return
case 'Teams For WooCommerce Memberships':
return
case 'SeoPress':
diff --git a/frontend/src/components/AllIntegrations/IntegInfo.jsx b/frontend/src/components/AllIntegrations/IntegInfo.jsx
index c8e7c901..ad9f473d 100644
--- a/frontend/src/components/AllIntegrations/IntegInfo.jsx
+++ b/frontend/src/components/AllIntegrations/IntegInfo.jsx
@@ -177,6 +177,7 @@ const TeamsForWooCommerceMembershipsAuthorization = lazy(
)
const SeoPressAuthorization = lazy(() => import('./SeoPress/SeoPressAuthorization'))
const NotificationXAuthorization = lazy(() => import('./NotificationX/NotificationXAuthorization'))
+const AsgarosForumAuthorization = lazy(() => import('./AsgarosForum/AsgarosForumAuthorization'))
const UserRegistrationMembershipAuthorization = lazy(
() => import('./UserRegistrationMembership/UserRegistrationMembershipAuthorization')
)
@@ -632,6 +633,9 @@ export default function IntegInfo() {
return
case 'NotificationX':
return
+ case 'Asgaros Forum':
+ case 'AsgarosForum':
+ return
default:
return <>>
}
diff --git a/frontend/src/components/AllIntegrations/NewInteg.jsx b/frontend/src/components/AllIntegrations/NewInteg.jsx
index 96c83365..57ca04af 100644
--- a/frontend/src/components/AllIntegrations/NewInteg.jsx
+++ b/frontend/src/components/AllIntegrations/NewInteg.jsx
@@ -174,6 +174,10 @@ const NotificationX = lazy(() => import('./NotificationX/NotificationX'))
const TeamsForWooCommerceMemberships = lazy(() =>
import('./TeamsForWooCommerceMemberships/TeamsForWooCommerceMemberships')
)
+const AsgarosForum = lazy(() => import('./AsgarosForum/AsgarosForum'))
+const TeamsForWooCommerceMemberships = lazy(
+ () => import('./TeamsForWooCommerceMemberships/TeamsForWooCommerceMemberships')
+)
const SeoPress = lazy(() => import('./SeoPress/SeoPress'))
const UserRegistrationMembership = lazy(
() => import('./UserRegistrationMembership/UserRegistrationMembership')
@@ -1662,6 +1666,16 @@ export default function NewInteg({ allIntegURL }) {
setFlow={setFlow}
/>
)
+ case 'Asgaros Forum':
+ case 'AsgarosForum':
+ return (
+
+ )
case 'Teams For WooCommerce Memberships':
return (
!inte.disable && !inte.pro && setAction(inte.type)}
role="button"
tabIndex="0"
- className={`btcd-inte-card inte-sm mr-4 mt-3 ${
- inte.disable && !inte.pro && 'btcd-inte-dis'
- } ${inte.pro && 'btcd-inte-pro'}`}>
+ className={`btcd-inte-card inte-sm mr-4 mt-3 ${inte.disable && !inte.pro && 'btcd-inte-dis'} ${inte.pro && 'btcd-inte-pro'}`}>
{inte.pro && (
From a1f6fe225d7d1cd15e3262b10a00cf1d2e4d5ebf Mon Sep 17 00:00:00 2001
From: Rishad Alam <101513331+RishadAlam@users.noreply.github.com>
Date: Fri, 10 Apr 2026 10:29:06 +0600
Subject: [PATCH 2/3] refactor: asgaros forum actions
---
.../AllIntegrations/AsgarosForum/AsgarosForum.jsx | 2 +-
.../AsgarosForum/AsgarosForumIntegLayout.jsx | 11 +----------
.../AllIntegrations/AsgarosForum/EditAsgarosForum.jsx | 2 +-
.../AllIntegrations/AsgarosForum/staticData.js | 2 +-
frontend/src/components/AllIntegrations/EditInteg.jsx | 3 ---
frontend/src/components/AllIntegrations/NewInteg.jsx | 3 ---
6 files changed, 4 insertions(+), 19 deletions(-)
diff --git a/frontend/src/components/AllIntegrations/AsgarosForum/AsgarosForum.jsx b/frontend/src/components/AllIntegrations/AsgarosForum/AsgarosForum.jsx
index d6708d54..276e8b6b 100644
--- a/frontend/src/components/AllIntegrations/AsgarosForum/AsgarosForum.jsx
+++ b/frontend/src/components/AllIntegrations/AsgarosForum/AsgarosForum.jsx
@@ -1,6 +1,6 @@
import { useState } from 'react'
import 'react-multiple-select-dropdown-lite/dist/index.css'
-import { useNavigate, useParams } from 'react-router-dom'
+import { useNavigate, useParams } from 'react-router'
import BackIcn from '../../../Icons/BackIcn'
import { __ } from '../../../Utils/i18nwrap'
import SnackMsg from '../../Utilities/SnackMsg'
diff --git a/frontend/src/components/AllIntegrations/AsgarosForum/AsgarosForumIntegLayout.jsx b/frontend/src/components/AllIntegrations/AsgarosForum/AsgarosForumIntegLayout.jsx
index 090e2733..d5f05864 100644
--- a/frontend/src/components/AllIntegrations/AsgarosForum/AsgarosForumIntegLayout.jsx
+++ b/frontend/src/components/AllIntegrations/AsgarosForum/AsgarosForumIntegLayout.jsx
@@ -100,21 +100,12 @@ export default function AsgarosForumIntegLayout({ formFields, asgarosForumConf,
>
)}
-
- {!checkMappedFields(asgarosForumConf) && !!asgarosForumConf?.mainAction && (
- <>
-
-
- >
- )}
>
)
}
diff --git a/frontend/src/components/AllIntegrations/AsgarosForum/EditAsgarosForum.jsx b/frontend/src/components/AllIntegrations/AsgarosForum/EditAsgarosForum.jsx
index 488a1bac..9543c358 100644
--- a/frontend/src/components/AllIntegrations/AsgarosForum/EditAsgarosForum.jsx
+++ b/frontend/src/components/AllIntegrations/AsgarosForum/EditAsgarosForum.jsx
@@ -1,5 +1,5 @@
import { useState } from 'react'
-import { useNavigate, useParams } from 'react-router-dom'
+import { useNavigate, useParams } from 'react-router'
import { useRecoilState, useRecoilValue } from 'recoil'
import { $actionConf, $formFields, $newFlow } from '../../../GlobalStates'
import { __ } from '../../../Utils/i18nwrap'
diff --git a/frontend/src/components/AllIntegrations/AsgarosForum/staticData.js b/frontend/src/components/AllIntegrations/AsgarosForum/staticData.js
index e0319ad3..7a3a347a 100644
--- a/frontend/src/components/AllIntegrations/AsgarosForum/staticData.js
+++ b/frontend/src/components/AllIntegrations/AsgarosForum/staticData.js
@@ -31,7 +31,7 @@ export const asgarosForumActionFields = {
{ key: 'author_id', label: __('Author ID', 'bit-integrations'), required: false }
],
create_forum: [
- { key: 'parent_id', label: __('Parent ID', 'bit-integrations'), required: true },
+ { key: 'parent_id', label: __('Parent ID', 'bit-integrations'), required: false },
{ key: 'forum_name', label: __('Forum Name', 'bit-integrations'), required: true },
{ key: 'forum_description', label: __('Forum Description', 'bit-integrations'), required: false },
{ key: 'forum_icon', label: __('Forum Icon', 'bit-integrations'), required: false }
diff --git a/frontend/src/components/AllIntegrations/EditInteg.jsx b/frontend/src/components/AllIntegrations/EditInteg.jsx
index d7ca5aa2..daba789d 100644
--- a/frontend/src/components/AllIntegrations/EditInteg.jsx
+++ b/frontend/src/components/AllIntegrations/EditInteg.jsx
@@ -176,9 +176,6 @@ const EditTeamsForWooCommerceMemberships = lazy(() =>
import('./TeamsForWooCommerceMemberships/EditTeamsForWooCommerceMemberships')
)
const EditAsgarosForum = lazy(() => import('./AsgarosForum/EditAsgarosForum'))
-const EditTeamsForWooCommerceMemberships = lazy(
- () => import('./TeamsForWooCommerceMemberships/EditTeamsForWooCommerceMemberships')
-)
const EditSeoPress = lazy(() => import('./SeoPress/EditSeoPress'))
const EditUserRegistrationMembership = lazy(
() => import('./UserRegistrationMembership/EditUserRegistrationMembership')
diff --git a/frontend/src/components/AllIntegrations/NewInteg.jsx b/frontend/src/components/AllIntegrations/NewInteg.jsx
index 832b4447..490dfe05 100644
--- a/frontend/src/components/AllIntegrations/NewInteg.jsx
+++ b/frontend/src/components/AllIntegrations/NewInteg.jsx
@@ -175,9 +175,6 @@ const TeamsForWooCommerceMemberships = lazy(() =>
import('./TeamsForWooCommerceMemberships/TeamsForWooCommerceMemberships')
)
const AsgarosForum = lazy(() => import('./AsgarosForum/AsgarosForum'))
-const TeamsForWooCommerceMemberships = lazy(
- () => import('./TeamsForWooCommerceMemberships/TeamsForWooCommerceMemberships')
-)
const SeoPress = lazy(() => import('./SeoPress/SeoPress'))
const UserRegistrationMembership = lazy(
() => import('./UserRegistrationMembership/UserRegistrationMembership')
From 67b51ed8d0755ec923501f7683f99d637c55b250 Mon Sep 17 00:00:00 2001
From: Rishad Alam <101513331+RishadAlam@users.noreply.github.com>
Date: Fri, 10 Apr 2026 10:39:31 +0600
Subject: [PATCH 3/3] refactor: asgaros forum component imports
---
.../components/AllIntegrations/AsgarosForum/AsgarosForum.jsx | 3 ++-
.../AllIntegrations/AsgarosForum/AsgarosForumIntegLayout.jsx | 4 ++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/frontend/src/components/AllIntegrations/AsgarosForum/AsgarosForum.jsx b/frontend/src/components/AllIntegrations/AsgarosForum/AsgarosForum.jsx
index 276e8b6b..10c37323 100644
--- a/frontend/src/components/AllIntegrations/AsgarosForum/AsgarosForum.jsx
+++ b/frontend/src/components/AllIntegrations/AsgarosForum/AsgarosForum.jsx
@@ -27,7 +27,8 @@ export default function AsgarosForum({ formFields, setFlow, flow, allIntegURL })
const nextPage = val => {
setTimeout(() => {
- document.getElementById('btcd-settings-wrp').scrollTop = 0
+ const settingsWrapper = document.getElementById('btcd-settings-wrp')
+ if (settingsWrapper) settingsWrapper.scrollTop = 0
}, 300)
if (val === 3) {
diff --git a/frontend/src/components/AllIntegrations/AsgarosForum/AsgarosForumIntegLayout.jsx b/frontend/src/components/AllIntegrations/AsgarosForum/AsgarosForumIntegLayout.jsx
index d5f05864..fc046955 100644
--- a/frontend/src/components/AllIntegrations/AsgarosForum/AsgarosForumIntegLayout.jsx
+++ b/frontend/src/components/AllIntegrations/AsgarosForum/AsgarosForumIntegLayout.jsx
@@ -6,8 +6,8 @@ import { __ } from '../../../Utils/i18nwrap'
import Note from '../../Utilities/Note'
import { checkIsPro, getProLabel } from '../../Utilities/ProUtilHelpers'
import { addFieldMap } from '../IntegrationHelpers/IntegrationHelpers'
+import { generateMappedField, getActionFields } from './AsgarosForumCommonFunc'
import AsgarosForumFieldMap from './AsgarosForumFieldMap'
-import { checkMappedFields, generateMappedField, getActionFields } from './AsgarosForumCommonFunc'
import { modules } from './staticData'
export default function AsgarosForumIntegLayout({ formFields, asgarosForumConf, setAsgarosForumConf }) {
@@ -100,7 +100,7 @@ export default function AsgarosForumIntegLayout({ formFields, asgarosForumConf,