@tellescope/react-components 1.136.1 → 1.138.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/form_responses.d.ts +5 -2
- package/lib/cjs/Forms/form_responses.d.ts.map +1 -1
- package/lib/cjs/Forms/form_responses.js +9 -4
- package/lib/cjs/Forms/form_responses.js.map +1 -1
- package/lib/cjs/Forms/forms.d.ts.map +1 -1
- package/lib/cjs/Forms/forms.js +25 -24
- package/lib/cjs/Forms/forms.js.map +1 -1
- package/lib/cjs/inputs_shared.d.ts +4 -1
- package/lib/cjs/inputs_shared.d.ts.map +1 -1
- package/lib/cjs/inputs_shared.js +7 -1
- package/lib/cjs/inputs_shared.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 +20 -4
- package/lib/cjs/state.js.map +1 -1
- package/lib/esm/Forms/form_responses.d.ts +5 -2
- package/lib/esm/Forms/form_responses.d.ts.map +1 -1
- package/lib/esm/Forms/form_responses.js +9 -4
- package/lib/esm/Forms/form_responses.js.map +1 -1
- package/lib/esm/Forms/forms.d.ts.map +1 -1
- package/lib/esm/Forms/forms.js +25 -24
- package/lib/esm/Forms/forms.js.map +1 -1
- package/lib/esm/inputs_shared.d.ts +4 -1
- package/lib/esm/inputs_shared.d.ts.map +1 -1
- package/lib/esm/inputs_shared.js +6 -1
- package/lib/esm/inputs_shared.js.map +1 -1
- package/lib/esm/state.d.ts +36 -0
- package/lib/esm/state.d.ts.map +1 -1
- package/lib/esm/state.js +16 -1
- package/lib/esm/state.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/src/Forms/form_responses.tsx +27 -3
- package/src/Forms/forms.tsx +1 -0
- package/src/inputs_shared.tsx +13 -2
- package/src/state.tsx +22 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tellescope/react-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.138.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/cjs/index.js",
|
|
6
6
|
"module": "./lib/esm/index.js",
|
|
@@ -47,12 +47,12 @@
|
|
|
47
47
|
"@reduxjs/toolkit": "^1.6.2",
|
|
48
48
|
"@stripe/react-stripe-js": "^2.1.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.
|
|
50
|
+
"@tellescope/constants": "^1.138.0",
|
|
51
|
+
"@tellescope/sdk": "^1.138.0",
|
|
52
|
+
"@tellescope/types-client": "^1.138.0",
|
|
53
|
+
"@tellescope/types-models": "^1.138.0",
|
|
54
54
|
"@tellescope/types-utilities": "^1.69.3",
|
|
55
|
-
"@tellescope/utilities": "^1.
|
|
55
|
+
"@tellescope/utilities": "^1.138.0",
|
|
56
56
|
"@typescript-eslint/eslint-plugin": "^4.33.0",
|
|
57
57
|
"@typescript-eslint/parser": "^4.33.0",
|
|
58
58
|
"css-to-react-native": "^3.0.0",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
80
80
|
"react-native": "^0.65.0 || ^0.66.0 || ^0.67.0 || ^0.68.0 || ^0.71.0"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "cc023df2e9c137ffc5c2e745a629858b2fe4476b",
|
|
83
83
|
"publishConfig": {
|
|
84
84
|
"access": "public"
|
|
85
85
|
}
|
|
@@ -156,6 +156,17 @@ export const ResponseAnswer = ({ formResponse, fieldId, isHTML, answer: a, print
|
|
|
156
156
|
)
|
|
157
157
|
|
|
158
158
|
})()
|
|
159
|
+
: (a.type === 'Related Contacts' && a.value && a.value.length > 0) ? (
|
|
160
|
+
<Grid container direction="column" spacing={1}>
|
|
161
|
+
{a.value.map((v, i) => (
|
|
162
|
+
<Grid item key={i}>
|
|
163
|
+
<Typography>
|
|
164
|
+
{v.fname}{v.lname && ` ${v.lname}`}{v.dateOfBirth && ` ${v.dateOfBirth}`}{v.email && `, ${v.email}`}{v.phone && `, ${v.phone}`}
|
|
165
|
+
</Typography>
|
|
166
|
+
</Grid>
|
|
167
|
+
))}
|
|
168
|
+
</Grid>
|
|
169
|
+
)
|
|
159
170
|
: (
|
|
160
171
|
<Typography style={answerStyles}>
|
|
161
172
|
{form_response_value_to_string(a.value)}
|
|
@@ -188,8 +199,20 @@ export const OrganizationLogo = () => {
|
|
|
188
199
|
)
|
|
189
200
|
}
|
|
190
201
|
|
|
191
|
-
export const ResolveOrganizationLogo = () => {
|
|
202
|
+
export const ResolveOrganizationLogo = ({ logoURL } : { logoURL?: string }) => {
|
|
192
203
|
const session = useResolvedSession()
|
|
204
|
+
|
|
205
|
+
if (logoURL) {
|
|
206
|
+
return (
|
|
207
|
+
<Image
|
|
208
|
+
src={logoURL}
|
|
209
|
+
alt=""
|
|
210
|
+
maxWidth={400}
|
|
211
|
+
height={50}
|
|
212
|
+
/>
|
|
213
|
+
)
|
|
214
|
+
}
|
|
215
|
+
|
|
193
216
|
if (session.type === 'enduser') return null
|
|
194
217
|
|
|
195
218
|
return <OrganizationLogo />
|
|
@@ -201,9 +224,10 @@ interface FormResponse_T {
|
|
|
201
224
|
hideHeader?: boolean,
|
|
202
225
|
response: FormResponse,
|
|
203
226
|
id?: string,
|
|
227
|
+
logoURL?: string,
|
|
204
228
|
}
|
|
205
229
|
// this should use all vanilla React / inline styles to ensure printing is consistent
|
|
206
|
-
export const FormResponseView = ({ enduser, onClose, hideHeader, response, id, printing, onImageClick } : FormResponse_T & {
|
|
230
|
+
export const FormResponseView = ({ logoURL, enduser, onClose, hideHeader, response, id, printing, onImageClick } : FormResponse_T & {
|
|
207
231
|
printing?: boolean,
|
|
208
232
|
onImageClick?: (args: { src: string }) => void,
|
|
209
233
|
}) => {
|
|
@@ -220,7 +244,7 @@ export const FormResponseView = ({ enduser, onClose, hideHeader, response, id, p
|
|
|
220
244
|
<div style={{ textAlign: 'center' }}>
|
|
221
245
|
{!hideHeader &&
|
|
222
246
|
<>
|
|
223
|
-
<ResolveOrganizationLogo />
|
|
247
|
+
<ResolveOrganizationLogo logoURL={logoURL} />
|
|
224
248
|
|
|
225
249
|
<h2 style={{
|
|
226
250
|
fontSize: 20,
|
package/src/Forms/forms.tsx
CHANGED
|
@@ -720,6 +720,7 @@ export const SaveDraft = ({
|
|
|
720
720
|
),
|
|
721
721
|
{
|
|
722
722
|
draftSavedAt: new Date(),
|
|
723
|
+
draftSavedBy: session?.userInfo?.id,
|
|
723
724
|
responses: [
|
|
724
725
|
...(existingResponses ?? []).filter(r => !fields.find(f => f.id === r.fieldId)),
|
|
725
726
|
...getResponsesWithQuestionGroupAnswers(includedFieldIds.map(id => responses.find(r => r.fieldId === id)!))
|
package/src/inputs_shared.tsx
CHANGED
|
@@ -5,8 +5,8 @@ import { LoadFunction, LoadFunctionArguments } from "@tellescope/sdk"
|
|
|
5
5
|
import { ALL_ACCESS, UNSEARCHABLE_FIELDS } from "@tellescope/constants"
|
|
6
6
|
import { SearchAPIProps, useSearchAPI } from "./hooks"
|
|
7
7
|
import { TextFieldProps } from "./mui"
|
|
8
|
-
import { AppointmentBookingPage, AppointmentLocation, AutomationTrigger, CalendarEventTemplate, ChatRoom, Database, DatabaseRecord, Enduser, FaxLog, File, Form, FormGroup, Forum, Journey, ManagedContentRecord, MessageTemplateSnippet, Organization, PrescriptionRoute, Template, Ticket, TicketQueue, User, UserNotification } from "@tellescope/types-client"
|
|
9
|
-
import { Button, Checkbox, Flex, HoverPaper, LoadingButton, LoadingData, LoadingLinear, ScrollingList, SearchTextInput, Typography, useAppointmentBookingPages, useAppointmentLocations, useAutomationTriggers, useCalendarEventTemplates, useChatRooms, useDatabaseRecords, useDatabases, useEndusers, useFaxLogs, useFiles, useFormGroups, useForms, useForums, useJourneys, useManagedContentRecords, useMessageTemplateSnippets, useNotifications, useOrganization, useOrganizations, usePrescriptionRoutes, useResolvedSession, useSession, useTemplates, useTicketQueues, useTickets, useUsers, value_is_loaded } from "."
|
|
8
|
+
import { AppointmentBookingPage, AppointmentLocation, AutomationTrigger, CalendarEventTemplate, CallHoldQueue, ChatRoom, Database, DatabaseRecord, Enduser, FaxLog, File, Form, FormGroup, Forum, Journey, ManagedContentRecord, MessageTemplateSnippet, Organization, PrescriptionRoute, Template, Ticket, TicketQueue, User, UserNotification } from "@tellescope/types-client"
|
|
9
|
+
import { Button, Checkbox, Flex, HoverPaper, LoadingButton, LoadingData, LoadingLinear, ScrollingList, SearchTextInput, Typography, useAppointmentBookingPages, useAppointmentLocations, useAutomationTriggers, useCalendarEventTemplates, useCallHoldQueues, useChatRooms, useDatabaseRecords, useDatabases, useEndusers, useFaxLogs, useFiles, useFormGroups, useForms, useForums, useJourneys, useManagedContentRecords, useMessageTemplateSnippets, useNotifications, useOrganization, useOrganizations, usePrescriptionRoutes, useResolvedSession, useSession, useTemplates, useTicketQueues, useTickets, useUsers, value_is_loaded } from "."
|
|
10
10
|
import { SxProps } from "@mui/material"
|
|
11
11
|
import { AccessPermissions } from "@tellescope/types-models"
|
|
12
12
|
|
|
@@ -563,6 +563,17 @@ export const FileSearch = (props: Omit<GenericSearchProps<File>, 'filterKey'> &
|
|
|
563
563
|
)
|
|
564
564
|
}
|
|
565
565
|
|
|
566
|
+
export const CallHoldQueueSearch = (props: Omit<GenericSearchProps<CallHoldQueue>, 'filterKey'> & { filterKey?: string }) => {
|
|
567
|
+
const session = useSession()
|
|
568
|
+
const [, { addLocalElements }] = useCallHoldQueues({ dontFetch: true })
|
|
569
|
+
return (
|
|
570
|
+
<ModelSearchInput filterKey="call-hold-queue" {...props}
|
|
571
|
+
searchAPI={session.api.call_hold_queues.getSome}
|
|
572
|
+
onLoad={addLocalElements}
|
|
573
|
+
/>
|
|
574
|
+
)
|
|
575
|
+
}
|
|
576
|
+
|
|
566
577
|
export const TicketQueueSearch = (props: Omit<GenericSearchProps<TicketQueue>, 'filterKey'> & { filterKey?: string }) => {
|
|
567
578
|
const session = useSession()
|
|
568
579
|
const [, { addLocalElements }] = useTicketQueues({ dontFetch: true })
|
package/src/state.tsx
CHANGED
|
@@ -91,6 +91,7 @@ import {
|
|
|
91
91
|
PortalBranding,
|
|
92
92
|
MessageTemplateSnippet,
|
|
93
93
|
FaxLog,
|
|
94
|
+
CallHoldQueue,
|
|
94
95
|
} from "@tellescope/types-client"
|
|
95
96
|
|
|
96
97
|
import {
|
|
@@ -340,6 +341,7 @@ const ticketThreadsSlice = createSliceForList<TicketThread, 'ticket_threads'>('t
|
|
|
340
341
|
const ticketThreadCommentsSlice = createSliceForList<TicketThreadComment, 'ticket_thread_comments'>('ticket_thread_comments')
|
|
341
342
|
const configurationsSlice = createSliceForList<Configuration, 'configurations'>('configurations')
|
|
342
343
|
const ticketQueuesSlice = createSliceForList<TicketQueue, 'ticket_queues'>('ticket_queues')
|
|
344
|
+
const callHoldQueuesSlice = createSliceForList<TicketQueue, 'call_hold_queues'>('call_hold_queues')
|
|
343
345
|
const enduserOrdersSlice = createSliceForList<EnduserOrder, 'enduser_orders'>('enduser_orders')
|
|
344
346
|
const enduserEncountersSlice = createSliceForList<EnduserEncounter, 'enduser_encounters'>('enduser_encounters')
|
|
345
347
|
const vitalConfigurationsSlice = createSliceForList<VitalConfiguration, 'vital_configurations'>('vital_configurations')
|
|
@@ -434,6 +436,7 @@ export const sharedConfig = {
|
|
|
434
436
|
portal_brandings: portalBrandingsSlice.reducer,
|
|
435
437
|
message_template_snippets: messageTemplateSnippetsSlice.reducer,
|
|
436
438
|
fax_logs: faxLogsSlice.reducer,
|
|
439
|
+
call_hold_queues: callHoldQueuesSlice.reducer,
|
|
437
440
|
},
|
|
438
441
|
}
|
|
439
442
|
|
|
@@ -1439,6 +1442,24 @@ export const useEnduserProfileViews = (options={} as HookOptions<EnduserProfileV
|
|
|
1439
1442
|
},
|
|
1440
1443
|
)
|
|
1441
1444
|
}
|
|
1445
|
+
export const useCallHoldQueues = (options={} as HookOptions<CallHoldQueue>) => {
|
|
1446
|
+
const session = useSession()
|
|
1447
|
+
|
|
1448
|
+
return useListStateHook('call_hold_queues', useTypedSelector(s => s.call_hold_queues), session, callHoldQueuesSlice,
|
|
1449
|
+
{
|
|
1450
|
+
loadQuery: session.api.call_hold_queues.getSome,
|
|
1451
|
+
findOne: session.api.call_hold_queues.getOne,
|
|
1452
|
+
findByIds: session.api.call_hold_queues.getByIds,
|
|
1453
|
+
addOne: session.api.call_hold_queues.createOne,
|
|
1454
|
+
addSome: session.api.call_hold_queues.createSome,
|
|
1455
|
+
deleteOne: session.api.call_hold_queues.deleteOne,
|
|
1456
|
+
updateOne: session.api.call_hold_queues.updateOne,
|
|
1457
|
+
},
|
|
1458
|
+
{
|
|
1459
|
+
...options,
|
|
1460
|
+
},
|
|
1461
|
+
)
|
|
1462
|
+
}
|
|
1442
1463
|
export const useTicketQueues = (options={} as HookOptions<TicketQueue>) => {
|
|
1443
1464
|
const session = useSession()
|
|
1444
1465
|
|
|
@@ -2284,7 +2305,7 @@ export const useOrganizations = (options={} as HookOptions<Organization>) => {
|
|
|
2284
2305
|
)
|
|
2285
2306
|
}
|
|
2286
2307
|
export const useOrganization = (options={} as HookOptions<Organization>) => {
|
|
2287
|
-
const session =
|
|
2308
|
+
const session = useResolvedSession()
|
|
2288
2309
|
const [organizationsLoading, actions] = useOrganizations(options)
|
|
2289
2310
|
|
|
2290
2311
|
return [
|