Skip to content

Commit 7e740e6

Browse files
authored
Merge pull request #72 from Bit-Apps-Pro/rishad-dev-tmp
fixed some minor bugs
2 parents 19527fb + c692432 commit 7e740e6

File tree

5 files changed

+33
-22
lines changed

5 files changed

+33
-22
lines changed

frontend-dev/src/components/AllIntegrations/Freshdesk/FreshdeskAuthorization.jsx

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,19 @@ export default function FreshdeskAuthorization({
3939
}
4040

4141
const freshdeskInstructions = `
42-
<h4>${__('App Domain Example', 'bit-integrations')}</h4>
42+
<h4>${__('Locate Your App Domain', 'bit-integrations')}</h4>
4343
<ul>
44-
<li>https://domain-help.freshdesk.com/</li>
44+
<li>${__('Access your Freshdesk account.', 'bit-integrations')}</li>
45+
<li>${__('Copy the URL displayed in your browser’s address bar', 'bit-integrations')} (e.g., https://domain.freshdesk.com/)</li>
46+
<li>${__('Paste the copied App Domain into the designated “App Domain” field within the integrations you’re setting up.', 'bit-integrations')}</li>
47+
</ul>
48+
<h4>${__('Retrieve Your App API Key', 'bit-integrations')}</h4>
49+
<ul>
50+
<li>${__('Within your Freshdesk account, click on your profile icon, situated in the top right corner.', 'bit-integrations')}</li>
51+
<li>${__('Select “Profile Settings” from the options that appear.', 'bit-integrations')}</li>
52+
<li>${__('Locate your App API key, prominently displayed on the top right side of the Profile Settings page.', 'bit-integrations')}</li>
53+
<li>${__('Copy this key.', 'bit-integrations')}</li>
54+
<li>${__('Paste the copied App API key into the designated “App API key” field within the integrations you’re configuring.', 'bit-integrations')}</li>
4555
</ul>`
4656

4757
return (
@@ -69,17 +79,6 @@ export default function FreshdeskAuthorization({
6979
disabled={isInfo}
7080
/>
7181

72-
<small className="d-blk mt-5">
73-
{__('To get access Token , Please Visit', 'bit-integrations')}{' '}
74-
<a
75-
className="btcd-link"
76-
href="https://bitcode-help.freshdesk.com/a/profiles/72009210017/edit"
77-
target="_blank"
78-
rel="noreferrer">
79-
{__('FreshDesk Console', 'bit-integrations')}
80-
</a>
81-
</small>
82-
8382
<div className="mt-3">
8483
<b>{__('Your App Domain:', 'bit-integrations')}</b>
8584
</div>
@@ -92,6 +91,7 @@ export default function FreshdeskAuthorization({
9291
placeholder={__('App Domain...', 'bit-integrations')}
9392
disabled={isInfo}
9493
/>
94+
<small className="d-blk mt-2">{`${__('App Domain Example', 'bit-integrations')}: https://domain.freshdesk.com`}</small>
9595
<div style={{ color: 'red' }}>{error.app_domain}</div>
9696

9797
<div className="mt-3">
@@ -106,6 +106,16 @@ export default function FreshdeskAuthorization({
106106
placeholder={__('Access Token...', 'bit-integrations')}
107107
disabled={isInfo}
108108
/>
109+
<small className="d-blk mt-2">
110+
{__('To get access Token , Please Visit', 'bit-integrations')}{' '}
111+
<a
112+
className="btcd-link"
113+
href={`${freshdeskConf?.app_domain || 'https://domain.freshdesk.com'}/a/profiles/72009210017/edit`}
114+
target="_blank"
115+
rel="noreferrer">
116+
{__('FreshDesk Console', 'bit-integrations')}
117+
</a>
118+
</small>
109119
<div style={{ color: 'red' }}>{error.api_key}</div>
110120

111121
{!isInfo && (

frontend-dev/src/components/AllIntegrations/IntegrationHelpers/IntegrationHelpers.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ export const saveIntegConfig = async (
150150
tmpConf = LifterLmsStateIH(tmpConf, dataFlow)
151151
} else if (flow.triggered_entity === 'MasterStudyLms') {
152152
const dataFlow = edit ? flow?.flow_details : flow?.triggerData
153-
tmpConf = MasterStudyLmsStateIH(tmpConf, dataFlow, flow?.triggered_entity_id)
153+
const formID = dataFlow?.formID || flow?.triggered_entity_id
154+
tmpConf = MasterStudyLmsStateIH(tmpConf, dataFlow, formID)
154155
} else if (flow.triggered_entity === 'ThriveApprentice') {
155156
const dataFlow = edit ? flow?.flow_details : flow?.triggerData
156157
tmpConf = ThriveApprenticeStateIH(tmpConf, dataFlow)
@@ -332,7 +333,8 @@ export const saveActionConf = async ({
332333
tmpConf = LifterLmsStateIH(tmpConf, dataFlow)
333334
} else if (flow.triggered_entity === 'MasterStudyLms') {
334335
const dataFlow = edit ? flow?.flow_details : flow?.triggerData
335-
tmpConf = MasterStudyLmsStateIH(tmpConf, dataFlow, flow?.triggered_entity_id)
336+
const formID = dataFlow?.formID || flow?.triggered_entity_id
337+
tmpConf = MasterStudyLmsStateIH(tmpConf, dataFlow, formID)
336338
} else if (flow.triggered_entity === 'ThriveApprentice') {
337339
const dataFlow = edit ? flow?.flow_details : flow?.triggerData
338340
tmpConf = ThriveApprenticeStateIH(tmpConf, dataFlow)

includes/Actions/Freshdesk/FreshdeskController.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
namespace BitCode\FI\Actions\Freshdesk;
88

9-
use BitCode\FI\Core\Util\HttpHelper;
109
use WP_Error;
10+
use BitCode\FI\Core\Util\HttpHelper;
1111

1212
/**
1313
* Provide functionality for Freshdesk integration
@@ -42,10 +42,9 @@ public function checkAuthorizationAndFetchTickets($tokenRequestParams)
4242
];
4343

4444
$apiEndpoint = $tokenRequestParams->app_domain . '/api/v2/tickets';
45-
4645
$apiResponse = HttpHelper::get($apiEndpoint, null, $header);
4746

48-
if (is_wp_error($apiResponse) || empty($apiResponse[0]->id)) {
47+
if (is_wp_error($apiResponse) || HttpHelper::$responseCode !== 200) {
4948
wp_send_json_error(
5049
empty($apiResponse->error) ? 'Unknown' : $apiResponse->error,
5150
400

includes/Actions/OmniSend/RecordApiHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
namespace BitCode\FI\Actions\OmniSend;
88

9-
use BitCode\FI\Log\LogHandler;
109
use BitCode\FI\Core\Util\Common;
1110
use BitCode\FI\Core\Util\HttpHelper;
11+
use BitCode\FI\Log\LogHandler;
1212

1313
/**
1414
* Provide functionality for Record insert, upsert
@@ -103,7 +103,7 @@ public function execute(
103103
$emailStatus,
104104
$smsStatus,
105105
$fieldValues,
106-
$fieldMap,
106+
$fieldMap
107107
) {
108108
$finalData = $this->generateReqDataFromFieldMap($fieldValues, $fieldMap);
109109
$apiResponse = $this->addContact(

includes/Flow/Flow.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,8 +469,8 @@ public static function execute($triggered_entity, $triggered_entity_id, $data, $
469469
$integrationName = 'Registration';
470470

471471
break;
472-
case 'Zoho Marketing Automation(Zoho Marketing Hub)':
473-
$integrationName = 'Zoho Marketing Hub';
472+
case 'ZohoMarketingAutomation(ZohoMarketingHub)':
473+
$integrationName = 'ZohoMarketingHub';
474474

475475
break;
476476

0 commit comments

Comments
 (0)