@tellescope/react-components 1.162.0 → 1.164.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tellescope/react-components",
3
- "version": "1.162.0",
3
+ "version": "1.164.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.162.0",
51
- "@tellescope/sdk": "^1.162.0",
52
- "@tellescope/types-client": "^1.162.0",
53
- "@tellescope/types-models": "^1.162.0",
54
- "@tellescope/types-utilities": "^1.162.0",
55
- "@tellescope/utilities": "^1.162.0",
56
- "@tellescope/validation": "^1.162.0",
50
+ "@tellescope/constants": "^1.164.0",
51
+ "@tellescope/sdk": "^1.164.0",
52
+ "@tellescope/types-client": "^1.164.0",
53
+ "@tellescope/types-models": "^1.164.0",
54
+ "@tellescope/types-utilities": "^1.164.0",
55
+ "@tellescope/utilities": "^1.164.0",
56
+ "@tellescope/validation": "^1.164.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": "b58746104f8a4bf539bb7de5f0506e08c710adb4",
83
+ "gitHead": "960a17da7d2fabf1484b9d36743e166f61ac590f",
84
84
  "publishConfig": {
85
85
  "access": "public"
86
86
  }
@@ -1045,6 +1045,44 @@ export const AddressInput = ({ field, form, value, onChange, ...props }: FormInp
1045
1045
  )
1046
1046
  )
1047
1047
 
