From 987e8538ff19bf17cc6254ea1608cf013de1a3e7 Mon Sep 17 00:00:00 2001 From: Rishad Alam <101513331+RishadAlam@users.noreply.github.com> Date: Tue, 17 Mar 2026 14:58:16 +0600 Subject: [PATCH 1/9] feat: creator lms integration init --- .../CreatorLms/CreatorLmsController.php | 55 ++++++ .../Actions/CreatorLms/RecordApiHelper.php | 105 ++++++++++++ backend/Actions/CreatorLms/Routes.php | 10 ++ backend/Core/Util/AllTriggersName.php | 1 + .../src/Utils/StaticData/tutorialLinks.js | 4 + .../Utils/StaticData/webhookIntegrations.js | 1 + .../AllIntegrations/Autonami/Autonami.jsx | 2 +- .../AllIntegrations/CreatorLms/CreatorLms.jsx | 106 ++++++++++++ .../CreatorLms/CreatorLmsAuthorization.jsx | 118 +++++++++++++ .../CreatorLms/CreatorLmsCommonFunc.js | 38 +++++ .../CreatorLms/CreatorLmsFieldMap.jsx | 113 +++++++++++++ .../CreatorLms/CreatorLmsIntegLayout.jsx | 160 ++++++++++++++++++ .../CreatorLms/EditCreatorLms.jsx | 76 +++++++++ .../AllIntegrations/CreatorLms/staticData.js | 47 +++++ .../components/AllIntegrations/EditInteg.jsx | 3 + .../AllIntegrations/FluentCRM/FluentCrm.jsx | 2 +- .../AllIntegrations/FluentCart/FluentCart.jsx | 2 +- .../components/AllIntegrations/IntegInfo.jsx | 3 + .../AllIntegrations/MailPoet/MailPoet.jsx | 2 +- .../MailerPress/MailerPress.jsx | 2 +- .../components/AllIntegrations/NewInteg.jsx | 10 ++ .../AllIntegrations/SeoPress/SeoPress.jsx | 2 +- .../TeamsForWooCommerceMemberships.jsx | 2 +- .../AllIntegrations/Telegram/Telegram.jsx | 2 +- .../UserRegistrationMembership.jsx | 2 +- .../AllIntegrations/WPCafe/WPCafe.jsx | 2 +- .../WPCourseware/WPCourseware.jsx | 4 +- .../src/components/Flow/New/SelectAction.jsx | 1 + .../src/resource/img/integ/creatorLms.webp | Bin 0 -> 1590 bytes 29 files changed, 863 insertions(+), 12 deletions(-) create mode 100644 backend/Actions/CreatorLms/CreatorLmsController.php create mode 100644 backend/Actions/CreatorLms/RecordApiHelper.php create mode 100644 backend/Actions/CreatorLms/Routes.php create mode 100644 frontend/src/components/AllIntegrations/CreatorLms/CreatorLms.jsx create mode 100644 frontend/src/components/AllIntegrations/CreatorLms/CreatorLmsAuthorization.jsx create mode 100644 frontend/src/components/AllIntegrations/CreatorLms/CreatorLmsCommonFunc.js create mode 100644 frontend/src/components/AllIntegrations/CreatorLms/CreatorLmsFieldMap.jsx create mode 100644 frontend/src/components/AllIntegrations/CreatorLms/CreatorLmsIntegLayout.jsx create mode 100644 frontend/src/components/AllIntegrations/CreatorLms/EditCreatorLms.jsx create mode 100644 frontend/src/components/AllIntegrations/CreatorLms/staticData.js create mode 100644 frontend/src/resource/img/integ/creatorLms.webp diff --git a/backend/Actions/CreatorLms/CreatorLmsController.php b/backend/Actions/CreatorLms/CreatorLmsController.php new file mode 100644 index 000000000..7e840459e --- /dev/null +++ b/backend/Actions/CreatorLms/CreatorLmsController.php @@ -0,0 +1,55 @@ +flow_details; + $integId = $integrationData->id; + $fieldMap = $integrationDetails->field_map; + $utilities = isset($integrationDetails->utilities) ? $integrationDetails->utilities : []; + + if (empty($fieldMap)) { + return new WP_Error('field_map_empty', __('Field map is empty', 'bit-integrations')); + } + + $recordApiHelper = new RecordApiHelper($integrationDetails, $integId); + $creatorLmsResponse = $recordApiHelper->execute($fieldValues, $fieldMap, $utilities); + + if (is_wp_error($creatorLmsResponse)) { + return $creatorLmsResponse; + } + + return $creatorLmsResponse; + } +} diff --git a/backend/Actions/CreatorLms/RecordApiHelper.php b/backend/Actions/CreatorLms/RecordApiHelper.php new file mode 100644 index 000000000..c0a86029b --- /dev/null +++ b/backend/Actions/CreatorLms/RecordApiHelper.php @@ -0,0 +1,105 @@ +_integrationDetails = $integrationDetails; + $this->_integrationID = $integId; + } + + public function execute($fieldValues, $fieldMap, $utilities) + { + if (!class_exists('CreatorLms') || !\function_exists('crlms_get_course')) { + return [ + 'success' => false, + 'message' => __('Creator LMS is not installed or activated', 'bit-integrations') + ]; + } + + $fieldData = static::generateReqDataFromFieldMap($fieldMap, $fieldValues); + $mainAction = $this->_integrationDetails->mainAction ?? 'create_student'; + + $defaultResponse = [ + 'success' => false, + 'message' => wp_sprintf(__('%s plugin is not installed or activate', 'bit-integrations'), 'Bit Integrations Pro') + ]; + + switch ($mainAction) { + case 'create_student': + $response = Hooks::apply(Config::withPrefix('creator_lms_create_student'), $defaultResponse, $fieldData); + $type = 'student'; + $actionType = 'create_student'; + + break; + case 'update_student_data': + $response = Hooks::apply(Config::withPrefix('creator_lms_update_student_data'), $defaultResponse, $fieldData); + $type = 'student'; + $actionType = 'update_student_data'; + + break; + case 'enroll_user_in_course': + $response = Hooks::apply(Config::withPrefix('creator_lms_enroll_user_in_course'), $defaultResponse, $fieldData); + $type = 'enrollment'; + $actionType = 'enroll_user_in_course'; + + break; + case 'create_course': + $response = Hooks::apply(Config::withPrefix('creator_lms_create_course'), $defaultResponse, $fieldData, $this->_integrationDetails); + $type = 'course'; + $actionType = 'create_course'; + + break; + case 'mark_lesson_completed': + $response = Hooks::apply(Config::withPrefix('creator_lms_mark_lesson_completed'), $defaultResponse, $fieldData); + $type = 'lesson'; + $actionType = 'mark_lesson_completed'; + + break; + default: + $response = ['success' => false, 'message' => __('Invalid action', 'bit-integrations')]; + $type = 'CreatorLms'; + $actionType = 'unknown'; + + break; + } + + $responseType = isset($response['success']) && $response['success'] ? 'success' : 'error'; + LogHandler::save($this->_integrationID, ['type' => $type, 'type_name' => $actionType], $responseType, $response); + + return $response; + } + + private function generateReqDataFromFieldMap($fieldMap, $fieldValues) + { + $dataFinal = []; + foreach ($fieldMap as $item) { + $triggerValue = $item->formField; + $actionValue = $item->creatorLmsField; + + $dataFinal[$actionValue] = $triggerValue === 'custom' && isset($item->customValue) + ? Common::replaceFieldWithValue($item->customValue, $fieldValues) + : $fieldValues[$triggerValue] ?? ''; + } + + return $dataFinal; + } +} diff --git a/backend/Actions/CreatorLms/Routes.php b/backend/Actions/CreatorLms/Routes.php new file mode 100644 index 000000000..044f1b6da --- /dev/null +++ b/backend/Actions/CreatorLms/Routes.php @@ -0,0 +1,10 @@ + ['name' => 'Fluent Forms', 'isPro' => true, 'is_active' => false], 'FluentBoards' => ['name' => 'Fluent Boards', 'isPro' => true, 'is_active' => false], 'FluentBooking' => ['name' => 'Fluent Booking', 'isPro' => true, 'is_active' => false], + 'CreatorLms' => ['name' => 'Creator LMS', 'isPro' => true, 'is_active' => false], 'FluentCart' => ['name' => 'FluentCart', 'isPro' => true, 'is_active' => false], 'FluentCrm' => ['name' => 'Fluent CRM', 'isPro' => true, 'is_active' => false], 'FluentCommunity' => ['name' => 'Fluent Community', 'isPro' => true, 'is_active' => false], diff --git a/frontend/src/Utils/StaticData/tutorialLinks.js b/frontend/src/Utils/StaticData/tutorialLinks.js index 8c5666cdd..ec1c99c42 100644 --- a/frontend/src/Utils/StaticData/tutorialLinks.js +++ b/frontend/src/Utils/StaticData/tutorialLinks.js @@ -558,6 +558,10 @@ const tutorialLinks = { 'https://youtube.com/playlist?list=PL7c6CDwwm-AL0ckxqJPUdiG0syI65HXg2&si=JkJ_0Q0iOA24_wtl', docLink: 'https://bit-integrations.com/wp-docs/actions/academy-lms-integrations-as-an-action/' }, + creatorLms: { + youTubeLink: '', + docLink: 'https://bit-integrations.com/wp-docs/actions/creator-lms-integrations/' + }, woodpecker: { youTubeLink: 'https://youtube.com/playlist?list=PL7c6CDwwm-AL0mmQk0yX6u-HnqDzJeXDu&si=MdiwtkYVb0kBIjPD', diff --git a/frontend/src/Utils/StaticData/webhookIntegrations.js b/frontend/src/Utils/StaticData/webhookIntegrations.js index a846b22fc..fb44eaf2b 100644 --- a/frontend/src/Utils/StaticData/webhookIntegrations.js +++ b/frontend/src/Utils/StaticData/webhookIntegrations.js @@ -75,6 +75,7 @@ export const customFormIntegrations = [ 'FormGent', 'GeoDirectory', 'StoreEngine', + 'CreatorLms', 'FluentCart', 'MailMint', 'BookingCalendarContactForm', diff --git a/frontend/src/components/AllIntegrations/Autonami/Autonami.jsx b/frontend/src/components/AllIntegrations/Autonami/Autonami.jsx index 47e1f0d57..5aa31e831 100644 --- a/frontend/src/components/AllIntegrations/Autonami/Autonami.jsx +++ b/frontend/src/components/AllIntegrations/Autonami/Autonami.jsx @@ -69,7 +69,7 @@ export default function Autonami({ formFields, setFlow, flow, allIntegURL }) { style={{ width: step === 2 && 900, height: step === 2 && 'auto', - minHeight: step === 2 && `${200}px` + minHeight: step === 2 && `${500}px` }}> { + setTimeout(() => { + document.getElementById('btcd-settings-wrp').scrollTop = 0 + }, 300) + + if (val === 3) { + if (!checkMappedFields(creatorLmsConf)) { + setSnackbar({ + show: true, + msg: __('Please map all required fields to continue.', 'bit-integrations') + }) + return + } + + if (creatorLmsConf.name !== '' && creatorLmsConf.field_map.length > 0) { + setStep(val) + } + } else { + setStep(val) + } + } + + return ( +
+ +
{/* */}
+ + {/* STEP 1 */} + + + {/* STEP 2 */} +
+ +
+
+
+ +
+ + {/* STEP 3 */} + + saveIntegConfig(flow, setFlow, allIntegURL, creatorLmsConf, navigate, '', '', setIsLoading) + } + isLoading={isLoading} + /> +
+ ) +} diff --git a/frontend/src/components/AllIntegrations/CreatorLms/CreatorLmsAuthorization.jsx b/frontend/src/components/AllIntegrations/CreatorLms/CreatorLmsAuthorization.jsx new file mode 100644 index 000000000..bafd9e801 --- /dev/null +++ b/frontend/src/components/AllIntegrations/CreatorLms/CreatorLmsAuthorization.jsx @@ -0,0 +1,118 @@ +import { useState } from 'react' +import BackIcn from '../../../Icons/BackIcn' +import bitsFetch from '../../../Utils/bitsFetch' +import { __ } from '../../../Utils/i18nwrap' +import tutorialLinks from '../../../Utils/StaticData/tutorialLinks' +import LoaderSm from '../../Loaders/LoaderSm' +import TutorialLink from '../../Utilities/TutorialLink' + +export default function CreatorLmsAuthorization({ + formID, + creatorLmsConf, + setCreatorLmsConf, + step, + nextPage, + isLoading, + setIsLoading, + setSnackbar +}) { + const [isAuthorized, setIsAuthorized] = useState(false) + const [showAuthMsg, setShowAuthMsg] = useState(false) + const { creatorLms } = tutorialLinks + + const authorizeHandler = () => { + setIsLoading('auth') + bitsFetch({}, 'creator_lms_authorize').then(result => { + if (result?.success) { + setIsAuthorized(true) + setSnackbar({ + show: true, + msg: __('Connected with Creator LMS Successfully', 'bit-integrations') + }) + } + setIsLoading(false) + setShowAuthMsg(true) + }) + } + + const handleInput = e => { + const newConf = { ...creatorLmsConf } + newConf[e.target.name] = e.target.value + setCreatorLmsConf(newConf) + } + + return ( +
+ {creatorLms?.youTubeLink && ( + + )} + {creatorLms?.docLink && } + +
+ {__('Integration Name:', 'bit-integrations')} +
+ + + {isLoading === 'auth' && ( +
+ + {__('Checking if Creator LMS is authorized!!!', 'bit-integrations')} +
+ )} + + {showAuthMsg && !isAuthorized && !isLoading && ( +
+
+
+ +
+
+ {__('Creator LMS is not activated or not installed', 'bit-integrations')} +
+
+
+ )} + + {showAuthMsg && isAuthorized && !isLoading && ( +
+
+ +
+
{__('Creator LMS is activated', 'bit-integrations')}
+
+ )} + + +
+ +
+ ) +} diff --git a/frontend/src/components/AllIntegrations/CreatorLms/CreatorLmsCommonFunc.js b/frontend/src/components/AllIntegrations/CreatorLms/CreatorLmsCommonFunc.js new file mode 100644 index 000000000..45fe24a70 --- /dev/null +++ b/frontend/src/components/AllIntegrations/CreatorLms/CreatorLmsCommonFunc.js @@ -0,0 +1,38 @@ +import { create } from 'mutative' +import toast from 'react-hot-toast' +import bitsFetch from '../../../Utils/bitsFetch' +import { __ } from '../../../Utils/i18nwrap' + +export const handleInput = (e, creatorLmsConf, setCreatorLmsConf) => { + const { name, value } = e.target + setCreatorLmsConf(prevConf => + create(prevConf, draftConf => { + draftConf[name] = value + }) + ) +} + +export const checkMappedFields = creatorLmsConf => { + const mappedFields = creatorLmsConf?.field_map + ? creatorLmsConf.field_map.filter( + mappedField => + !mappedField.formField || + !mappedField.creatorLmsField || + (mappedField.formField === 'custom' && !mappedField.customValue) + ) + : [] + if (mappedFields.length > 0) { + return false + } + return true +} + +export const generateMappedField = fields => { + const requiredFlds = fields.filter(fld => fld.required === true) + return requiredFlds.length > 0 + ? requiredFlds.map(field => ({ + formField: '', + creatorLmsField: field.key + })) + : [{ formField: '', creatorLmsField: '' }] +} diff --git a/frontend/src/components/AllIntegrations/CreatorLms/CreatorLmsFieldMap.jsx b/frontend/src/components/AllIntegrations/CreatorLms/CreatorLmsFieldMap.jsx new file mode 100644 index 000000000..0c2e081b4 --- /dev/null +++ b/frontend/src/components/AllIntegrations/CreatorLms/CreatorLmsFieldMap.jsx @@ -0,0 +1,113 @@ +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 CreatorLmsFieldMap({ + i, + formFields, + field, + creatorLmsConf, + setCreatorLmsConf +}) { + const btcbi = useRecoilValue($appConfigState) + const { isPro } = btcbi + + const requiredFlds = creatorLmsConf?.creatorLmsFields?.filter(fld => fld.required === true) || [] + const nonRequiredFlds = + creatorLmsConf?.creatorLmsFields?.filter(fld => fld.required === false) || [] + + return ( +
+
+
+ + + {field.formField === 'custom' && ( + handleCustomValue(e, i, creatorLmsConf, setCreatorLmsConf)} + 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/CreatorLms/CreatorLmsIntegLayout.jsx b/frontend/src/components/AllIntegrations/CreatorLms/CreatorLmsIntegLayout.jsx new file mode 100644 index 000000000..68296fd64 --- /dev/null +++ b/frontend/src/components/AllIntegrations/CreatorLms/CreatorLmsIntegLayout.jsx @@ -0,0 +1,160 @@ +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 Loader from '../../Loaders/Loader' +import { checkIsPro, getProLabel } from '../../Utilities/ProUtilHelpers' +import { addFieldMap } from '../IntegrationHelpers/IntegrationHelpers' +import { + generateMappedField +} from './CreatorLmsCommonFunc' +import CreatorLmsFieldMap from './CreatorLmsFieldMap' +import { + courseStatusOptions, + CreateCourseFields, + CreateStudentFields, + EnrollUserInCourseFields, + MarkLessonCompletedFields, + modules, + UpdateStudentFields +} from './staticData' + +export default function CreatorLmsIntegLayout({ + formID, + formFields, + creatorLmsConf, + setCreatorLmsConf, + isLoading, + setIsLoading, + setSnackbar +}) { + const appConfig = useRecoilValue($appConfigState) + const { isPro } = appConfig + + const handleMainAction = value => { + setCreatorLmsConf(prevConf => + create(prevConf, draftConf => { + draftConf.mainAction = value + draftConf.courseStatus = null + + switch (value) { + case 'create_student': + draftConf.creatorLmsFields = CreateStudentFields + break + case 'update_student_data': + draftConf.creatorLmsFields = UpdateStudentFields + break + case 'enroll_user_in_course': + draftConf.creatorLmsFields = EnrollUserInCourseFields + break + case 'create_course': + draftConf.creatorLmsFields = CreateCourseFields + break + case 'mark_lesson_completed': + draftConf.creatorLmsFields = MarkLessonCompletedFields + break + default: + draftConf.creatorLmsFields = [] + } + + draftConf.field_map = generateMappedField(draftConf.creatorLmsFields) + }) + ) + } + + 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 + /> +
+ + {creatorLmsConf?.mainAction === 'create_course' && ( + <> +
+
+ {__('Course Status:', 'bit-integrations')} + + setCreatorLmsConf(prevConf => + create(prevConf, draftConf => { + draftConf.courseStatus = val + }) + ) + } + singleSelect + closeOnSelect + /> +
+ + )} + + {isLoading && ( + + )} + + {creatorLmsConf?.mainAction && creatorLmsConf.creatorLmsFields && creatorLmsConf.creatorLmsFields.length > 0 && ( +
+ {__('Map Fields', 'bit-integrations')} +
+
+
+ {__('Form Fields', 'bit-integrations')} +
+
+ {__('Creator LMS Fields', 'bit-integrations')} +
+
+ + {creatorLmsConf?.field_map?.map((itm, i) => ( + + ))} +
+ +
+
+
+ )} + + ) +} diff --git a/frontend/src/components/AllIntegrations/CreatorLms/EditCreatorLms.jsx b/frontend/src/components/AllIntegrations/CreatorLms/EditCreatorLms.jsx new file mode 100644 index 000000000..259c9b77f --- /dev/null +++ b/frontend/src/components/AllIntegrations/CreatorLms/EditCreatorLms.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 './CreatorLmsCommonFunc' +import CreatorLmsIntegLayout from './CreatorLmsIntegLayout' + +export default function EditCreatorLms({ allIntegURL }) { + const navigate = useNavigate() + const { id, formID } = useParams() + + const [creatorLmsConf, setCreatorLmsConf] = 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, creatorLmsConf, setCreatorLmsConf)} + name="name" + value={creatorLmsConf.name} + type="text" + placeholder={__('Integration Name...', 'bit-integrations')} + /> +
+
+ + + + + + + saveActionConf({ + flow, + setFlow, + allIntegURL, + conf: creatorLmsConf, + navigate, + id, + edit: 1, + setIsLoading, + setSnackbar + }) + } + disabled={!checkMappedFields(creatorLmsConf)} + isLoading={isLoading} + dataConf={creatorLmsConf} + setDataConf={setCreatorLmsConf} + formFields={formFields} + /> +
+
+ ) +} diff --git a/frontend/src/components/AllIntegrations/CreatorLms/staticData.js b/frontend/src/components/AllIntegrations/CreatorLms/staticData.js new file mode 100644 index 000000000..db9fa1fd4 --- /dev/null +++ b/frontend/src/components/AllIntegrations/CreatorLms/staticData.js @@ -0,0 +1,47 @@ +import { __ } from '../../../Utils/i18nwrap' + +export const modules = [ + { name: 'create_student', label: __('Create Student', 'bit-integrations'), is_pro: true }, + { name: 'update_student_data', label: __('Update Student Data', 'bit-integrations'), is_pro: true }, + { name: 'enroll_user_in_course', label: __('Enroll User in Course', 'bit-integrations'), is_pro: true }, + { name: 'create_course', label: __('Create Course', 'bit-integrations'), is_pro: true }, + { name: 'mark_lesson_completed', label: __('Mark Lesson Completed', 'bit-integrations'), is_pro: true } +] + +export const CreateStudentFields = [ + { key: 'user_email', label: __('Student Email', 'bit-integrations'), required: true }, + { key: 'username', label: __('Username', 'bit-integrations'), required: false }, + { key: 'password', label: __('Password', 'bit-integrations'), required: false }, + { key: 'first_name', label: __('First Name', 'bit-integrations'), required: false }, + { key: 'last_name', label: __('Last Name', 'bit-integrations'), required: false } +] + +export const UpdateStudentFields = [ + { key: 'user_email', label: __('Student Email', 'bit-integrations'), required: true }, + { key: 'new_email', label: __('New Email Address', 'bit-integrations'), required: false }, + { key: 'first_name', label: __('First Name', 'bit-integrations'), required: false }, + { key: 'last_name', label: __('Last Name', 'bit-integrations'), required: false }, + { key: 'display_name', label: __('Display Name', 'bit-integrations'), required: false } +] + +export const EnrollUserInCourseFields = [ + { key: 'user_email', label: __('Student Email', 'bit-integrations'), required: true }, + { key: 'course_id', label: __('Course ID', 'bit-integrations'), required: true } +] + +export const CreateCourseFields = [ + { key: 'course_title', label: __('Course Title', 'bit-integrations'), required: true }, + { key: 'course_description', label: __('Course Description', 'bit-integrations'), required: true } +] + +export const courseStatusOptions = [ + { label: __('Draft', 'bit-integrations'), value: 'draft' }, + { label: __('Publish', 'bit-integrations'), value: 'publish' }, + { label: __('Pending', 'bit-integrations'), value: 'pending' } +] + +export const MarkLessonCompletedFields = [ + { key: 'user_email', label: __('Student Email', 'bit-integrations'), required: true }, + { key: 'course_id', label: __('Course ID', 'bit-integrations'), required: true }, + { key: 'lesson_id', label: __('Lesson ID', 'bit-integrations'), required: true } +] diff --git a/frontend/src/components/AllIntegrations/EditInteg.jsx b/frontend/src/components/AllIntegrations/EditInteg.jsx index 9f03f7704..9d0868853 100644 --- a/frontend/src/components/AllIntegrations/EditInteg.jsx +++ b/frontend/src/components/AllIntegrations/EditInteg.jsx @@ -169,6 +169,7 @@ const EditBento = lazy(() => import('./Bento/EditBento')) const EditLine = lazy(() => import('./Line/EditLine')) const EditACPT = lazy(() => import('./ACPT/EditACPT')) const EditWishlistMember = lazy(() => import('./WishlistMember/EditWishlistMember')) +const EditCreatorLms = lazy(() => import('./CreatorLms/EditCreatorLms')) const EditFluentCart = lazy(() => import('./FluentCart/EditFluentCart')) const EditWPCafe = lazy(() => import('./WPCafe/EditWPCafe')) const EditNotificationX = lazy(() => import('./NotificationX/EditNotificationX')) @@ -581,6 +582,8 @@ const IntegType = memo(({ allIntegURL, flow }) => { return case 'Wishlist Member': return + case 'CreatorLms': + return case 'FluentCart': return case 'WPCafe': diff --git a/frontend/src/components/AllIntegrations/FluentCRM/FluentCrm.jsx b/frontend/src/components/AllIntegrations/FluentCRM/FluentCrm.jsx index 30a790255..760cd830b 100644 --- a/frontend/src/components/AllIntegrations/FluentCRM/FluentCrm.jsx +++ b/frontend/src/components/AllIntegrations/FluentCRM/FluentCrm.jsx @@ -78,7 +78,7 @@ export default function FluentCrm({ formFields, setFlow, flow, allIntegURL }) { style={{ width: step === 2 && 900, height: step === 2 && 'auto', - minHeight: step === 2 && `${200}px` + minHeight: step === 2 && `${500}px` }}> import('./Bento/BentoAuthorization')) const LineAuthorization = lazy(() => import('./Line/LineAuthorization')) const ACPTAuthorization = lazy(() => import('./ACPT/ACPTAuthorization')) const WishlistMemberAuthorization = lazy(() => import('./WishlistMember/WishlistMemberAuthorization')) +const CreatorLmsAuthorization = lazy(() => import('./CreatorLms/CreatorLmsAuthorization')) const FluentCartAuthorization = lazy(() => import('./FluentCart/FluentCartAuthorization')) const WPCafeAuthorization = lazy(() => import('./WPCafe/WPCafeAuthorization')) const TeamsForWooCommerceMembershipsAuthorization = lazy( @@ -616,6 +617,8 @@ export default function IntegInfo() { return case 'WishlistMember': return + case 'CreatorLms': + return case 'FluentCart': return case 'WPCafe': diff --git a/frontend/src/components/AllIntegrations/MailPoet/MailPoet.jsx b/frontend/src/components/AllIntegrations/MailPoet/MailPoet.jsx index 3e8783640..fb2ee91ef 100644 --- a/frontend/src/components/AllIntegrations/MailPoet/MailPoet.jsx +++ b/frontend/src/components/AllIntegrations/MailPoet/MailPoet.jsx @@ -69,7 +69,7 @@ export default function MailPoet({ formFields, setFlow, flow, allIntegURL }) { style={{ width: step === 2 && 900, height: step === 2 && 'auto', - minHeight: step === 2 && `${200}px` + minHeight: step === 2 && `${500}px` }}> import('./Bento/Bento')) const Line = lazy(() => import('./Line/Line')) const ACPT = lazy(() => import('./ACPT/ACPT')) const WishlistMember = lazy(() => import('./WishlistMember/WishlistMember')) +const CreatorLms = lazy(() => import('./CreatorLms/CreatorLms')) const FluentCart = lazy(() => import('./FluentCart/FluentCart')) const WPCafe = lazy(() => import('./WPCafe/WPCafe')) const NotificationX = lazy(() => import('./NotificationX/NotificationX')) @@ -1635,6 +1636,15 @@ export default function NewInteg({ allIntegURL }) { setFlow={setFlow} /> ) + case 'CreatorLms': + return ( + + ) case 'FluentCart': return (