Skip to content

Commit 8bd98b7

Browse files
authored
Merge pull request #108 from Bit-Apps-Pro/feat/add-line
Feat/add-line
2 parents 6c822aa + 41fd71e commit 8bd98b7

File tree

19 files changed

+1738
-45
lines changed

19 files changed

+1738
-45
lines changed

frontend-dev/src/Utils/StaticData/tutorialLinks.js

Lines changed: 47 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ const tutorialLinks = {
99
docLink: 'https://bitapps.pro/docs/bit-integrations/actions/bit-form-integrations/'
1010
},
1111
autonami: {
12-
youTubeLink: 'https://youtube.com/playlist?list=PL7c6CDwwm-AKKvkYEkCSXVfslSI_92xZq&si=K1EdWwex5pVIpTy7',
12+
youTubeLink:
13+
'https://youtube.com/playlist?list=PL7c6CDwwm-AKKvkYEkCSXVfslSI_92xZq&si=K1EdWwex5pVIpTy7',
1314
docLink: 'https://bitapps.pro/docs/bit-integrations/actions/funnelkit-integrations/'
1415
},
1516
acumbamail: {
1617
youTubeLink: 'https://www.youtube.com/playlist?list=PL7c6CDwwm-AJwT-RmvZ4iuAqhIdG9nZ2S',
17-
docLink:
18-
'https://bitapps.pro/docs/bit-integrations/actions/acumbamail-integrations/'
18+
docLink: 'https://bitapps.pro/docs/bit-integrations/actions/acumbamail-integrations/'
1919
},
2020
antsAndApps: {
2121
youTubeLink: '',
@@ -34,23 +34,26 @@ const tutorialLinks = {
3434
docLink: 'https://bitapps.pro/docs/bit-integrations/actions/asana-integrations/'
3535
},
3636
buddyBoss: {
37-
youTubeLink: 'https://youtube.com/playlist?list=PL7c6CDwwm-AL1Lmj_7nU7vTQwly34ScS1&si=3OvpQ12uRwVI8W-z',
37+
youTubeLink:
38+
'https://youtube.com/playlist?list=PL7c6CDwwm-AL1Lmj_7nU7vTQwly34ScS1&si=3OvpQ12uRwVI8W-z',
3839
docLink: 'https://bitapps.pro/docs/bit-integrations/trigger/buddyboss-integrations/'
3940
},
4041
benchMark: {
4142
youTubeLink: 'https://www.youtube.com/playlist?list=PL7c6CDwwm-AIrUyTzC5KAyuEv22VDxXhU',
4243
docLink: 'https://bitapps.pro/docs/bit-integrations/actions/benchmark-email-integrations/'
4344
},
4445
constantContact: {
45-
youTubeLink: 'https://youtube.com/playlist?list=PL7c6CDwwm-ALc1_UJACiwJW3D0eYZeYWK&si=ZbML8PwhZka3X3Z6',
46+
youTubeLink:
47+
'https://youtube.com/playlist?list=PL7c6CDwwm-ALc1_UJACiwJW3D0eYZeYWK&si=ZbML8PwhZka3X3Z6',
4648
docLink: 'https://bitapps.pro/docs/bit-integrations/actions/constant-contact-integrations/'
4749
},
4850
customAction: {
4951
youTubeLink: '',
5052
docLink: 'https://bit-integrations.com/wp-docs/actions/custom-action-integrations/'
5153
},
5254
customApi: {
53-
youTubeLink: 'https://youtube.com/playlist?list=PL7c6CDwwm-AKth-ShFWFrh0F1uWphkMud&si=RIBDhH2FtQqJKhLr',
55+
youTubeLink:
56+
'https://youtube.com/playlist?list=PL7c6CDwwm-AKth-ShFWFrh0F1uWphkMud&si=RIBDhH2FtQqJKhLr',
5457
docLink: 'https://bitapps.pro/docs/bit-integrations/actions/customapi-integrations/'
5558
},
5659
capsulecrm: {
@@ -67,7 +70,8 @@ const tutorialLinks = {
6770
docLink: 'https://bitapps.pro/docs/bit-integrations/actions/clinchpad-integrations/'
6871
},
6972
clickup: {
70-
youTubeLink: 'https://youtube.com/playlist?list=PL7c6CDwwm-AKF5yTZkCfNFnA94Bd848ok&si=wJHzL784d37jp8PK',
73+
youTubeLink:
74+
'https://youtube.com/playlist?list=PL7c6CDwwm-AKF5yTZkCfNFnA94Bd848ok&si=wJHzL784d37jp8PK',
7175
docLink: 'https://bitapps.pro/docs/bit-integrations/actions/clickup-integrations/'
7276
},
7377
coppercrm: {
@@ -83,7 +87,8 @@ const tutorialLinks = {
8387
docLink: 'https://bitapps.pro/docs/bit-integrations/actions/directiq-integrations/'
8488
},
8589
discord: {
86-
youTubeLink: "https://youtube.com/playlist?list=PL7c6CDwwm-ALnPrvN-ao1AhwEddKI4rLd&si=6s5TJENXOxRjNAyY",
90+
youTubeLink:
91+
'https://youtube.com/playlist?list=PL7c6CDwwm-ALnPrvN-ao1AhwEddKI4rLd&si=6s5TJENXOxRjNAyY',
8792
docLink: 'https://bitapps.pro/docs/bit-integrations/actions/discord-integrations/'
8893
},
8994
elasticEmail: {
@@ -103,7 +108,8 @@ const tutorialLinks = {
103108
docLink: 'https://bitapps.pro/docs/bit-integrations/actions/fluentcrm-integrations/'
104109
},
105110
fluentSupport: {
106-
youTubeLink: 'https://youtube.com/playlist?list=PL7c6CDwwm-AJk_-lRrBQGqA0ZdErCb6q0&si=gQTJMXX65Fkh-CMJ',
111+
youTubeLink:
112+
'https://youtube.com/playlist?list=PL7c6CDwwm-AJk_-lRrBQGqA0ZdErCb6q0&si=gQTJMXX65Fkh-CMJ',
107113
docLink: 'https://bitapps.pro/docs/bit-integrations/actions/fluent-support-integrations/'
108114
},
109115
freshdesk: {
@@ -168,11 +174,13 @@ const tutorialLinks = {
168174
docLink: 'https://bitapps.pro/docs/bit-integrations/actions/ifttt-integrations/'
169175
},
170176
insightly: {
171-
youTubeLink: 'https://youtube.com/playlist?list=PL7c6CDwwm-AJJZikQUoBuFD6vqyBIsmyA&si=k2zhHewzRw4nW4pu',
177+
youTubeLink:
178+
'https://youtube.com/playlist?list=PL7c6CDwwm-AJJZikQUoBuFD6vqyBIsmyA&si=k2zhHewzRw4nW4pu',
172179
docLink: 'https://bitapps.pro/docs/bit-integrations/actions/insightly-integrations/'
173180
},
174181
keap: {
175-
youTubeLink: 'https://youtube.com/playlist?list=PL7c6CDwwm-AIcGnheYoOKjXkF3LK1cLRt&si=kXhE2PE5RK1kuUky',
182+
youTubeLink:
183+
'https://youtube.com/playlist?list=PL7c6CDwwm-AIcGnheYoOKjXkF3LK1cLRt&si=kXhE2PE5RK1kuUky',
176184
docLink: 'https://bitapps.pro/docs/bit-integrations/actions/keap-integrations/'
177185
},
178186
klaviyo: {
@@ -184,7 +192,8 @@ const tutorialLinks = {
184192
docLink: 'https://bitapps.pro/docs/bit-integrations/actions/konnectzit-integrations/'
185193
},
186194
kirimEmail: {
187-
youTubeLink: 'https://youtube.com/playlist?list=PL7c6CDwwm-AJVR9cAQg2OKLSqMC2G1Wlg&si=hVGmDkrezTYULJHO',
195+
youTubeLink:
196+
'https://youtube.com/playlist?list=PL7c6CDwwm-AJVR9cAQg2OKLSqMC2G1Wlg&si=hVGmDkrezTYULJHO',
188197
docLink: 'https://bitapps.pro/docs/bit-integrations/actions/kirim-email-integrations/'
189198
},
190199
learnDash: {
@@ -200,7 +209,8 @@ const tutorialLinks = {
200209
docLink: 'https://bitapps.pro/docs/bit-integrations/actions/mail-integrations/'
201210
},
202211
masterStudyLMS: {
203-
youTubeLink: 'https://youtube.com/playlist?list=PL7c6CDwwm-AIRhdvMtVF1lKcj4zD1cFHK&si=RYO0rZbA3OeZdd0w',
212+
youTubeLink:
213+
'https://youtube.com/playlist?list=PL7c6CDwwm-AIRhdvMtVF1lKcj4zD1cFHK&si=RYO0rZbA3OeZdd0w',
204214
docLink: 'https://bitapps.pro/docs/bit-integrations/actions/masterstudy-lms-integrations/'
205215
},
206216
mailBluster: {
@@ -401,7 +411,8 @@ const tutorialLinks = {
401411
docLink: 'https://bitapps.pro/docs/bit-integrations/actions/wishlist-integrations/'
402412
},
403413
zapierLinks: {
404-
youTubeLink: 'https://youtube.com/playlist?list=PL7c6CDwwm-ALfK6q_IEHnwcwTsl7ra04w&si=Hz8knNWJA6XhuCb2',
414+
youTubeLink:
415+
'https://youtube.com/playlist?list=PL7c6CDwwm-ALfK6q_IEHnwcwTsl7ra04w&si=Hz8knNWJA6XhuCb2',
405416
docLink: 'https://bitapps.pro/docs/bit-integrations/actions/zapier-integrations/'
406417
},
407418
zohoBigin: {
@@ -538,7 +549,8 @@ const tutorialLinks = {
538549
docLink: 'https://bitapps.pro/docs/bit-integrations/actions/livestorm-integrations/'
539550
},
540551
oneHashCRM: {
541-
youTubeLink: 'https://youtube.com/playlist?list=PL7c6CDwwm-AKEGvpfNOQRJmr1vBBXxssV&si=OFWMWkNX2y-5l90y',
552+
youTubeLink:
553+
'https://youtube.com/playlist?list=PL7c6CDwwm-AKEGvpfNOQRJmr1vBBXxssV&si=OFWMWkNX2y-5l90y',
542554
docLink: 'https://bitapps.pro/docs/bit-integrations/actions/onehash-crm-integrations/'
543555
},
544556
academyLms: {
@@ -547,43 +559,51 @@ const tutorialLinks = {
547559
docLink: 'https://bit-integrations.com/wp-docs/actions/academy-lms-integrations-as-an-action/'
548560
},
549561
woodpecker: {
550-
youTubeLink: 'https://youtube.com/playlist?list=PL7c6CDwwm-AL0mmQk0yX6u-HnqDzJeXDu&si=MdiwtkYVb0kBIjPD',
562+
youTubeLink:
563+
'https://youtube.com/playlist?list=PL7c6CDwwm-AL0mmQk0yX6u-HnqDzJeXDu&si=MdiwtkYVb0kBIjPD',
551564
docLink: 'https://bitapps.pro/docs/bit-integrations/actions/woodpecker-integrations/'
552565
},
553566
moxiecrm: {
554-
youTubeLink: 'https://youtube.com/playlist?list=PL7c6CDwwm-AK-vKTk6K0SjzR9ciayOr87&si=AT29lKvhEvPBsBnR',
567+
youTubeLink:
568+
'https://youtube.com/playlist?list=PL7c6CDwwm-AK-vKTk6K0SjzR9ciayOr87&si=AT29lKvhEvPBsBnR',
555569
docLink: 'https://bitapps.pro/docs/bit-integrations/actions/moxie-integrations/'
556570
},
557571
wpFusionLinks: {
558572
youTubeLink: '',
559573
docLink: 'https://bitapps.pro/docs/bit-integrations/actions/wp-fusion-integrations/'
560574
},
561575
affiliate: {
562-
youTubeLink: 'https://youtube.com/playlist?list=PL7c6CDwwm-AKA6EP_4OMVlEHrBw5kSrQo&si=aVAvTaA0hsb4pzYU',
576+
youTubeLink:
577+
'https://youtube.com/playlist?list=PL7c6CDwwm-AKA6EP_4OMVlEHrBw5kSrQo&si=aVAvTaA0hsb4pzYU',
563578
docLink: 'https://bitapps.pro/docs/bit-integrations/actions/affiliatewp-integrations/'
564579
},
565580
newsletter: {
566-
youTubeLink: 'https://youtube.com/playlist?list=PL7c6CDwwm-AISvJs0enpWVRPxFERVkf91&si=tCh4063CvwFVG4WV',
581+
youTubeLink:
582+
'https://youtube.com/playlist?list=PL7c6CDwwm-AISvJs0enpWVRPxFERVkf91&si=tCh4063CvwFVG4WV',
567583
docLink: 'https://bit-integrations.com/wp-docs/actions/newsletter-integrations/'
568584
},
569585
sureMembers: {
570-
youTubeLink: 'https://youtube.com/playlist?list=PL7c6CDwwm-AL1LP5QSkVmALdxVs_M3AAA&si=0gZBuVxulvBYgAnU',
586+
youTubeLink:
587+
'https://youtube.com/playlist?list=PL7c6CDwwm-AL1LP5QSkVmALdxVs_M3AAA&si=0gZBuVxulvBYgAnU',
571588
docLink: 'https://bit-integrations.com/wp-docs/actions/suremembers-integrations-as-an-action/'
572589
},
573590
mailster: {
574-
youTubeLink: 'https://youtube.com/playlist?list=PL7c6CDwwm-AK04F8F1OgzMOK8_2w1XLus&si=hpavLGkCazDUdYxA',
591+
youTubeLink:
592+
'https://youtube.com/playlist?list=PL7c6CDwwm-AK04F8F1OgzMOK8_2w1XLus&si=hpavLGkCazDUdYxA',
575593
docLink: 'https://bit-integrations.com/wp-docs/actions/mailster-integrations-as-an-action/'
576594
},
577595
wpforo: {
578596
youTubeLink: '',
579597
docLink: 'https://bit-integrations.com/wp-docs/actions/wpforo-integrations-as-an-action/'
580598
},
581599
dokan: {
582-
youTubeLink: 'https://youtube.com/playlist?list=PL7c6CDwwm-AK_Lwk-n8sM2XzXl6D2Ixti&si=bKb1MWsKafVXCh01',
600+
youTubeLink:
601+
'https://youtube.com/playlist?list=PL7c6CDwwm-AK_Lwk-n8sM2XzXl6D2Ixti&si=bKb1MWsKafVXCh01',
583602
docLink: 'https://bit-integrations.com/wp-docs/actions/dokan-integrations-as-an-action/'
584603
},
585604
drip: {
586-
youTubeLink: 'https://youtube.com/playlist?list=PL7c6CDwwm-AKIFJxDo8hkPRBgLcfMoiV1&si=ZjISDBaNURxS82pz',
605+
youTubeLink:
606+
'https://youtube.com/playlist?list=PL7c6CDwwm-AKIFJxDo8hkPRBgLcfMoiV1&si=ZjISDBaNURxS82pz',
587607
docLink: 'https://bit-integrations.com/wp-docs/actions/drip-integrations/'
588608
},
589609
jetEngine: {
@@ -614,6 +634,10 @@ const tutorialLinks = {
614634
bento: {
615635
youTubeLink: '',
616636
docLink: 'https://bit-integrations.com/wp-docs/actions/bento-integrations/'
637+
},
638+
line: {
639+
youTubeLink: '',
640+
docLink: 'https://bit-integrations.com/wp-docs/actions/line-integrations/'
617641
}
618642
}
619643
export default tutorialLinks

frontend-dev/src/components/AllIntegrations/EditInteg.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ const EditLMFWC = lazy(() => import('./LMFWC/EditLMFWC'))
164164
const EditVoxel = lazy(() => import('./Voxel/EditVoxel'))
165165
const EditSmartSuite = lazy(() => import('./SmartSuite/EditSmartSuite'))
166166
const EditBento = lazy(() => import('./Bento/EditBento'))
167+
const EditLine = lazy(() => import('./Line/EditLine'))
167168

168169
const loaderStyle = {
169170
display: 'flex',
@@ -554,6 +555,8 @@ const IntegType = memo(({ allIntegURL, flow }) => {
554555
return <EditSmartSuite allIntegURL={allIntegURL} />
555556
case 'Bento':
556557
return <EditBento allIntegURL={allIntegURL} />
558+
case 'Line':
559+
return <EditLine allIntegURL={allIntegURL} />
557560
default:
558561
return <Loader style={loaderStyle} />
559562
}

frontend-dev/src/components/AllIntegrations/IntegInfo.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ const LMFWCAuthorization = lazy(() => import('./LMFWC/LMFWCAuthorization'))
163163
const VoxelAuthorization = lazy(() => import('./Voxel/VoxelAuthorization'))
164164
const SmartSuiteAuthorization = lazy(() => import('./SmartSuite/SmartSuiteAuthorization'))
165165
const BentoAuthorization = lazy(() => import('./Bento/BentoAuthorization'))
166+
const LineAuthorization = lazy(() => import('./Line/LineAuthorization'))
166167

167168
export default function IntegInfo() {
168169
const { id, type } = useParams()
@@ -544,6 +545,8 @@ export default function IntegInfo() {
544545
return <SmartSuiteAuthorization smartSuiteConf={integrationConf} step={1} isInfo />
545546
case 'Bento':
546547
return <BentoAuthorization bentoConf={integrationConf} step={1} isInfo />
548+
case 'Line':
549+
return <LineAuthorization lineConf={integrationConf} step={1} isInfo />
547550
default:
548551
return <></>
549552
}

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

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import {
4444
import c from 'react-multiple-select-dropdown-lite'
4545
import { create } from 'mutative'
4646

47-
export const checkWebhookIntegrationsExist = (entity) => {
47+
export const checkWebhookIntegrationsExist = entity => {
4848
const integrations = webhookIntegrations
4949
return integrations.includes(entity)
5050
}
@@ -406,7 +406,7 @@ export const saveActionConf = async ({
406406
action = 'flow/update'
407407
}
408408
try {
409-
await bitsFetch(data, action).then((res) => {
409+
await bitsFetch(data, action).then(res => {
410410
if (!edit && res.success) {
411411
navigate(allIntegURL)
412412
}
@@ -440,14 +440,14 @@ export const saveActionConf = async ({
440440
}
441441
}
442442

443-
export const setGrantTokenResponse = (integ) => {
443+
export const setGrantTokenResponse = integ => {
444444
const grantTokenResponse = {}
445445
const authWindowLocation = window.location.href
446446
const queryParams = authWindowLocation
447447
.replace(`${window.opener.location.href}/redirect`, '')
448448
.split('&')
449449
if (queryParams) {
450-
queryParams.forEach((element) => {
450+
queryParams.forEach(element => {
451451
const gtKeyValue = element.split('=')
452452
if (gtKeyValue[1]) {
453453
// eslint-disable-next-line prefer-destructuring
@@ -480,11 +480,13 @@ export const handleAuthorize = (
480480
return
481481
}
482482
setIsLoading(true)
483-
const apiEndpoint = `https://accounts.zoho.${confTmp.dataCenter
484-
}/oauth/v2/auth?scope=${scopes}&response_type=code&client_id=${confTmp.clientId
485-
}&prompt=Consent&access_type=offline&state=${encodeURIComponent(
486-
window.location.href
487-
)}/redirect&redirect_uri=${encodeURIComponent(`${btcbi.api.base}`)}/redirect`
483+
const apiEndpoint = `https://accounts.zoho.${
484+
confTmp.dataCenter
485+
}/oauth/v2/auth?scope=${scopes}&response_type=code&client_id=${
486+
confTmp.clientId
487+
}&prompt=Consent&access_type=offline&state=${encodeURIComponent(
488+
window.location.href
489+
)}/redirect&redirect_uri=${encodeURIComponent(`${btcbi.api.base}`)}/redirect`
488490
const authWindow = window.open(apiEndpoint, integ, 'width=400,height=609,toolbar=off')
489491
const popupURLCheckTimer = setInterval(() => {
490492
if (authWindow.closed) {
@@ -548,8 +550,8 @@ const tokenHelper = (
548550
tokenRequestParams.redirectURI = `${btcbi.api.base}/redirect`
549551

550552
bitsFetch(tokenRequestParams, `${ajaxInteg}_generate_token`)
551-
.then((result) => result)
552-
.then((result) => {
553+
.then(result => result)
554+
.then(result => {
553555
if (result && result.success) {
554556
const newConf = { ...confTmp }
555557
newConf.tokenDetails = result.data
@@ -565,8 +567,9 @@ const tokenHelper = (
565567
) {
566568
setSnackbar({
567569
show: true,
568-
msg: `${__('Authorization failed Cause:', 'bit-integrations')}${result.data.data || result.data
569-
}. ${__('please try again', 'bit-integrations')}`
570+
msg: `${__('Authorization failed Cause:', 'bit-integrations')}${
571+
result.data.data || result.data
572+
}. ${__('please try again', 'bit-integrations')}`
570573
})
571574
} else {
572575
setSnackbar({
@@ -641,12 +644,14 @@ export const handleCustomValue = (event, index, conftTmp, setConf, tab) => {
641644
}
642645

643646
export const setFieldInputOnMsgBody = (val, setConf, inputRef) => {
644-
setConf(prevConf => create(prevConf, draftConf => {
645-
const body = draftConf.body
646-
const cursorPosition = inputRef.current.selectionStart
647-
const firstHalfBody = body.substring(0, cursorPosition)
648-
const lastHalfBody = body.substring(cursorPosition, body.length)
647+
setConf(prevConf =>
648+
create(prevConf, draftConf => {
649+
const body = draftConf.body
650+
const cursorPosition = inputRef.current.selectionStart
651+
const firstHalfBody = body.substring(0, cursorPosition)
652+
const lastHalfBody = body.substring(cursorPosition, body.length)
649653

650-
draftConf.body = firstHalfBody + val + lastHalfBody
651-
}))
654+
draftConf.body = firstHalfBody + val + lastHalfBody
655+
})
656+
)
652657
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import React from 'react'
2+
3+
const AddFieldButton = ({
4+
fieldMapLength,
5+
lineConf,
6+
setLineConf,
7+
fields,
8+
isLoading,
9+
sendType,
10+
addFieldMapFunc
11+
}) => {
12+
if (!lineConf[sendType] || isLoading) return null
13+
14+
const handleClick = () => {
15+
addFieldMapFunc(fieldMapLength, lineConf, setLineConf, fields)
16+
}
17+
18+
return (
19+
<div className="txt-center btcbi-field-map-button mt-2">
20+
<button onClick={handleClick} className="icn-btn sh-sm" type="button">
21+
+
22+
</button>
23+
</div>
24+
)
25+
}
26+
27+
export default AddFieldButton

0 commit comments

Comments
 (0)