@controleonline/ui-common 1.2.108 → 1.2.110

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.
Files changed (50) hide show
  1. package/.release/rc-manifest.json +7 -5
  2. package/package.json +1 -1
  3. package/src/react/components/CategoryForm.js +539 -539
  4. package/src/react/components/DefaultProvider.native.js +2 -2
  5. package/src/react/components/DefaultProvider.web.js +2 -2
  6. package/src/react/components/integrations/IntegrationHero/index.js +1 -1
  7. package/src/react/components/integrations/IntegrationHero/styles.js +2 -2
  8. package/src/react/components/integrations/IntegrationTabs/index.js +1 -1
  9. package/src/react/components/integrations/IntegrationTabs/styles.js +1 -1
  10. package/src/react/pages/Connections.js +18 -96
  11. package/src/react/pages/Connections.styles.js +72 -72
  12. package/src/react/pages/Devices/detail/DeviceDetailHeader.js +1 -1
  13. package/src/react/pages/Devices/detail/DeviceDetailMovementSections.js +1 -1
  14. package/src/react/pages/Devices/detail/useDeviceDetailStateA.js +2 -2
  15. package/src/react/pages/Devices/detail/useDeviceDetailStateB.js +2 -2
  16. package/src/react/pages/Devices/deviceTypes/DeviceGroupCard.js +1 -1
  17. package/src/react/pages/Devices/deviceTypes/shared.js +2 -2
  18. package/src/react/pages/Devices.js +2 -2
  19. package/src/react/pages/Devices.styles.js +353 -353
  20. package/src/react/pages/Food99IntegrationPage/components/Food99CatalogTab.js +219 -219
  21. package/src/react/pages/Food99IntegrationPage/components/Food99OverviewTab.js +134 -134
  22. package/src/react/pages/Food99IntegrationPage/components/Food99PreviewModal.js +173 -173
  23. package/src/react/pages/Food99IntegrationPage/components/Food99QuickWalletModal.js +1 -1
  24. package/src/react/pages/Food99IntegrationPage/components/Food99SettingsTab.js +306 -306
  25. package/src/react/pages/Food99IntegrationPage/components/Food99StoreTab.js +417 -417
  26. package/src/react/pages/Food99IntegrationPage/index.js +1530 -1530
  27. package/src/react/pages/Food99IntegrationPage/styles.js +792 -792
  28. package/src/react/pages/IFoodIntegrationPage/components/IFoodOperationsTab.js +267 -267
  29. package/src/react/pages/IFoodIntegrationPage/components/IFoodOverviewTab.js +118 -118
  30. package/src/react/pages/IFoodIntegrationPage/components/IFoodPreviewModal.js +101 -101
  31. package/src/react/pages/IFoodIntegrationPage/components/IFoodStoreTab.js +150 -150
  32. package/src/react/pages/IFoodIntegrationPage/index.js +1298 -1298
  33. package/src/react/pages/Imports.js +1 -1
  34. package/src/react/pages/Imports.styles.js +223 -223
  35. package/src/react/pages/IntegrationConfigPage.js +2 -2
  36. package/src/react/pages/Integrations.js +299 -299
  37. package/src/react/pages/Integrations.styles.js +130 -130
  38. package/src/react/pages/LinkedInIntegrationPage.js +2 -2
  39. package/src/react/pages/ManagerOrderNotificationsPage.js +642 -642
  40. package/src/react/pages/MarketplaceIntegrationPage/components/MarketplaceProductCard.js +205 -205
  41. package/src/react/pages/MercadoLivreIntegrationPage.js +2 -2
  42. package/src/react/pages/PrinterDeviceDetailPage.js +1915 -1915
  43. package/src/react/pages/PrinterDeviceFormPage.js +2 -2
  44. package/src/react/pages/WhatsAppConnectionPage.js +280 -364
  45. package/src/react/pages/WhatsAppConnectionPage.styles.js +315 -279
  46. package/src/react/pages/WhatsAppProviderForm.js +1 -1
  47. package/src/react/pages/whatsAppConnectionHelpers.js +38 -10
  48. package/src/react/utils/fileUrl.js +1 -1
  49. package/src/store/connections/customActions.js +16 -14
  50. package/src/store/connections/index.js +109 -105
