@controleonline/ui-common 1.2.95 → 1.2.96
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/docs/homepage-1056.md
CHANGED
|
@@ -9,4 +9,6 @@ Local evidence: 40 homepage tests and 34 runtime footer/zoom tests passed. No pr
|
|
|
9
9
|
|
|
10
10
|
Keep the navigation tree mounted while translations initialize. Hide the shell and disable pointer/accessibility interaction until the existing translation readiness contract succeeds. Unmounting navigation during login resets its route and repeatedly mounts/registers the bottom bar, causing React maximum update depth. No route, permission, translation source, theme or zoom changes. Native behavior is unchanged.
|
|
11
11
|
|
|
12
|
-
Regression evidence: app-community homepage bootstrapNavigation.test.js reproduced maximum update depth before the fix, then passed after it. 44 tests across 9 homepage suites passed. Runtime Dev reproduced the unfixed bug; new runtime verification is required after consuming ui-common 1.2.
|
|
12
|
+
Regression evidence: app-community homepage bootstrapNavigation.test.js reproduced maximum update depth before the fix, then passed after it. 44 tests across 9 homepage suites passed. Runtime Dev reproduced the unfixed bug; new runtime verification is required after consuming ui-common 1.2.96.
|
|
13
|
+
|
|
14
|
+
Release 1.2.96 uses the task-only c91510d source plus version metadata. The integration merge into dev preserves independent team work, but those changes are excluded from this homepage package. Publication uses the existing tag-triggered trusted publishing workflow.
|
package/package.json
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
ok True
|
|
3
|
-
eCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
1
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
4
2
|
import { ActivityIndicator, Platform, RefreshControl, ScrollView, Text, TouchableOpacity, View } from 'react-native';
|
|
5
3
|
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
6
4
|
import { useFocusEffect } from '@react-navigation/native';
|
|
@@ -16,7 +14,6 @@ import { fetchPeopleConfigs } from './fetchPeopleConfigs';
|
|
|
16
14
|
import IntegrationConfigFields from './IntegrationConfigFields';
|
|
17
15
|
import {
|
|
18
16
|
ROUTE_PROVIDER_MAP,
|
|
19
|
-
expandBundledConfig,
|
|
20
17
|
extractAuthorizationUrl,
|
|
21
18
|
formatApiError,
|
|
22
19
|
formatUberOAuthError,
|
|
@@ -115,8 +112,6 @@ export default function IntegrationConfigPage({ route, embedded = false, fiscalT
|
|
|
115
112
|
const allFieldKeysSig = useMemo(() => allFieldKeys.join('|'), [allFieldKeys]);
|
|
116
113
|
// Pure config providers (e.g. receita-federal) do not use marketplace/integrations.
|
|
117
114
|
const needsMarketplaceIntegration = Boolean(providerConfig?.oauthConnect);
|
|
118
|
-
const bundleKey = normalizeTextValue(providerConfig?.bundleKey);
|
|
119
|
-
const configVisibility = normalizeTextValue(providerConfig?.visibility) || 'public';
|
|
120
115
|
|
|
121
116
|
useEffect(() => {
|
|
122
117
|
setConfigValues({});
|
|
@@ -140,28 +135,14 @@ export default function IntegrationConfigPage({ route, embedded = false, fiscalT
|
|
|
140
135
|
}
|
|
141
136
|
if (showLoading) setLoading(true);
|
|
142
137
|
try {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
configKeys: [bundleKey],
|
|
147
|
-
});
|
|
148
|
-
const bundled = configItems.find(
|
|
149
|
-
item => String(item?.configKey || '').trim() === bundleKey,
|
|
150
|
-
);
|
|
151
|
-
const mergeFields = allConfigFields.length ? allConfigFields : visibleFields;
|
|
152
|
-
setConfigValues(current =>
|
|
153
|
-
expandBundledConfig(mergeFields, bundled?.configValue, current),
|
|
154
|
-
);
|
|
155
|
-
} else {
|
|
156
|
-
const keys = allFieldKeys.length
|
|
157
|
-
? allFieldKeys
|
|
158
|
-
: visibleFields.map(field => field.key).filter(Boolean);
|
|
138
|
+
const keys = allFieldKeys.length
|
|
139
|
+
? allFieldKeys
|
|
140
|
+
: visibleFields.map(field => field.key).filter(Boolean);
|
|
159
141
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}
|
|
142
|
+
if (keys.length) {
|
|
143
|
+
const configItems = await fetchPeopleConfigs({ peopleIri: providerIri, configKeys: keys });
|
|
144
|
+
const mergeFields = allConfigFields.length ? allConfigFields : visibleFields;
|
|
145
|
+
setConfigValues(current => mergeTabValues(mergeFields, configItems, current));
|
|
165
146
|
}
|
|
166
147
|
|
|
167
148
|
if (needsMarketplaceIntegration) {
|
|
@@ -189,7 +170,6 @@ export default function IntegrationConfigPage({ route, embedded = false, fiscalT
|
|
|
189
170
|
allConfigFields,
|
|
190
171
|
allFieldKeys,
|
|
191
172
|
allFieldKeysSig,
|
|
192
|
-
bundleKey,
|
|
193
173
|
needsMarketplaceIntegration,
|
|
194
174
|
providerConfig,
|
|
195
175
|
providerIri,
|
|
@@ -266,44 +246,16 @@ export default function IntegrationConfigPage({ route, embedded = false, fiscalT
|
|
|
266
246
|
showError('Nao foi possivel identificar a integracao selecionada.');
|
|
267
247
|
return;
|
|
268
248
|
}
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
(visibleFields || []).forEach(field => {
|
|
274
|
-
payloadObject[field.key] = normalizeTextValue(configValues[field.key]);
|
|
275
|
-
});
|
|
276
|
-
configs = [
|
|
277
|
-
{
|
|
278
|
-
configKey: bundleKey,
|
|
279
|
-
configValue: toConfigRequestValue(payloadObject),
|
|
280
|
-
},
|
|
281
|
-
];
|
|
282
|
-
} else {
|
|
283
|
-
configs = visibleFields.map(field => ({
|
|
284
|
-
configKey: field.key,
|
|
285
|
-
configValue: toConfigRequestValue(normalizeTextValue(configValues[field.key])),
|
|
286
|
-
}));
|
|
287
|
-
}
|
|
288
|
-
|
|
249
|
+
const configs = visibleFields.map(field => ({
|
|
250
|
+
configKey: field.key,
|
|
251
|
+
configValue: toConfigRequestValue(normalizeTextValue(configValues[field.key])),
|
|
252
|
+
}));
|
|
289
253
|
try {
|
|
290
|
-
await persistConfigs({ configs, people: providerIri, module: 4, visibility:
|
|
254
|
+
await persistConfigs({ configs, people: providerIri, module: 4, visibility: 'public' });
|
|
291
255
|
showSuccess(`${activeTabDef?.label || providerConfig.label} salvo com sucesso.`);
|
|
292
256
|
await loadPageData({ showLoading: false });
|
|
293
257
|
} catch (error) { showError(error?.message || 'Nao foi possivel salvar a integracao.'); }
|
|
294
|
-
}, [
|
|
295
|
-
activeTabDef,
|
|
296
|
-
bundleKey,
|
|
297
|
-
configValues,
|
|
298
|
-
configVisibility,
|
|
299
|
-
loadPageData,
|
|
300
|
-
persistConfigs,
|
|
301
|
-
providerConfig,
|
|
302
|
-
providerIri,
|
|
303
|
-
showError,
|
|
304
|
-
showSuccess,
|
|
305
|
-
visibleFields,
|
|
306
|
-
]);
|
|
258
|
+
}, [activeTabDef, configValues, loadPageData, persistConfigs, providerConfig, providerIri, showError, showSuccess, visibleFields]);
|
|
307
259
|
|
|
308
260
|
if (!providerConfig) return <CenterState icon="alert-triangle" iconColor="#e67e22" title="Integracao indisponivel" text="A tela solicitada nao possui configuracao cadastrada." />;
|
|
309
261
|
if (!providerId) return <CenterState icon="building" iconColor="#94A3B8" title="Empresa nao identificada" text="Abra a ficha da empresa para gravar as configuracoes fiscais nela." />;
|
|
@@ -5,7 +5,6 @@ export const ROUTE_PROVIDER_MAP = {
|
|
|
5
5
|
AsaasIntegrationPage: 'asaas',
|
|
6
6
|
ClickSignIntegrationPage: 'clicksign',
|
|
7
7
|
ReceitaFederalIntegrationPage: 'receita-federal',
|
|
8
|
-
SemPararIntegrationPage: 'sem-parar',
|
|
9
8
|
};
|
|
10
9
|
|
|
11
10
|
export const routeNameToPath = routeName =>
|
|
@@ -54,22 +53,6 @@ export const mergeTabValues = (fields, source, current = {}) => {
|
|
|
54
53
|
return next;
|
|
55
54
|
};
|
|
56
55
|
|
|
57
|
-
/** Expand a single JSON config (bundleKey) into flat field values. */
|
|
58
|
-
export const expandBundledConfig = (fields, rawValue, current = {}) => {
|
|
59
|
-
let parsed = rawValue;
|
|
60
|
-
if (typeof rawValue === 'string') {
|
|
61
|
-
try {
|
|
62
|
-
parsed = JSON.parse(rawValue);
|
|
63
|
-
} catch {
|
|
64
|
-
parsed = {};
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
68
|
-
parsed = {};
|
|
69
|
-
}
|
|
70
|
-
return mergeTabValues(fields, parsed, current);
|
|
71
|
-
};
|
|
72
|
-
|
|
73
56
|
export const buildFieldValues = (providerConfig, source) =>
|
|
74
57
|
mergeTabValues(getConfigFields(providerConfig), source, {});
|
|
75
58
|
|
|
@@ -70,16 +70,6 @@ export const INTEGRATION_LIST = [
|
|
|
70
70
|
accent: '#166534',
|
|
71
71
|
icon: 'file-text',
|
|
72
72
|
},
|
|
73
|
-
{
|
|
74
|
-
key: 'sem-parar',
|
|
75
|
-
label: 'Sem Parar',
|
|
76
|
-
route: 'IntegrationConfigPage',
|
|
77
|
-
routeParams: {
|
|
78
|
-
providerKey: 'sem-parar',
|
|
79
|
-
},
|
|
80
|
-
accent: '#0EA5E9',
|
|
81
|
-
icon: 'truck',
|
|
82
|
-
},
|
|
83
73
|
];
|
|
84
74
|
|
|
85
75
|
export const INTEGRATION_CONFIGS = {
|
|
@@ -267,67 +257,6 @@ export const INTEGRATION_CONFIGS = {
|
|
|
267
257
|
],
|
|
268
258
|
fields: [],
|
|
269
259
|
},
|
|
270
|
-
|
|
271
|
-
'sem-parar': {
|
|
272
|
-
key: 'sem-parar',
|
|
273
|
-
label: 'Sem Parar',
|
|
274
|
-
accent: '#0EA5E9',
|
|
275
|
-
icon: 'truck',
|
|
276
|
-
description:
|
|
277
|
-
'Credenciais da empresa para emissao de vale-pedagio via Sem Parar.',
|
|
278
|
-
saveLabel: 'Salvar Sem Parar',
|
|
279
|
-
// Backend (api-platform-integration SemPararConfig) reads a single private JSON key.
|
|
280
|
-
bundleKey: 'SEM_PARAR',
|
|
281
|
-
visibility: 'private',
|
|
282
|
-
requiredKeys: ['ENABLED', 'CLIENT_ID', 'CLIENT_SECRET', 'USERNAME', 'PASSWORD'],
|
|
283
|
-
fields: [
|
|
284
|
-
{
|
|
285
|
-
key: 'ENABLED',
|
|
286
|
-
label: 'Ativo',
|
|
287
|
-
type: 'select',
|
|
288
|
-
options: [
|
|
289
|
-
{value: '1', label: 'Sim'},
|
|
290
|
-
{value: '0', label: 'Nao'},
|
|
291
|
-
],
|
|
292
|
-
},
|
|
293
|
-
{
|
|
294
|
-
key: 'ENVIRONMENT',
|
|
295
|
-
label: 'Ambiente',
|
|
296
|
-
type: 'select',
|
|
297
|
-
options: [
|
|
298
|
-
{value: 'sandbox', label: 'Sandbox'},
|
|
299
|
-
{value: 'production', label: 'Producao'},
|
|
300
|
-
],
|
|
301
|
-
},
|
|
302
|
-
{
|
|
303
|
-
key: 'CLIENT_ID',
|
|
304
|
-
label: 'Client ID',
|
|
305
|
-
placeholder: 'Client ID Sem Parar',
|
|
306
|
-
},
|
|
307
|
-
{
|
|
308
|
-
key: 'CLIENT_SECRET',
|
|
309
|
-
label: 'Client secret',
|
|
310
|
-
placeholder: 'Client secret Sem Parar',
|
|
311
|
-
secureTextEntry: true,
|
|
312
|
-
},
|
|
313
|
-
{
|
|
314
|
-
key: 'USERNAME',
|
|
315
|
-
label: 'Usuario',
|
|
316
|
-
placeholder: 'Usuario da API',
|
|
317
|
-
},
|
|
318
|
-
{
|
|
319
|
-
key: 'PASSWORD',
|
|
320
|
-
label: 'Senha',
|
|
321
|
-
placeholder: 'Senha da API',
|
|
322
|
-
secureTextEntry: true,
|
|
323
|
-
},
|
|
324
|
-
{
|
|
325
|
-
key: 'CONVENIADO',
|
|
326
|
-
label: 'Conveniado',
|
|
327
|
-
placeholder: 'Codigo do conveniado (se aplicavel)',
|
|
328
|
-
},
|
|
329
|
-
],
|
|
330
|
-
},
|
|
331
260
|
};
|
|
332
261
|
|
|
333
262
|
export const getIntegrationListItem = key =>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export const CIELO_CONFIG_KEY = 'CIELO';
|
|
2
2
|
export const NEW_RELIC_CONFIG_KEY = 'NEW_RELIC';
|
|
3
3
|
export const SPOTIFY_CONFIG_KEY = 'SPOTIFY';
|
|
4
|
-
export const SEM_PARAR_CONFIG_KEY = 'SEM_PARAR';
|
|
5
4
|
|
|
6
5
|
export const DEFAULT_CIELO_CONFIG = {
|
|
7
6
|
ACCESS_TOKEN: '',
|
|
@@ -24,21 +23,6 @@ export const DEFAULT_SPOTIFY_CONFIG = {
|
|
|
24
23
|
CLIENT_SECRET: '',
|
|
25
24
|
};
|
|
26
25
|
|
|
27
|
-
/**
|
|
28
|
-
* Company-scoped Sem Parar credentials for vale-pedágio emission.
|
|
29
|
-
* ENABLED: "1" | "0"
|
|
30
|
-
* ENVIRONMENT: "sandbox" | "production"
|
|
31
|
-
*/
|
|
32
|
-
export const DEFAULT_SEM_PARAR_CONFIG = {
|
|
33
|
-
ENABLED: '0',
|
|
34
|
-
CLIENT_ID: '',
|
|
35
|
-
CLIENT_SECRET: '',
|
|
36
|
-
USERNAME: '',
|
|
37
|
-
PASSWORD: '',
|
|
38
|
-
ENVIRONMENT: 'sandbox',
|
|
39
|
-
CONVENIADO: '',
|
|
40
|
-
};
|
|
41
|
-
|
|
42
26
|
const isConfigMap = value =>
|
|
43
27
|
value && typeof value === 'object' && !Array.isArray(value);
|
|
44
28
|
|
|
@@ -94,10 +78,3 @@ export const resolveSpotifyConfig = configs =>
|
|
|
94
78
|
SPOTIFY_CONFIG_KEY,
|
|
95
79
|
DEFAULT_SPOTIFY_CONFIG,
|
|
96
80
|
);
|
|
97
|
-
|
|
98
|
-
export const resolveSemPararConfig = configs =>
|
|
99
|
-
resolveIntegrationConfig(
|
|
100
|
-
configs,
|
|
101
|
-
SEM_PARAR_CONFIG_KEY,
|
|
102
|
-
DEFAULT_SEM_PARAR_CONFIG,
|
|
103
|
-
);
|