@tellescope/react-components 1.154.0 → 1.156.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/Forms/forms.d.ts +6 -0
- package/lib/cjs/Forms/forms.d.ts.map +1 -1
- package/lib/cjs/Forms/forms.js +6 -5
- package/lib/cjs/Forms/forms.js.map +1 -1
- package/lib/cjs/Forms/hooks.d.ts.map +1 -1
- package/lib/cjs/Forms/hooks.js +3 -0
- package/lib/cjs/Forms/hooks.js.map +1 -1
- package/lib/cjs/Forms/inputs.d.ts +1 -1
- package/lib/cjs/Forms/inputs.d.ts.map +1 -1
- package/lib/cjs/Forms/inputs.js +21 -4
- package/lib/cjs/Forms/inputs.js.map +1 -1
- package/lib/cjs/state.d.ts +36 -0
- package/lib/cjs/state.d.ts.map +1 -1
- package/lib/cjs/state.js +19 -3
- package/lib/cjs/state.js.map +1 -1
- package/lib/esm/CMS/components.d.ts +0 -1
- package/lib/esm/CMS/components.d.ts.map +1 -1
- package/lib/esm/Forms/form_responses.d.ts +0 -1
- package/lib/esm/Forms/form_responses.d.ts.map +1 -1
- package/lib/esm/Forms/forms.d.ts +9 -3
- package/lib/esm/Forms/forms.d.ts.map +1 -1
- package/lib/esm/Forms/forms.js +2 -2
- package/lib/esm/Forms/forms.js.map +1 -1
- package/lib/esm/Forms/hooks.d.ts +0 -1
- package/lib/esm/Forms/hooks.d.ts.map +1 -1
- package/lib/esm/Forms/hooks.js +3 -0
- package/lib/esm/Forms/hooks.js.map +1 -1
- package/lib/esm/Forms/inputs.d.ts +2 -2
- package/lib/esm/Forms/inputs.d.ts.map +1 -1
- package/lib/esm/Forms/inputs.js +21 -4
- package/lib/esm/Forms/inputs.js.map +1 -1
- package/lib/esm/controls.d.ts +2 -2
- package/lib/esm/inputs.d.ts +1 -1
- package/lib/esm/inputs.native.d.ts +0 -1
- package/lib/esm/inputs.native.d.ts.map +1 -1
- package/lib/esm/state.d.ts +80 -44
- package/lib/esm/state.d.ts.map +1 -1
- package/lib/esm/state.js +15 -0
- package/lib/esm/state.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/src/Forms/forms.tsx +2 -2
- package/src/Forms/hooks.tsx +3 -0
- package/src/Forms/inputs.tsx +39 -4
- package/src/state.tsx +19 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tellescope/react-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.156.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/cjs/index.js",
|
|
6
6
|
"module": "./lib/esm/index.js",
|
|
@@ -47,13 +47,13 @@
|
|
|
47
47
|
"@reduxjs/toolkit": "^1.6.2",
|
|
48
48
|
"@stripe/react-stripe-js": "^2.9.0",
|
|
49
49
|
"@stripe/stripe-js": "^1.52.1",
|
|
50
|
-
"@tellescope/constants": "^1.
|
|
51
|
-
"@tellescope/sdk": "^1.
|
|
52
|
-
"@tellescope/types-client": "^1.
|
|
53
|
-
"@tellescope/types-models": "^1.
|
|
54
|
-
"@tellescope/types-utilities": "^1.
|
|
55
|
-
"@tellescope/utilities": "^1.
|
|
56
|
-
"@tellescope/validation": "^1.
|
|
50
|
+
"@tellescope/constants": "^1.156.0",
|
|
51
|
+
"@tellescope/sdk": "^1.156.0",
|
|
52
|
+
"@tellescope/types-client": "^1.156.0",
|
|
53
|
+
"@tellescope/types-models": "^1.156.0",
|
|
54
|
+
"@tellescope/types-utilities": "^1.156.0",
|
|
55
|
+
"@tellescope/utilities": "^1.156.0",
|
|
56
|
+
"@tellescope/validation": "^1.156.0",
|
|
57
57
|
"@typescript-eslint/eslint-plugin": "^4.33.0",
|
|
58
58
|
"@typescript-eslint/parser": "^4.33.0",
|
|
59
59
|
"css-to-react-native": "^3.0.0",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
81
81
|
"react-native": "^0.65.0 || ^0.66.0 || ^0.67.0 || ^0.68.0 || ^0.71.0"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "b3935c9a52ebc569391bbb1cda5027670473cc5d",
|
|
84
84
|
"publishConfig": {
|
|
85
85
|
"access": "public"
|
|
86
86
|
}
|
package/src/Forms/forms.tsx
CHANGED
|
@@ -254,7 +254,7 @@ export const QuestionForField = ({
|
|
|
254
254
|
<Height field={field} disabled={value.disabled} value={value.answer.value as any} onChange={onFieldChange as ChangeHandler<any>} form={form} />
|
|
255
255
|
)
|
|
256
256
|
: field.type === 'Redirect' ? (
|
|
257
|
-
<Redirect groupId={groupId} groupInsance={groupInstance} submit={submit} field={field} value={value.answer.value as any} onChange={onFieldChange as ChangeHandler<any>} form={form} />
|
|
257
|
+
<Redirect responses={responses} enduser={enduser} groupId={groupId} groupInsance={groupInstance} submit={submit} field={field} value={value.answer.value as any} onChange={onFieldChange as ChangeHandler<any>} form={form} />
|
|
258
258
|
)
|
|
259
259
|
: field.type === 'Related Contacts' ? (
|
|
260
260
|
<RelatedContacts field={field} value={value.answer.value as any} onChange={onFieldChange as ChangeHandler<any>} form={form} />
|
|
@@ -601,7 +601,7 @@ export const TellescopeSingleQuestionFlow: typeof TellescopeForm = ({
|
|
|
601
601
|
}
|
|
602
602
|
|
|
603
603
|
export const DEFAULT_THANKS_MESSAGE = "Your response was successfully recorded";
|
|
604
|
-
const ThanksMessage = ({
|
|
604
|
+
export const ThanksMessage = ({
|
|
605
605
|
thanksMessage,
|
|
606
606
|
htmlThanksMessage,
|
|
607
607
|
showRestartAtEnd,
|
package/src/Forms/hooks.tsx
CHANGED
|
@@ -99,6 +99,9 @@ export const default_label_for_compound_logic = (f: CompoundFilter<string>): str
|
|
|
99
99
|
const value = f.condition[key]
|
|
100
100
|
if (value && typeof value === 'object') {
|
|
101
101
|
const objectKey = Object.keys(value)[0]
|
|
102
|
+
if (objectKey === '$ne') {
|
|
103
|
+
return `${key} Does Not Equal ${value[objectKey as keyof typeof value]}`
|
|
104
|
+
}
|
|
102
105
|
if (objectKey === '$gt') {
|
|
103
106
|
return `${key} Greater Than ${value[objectKey as keyof typeof value]}`
|
|
104
107
|
}
|
package/src/Forms/inputs.tsx
CHANGED
|
@@ -1459,12 +1459,12 @@ export const StripeInput = ({ field, value, onChange, setCustomerId }: FormInput
|
|
|
1459
1459
|
|
|
1460
1460
|
session.api.form_responses.stripe_details({ fieldId: field.id })
|
|
1461
1461
|
.then(({ clientSecret, publishableKey, stripeAccount, businessName, customerId, isCheckout, answerText }) => {
|
|
1462
|
+
setAnswertext(answerText || '')
|
|
1462
1463
|
setIsCheckout(!!isCheckout)
|
|
1463
1464
|
setClientSecret(clientSecret)
|
|
1464
1465
|
setStripePromise(loadStripe(publishableKey, { stripeAccount }))
|
|
1465
1466
|
setBusinessName(businessName)
|
|
1466
1467
|
setCustomerId(customerId)
|
|
1467
|
-
setAnswertext(answerText || '')
|
|
1468
1468
|
})
|
|
1469
1469
|
.catch(console.error)
|
|
1470
1470
|
}, [session, value, field.id])
|
|
@@ -2735,7 +2735,7 @@ export const HeightInput = ({ field, value={} as any, onChange, ...props }: Form
|
|
|
2735
2735
|
</Grid>
|
|
2736
2736
|
)
|
|
2737
2737
|
|
|
2738
|
-
export const RedirectInput = ({ groupId, groupInsance, formResponseId, field, submit, value={} as any, onChange, ...props }: FormInputProps<'Redirect'>) => {
|
|
2738
|
+
export const RedirectInput = ({ groupId, groupInsance, formResponseId, field, submit, value={} as any, onChange, responses, enduser, ...props }: FormInputProps<'Redirect'>) => {
|
|
2739
2739
|
const session = useResolvedSession()
|
|
2740
2740
|
|
|
2741
2741
|
let eId = ''
|
|
@@ -2743,6 +2743,33 @@ export const RedirectInput = ({ groupId, groupInsance, formResponseId, field, su
|
|
|
2743
2743
|
eId = new URL(window.location.href).searchParams.get('eId') || ''
|
|
2744
2744
|
} catch(err) {}
|
|
2745
2745
|
|
|
2746
|
+
const email = (
|
|
2747
|
+
responses?.find(r => r.intakeField === 'email')?.answer?.value
|
|
2748
|
+
|| enduser?.email
|
|
2749
|
+
|| session.userInfo.email
|
|
2750
|
+
)
|
|
2751
|
+
const phone = (
|
|
2752
|
+
responses?.find(r => r.intakeField === 'phone')?.answer?.value
|
|
2753
|
+
|| enduser?.phone
|
|
2754
|
+
|| session.userInfo.phone
|
|
2755
|
+
)
|
|
2756
|
+
const fname = (
|
|
2757
|
+
responses?.find(r => r.intakeField === 'fname')?.answer?.value
|
|
2758
|
+
|| enduser?.fname
|
|
2759
|
+
|| session.userInfo?.fname
|
|
2760
|
+
)
|
|
2761
|
+
const lname = (
|
|
2762
|
+
responses?.find(r => r.intakeField === 'lname')?.answer?.value
|
|
2763
|
+
|| enduser?.lname
|
|
2764
|
+
|| session.userInfo?.lname
|
|
2765
|
+
)
|
|
2766
|
+
const state = (
|
|
2767
|
+
responses?.find(r => r.intakeField === 'state')?.answer?.value
|
|
2768
|
+
|| (responses?.find(r => r.intakeField === 'Address')?.answer?.value as any)?.state
|
|
2769
|
+
|| enduser?.state
|
|
2770
|
+
|| (session.userInfo as Enduser)?.state
|
|
2771
|
+
)
|
|
2772
|
+
|
|
2746
2773
|
useEffect(() => {
|
|
2747
2774
|
if (session.type === 'user') { return }
|
|
2748
2775
|
|
|
@@ -2751,7 +2778,15 @@ export const RedirectInput = ({ groupId, groupInsance, formResponseId, field, su
|
|
|
2751
2778
|
.finally(() => {
|
|
2752
2779
|
if (!field.options?.redirectExternalUrl) { return }
|
|
2753
2780
|
|
|
2754
|
-
window.location.href =
|
|
2781
|
+
window.location.href = (
|
|
2782
|
+
replace_enduser_template_values(
|
|
2783
|
+
field.options.redirectExternalUrl,
|
|
2784
|
+
{
|
|
2785
|
+
...session.userInfo as any,
|
|
2786
|
+
email, fname, lname, state, phone,
|
|
2787
|
+
}
|
|
2788
|
+
)
|
|
2789
|
+
)
|
|
2755
2790
|
})
|
|
2756
2791
|
.catch(console.error)
|
|
2757
2792
|
|
|
@@ -2785,7 +2820,7 @@ export const RedirectInput = ({ groupId, groupInsance, formResponseId, field, su
|
|
|
2785
2820
|
})
|
|
2786
2821
|
))
|
|
2787
2822
|
.catch(console.error)
|
|
2788
|
-
}, [session])
|
|
2823
|
+
}, [session, email, fname, lname, state, phone])
|
|
2789
2824
|
|
|
2790
2825
|
if (session.type === 'user') {
|
|
2791
2826
|
return (
|
package/src/state.tsx
CHANGED
|
@@ -95,6 +95,7 @@ import {
|
|
|
95
95
|
SuggestedContact,
|
|
96
96
|
DiagnosisCode,
|
|
97
97
|
AllergyCode,
|
|
98
|
+
IntegrationLog,
|
|
98
99
|
} from "@tellescope/types-client"
|
|
99
100
|
|
|
100
101
|
import {
|
|
@@ -357,6 +358,7 @@ const faxLogsSlice = createSliceForList<FaxLog, 'fax_logs'>('fax_logs')
|
|
|
357
358
|
const suggestedContactsSlice = createSliceForList<SuggestedContact, 'suggested_contacts'>('suggested_contacts')
|
|
358
359
|
const diagnosisCodesSlice = createSliceForList<DiagnosisCode, 'diagnosis_codes'>('diagnosis_codes')
|
|
359
360
|
const allergyCodesSlice = createSliceForList<AllergyCode, 'allergy_codes'>('allergy_codes')
|
|
361
|
+
const integrationLogsSlice = createSliceForList<IntegrationLog, 'integration_logs'>('integration_logs')
|
|
360
362
|
|
|
361
363
|
const roleBasedAccessPermissionsSlice = createSliceForList<RoleBasedAccessPermission, 'role_based_access_permissions'>('role_based_access_permissions')
|
|
362
364
|
|
|
@@ -365,6 +367,7 @@ const userLogsSlice = createSliceForList<UserLog, 'user_logs'>('user_logs')
|
|
|
365
367
|
|
|
366
368
|
export const sharedConfig = {
|
|
367
369
|
reducer: {
|
|
370
|
+
integration_logs: integrationLogsSlice.reducer,
|
|
368
371
|
ticket_queues: ticketQueuesSlice.reducer,
|
|
369
372
|
automation_triggers: automationTriggersSlice.reducer,
|
|
370
373
|
automated_actions: automatedActionsSlice.reducer,
|
|
@@ -1350,6 +1353,22 @@ export const useEnduserOrders = (options={} as HookOptions<EnduserOrder>) => {
|
|
|
1350
1353
|
{...options}
|
|
1351
1354
|
)
|
|
1352
1355
|
}
|
|
1356
|
+
export const useIntegrationLogs = (options={} as HookOptions<IntegrationLog>) => {
|
|
1357
|
+
const session = useSession()
|
|
1358
|
+
return useListStateHook(
|
|
1359
|
+
'integration_logs', useTypedSelector(s => s.integration_logs), session, integrationLogsSlice,
|
|
1360
|
+
{
|
|
1361
|
+
loadQuery: session.api.integration_logs.getSome,
|
|
1362
|
+
findOne: session.api.integration_logs.getOne,
|
|
1363
|
+
findByIds: session.api.integration_logs.getByIds,
|
|
1364
|
+
addOne: session.api.integration_logs.createOne,
|
|
1365
|
+
addSome: session.api.integration_logs.createSome,
|
|
1366
|
+
deleteOne: session.api.integration_logs.deleteOne,
|
|
1367
|
+
updateOne: session.api.integration_logs.updateOne,
|
|
1368
|
+
},
|
|
1369
|
+
{...options}
|
|
1370
|
+
)
|
|
1371
|
+
}
|
|
1353
1372
|
export const useWebhookLogs = (options={} as HookOptions<WebhookLog>) => {
|
|
1354
1373
|
const session = useSession()
|
|
1355
1374
|
return useListStateHook(
|