@supportworks/multi-imagepicker 8.0.18 → 8.2.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/changes.md +7 -0
- package/package.json +1 -1
- package/src/components/AddImages.js +29 -58
- package/src/components/UploadWarningModal.js +40 -37
package/changes.md
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
|
|
2
|
+
# v8.2.0 2026-04-09
|
|
3
|
+
* reverted back to v8.0.16
|
|
4
|
+
* then changed UploadWarningModal to just be a regular component instead of a modal, to fix multiple nested modals issue on older iPads
|
|
5
|
+
|
|
6
|
+
# v8.0.19 2026-03-31
|
|
7
|
+
* tweak to attaching
|
|
8
|
+
|
|
2
9
|
# v8.0.18 2026-03-25
|
|
3
10
|
* refactored attaching
|
|
4
11
|
|
package/package.json
CHANGED
|
@@ -33,7 +33,6 @@ const AddImages = forwardRef((
|
|
|
33
33
|
}, ref) => {
|
|
34
34
|
const [showAttaching, setShowAttaching] = useState(false)
|
|
35
35
|
const [showAdd, setShowAdd] = useState(false)
|
|
36
|
-
const [pendingAttach, setPendingAttach] = useState(false)
|
|
37
36
|
const [showInfoDialog, setShowInfoDialog] = useState(false)
|
|
38
37
|
const [allImageDataValid, setAllImageDataValid] = useState(true)
|
|
39
38
|
const [showToCust, setShowToCust] = useState(false)
|
|
@@ -136,59 +135,31 @@ const AddImages = forwardRef((
|
|
|
136
135
|
}
|
|
137
136
|
}, [addPicture, prospectInst, hasAndroidWritePermission, showToCust, saveToDevice, allowSaveToDevice])
|
|
138
137
|
|
|
139
|
-
const
|
|
138
|
+
const onAttach = useCallback(async () => {
|
|
140
139
|
if (!isMountedRef.current) {
|
|
141
140
|
return
|
|
142
141
|
}
|
|
143
142
|
|
|
144
|
-
setShowAttaching(
|
|
143
|
+
setShowAttaching(false)
|
|
144
|
+
setShowAdd(false)
|
|
145
145
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
await Api.getApi().setDefaultSavePhotosToDevice(saveToDevice)
|
|
150
|
-
}
|
|
151
|
-
if (allowEdit && showToCustomerAllowed) {
|
|
152
|
-
await Api.getApi().setDefaultShowToCustomer(showToCust)
|
|
153
|
-
}
|
|
154
|
-
Analytics.logEvent('mip_addImages_onAttach', { source_page: 'MultiImagePicker' })
|
|
155
|
-
if (callback) {
|
|
156
|
-
callback()
|
|
157
|
-
}
|
|
158
|
-
} finally {
|
|
159
|
-
if (isMountedRef.current) {
|
|
160
|
-
setShowAttaching(false)
|
|
161
|
-
setPendingAttach(false)
|
|
162
|
-
}
|
|
146
|
+
await addPicturesToProject()
|
|
147
|
+
if (allowEdit && allowSaveToDevice) {
|
|
148
|
+
await Api.getApi().setDefaultSavePhotosToDevice(saveToDevice)
|
|
163
149
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
const onAttach = useCallback(() => {
|
|
167
|
-
if (!isMountedRef.current) {
|
|
168
|
-
return
|
|
150
|
+
if (allowEdit && showToCustomerAllowed) {
|
|
151
|
+
await Api.getApi().setDefaultShowToCustomer(showToCust)
|
|
169
152
|
}
|
|
170
|
-
|
|
171
|
-
if (
|
|
172
|
-
|
|
173
|
-
setShowAdd(false)
|
|
174
|
-
return
|
|
153
|
+
Analytics.logEvent('mip_addImages_onAttach', { source_page: 'MultiImagePicker' })
|
|
154
|
+
if (callback) {
|
|
155
|
+
callback()
|
|
175
156
|
}
|
|
176
|
-
|
|
177
|
-
void performAttach()
|
|
178
|
-
}, [performAttach, showAdd])
|
|
179
|
-
|
|
180
|
-
const onAddModalDismiss = useCallback(() => {
|
|
181
|
-
if (!pendingAttach) {
|
|
182
|
-
return
|
|
183
|
-
}
|
|
184
|
-
void performAttach()
|
|
185
|
-
}, [pendingAttach, performAttach])
|
|
157
|
+
}, [addPicturesToProject, allowEdit, callback, saveToDevice, allowSaveToDevice, showToCust, showToCustomerAllowed])
|
|
186
158
|
|
|
187
159
|
const onClose = useCallback(() => {
|
|
188
160
|
if (!isMountedRef.current) {
|
|
189
161
|
return
|
|
190
162
|
}
|
|
191
|
-
setPendingAttach(false)
|
|
192
163
|
setShowAttaching(false)
|
|
193
164
|
setShowAdd(false)
|
|
194
165
|
}, [])
|
|
@@ -442,15 +413,9 @@ const AddImages = forwardRef((
|
|
|
442
413
|
)
|
|
443
414
|
}
|
|
444
415
|
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
<MultiImagePicker ref={setPickerRef} hitSlop={hitSlop} maxCount={maxCount} parentStyle={parentStyle} callback={onImageSelect}>
|
|
449
|
-
{children}
|
|
450
|
-
</MultiImagePicker>
|
|
451
|
-
)}
|
|
452
|
-
|
|
453
|
-
<Modal visible={showAdd} presentationStyle='fullScreen' animationType='slide' onDismiss={onAddModalDismiss}>
|
|
416
|
+
if (showAdd) {
|
|
417
|
+
return (
|
|
418
|
+
<Modal presentationStyle='fullScreen' animationType='slide'>
|
|
454
419
|
<ScreenSafeAreaView style={styles.Page} edges={['top','bottom']} includeProvider>
|
|
455
420
|
<AppBarH8
|
|
456
421
|
variant='regular'
|
|
@@ -486,16 +451,22 @@ const AddImages = forwardRef((
|
|
|
486
451
|
disabled={!allImageDataValid}
|
|
487
452
|
/>
|
|
488
453
|
</View>
|
|
489
|
-
</ScreenSafeAreaView>
|
|
490
454
|
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
455
|
+
{Api.getApi().sendPhotosToCRM() && (
|
|
456
|
+
<UploadWarningModal
|
|
457
|
+
visible={showInfoDialog}
|
|
458
|
+
onClose={onCloseInfoDialog}
|
|
459
|
+
/>
|
|
460
|
+
)}
|
|
461
|
+
</ScreenSafeAreaView>
|
|
497
462
|
</Modal>
|
|
498
|
-
|
|
463
|
+
)
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
return (
|
|
467
|
+
<MultiImagePicker ref={setPickerRef} hitSlop={hitSlop} maxCount={maxCount} parentStyle={parentStyle} callback={onImageSelect}>
|
|
468
|
+
{children}
|
|
469
|
+
</MultiImagePicker>
|
|
499
470
|
)
|
|
500
471
|
})
|
|
501
472
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useCallback, useState } from 'react'
|
|
2
|
-
import {
|
|
2
|
+
import { View, StyleSheet, Text, Platform } from 'react-native'
|
|
3
3
|
import { colors, stdStyles } from '@supportworks/app-styler'
|
|
4
4
|
import { CheckBox, CommonButton } from '@supportworks/core-controls'
|
|
5
5
|
import { Icons } from '@supportworks/icon-library'
|
|
@@ -15,53 +15,56 @@ const UploadWarningModal = (
|
|
|
15
15
|
if (onClose) onClose(skipInfoDialog)
|
|
16
16
|
}, [onClose, skipInfoDialog])
|
|
17
17
|
|
|
18
|
+
if (!visible) {
|
|
19
|
+
return null
|
|
20
|
+
}
|
|
21
|
+
|
|
18
22
|
return (
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
<Icons.IconPencilLock fill={colors.brandPrimary} fillOpacity={1} />
|
|
29
|
-
</View>
|
|
30
|
-
<View style={styles.InfoDialogTitleRow}>
|
|
31
|
-
<Text style={styles.TitleText}>
|
|
32
|
-
Captions can't be updated in CRM after upload
|
|
33
|
-
</Text>
|
|
34
|
-
</View>
|
|
35
|
-
<Text style={stdStyles.Body2}>
|
|
36
|
-
Photo captions can be edited now, but not after submitting to the CRM. Please review before uploading.
|
|
23
|
+
<View style={styles.ModalView}>
|
|
24
|
+
<View style={styles.Backdrop} />
|
|
25
|
+
<View style={styles.InfoDialogContent}>
|
|
26
|
+
<View style={styles.InfoDialogIconRow}>
|
|
27
|
+
<Icons.IconPencilLock fill={colors.brandPrimary} fillOpacity={1} />
|
|
28
|
+
</View>
|
|
29
|
+
<View style={styles.InfoDialogTitleRow}>
|
|
30
|
+
<Text style={styles.TitleText}>
|
|
31
|
+
Captions can't be updated in CRM after upload
|
|
37
32
|
</Text>
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
33
|
+
</View>
|
|
34
|
+
<Text style={stdStyles.Body2}>
|
|
35
|
+
Photo captions can be edited now, but not after submitting to the CRM. Please review before uploading.
|
|
36
|
+
</Text>
|
|
37
|
+
<View style={styles.InfoDialogCheckboxRow}>
|
|
38
|
+
<CheckBox
|
|
39
|
+
label="Don't show this message again"
|
|
40
|
+
checked={!!skipInfoDialog}
|
|
41
|
+
onChange={(newVal) => setSkipInfoDialog(newVal)}
|
|
42
|
+
/>
|
|
43
|
+
</View>
|
|
44
|
+
<View style={styles.InfoDialogButtonRow}>
|
|
45
|
+
<CommonButton
|
|
46
|
+
variant='filled'
|
|
47
|
+
size='medium'
|
|
48
|
+
label='Got it'
|
|
49
|
+
fullWidth
|
|
50
|
+
onPress={handleClose}
|
|
51
|
+
/>
|
|
54
52
|
</View>
|
|
55
53
|
</View>
|
|
56
|
-
</
|
|
54
|
+
</View>
|
|
57
55
|
)
|
|
58
56
|
}
|
|
59
57
|
|
|
60
58
|
const styles = StyleSheet.create({
|
|
61
59
|
ModalView: {
|
|
62
|
-
|
|
60
|
+
...StyleSheet.absoluteFillObject,
|
|
63
61
|
justifyContent: 'center',
|
|
64
62
|
alignItems: 'center',
|
|
63
|
+
zIndex: 10
|
|
64
|
+
},
|
|
65
|
+
Backdrop: {
|
|
66
|
+
...StyleSheet.absoluteFillObject,
|
|
67
|
+
backgroundColor: colors.black36
|
|
65
68
|
},
|
|
66
69
|
InfoDialogContent: {
|
|
67
70
|
backgroundColor: 'white',
|