@controleonline/ui-customers 1.0.81 → 1.0.83
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/.github/workflows/integration-source-gate.yml +68 -0
- package/.github/workflows/publish-npm.yml +91 -0
- package/AGENTS.md +12 -6
- package/docs/technical/Client-Details-Criar-Usuario.md +113 -0
- package/package.json +5 -4
- package/src/react/components/tabs/AddressesTab.js +240 -335
- package/src/react/components/tabs/DocumentAttachments.js +270 -0
- package/src/react/components/tabs/DocumentsTab.js +355 -463
- package/src/react/components/tabs/DocumentsTab.styles.js +123 -0
- package/src/react/components/tabs/EmployeeCreateFormFields.js +203 -0
- package/src/react/components/tabs/EmployeesTab.js +17 -171
- package/src/react/components/tabs/EmployeesTab.styles.js +220 -172
- package/src/react/components/tabs/GeneralTab.js +84 -46
- package/src/react/components/tabs/GeneralTab.styles.js +81 -77
- package/src/react/components/tabs/MediaTab.js +50 -5
- package/src/react/components/tabs/PeopleCategoriesPanel.js +161 -78
- package/src/react/components/tabs/SalesmanTab.js +1 -1
- package/src/react/components/tabs/UserFormModal.js +26 -2
- package/src/react/components/tabs/UsersTab.js +30 -19
- package/src/react/components/tabs/UsersTab.styles.js +257 -257
- package/src/react/components/tabs/UsersTabApiKeyModal.js +115 -0
- package/src/react/components/tabs/UsersTabUserModal.js +222 -0
- package/src/react/components/tabs/addressesTabHelpers.js +190 -0
- package/src/react/components/tabs/documentsTabHelpers.js +142 -0
- package/src/react/components/tabs/employeeContacts.js +3 -23
- package/src/react/components/tabs/employeeUnlink.js +7 -4
- package/src/react/components/tabs/employeesTabHelpers.js +33 -9
- package/src/react/components/tabs/generalTabHelpers.js +30 -8
- package/src/react/components/tabs/useGeneralTabPeopleLink.js +68 -0
- package/src/react/components/tabs/usersTabHelpers.js +24 -23
- package/src/react/pages/details.page.styles.js +114 -100
- package/src/react/pages/employees.js +4 -0
- package/src/react/utils/humanCompanyLinkTypes.js +28 -0
- package/src/tests/browser/manager/client-details-add-user-modal.spec.js +281 -0
- package/src/tests/browser/manager/client-details-address-create-coords.spec.js +414 -0
- package/src/tests/browser/manager/client-details-address-edit.spec.js +331 -0
- package/src/tests/browser/manager/client-details-contact-edit.spec.js +198 -0
- package/src/tests/browser/manager/client-details-create-contact.spec.js +306 -0
- package/src/tests/browser/manager/client-details-documents.spec.js +346 -0
- package/src/tests/browser/manager/client-details-identity-case.spec.js +227 -0
- package/src/tests/browser/manager/client-details-people-type.manifest.md +18 -0
- package/src/tests/browser/manager/client-details-people-type.spec.js +345 -0
- package/src/tests/browser/manager/client-details-supplier-product-create.spec.js +334 -0
- package/src/tests/browser/manager/client-details-users-tab-load.spec.js +194 -0
- package/src/tests/browser/manager/employees-salesman-after-sales.spec.js +441 -0
- package/src/tests/react/components/SalesmanTab.company.test.js +40 -0
- package/src/tests/react/components/tabs/UsersTab.styles.test.js +39 -0
- package/src/tests/react/components/tabs/addressesTabHelpers.test.js +78 -0
- package/src/tests/react/components/tabs/documentsTabContract.test.mjs +37 -0
- package/src/tests/react/components/tabs/documentsTabHelpers.test.mjs +93 -0
- package/src/tests/react/components/tabs/employeeContacts.test.js +46 -4
- package/src/tests/react/components/tabs/employeeLinkTypes.contract.test.mjs +52 -0
- package/src/tests/react/components/tabs/employeeUnlink.test.js +11 -11
- package/src/tests/react/components/tabs/employeesTabHelpers.media.test.js +2 -23
- package/src/tests/react/components/tabs/employeesTabHelpers.test.js +59 -0
- package/src/tests/react/components/tabs/generalTabHelpers.test.js +35 -0
- package/src/tests/react/components/tabs/peopleMediaTabs.test.js +217 -217
- package/src/tests/react/components/tabs/peopleType.contract.test.mjs +47 -0
- package/src/tests/react/components/tabs/resolveSeededLinkType.test.mjs +20 -0
- package/src/tests/react/components/tabs/salesmanTabMedia.no-redeclare.test.mjs +33 -0
- package/src/tests/react/components/tabs/usersTabHelpers.test.js +20 -0
- package/src/tests/react/components/tabs/usersTabHelpers.test.mjs +63 -0
- package/src/tests/react/pages/employees.test.js +2 -0
- package/src/tests/react/utils/humanCompanyLinkTypes.test.js +50 -0
|
@@ -1,75 +1,77 @@
|
|
|
1
|
-
import {StyleSheet} from 'react-native';
|
|
2
|
-
|
|
3
|
-
export const createGeneralTabStyles = themeColors =>
|
|
4
|
-
StyleSheet.create({
|
|
5
|
-
container: {
|
|
6
|
-
flex: 1,
|
|
7
|
-
backgroundColor: themeColors.pageBackground,
|
|
8
|
-
},
|
|
9
|
-
content: {
|
|
10
|
-
paddingBottom: 80,
|
|
11
|
-
},
|
|
12
|
-
fieldGroup: {
|
|
13
|
-
marginBottom: 12,
|
|
14
|
-
},
|
|
15
|
-
fieldGroupLarge: {
|
|
16
|
-
marginBottom: 16,
|
|
17
|
-
},
|
|
18
|
-
fieldLabel: {
|
|
19
|
-
fontSize: 14,
|
|
20
|
-
fontWeight: '600',
|
|
21
|
-
color: themeColors.textSecondary,
|
|
22
|
-
marginBottom: 6,
|
|
23
|
-
},
|
|
24
|
-
input: {
|
|
25
|
-
borderWidth: 1,
|
|
26
|
-
borderColor: themeColors.inputBorder,
|
|
27
|
-
borderRadius: 10,
|
|
28
|
-
paddingHorizontal: 12,
|
|
29
|
-
paddingVertical: 10,
|
|
30
|
-
fontSize: 15,
|
|
31
|
-
color: themeColors.inputText,
|
|
32
|
-
backgroundColor: themeColors.inputBackground,
|
|
33
|
-
},
|
|
34
|
-
inputRow: {
|
|
35
|
-
flexDirection: 'row',
|
|
36
|
-
alignItems: 'center',
|
|
37
|
-
borderWidth: 1,
|
|
38
|
-
borderColor: themeColors.inputBorder,
|
|
39
|
-
borderRadius: 10,
|
|
40
|
-
backgroundColor: themeColors.inputBackground,
|
|
41
|
-
},
|
|
42
|
-
inputIcon: {
|
|
43
|
-
marginLeft: 10,
|
|
44
|
-
},
|
|
45
|
-
inputRowField: {
|
|
46
|
-
flex: 1,
|
|
47
|
-
paddingHorizontal: 10,
|
|
48
|
-
paddingVertical: 10,
|
|
49
|
-
fontSize: 15,
|
|
50
|
-
color: themeColors.inputText,
|
|
51
|
-
},
|
|
52
|
-
switchRow: {
|
|
53
|
-
flexDirection: 'row',
|
|
54
|
-
alignItems: 'center',
|
|
55
|
-
justifyContent: 'space-between',
|
|
56
|
-
borderWidth: 1,
|
|
57
|
-
borderColor: themeColors.inputBorder,
|
|
58
|
-
borderRadius: 10,
|
|
59
|
-
backgroundColor: themeColors.inputBackground,
|
|
60
|
-
paddingHorizontal: 12,
|
|
61
|
-
paddingVertical: 8,
|
|
62
|
-
},
|
|
63
|
-
switchLabel: {
|
|
64
|
-
fontSize: 14,
|
|
65
|
-
color: themeColors.textSecondary,
|
|
66
|
-
},
|
|
1
|
+
import {StyleSheet} from 'react-native';
|
|
2
|
+
|
|
3
|
+
export const createGeneralTabStyles = themeColors =>
|
|
4
|
+
StyleSheet.create({
|
|
5
|
+
container: {
|
|
6
|
+
flex: 1,
|
|
7
|
+
backgroundColor: themeColors.pageBackground,
|
|
8
|
+
},
|
|
9
|
+
content: {
|
|
10
|
+
paddingBottom: 80,
|
|
11
|
+
},
|
|
12
|
+
fieldGroup: {
|
|
13
|
+
marginBottom: 12,
|
|
14
|
+
},
|
|
15
|
+
fieldGroupLarge: {
|
|
16
|
+
marginBottom: 16,
|
|
17
|
+
},
|
|
18
|
+
fieldLabel: {
|
|
19
|
+
fontSize: 14,
|
|
20
|
+
fontWeight: '600',
|
|
21
|
+
color: themeColors.textSecondary,
|
|
22
|
+
marginBottom: 6,
|
|
23
|
+
},
|
|
24
|
+
input: {
|
|
25
|
+
borderWidth: 1,
|
|
26
|
+
borderColor: themeColors.inputBorder,
|
|
27
|
+
borderRadius: 10,
|
|
28
|
+
paddingHorizontal: 12,
|
|
29
|
+
paddingVertical: 10,
|
|
30
|
+
fontSize: 15,
|
|
31
|
+
color: themeColors.inputText,
|
|
32
|
+
backgroundColor: themeColors.inputBackground,
|
|
33
|
+
},
|
|
34
|
+
inputRow: {
|
|
35
|
+
flexDirection: 'row',
|
|
36
|
+
alignItems: 'center',
|
|
37
|
+
borderWidth: 1,
|
|
38
|
+
borderColor: themeColors.inputBorder,
|
|
39
|
+
borderRadius: 10,
|
|
40
|
+
backgroundColor: themeColors.inputBackground,
|
|
41
|
+
},
|
|
42
|
+
inputIcon: {
|
|
43
|
+
marginLeft: 10,
|
|
44
|
+
},
|
|
45
|
+
inputRowField: {
|
|
46
|
+
flex: 1,
|
|
47
|
+
paddingHorizontal: 10,
|
|
48
|
+
paddingVertical: 10,
|
|
49
|
+
fontSize: 15,
|
|
50
|
+
color: themeColors.inputText,
|
|
51
|
+
},
|
|
52
|
+
switchRow: {
|
|
53
|
+
flexDirection: 'row',
|
|
54
|
+
alignItems: 'center',
|
|
55
|
+
justifyContent: 'space-between',
|
|
56
|
+
borderWidth: 1,
|
|
57
|
+
borderColor: themeColors.inputBorder,
|
|
58
|
+
borderRadius: 10,
|
|
59
|
+
backgroundColor: themeColors.inputBackground,
|
|
60
|
+
paddingHorizontal: 12,
|
|
61
|
+
paddingVertical: 8,
|
|
62
|
+
},
|
|
63
|
+
switchLabel: {
|
|
64
|
+
fontSize: 14,
|
|
65
|
+
color: themeColors.textSecondary,
|
|
66
|
+
},
|
|
67
67
|
saveButton: {
|
|
68
68
|
height: 42,
|
|
69
69
|
borderRadius: 10,
|
|
70
70
|
alignItems: 'center',
|
|
71
71
|
justifyContent: 'center',
|
|
72
72
|
backgroundColor: themeColors.buttonBackground,
|
|
73
|
+
borderWidth: 1,
|
|
74
|
+
borderColor: themeColors.buttonBorder || themeColors.buttonBackground,
|
|
73
75
|
},
|
|
74
76
|
uploadImageButton: {
|
|
75
77
|
height: 42,
|
|
@@ -88,14 +90,16 @@ export const createGeneralTabStyles = themeColors =>
|
|
|
88
90
|
fontWeight: '700',
|
|
89
91
|
},
|
|
90
92
|
saveButtonDisabled: {
|
|
91
|
-
backgroundColor: themeColors.
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
93
|
+
backgroundColor: themeColors.buttonBackgroundSecondary,
|
|
94
|
+
borderWidth: 1,
|
|
95
|
+
borderColor: themeColors.buttonBorderSecondary,
|
|
96
|
+
},
|
|
97
|
+
saveButtonText: {
|
|
98
|
+
color: themeColors.buttonText,
|
|
99
|
+
fontSize: 15,
|
|
100
|
+
fontWeight: '700',
|
|
101
|
+
},
|
|
102
|
+
saveButtonTextDisabled: {
|
|
103
|
+
color: themeColors.buttonTextSecondary,
|
|
104
|
+
},
|
|
105
|
+
});
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
} from 'react-native';
|
|
8
8
|
import { useStore } from '@store';
|
|
9
9
|
import DefaultUpload from '@controleonline/ui-default/src/react/components/upload/DefaultUpload';
|
|
10
|
+
import DefaultFile from '@controleonline/ui-default/src/react/components/files/DefaultFile';
|
|
10
11
|
import { extractFileId } from '@controleonline/ui-default/src/react/components/upload/fileUpload';
|
|
11
12
|
import { useMessage } from '@controleonline/ui-common/src/react/components/MessageService';
|
|
12
13
|
import { resolveThemePalette, withOpacity } from '@controleonline/../../src/styles/branding';
|
|
@@ -214,6 +215,46 @@ const MediaTab = ({ client, onChanged = null }) => {
|
|
|
214
215
|
},
|
|
215
216
|
]}
|
|
216
217
|
>
|
|
218
|
+
<View
|
|
219
|
+
style={[
|
|
220
|
+
styles.mediaPreviewFrame,
|
|
221
|
+
styles.mediaPreviewTransparencyGrid,
|
|
222
|
+
{
|
|
223
|
+
borderColor: withOpacity(palette.primary || '#2563EB', 0.14),
|
|
224
|
+
},
|
|
225
|
+
]}>
|
|
226
|
+
{(() => {
|
|
227
|
+
const rawFile = currentMedia?.file;
|
|
228
|
+
const fileId = extractFileId(rawFile);
|
|
229
|
+
const file =
|
|
230
|
+
rawFile && typeof rawFile === 'object' && !Array.isArray(rawFile)
|
|
231
|
+
? rawFile
|
|
232
|
+
: fileId
|
|
233
|
+
? {id: fileId, '@id': `/files/${fileId}`}
|
|
234
|
+
: null;
|
|
235
|
+
if (!file) {
|
|
236
|
+
return (
|
|
237
|
+
<View style={styles.mediaEmptyState}>
|
|
238
|
+
<Text
|
|
239
|
+
style={[
|
|
240
|
+
styles.mediaEmptyText,
|
|
241
|
+
{color: palette.textSecondary || '#64748B'},
|
|
242
|
+
]}>
|
|
243
|
+
Sem imagem
|
|
244
|
+
</Text>
|
|
245
|
+
</View>
|
|
246
|
+
);
|
|
247
|
+
}
|
|
248
|
+
return (
|
|
249
|
+
<DefaultFile
|
|
250
|
+
file={file}
|
|
251
|
+
company={client}
|
|
252
|
+
resizeMode="cover"
|
|
253
|
+
style={styles.mediaPreviewImage}
|
|
254
|
+
/>
|
|
255
|
+
);
|
|
256
|
+
})()}
|
|
257
|
+
</View>
|
|
217
258
|
<DefaultUpload
|
|
218
259
|
relationStoreName="people"
|
|
219
260
|
relationField="people"
|
|
@@ -319,8 +360,12 @@ const styles = StyleSheet.create({
|
|
|
319
360
|
fontSize: 12,
|
|
320
361
|
fontWeight: '700',
|
|
321
362
|
},
|
|
363
|
+
// app-community#813: preview 320x320
|
|
322
364
|
mediaPreviewFrame: {
|
|
323
|
-
|
|
365
|
+
width: 320,
|
|
366
|
+
height: 320,
|
|
367
|
+
maxWidth: 320,
|
|
368
|
+
alignSelf: 'center',
|
|
324
369
|
borderRadius: 14,
|
|
325
370
|
borderWidth: 1,
|
|
326
371
|
overflow: 'hidden',
|
|
@@ -333,15 +378,15 @@ const styles = StyleSheet.create({
|
|
|
333
378
|
backgroundColor: '#F8FAFC',
|
|
334
379
|
},
|
|
335
380
|
mediaPreviewImage: {
|
|
336
|
-
width:
|
|
337
|
-
height:
|
|
338
|
-
minHeight: 180,
|
|
381
|
+
width: 320,
|
|
382
|
+
height: 320,
|
|
339
383
|
},
|
|
340
384
|
mediaEmptyState: {
|
|
385
|
+
width: 320,
|
|
386
|
+
height: 320,
|
|
341
387
|
alignItems: 'center',
|
|
342
388
|
justifyContent: 'center',
|
|
343
389
|
gap: 8,
|
|
344
|
-
minHeight: 180,
|
|
345
390
|
},
|
|
346
391
|
mediaEmptyText: {
|
|
347
392
|
fontSize: 13,
|