1048
+ export const ESignatureTerms = () => {
1049
+ let companyName = 'Tellescope'
1050
+ try {
1051
+ const indexOfName = window.location.href.indexOf('name=')
1052
+ if (indexOfName !== -1) {
1053
+ companyName = (
1054
+ decodeURIComponent(window.location.href.substring(indexOfName + 5))
1055
+ || companyName
1056
+ )
1057
+ }
1058
+ } catch(err) {
1059
+ console.error(err)
1060
+ }
1061
+
1062
+ return (
1063
+ <div style={{paddingLeft: 10}}>
1064
+ <h1>{companyName} Electronic Signature Terms</h1>
1065
+
1066
+ <p>
1067
+ By selecting the "I consent to use electronic signatures" checkbox,
1068
+ you are signing this Agreement electronically.
1069
+ You agree your electronic signature is the legal
1070
+ equivalent of your manual/handwritten signature on this Agreement.
1071
+ By selecting "I consent to use electronic signatures" using any device, means or action, you consent to the
1072
+ legally binding terms and conditions of this Agreement.
1073
+ You further agree that your signature on this document (hereafter referred to as your "E-Signature")
1074
+ is as valid as if you signed the document in writing.
1075
+ You also agree that no certification authority or other third party
1076
+ verification is necessary to validate your E-Signature,
1077
+ and that the lack of such certification or third party verification will
1078
+ not in any way affect the enforceability
1079
+ of your E-Signature or any resulting agreement between you and
1080
+ {companyName} or between you and a customer of {companyName}.
1081
+ </p>
1082
+ </div>
1083
+ )
1084
+ }
1085
+
1048
1086
  export const SignatureInput = ({ value, field, autoFocus=true, enduser, onChange }: FormInputProps<'signature'>) => {
1049
1087
  const prefill = (
1050
1088
  field.options?.prefillSignature && enduser?.fname && enduser.lname
@@ -1103,7 +1141,7 @@ export const SignatureInput = ({ value, field, autoFocus=true, enduser, onChange
1103
1141
  />
1104
1142
  <Typography component="span" style={{ position: 'relative', top: 5, left: 2 }}>
1105
1143
  I consent to
1106
- use <a href="/e-signature-terms" target="_blank" rel="noopener noreferrer"> electronic signatures </a>
1144
+ use <a href={`/e-signature-terms?name=${field.options?.esignatureTermsCompanyName || ''}`} target="_blank" rel="noopener noreferrer"> electronic signatures </a>
1107
1145
  </Typography>
1108
1146
  </Grid>
1109
1147
 
@@ -2944,14 +2982,15 @@ export const HeightInput = ({ field, value={} as any, onChange, ...props }: Form
2944
2982
  </Grid>
2945
2983
  )
2946
2984
 
2947
- export const RedirectInput = ({ groupId, groupInsance, rootResponseId, formResponseId, field, submit, value={} as any, onChange, responses, enduser, ...props }: FormInputProps<'Redirect'>) => {
2985
+ export const RedirectInput = ({ enduserId, groupId, groupInsance, rootResponseId, formResponseId, field, submit, value={} as any, onChange, responses, enduser, ...props }: FormInputProps<'Redirect'>) => {
2948
2986
  console.log('formResponseId', formResponseId, 'rootResponseId', rootResponseId)
2949
2987
  const session = useResolvedSession()
2950
2988
 
2951
2989
  let eId = ''
2952
2990
  try {
2953
- eId = new URL(window.location.href).searchParams.get('eId') || ''
2991
+ eId = new URL(window.location.href).searchParams.get('eId') || enduserId || ''
2954
2992
  } catch(err) {}
2993
+ console.log(eId)
2955
2994
 
2956
2995
  const email = (
2957
2996
  responses?.find(r => r.intakeField === 'email')?.answer?.value
@@ -2993,7 +3032,7 @@ export const RedirectInput = ({ groupId, groupInsance, rootResponseId, formRespo
2993
3032
  field.options.redirectExternalUrl,
2994
3033
  {
2995
3034
  ...session.userInfo as any,
2996
- email, fname, lname, state, phone,
3035
+ id: eId, email, fname, lname, state, phone,
2997
3036
  }
2998
3037
  )
2999
3038
  )
package/src/inputs.tsx CHANGED
@@ -122,7 +122,7 @@ export const useFileUpload = (o={} as UseFileUploaderOptions) => {
122
122
  } finally {
123
123
  setUploading(false)
124
124
  }
125
- }, [session, setUploading, isCalledOut])
125
+ }, [session, setUploading, isCalledOut, enduserId])
126
126
 
127
127
  return {
128
128
  handleUpload,
package/src/state.tsx CHANGED
@@ -96,6 +96,7 @@ import {
96
96
  DiagnosisCode,
97
97
  AllergyCode,
98
98
  IntegrationLog,
99
+ EnduserEligibilityResult,
99
100
  } from "@tellescope/types-client"
100
101
 
101
102
  import {
@@ -359,6 +360,7 @@ const suggestedContactsSlice = createSliceForList<SuggestedContact, 'suggested_c
359
360
  const diagnosisCodesSlice = createSliceForList<DiagnosisCode, 'diagnosis_codes'>('diagnosis_codes')
360
361
  const allergyCodesSlice = createSliceForList<AllergyCode, 'allergy_codes'>('allergy_codes')
361
362
  const integrationLogsSlice = createSliceForList<IntegrationLog, 'integration_logs'>('integration_logs')
363
+ const enduserEligibilityResultsSlice = createSliceForList<EnduserEligibilityResult, 'enduser_eligibility_results'>('enduser_eligibility_results')
362
364
 
363
365
  const roleBasedAccessPermissionsSlice = createSliceForList<RoleBasedAccessPermission, 'role_based_access_permissions'>('role_based_access_permissions')
364
366
 
@@ -367,6 +369,7 @@ const userLogsSlice = createSliceForList<UserLog, 'user_logs'>('user_logs')
367
369
 
368
370
  export const sharedConfig = {
369
371
  reducer: {
372
+ enduser_eligibility_results: enduserEligibilityResultsSlice.reducer,
370
373
  integration_logs: integrationLogsSlice.reducer,
371
374
  ticket_queues: ticketQueuesSlice.reducer,
372
375
  automation_triggers: automationTriggersSlice.reducer,
@@ -1192,6 +1195,25 @@ export const useUserAndEnduserDisplayInfo = () => {
1192
1195
  return displayInfo
1193
1196
  }
1194
1197
 
1198
+ export const useEnduserEligibilityResults = (options={} as HookOptions<EnduserEligibilityResult>) => {
1199
+ const session = useResolvedSession()
1200
+
1201
+ return useListStateHook('enduser_eligibility_results', useTypedSelector(s => s.enduser_eligibility_results), session, enduserEligibilityResultsSlice,
1202
+ {
1203
+ loadQuery: session.api.enduser_eligibility_results.getSome,
1204
+ findOne: session.api.enduser_eligibility_results.getOne,
1205
+ findByIds: session.api.enduser_eligibility_results.getByIds,
1206
+ addOne: session.api.enduser_eligibility_results.createOne,
1207
+ addSome: session.api.enduser_eligibility_results.createSome,
1208
+ deleteOne: session.api.enduser_eligibility_results.deleteOne,
1209
+ updateOne: session.api.enduser_eligibility_results.updateOne,
1210
+ },
1211
+ {
1212
+ ...options,
1213
+ },
1214
+ )
1215
+ }
1216
+
1195
1217
  export const useSuggestedContacts = (options={} as HookOptions<SuggestedContact>) => {
1196
1218
  const session = useSession()
1197
1219