@@ -1,284 +1,320 @@
1
1
  import { StyleSheet } from 'react-native';
2
2
 
3
- const styles = StyleSheet.create({
4
- container: {
5
- flex: 1,
6
- backgroundColor: '#F8FAFC',
7
- },
8
- scroll: {
9
- paddingHorizontal: 16,
10
- paddingTop: 16,
11
- paddingBottom: 32,
12
- },
13
- centerState: {
14
- flex: 1,
15
- justifyContent: 'center',
16
- alignItems: 'center',
17
- paddingHorizontal: 28,
18
- },
19
- centerStateTitle: {
20
- marginTop: 16,
21
- fontSize: 18,
22
- fontWeight: '700',
23
- color: '#1E293B',
24
- textAlign: 'center',
25
- },
26
- centerStateText: {
27
- marginTop: 8,
28
- fontSize: 14,
29
- lineHeight: 21,
30
- color: '#64748B',
31
- textAlign: 'center',
32
- },
33
- heroCard: {
34
- borderRadius: 28,
35
- paddingHorizontal: 22,
36
- paddingVertical: 24,
37
- marginBottom: 18,
38
- flexDirection: 'row',
39
- alignItems: 'flex-start',
40
- justifyContent: 'space-between',
41
- },
42
- heroCopy: {
43
- flex: 1,
44
- paddingRight: 16,
45
- },
46
- heroEyebrow: {
47
- fontSize: 13,
48
- fontWeight: '800',
49
- letterSpacing: 1.3,
50
- color: 'rgba(255,255,255,0.82)',
51
- marginBottom: 10,
52
- },
53
- heroTitle: {
54
- fontSize: 22,
55
- fontWeight: '800',
56
- color: '#FFFFFF',
57
- marginBottom: 8,
58
- },
59
- heroText: {
60
- fontSize: 14,
61
- lineHeight: 21,
62
- color: 'rgba(255,255,255,0.88)',
63
- },
64
- heroBadge: {
65
- width: 54,
66
- height: 54,
67
- borderRadius: 18,
68
- backgroundColor: '#FFFFFF',
69
- alignItems: 'center',
70
- justifyContent: 'center',
71
- },
72
- formCard: {
73
- borderRadius: 28,
74
- backgroundColor: '#FFFFFF',
75
- padding: 18,
76
- marginBottom: 16,
77
- },
78
- formHeader: {
79
- flexDirection: 'row',
80
- justifyContent: 'space-between',
81
- alignItems: 'flex-start',
82
- gap: 12,
83
- marginBottom: 18,
84
- },
85
- cardTitle: {
86
- fontSize: 20,
87
- fontWeight: '800',
88
- color: '#0F172A',
89
- marginBottom: 6,
90
- },
91
- cardSubtitle: {
92
- fontSize: 14,
93
- lineHeight: 21,
94
- color: '#64748B',
95
- },
96
- statusBadge: {
97
- borderRadius: 999,
98
- paddingHorizontal: 12,
99
- paddingVertical: 8,
100
- },
101
- statusBadgeText: {
102
- fontSize: 13,
103
- fontWeight: '700',
104
- color: '#2563EB',
105
- },
106
- formRow: {
107
- flexDirection: 'row',
108
- gap: 12,
109
- marginBottom: 16,
110
- },
111
- inputGroupSmall: {
112
- width: 88,
113
- },
114
- inputGroupLarge: {
115
- flex: 1,
116
- },
117
- inputLabel: {
118
- fontSize: 12,
119
- fontWeight: '700',
120
- color: '#64748B',
121
- marginBottom: 8,
122
- },
123
- input: {
124
- height: 50,
125
- borderRadius: 16,
126
- borderWidth: 1,
127
- borderColor: '#E2E8F0',
128
- backgroundColor: '#F8FAFC',
129
- paddingHorizontal: 14,
130
- fontSize: 16,
131
- fontWeight: '600',
132
- color: '#0F172A',
133
- },
134
- primaryButton: {
135
- height: 52,
136
- borderRadius: 18,
137
- alignItems: 'center',
138
- justifyContent: 'center',
139
- flexDirection: 'row',
140
- gap: 10,
141
- },
142
- primaryButtonDisabled: {
143
- opacity: 0.75,
144
- },
145
- primaryButtonText: {
146
- fontSize: 15,
147
- fontWeight: '800',
148
- color: '#FFFFFF',
149
- },
150
- helperText: {
151
- marginTop: 12,
152
- fontSize: 13,
153
- color: '#64748B',
154
- },
155
- qrCard: {
156
- borderRadius: 28,
157
- backgroundColor: '#FFFFFF',
158
- padding: 18,
159
- marginBottom: 16,
160
- },
161
- qrHeader: {
162
- marginBottom: 18,
163
- },
164
- qrContent: {
165
- alignItems: 'center',
166
- justifyContent: 'center',
167
- },
168
- qrWrap: {
169
- padding: 18,
170
- borderRadius: 24,
171
- backgroundColor: '#FFFFFF',
172
- borderWidth: 1,
173
- borderColor: '#E2E8F0',
174
- },
175
- qrCaption: {
176
- marginTop: 16,
177
- fontSize: 13,
178
- lineHeight: 20,
179
- color: '#64748B',
180
- textAlign: 'center',
181
- },
182
- listHeader: {
183
- flexDirection: 'row',
184
- alignItems: 'flex-start',
185
- justifyContent: 'space-between',
186
- gap: 12,
187
- marginBottom: 14,
188
- },
189
- countBadge: {
190
- borderRadius: 999,
191
- backgroundColor: '#EEF2FF',
192
- paddingHorizontal: 12,
193
- paddingVertical: 8,
194
- },
195
- countBadgeText: {
196
- fontSize: 13,
197
- fontWeight: '700',
198
- color: '#4F46E5',
199
- },
200
- listWrap: {
201
- gap: 14,
202
- },
203
- connectionCard: {
204
- borderRadius: 24,
205
- backgroundColor: '#FFFFFF',
206
- padding: 16,
207
- },
208
- connectionTop: {
209
- flexDirection: 'row',
210
- alignItems: 'center',
211
- justifyContent: 'space-between',
212
- marginBottom: 14,
213
- },
214
- connectionIconWrap: {
215
- width: 48,
216
- height: 48,
217
- borderRadius: 16,
218
- alignItems: 'center',
219
- justifyContent: 'center',
220
- },
221
- connectionStatusBadge: {
222
- borderRadius: 999,
223
- paddingHorizontal: 12,
224
- paddingVertical: 8,
225
- },
226
- connectionStatusText: {
227
- fontSize: 13,
228
- fontWeight: '700',
229
- color: '#2563EB',
230
- },
231
- connectionName: {
232
- fontSize: 18,
233
- fontWeight: '800',
234
- color: '#0F172A',
235
- marginBottom: 14,
236
- },
237
- connectionMetaRow: {
238
- flexDirection: 'row',
239
- gap: 12,
240
- marginBottom: 12,
241
- },
242
- connectionMetaItem: {
243
- flex: 1,
244
- borderRadius: 18,
245
- backgroundColor: '#F8FAFC',
246
- paddingHorizontal: 14,
247
- paddingVertical: 14,
248
- },
249
- connectionMetaLabel: {
250
- fontSize: 12,
251
- fontWeight: '700',
252
- color: '#64748B',
253
- marginBottom: 6,
254
- },
255
- connectionMetaValue: {
256
- fontSize: 15,
257
- fontWeight: '700',
258
- color: '#0F172A',
259
- },
260
- emptyStateBox: {
261
- borderRadius: 22,
262
- backgroundColor: '#F8FAFC',
263
- alignItems: 'center',
264
- justifyContent: 'center',
265
- paddingHorizontal: 18,
266
- paddingVertical: 24,
267
- },
268
- emptyStateTitle: {
269
- marginTop: 12,
270
- fontSize: 16,
271
- fontWeight: '800',
272
- color: '#1E293B',
273
- textAlign: 'center',
274
- },
275
- emptyStateText: {
276
- marginTop: 8,
277
- fontSize: 14,
278
- lineHeight: 21,
279
- color: '#64748B',
280
- textAlign: 'center',
281
- },
3
+ const styles = StyleSheet.create({
4
+ container: {
5
+ flex: 1,
6
+ backgroundColor: '#F8FAFC',
7
+ },
8
+ scroll: {
9
+ paddingHorizontal: 16,
10
+ paddingTop: 16,
11
+ paddingBottom: 32,
12
+ },
13
+ centerState: {
14
+ flex: 1,
15
+ justifyContent: 'center',
16
+ alignItems: 'center',
17
+ paddingHorizontal: 28,
18
+ },
19
+ centerStateTitle: {
20
+ marginTop: 16,
21
+ fontSize: 18,
22
+ fontWeight: '700',
23
+ color: '#1E293B',
24
+ textAlign: 'center',
25
+ },
26
+ centerStateText: {
27
+ marginTop: 8,
28
+ fontSize: 14,
29
+ lineHeight: 21,
30
+ color: '#64748B',
31
+ textAlign: 'center',
32
+ },
33
+ heroCard: {
34
+ borderRadius: 28,
35
+ paddingHorizontal: 22,
36
+ paddingVertical: 24,
37
+ marginBottom: 18,
38
+ flexDirection: 'row',
39
+ alignItems: 'flex-start',
40
+ justifyContent: 'space-between',
41
+ },
42
+ heroCopy: {
43
+ flex: 1,
44
+ paddingRight: 16,
45
+ },
46
+ heroEyebrow: {
47
+ fontSize: 13,
48
+ fontWeight: '800',
49
+ letterSpacing: 1.3,
50
+ color: 'rgba(255,255,255,0.82)',
51
+ marginBottom: 10,
52
+ },
53
+ heroTitle: {
54
+ fontSize: 22,
55
+ fontWeight: '800',
56
+ color: '#FFFFFF',
57
+ marginBottom: 8,
58
+ },
59
+ heroText: {
60
+ fontSize: 14,
61
+ lineHeight: 21,
62
+ color: 'rgba(255,255,255,0.88)',
63
+ },
64
+ heroBadge: {
65
+ width: 54,
66
+ height: 54,
67
+ borderRadius: 18,
68
+ backgroundColor: '#FFFFFF',
69
+ alignItems: 'center',
70
+ justifyContent: 'center',
71
+ },
72
+ formCard: {
73
+ borderRadius: 28,
74
+ backgroundColor: '#FFFFFF',
75
+ padding: 18,
76
+ marginBottom: 16,
77
+ },
78
+ formHeader: {
79
+ flexDirection: 'row',
80
+ justifyContent: 'space-between',
81
+ alignItems: 'flex-start',
82
+ gap: 12,
83
+ marginBottom: 18,
84
+ },
85
+ cardTitle: {
86
+ fontSize: 20,
87
+ fontWeight: '800',
88
+ color: '#0F172A',
89
+ marginBottom: 6,
90
+ },
91
+ cardSubtitle: {
92
+ fontSize: 14,
93
+ lineHeight: 21,
94
+ color: '#64748B',
95
+ },
96
+ statusBadge: {
97
+ borderRadius: 999,
98
+ paddingHorizontal: 12,
99
+ paddingVertical: 8,
100
+ },
101
+ statusBadgeText: {
102
+ fontSize: 13,
103
+ fontWeight: '700',
104
+ color: '#2563EB',
105
+ },
106
+ formRow: {
107
+ flexDirection: 'row',
108
+ gap: 12,
109
+ marginBottom: 16,
110
+ },
111
+ inputGroupSmall: {
112
+ width: 88,
113
+ },
114
+ inputGroupLarge: {
115
+ flex: 1,
116
+ },
117
+ inputLabel: {
118
+ fontSize: 12,
119
+ fontWeight: '700',
120
+ color: '#64748B',
121
+ marginBottom: 8,
122
+ },
123
+ input: {
124
+ height: 50,
125
+ borderRadius: 16,
126
+ borderWidth: 1,
127
+ borderColor: '#E2E8F0',
128
+ backgroundColor: '#F8FAFC',
129
+ paddingHorizontal: 14,
130
+ fontSize: 16,
131
+ fontWeight: '600',
132
+ color: '#0F172A',
133
+ },
134
+ primaryButton: {
135
+ height: 52,
136
+ borderRadius: 18,
137
+ alignItems: 'center',
138
+ justifyContent: 'center',
139
+ flexDirection: 'row',
140
+ gap: 10,
141
+ },
142
+ primaryButtonDisabled: {
143
+ opacity: 0.75,
144
+ },
145
+ primaryButtonText: {
146
+ fontSize: 15,
147
+ fontWeight: '800',
148
+ color: '#FFFFFF',
149
+ },
150
+ helperText: {
151
+ marginTop: 12,
152
+ fontSize: 13,
153
+ color: '#64748B',
154
+ },
155
+ qrCard: {
156
+ borderRadius: 28,
157
+ backgroundColor: '#FFFFFF',
158
+ padding: 18,
159
+ marginBottom: 16,
160
+ },
161
+ qrHeader: {
162
+ marginBottom: 18,
163
+ },
164
+ qrContent: {
165
+ alignItems: 'center',
166
+ justifyContent: 'center',
167
+ },
168
+ qrWrap: {
169
+ padding: 18,
170
+ borderRadius: 24,
171
+ backgroundColor: '#FFFFFF',
172
+ borderWidth: 1,
173
+ borderColor: '#E2E8F0',
174
+ },
175
+ qrCaption: {
176
+ marginTop: 16,
177
+ fontSize: 13,
178
+ lineHeight: 20,
179
+ color: '#64748B',
180
+ textAlign: 'center',
181
+ },
182
+ listHeader: {
183
+ flexDirection: 'row',
184
+ alignItems: 'flex-start',
185
+ justifyContent: 'space-between',
186
+ gap: 12,
187
+ marginBottom: 14,
188
+ },
189
+ countBadge: {
190
+ borderRadius: 999,
191
+ backgroundColor: '#EEF2FF',
192
+ paddingHorizontal: 12,
193
+ paddingVertical: 8,
194
+ },
195
+ countBadgeText: {
196
+ fontSize: 13,
197
+ fontWeight: '700',
198
+ color: '#4F46E5',
199
+ },
200
+ listWrap: {
201
+ gap: 14,
202
+ },
203
+ connectionCard: {
204
+ borderRadius: 24,
205
+ backgroundColor: '#FFFFFF',
206
+ padding: 16,
207
+ },
208
+ connectionTop: {
209
+ flexDirection: 'row',
210
+ alignItems: 'center',
211
+ justifyContent: 'space-between',
212
+ marginBottom: 14,
213
+ },
214
+ connectionIconWrap: {
215
+ width: 48,
216
+ height: 48,
217
+ borderRadius: 16,
218
+ alignItems: 'center',
219
+ justifyContent: 'center',
220
+ },
221
+ connectionStatusBadge: {
222
+ borderRadius: 999,
223
+ paddingHorizontal: 12,
224
+ paddingVertical: 8,
225
+ },
226
+ connectionStatusText: {
227
+ fontSize: 13,
228
+ fontWeight: '700',
229
+ color: '#2563EB',
230
+ },
231
+ connectionName: {
232
+ fontSize: 18,
233
+ fontWeight: '800',
234
+ color: '#0F172A',
235
+ marginBottom: 14,
236
+ },
237
+ connectionMetaRow: {
238
+ flexDirection: 'row',
239
+ gap: 12,
240
+ marginBottom: 12,
241
+ },
242
+ connectionMetaItem: {
243
+ flex: 1,
244
+ borderRadius: 18,
245
+ backgroundColor: '#F8FAFC',
246
+ paddingHorizontal: 14,
247
+ paddingVertical: 14,
248
+ },
249
+ connectionMetaLabel: {
250
+ fontSize: 12,
251
+ fontWeight: '700',
252
+ color: '#64748B',
253
+ marginBottom: 6,
254
+ },
255
+ connectionMetaValue: {
256
+ fontSize: 15,
257
+ fontWeight: '700',
258
+ color: '#0F172A',
259
+ },
260
+ emptyStateBox: {
261
+ borderRadius: 22,
262
+ backgroundColor: '#F8FAFC',
263
+ alignItems: 'center',
264
+ justifyContent: 'center',
265
+ paddingHorizontal: 18,
266
+ paddingVertical: 24,
267
+ },
268
+ emptyStateTitle: {
269
+ marginTop: 12,
270
+ fontSize: 16,
271
+ fontWeight: '800',
272
+ color: '#1E293B',
273
+ textAlign: 'center',
274
+ },
275
+ emptyStateText: {
276
+ marginTop: 8,
277
+ fontSize: 14,
278
+ lineHeight: 21,
279
+ color: '#64748B',
280
+ textAlign: 'center',
281
+ },
282
+
283
+ feedbackBox: {
284
+ borderRadius: 12,
285
+ paddingHorizontal: 12,
286
+ paddingVertical: 10,
287
+ marginBottom: 12,
288
+ },
289
+ feedbackText: {
290
+ fontSize: 13,
291
+ lineHeight: 18,
292
+ color: '#0F172A',
293
+ },
294
+ selectedHint: {
295
+ fontSize: 13,
296
+ fontWeight: '600',
297
+ color: '#64748B',
298
+ marginBottom: 8,
299
+ },
300
+ statusLine: {
301
+ marginTop: 10,
302
+ fontSize: 13,
303
+ color: '#64748B',
304
+ },
305
+ previewName: {
306
+ fontSize: 15,
307
+ fontWeight: '700',
308
+ color: '#0F172A',
309
+ },
310
+ previewMeta: {
311
+ marginTop: 4,
312
+ fontSize: 12,
313
+ color: '#64748B',
314
+ },
282
315
  });
283
316
 
317
+ export const createStyles = (_palette) => styles;
318
+
284
319
  export default styles;
320
+
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { ActivityIndicator, Text, TextInput, TouchableOpacity, View } from 'react-native';
3
3
  import Icon from 'react-native-vector-icons/Feather';
4
- import { withOpacity } from '@controleonline/../../src/styles/branding';
4
+ import { withOpacity } from '@controleonline/ui-layout/src/styles/branding';
5
5
  import { PROVIDER_OFFICIAL, PROVIDER_UNOFFICIAL } from './whatsAppConnectionHelpers';
6
6
 
7
7
  export default function WhatsAppProviderForm({
@@ -19,6 +19,29 @@ export const formatPhoneLabel = phone => {
19
19
  return ddd ? `(${ddd}) ${firstPart}-${lastFour}` : `${firstPart}-${lastFour}`;
20
20
  };
21
21
 
22
+ const resolveStatusIri = status => {
23
+ if (!status) return null;
24
+ if (typeof status === 'string') {
25
+ if (status.startsWith('/') || status.startsWith('http')) return status;
26
+ return null;
27
+ }
28
+ if (typeof status === 'object') {
29
+ const iri = status['@id'] || status.id;
30
+ if (iri == null) return null;
31
+ const asString = String(iri);
32
+ if (asString.startsWith('/') || asString.startsWith('http')) return asString;
33
+ return `/statuses/${asString}`;
34
+ }
35
+ return null;
36
+ };
37
+
38
+ const resolveNumericId = item => {
39
+ const raw = item?.id ?? item?.['@id'];
40
+ if (raw == null) return null;
41
+ const digits = String(raw).replace(/\D/g, '');
42
+ return digits ? Number(digits) : null;
43
+ };
44
+
22
45
  export const normalizeConnection = item => {
23
46
  const channel =
24
47
  item?.channel === CHANNEL_WHATSAPP_OFFICIAL
@@ -26,15 +49,18 @@ export const normalizeConnection = item => {
26
49
  : CHANNEL_WHATSAPP;
27
50
  return {
28
51
  id: item?.id || item?.['@id'] || `connection-${Math.random()}`,
52
+ numericId: resolveNumericId(item),
29
53
  name: item?.name || 'Sem nome',
30
- status: item?.status?.status || item?.status || 'Pendente',
54
+ status:
55
+ (typeof item?.status === 'object'
56
+ ? item?.status?.status || item?.status?.name
57
+ : item?.status) || 'Pendente',
58
+ statusIri: resolveStatusIri(item?.status),
31
59
  type: item?.type || 'Nenhum',
32
60
  channel,
33
- /** alias used by list UI */
34
- provider: channel === CHANNEL_WHATSAPP_OFFICIAL ? CHANNEL_WHATSAPP_OFFICIAL : CHANNEL_WHATSAPP,
61
+ provider: channel,
35
62
  phone: item?.phone || {},
36
63
  phoneLabel: formatPhoneLabel(item?.phone),
37
- channelConfig: item?.channelConfig || item?.channel_config || null,
38
64
  };
39
65
  };
40
66
 
@@ -48,10 +74,18 @@ export const toArray = response => {
48
74
  export const formatApiError = error => {
49
75
  if (!error) return 'Nao foi possivel concluir a operacao.';
50
76
  if (typeof error === 'string') return error;
77
+ const violations = error?.violations || error?.data?.violations;
78
+ if (Array.isArray(violations) && violations.length) {
79
+ return violations
80
+ .map(v => v?.message || v?.propertyPath)
81
+ .filter(Boolean)
82
+ .join(' · ');
83
+ }
51
84
  return (
52
85
  error?.message ||
53
86
  error?.description ||
54
87
  error?.errmsg ||
88
+ error?.hydra?.description ||
55
89
  'Nao foi possivel concluir a operacao.'
56
90
  );
57
91
  };
@@ -69,9 +103,3 @@ export const buildOfficialChannelConfig = ({
69
103
  if (version) config.api_version = version;
70
104
  return config;
71
105
  };
72
-
73
- export const maskToken = token => {
74
- const value = String(token || '');
75
- if (value.length <= 8) return value ? '••••••••' : '';
76
- return `${value.slice(0, 4)}…${value.slice(-4)}`;
77
- };
@@ -1,6 +1,6 @@
1
1
  import {env as APP_ENV} from '@env';
2
2
  import {filterApiHeaders, isTrustedApiUrl} from '../../utils/trustedApiUrl';
3
- import {buildAssetUrl} from '@controleonline/../../src/styles/branding';
3
+ import {buildAssetUrl} from '@controleonline/ui-layout/src/styles/branding';
4
4
  import {
5
5
  resolveAppDomain,
6
6
  resolveCompanyDomain,