@tellescope/react-components 1.137.0 → 1.139.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/state.js +1 -1
- 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/state.js +1 -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/state.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tellescope/react-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.139.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.139.0",
|
|
51
|
+
"@tellescope/sdk": "^1.139.0",
|
|
52
|
+
"@tellescope/types-client": "^1.139.0",
|
|
53
|
+
"@tellescope/types-models": "^1.139.0",
|
|
54
54
|
"@tellescope/types-utilities": "^1.69.3",
|
|
55
|
-
"@tellescope/utilities": "^1.
|
|
55
|
+
"@tellescope/utilities": "^1.139.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": "635390a2c735fcc84cfaf7450acbbcad1231d875",
|
|
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/state.tsx
CHANGED
|
@@ -2305,7 +2305,7 @@ export const useOrganizations = (options={} as HookOptions<Organization>) => {
|
|
|
2305
2305
|
)
|
|
2306
2306
|
}
|
|
2307
2307
|
export const useOrganization = (options={} as HookOptions<Organization>) => {
|
|
2308
|
-
const session =
|
|
2308
|
+
const session = useResolvedSession()
|
|
2309
2309
|
const [organizationsLoading, actions] = useOrganizations(options)
|
|
2310
2310
|
|
|
2311
2311
|
return [
|