@controleonline/ui-common 1.2.135 → 1.2.137
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/.release/rc-manifest.json +6 -12
- package/package.json +3 -2
- package/src/react/components/RuntimeInfoFooter.js +26 -6
- package/src/react/pages/ConversationContextsCard.js +120 -0
- package/src/react/pages/EmailConnectionModal.js +2 -13
- package/src/react/pages/WhatsAppConnectionPage.js +10 -30
- package/src/react/pages/whatsAppConnectionHelpers.js +0 -1
- package/src/store/connections/customActions.js +0 -3
- package/src/tests/react/components/RuntimeInfoFooter.platform.contract.test.mjs +24 -0
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.2.
|
|
2
|
+
"version": "1.2.137",
|
|
3
3
|
"rc": 1,
|
|
4
|
-
"branch": "rc/1.2.
|
|
5
|
-
"baseMaster": "
|
|
6
|
-
"baseTag": "v1.2.
|
|
4
|
+
"branch": "rc/1.2.137-rc.1",
|
|
5
|
+
"baseMaster": "8571a3ddc00b6522b47e5fb7aad3bebaa2262017",
|
|
6
|
+
"baseTag": "v1.2.136",
|
|
7
7
|
"tasks": [
|
|
8
|
-
|
|
8
|
+
1764
|
|
9
9
|
],
|
|
10
|
-
"taskRepository": "ControleOnline/app-community",
|
|
11
10
|
"frozen": true,
|
|
12
11
|
"repositories": {
|
|
13
|
-
"ControleOnline/ui-common": "
|
|
14
|
-
},
|
|
15
|
-
"sources": {
|
|
16
|
-
"versão de produção v1.2.134": "df0c24b1d672e11f3165f2da1c1e22737a4e8fa9",
|
|
17
|
-
"staging": "18d4fc4da6a487dd66d0f421869c5afea1304ace",
|
|
18
|
-
"dev": "e38763d9f79f3a8137a4f10f455cb0daeefdacd8"
|
|
12
|
+
"ControleOnline/ui-common": "1d73fdcfdc793c22640111ea26647f254f47ec88"
|
|
19
13
|
}
|
|
20
14
|
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@controleonline/ui-common",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.137",
|
|
4
4
|
"author": "ControleOnline",
|
|
5
5
|
"description": "ControleOnline Common Quasar UI Component",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "src/react/index.js",
|
|
8
8
|
"scripts": {
|
|
9
|
-
"test": "npm run test:receita-federal && npm run test:imports-status && npm run test:runtime-language && npm run test:runtime-footer && npm run test:runtime-footer-marquee && npm run test:invoice-presentation && npm run test:system-error-message && npm run test:bottom-navigation-toolbar && npm run test:copy-device-configs && npm run test:print-routing && npm run test:device-detail-dependencies && npm run test:runtime-zoom && npm run test:cash-register-summary && npm run test:linked-order-payload && npm run test:document-file-content && npm run test:order-products-summary && npm run test:client-portfolio",
|
|
9
|
+
"test": "npm run test:receita-federal && npm run test:imports-status && npm run test:runtime-language && npm run test:runtime-footer && npm run test:runtime-footer-marquee && npm run test:runtime-footer-platform && npm run test:invoice-presentation && npm run test:system-error-message && npm run test:bottom-navigation-toolbar && npm run test:copy-device-configs && npm run test:print-routing && npm run test:device-detail-dependencies && npm run test:runtime-zoom && npm run test:cash-register-summary && npm run test:linked-order-payload && npm run test:document-file-content && npm run test:order-products-summary && npm run test:client-portfolio",
|
|
10
10
|
"test:receita-federal": "node --test src/tests/react/pages/receitaFederalIntegrationContract.test.mjs",
|
|
11
11
|
"test:imports-status": "mkdir -p node_modules/@controleonline && rm -rf node_modules/@controleonline/ui-common && ln -s ../.. node_modules/@controleonline/ui-common && node --test src/tests/react/utils/importStatus.test.js",
|
|
12
12
|
"test:cash-register-summary": "node --test src/tests/react/utils/cashRegisterSummary.test.js",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"test:bottom-navigation-toolbar": "node --test src/tests/react/utils/bottomNavigationToolbar.test.js",
|
|
23
23
|
"test:copy-device-configs": "node --test src/tests/react/utils/copyDeviceConfigs.test.mjs",
|
|
24
24
|
"test:print-routing": "node --test src/tests/react/utils/printRouting.test.mjs src/tests/react/utils/printSpoolUtils.test.mjs",
|
|
25
|
+
"test:runtime-footer-platform": "node --test src/tests/react/components/RuntimeInfoFooter.platform.contract.test.mjs",
|
|
25
26
|
"test:runtime-footer-marquee": "node --test src/tests/react/components/RuntimeFooterMarqueeText.test.js src/tests/react/components/RuntimeFooterMarqueeText.build.test.js",
|
|
26
27
|
"test:device-detail-dependencies": "node --test src/tests/react/pages/deviceDetailLoaderDependencies.test.mjs",
|
|
27
28
|
"test:runtime-zoom": "node --test src/tests/react/utils/runtimeZoom.test.js"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {useMemo} from 'react';
|
|
1
|
+
import React, {useEffect, useMemo, useState} from 'react';
|
|
2
2
|
import {
|
|
3
3
|
ActivityIndicator,
|
|
4
4
|
Platform,
|
|
@@ -25,6 +25,7 @@ import styles from './RuntimeInfoFooter.styles';
|
|
|
25
25
|
import RuntimeFooterMarqueeText from './RuntimeFooterMarqueeText';
|
|
26
26
|
import resolveHomeFooterSpacing from './RuntimeInfoFooter.home.spacing';
|
|
27
27
|
|
|
28
|
+
const ROTATION_INTERVAL_MS = 4000;
|
|
28
29
|
const COMPACT_BREAKPOINT = 720;
|
|
29
30
|
const MAX_INLINE_TEXT_LENGTH = 84;
|
|
30
31
|
const FALLBACK_TEXT_COLOR = '#0f172a';
|
|
@@ -71,6 +72,7 @@ const RuntimeInfoFooter = ({
|
|
|
71
72
|
}) => {
|
|
72
73
|
const {width} = useWindowDimensions();
|
|
73
74
|
const insets = useSafeAreaInsets();
|
|
75
|
+
const [activeIndex, setActiveIndex] = useState(0);
|
|
74
76
|
const allStores = useStores(state => state);
|
|
75
77
|
const deviceConfigStore = useStore('device_config');
|
|
76
78
|
const runtimeDebugStore = useStore('runtime_debug');
|
|
@@ -137,9 +139,10 @@ const RuntimeInfoFooter = ({
|
|
|
137
139
|
}),
|
|
138
140
|
[companyFooterText, primaryText],
|
|
139
141
|
);
|
|
140
|
-
//
|
|
141
|
-
// system text (e.g. "
|
|
142
|
-
// right to left, in a continuous loop
|
|
142
|
+
// Mobile (native): ticker. The text written by the user (company footer) comes
|
|
143
|
+
// first, then the system text (e.g. "Android • MANAGER (ip) / v1.10.x"). Both
|
|
144
|
+
// scroll together, right to left, in a continuous loop.
|
|
145
|
+
// Web: no ticker; the entries alternate every ROTATION_INTERVAL_MS.
|
|
143
146
|
const inlineText = useMemo(
|
|
144
147
|
() => getRuntimeFooterTickerText({companyFooterText, primaryText}),
|
|
145
148
|
[companyFooterText, primaryText],
|
|
@@ -215,12 +218,29 @@ const RuntimeInfoFooter = ({
|
|
|
215
218
|
? 0
|
|
216
219
|
: Math.max(Number(insets.bottom) || 0, 16);
|
|
217
220
|
|
|
221
|
+
const isWeb = Platform.OS === 'web';
|
|
222
|
+
const shouldRotate = isWeb && !showDebugInfo && rotationEntries.length > 1;
|
|
223
|
+
|
|
224
|
+
useEffect(() => {
|
|
225
|
+
if (!shouldRotate) {
|
|
226
|
+
setActiveIndex(0);
|
|
227
|
+
return undefined;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
const intervalId = setInterval(() => {
|
|
231
|
+
setActiveIndex(current => (current + 1) % rotationEntries.length);
|
|
232
|
+
}, ROTATION_INTERVAL_MS);
|
|
233
|
+
|
|
234
|
+
return () => clearInterval(intervalId);
|
|
235
|
+
}, [rotationEntries.length, shouldRotate]);
|
|
236
|
+
|
|
218
237
|
if (rotationEntries.length === 0 && !showDebugInfo) {
|
|
219
238
|
return null;
|
|
220
239
|
}
|
|
221
240
|
|
|
222
241
|
const displayedText =
|
|
223
|
-
|
|
242
|
+
(shouldRotate ? rotationEntries[activeIndex % rotationEntries.length] : inlineText) ||
|
|
243
|
+
primaryText || formatRuntimeFooterIdentifier(device?.id) || '';
|
|
224
244
|
const backgroundColor = colors?.footerBackground;
|
|
225
245
|
const homeSpacing = resolveHomeFooterSpacing(appearance, Platform.OS, insets.bottom);
|
|
226
246
|
const borderColor = colors?.footerBorder;
|
|
@@ -266,7 +286,7 @@ const RuntimeInfoFooter = ({
|
|
|
266
286
|
}
|
|
267
287
|
color={textColor}
|
|
268
288
|
opacity={1}
|
|
269
|
-
continuous
|
|
289
|
+
continuous={!isWeb}
|
|
270
290
|
style={styles.primaryText}
|
|
271
291
|
testID="runtime-footer-primary-text"
|
|
272
292
|
/>
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import React, { useCallback, useEffect, useState } from 'react';
|
|
2
|
+
import { ActivityIndicator, Text, TouchableOpacity, View } from 'react-native';
|
|
3
|
+
import Icon from 'react-native-vector-icons/Feather';
|
|
4
|
+
import { useStore } from '@store';
|
|
5
|
+
import { fetchPeopleConfigs } from './fetchPeopleConfigs';
|
|
6
|
+
|
|
7
|
+
// Attendance contexts served by the company's numbers/mailboxes (app-community#1764).
|
|
8
|
+
// With more than one enabled, the customer's first message gets a simple menu (no AI)
|
|
9
|
+
// and the request opens in the context the customer picks.
|
|
10
|
+
export const CONVERSATION_CONTEXTS_KEY = 'conversation-contexts';
|
|
11
|
+
export const CONVERSATION_CONTEXTS = [
|
|
12
|
+
['support', 'Suporte'],
|
|
13
|
+
['relationship', 'Comercial'],
|
|
14
|
+
];
|
|
15
|
+
const DEFAULT_CONTEXTS = ['support'];
|
|
16
|
+
|
|
17
|
+
export const parseConversationContexts = value => {
|
|
18
|
+
let list = value;
|
|
19
|
+
if (typeof value === 'string') {
|
|
20
|
+
try {
|
|
21
|
+
list = JSON.parse(value);
|
|
22
|
+
} catch (e) {
|
|
23
|
+
list = value.split(',');
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const valid = CONVERSATION_CONTEXTS.map(([key]) => key);
|
|
27
|
+
const keys = (Array.isArray(list) ? list : [])
|
|
28
|
+
.map(item => String(item || '').trim())
|
|
29
|
+
.filter((item, index, all) => valid.includes(item) && all.indexOf(item) === index);
|
|
30
|
+
return keys.length ? keys : DEFAULT_CONTEXTS;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export default function ConversationContextsCard({ peopleIri, styles, brandColors, showError, showSuccess }) {
|
|
34
|
+
const configsStore = useStore('configs');
|
|
35
|
+
const [enabled, setEnabled] = useState(DEFAULT_CONTEXTS);
|
|
36
|
+
const [loading, setLoading] = useState(true);
|
|
37
|
+
const [saving, setSaving] = useState(false);
|
|
38
|
+
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
let active = true;
|
|
41
|
+
setLoading(true);
|
|
42
|
+
fetchPeopleConfigs({ peopleIri, configKeys: [CONVERSATION_CONTEXTS_KEY] })
|
|
43
|
+
.then(items => {
|
|
44
|
+
if (active) setEnabled(parseConversationContexts(items?.[0]?.configValue));
|
|
45
|
+
})
|
|
46
|
+
.catch(() => {})
|
|
47
|
+
.finally(() => {
|
|
48
|
+
if (active) setLoading(false);
|
|
49
|
+
});
|
|
50
|
+
return () => {
|
|
51
|
+
active = false;
|
|
52
|
+
};
|
|
53
|
+
}, [peopleIri]);
|
|
54
|
+
|
|
55
|
+
const toggle = useCallback(async key => {
|
|
56
|
+
const next = enabled.includes(key) ? enabled.filter(item => item !== key) : [...enabled, key];
|
|
57
|
+
if (!next.length) {
|
|
58
|
+
showError?.('Deixe pelo menos um contexto habilitado.');
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const ordered = CONVERSATION_CONTEXTS.map(([item]) => item).filter(item => next.includes(item));
|
|
62
|
+
setSaving(true);
|
|
63
|
+
try {
|
|
64
|
+
await configsStore.actions.addConfigs({
|
|
65
|
+
configKey: CONVERSATION_CONTEXTS_KEY,
|
|
66
|
+
configValue: JSON.stringify(ordered),
|
|
67
|
+
people: peopleIri,
|
|
68
|
+
visibility: 'private',
|
|
69
|
+
});
|
|
70
|
+
setEnabled(ordered);
|
|
71
|
+
showSuccess?.('Contextos de atendimento atualizados.');
|
|
72
|
+
} catch (error) {
|
|
73
|
+
showError?.(error?.message || 'Nao foi possivel salvar os contextos.');
|
|
74
|
+
} finally {
|
|
75
|
+
setSaving(false);
|
|
76
|
+
}
|
|
77
|
+
}, [configsStore, enabled, peopleIri, showError, showSuccess]);
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<View style={{ marginTop: 16 }}>
|
|
81
|
+
<Text style={styles.inputLabel}>Contextos de atendimento</Text>
|
|
82
|
+
{loading ? (
|
|
83
|
+
<ActivityIndicator color={brandColors.primary} />
|
|
84
|
+
) : (
|
|
85
|
+
<View style={{ flexDirection: 'row', gap: 8, marginTop: 6, flexWrap: 'wrap' }}>
|
|
86
|
+
{CONVERSATION_CONTEXTS.map(([key, label]) => {
|
|
87
|
+
const active = enabled.includes(key);
|
|
88
|
+
return (
|
|
89
|
+
<TouchableOpacity
|
|
90
|
+
key={key}
|
|
91
|
+
disabled={saving}
|
|
92
|
+
onPress={() => toggle(key)}
|
|
93
|
+
style={{
|
|
94
|
+
flexDirection: 'row',
|
|
95
|
+
alignItems: 'center',
|
|
96
|
+
gap: 6,
|
|
97
|
+
borderWidth: 1,
|
|
98
|
+
borderColor: active ? brandColors.primary : '#CBD5E1',
|
|
99
|
+
backgroundColor: active ? brandColors.primary : 'transparent',
|
|
100
|
+
borderRadius: 14,
|
|
101
|
+
paddingHorizontal: 12,
|
|
102
|
+
paddingVertical: 6,
|
|
103
|
+
opacity: saving ? 0.6 : 1,
|
|
104
|
+
}}>
|
|
105
|
+
<Icon name={active ? 'check-square' : 'square'} size={14} color={active ? '#FFFFFF' : '#334155'} />
|
|
106
|
+
<Text style={{ color: active ? '#FFFFFF' : '#334155', fontSize: 12 }}>{label}</Text>
|
|
107
|
+
</TouchableOpacity>
|
|
108
|
+
);
|
|
109
|
+
})}
|
|
110
|
+
</View>
|
|
111
|
+
)}
|
|
112
|
+
<Text style={styles.helperText}>
|
|
113
|
+
{enabled.length > 1
|
|
114
|
+
? 'Todos os numeros atendem estes contextos. Na primeira mensagem o cliente recebe um menu e o chamado abre no contexto escolhido.'
|
|
115
|
+
: 'Todos os numeros atendem este contexto: o chamado abre direto nele.'}
|
|
116
|
+
{' '}Com IA configurada, ela atende primeiro e encaminha.
|
|
117
|
+
</Text>
|
|
118
|
+
</View>
|
|
119
|
+
);
|
|
120
|
+
}
|
|
@@ -18,14 +18,10 @@ const FIELDS = [
|
|
|
18
18
|
['smtp_host', 'Servidor SMTP', 'smtp.gmail.com'],
|
|
19
19
|
['smtp_port', 'Porta SMTP', '587'],
|
|
20
20
|
];
|
|
21
|
-
const TYPES = [
|
|
22
|
-
['support', 'Suporte'],
|
|
23
|
-
['relationship', 'Comercial'],
|
|
24
|
-
];
|
|
25
21
|
|
|
26
22
|
export default function EmailConnectionModal({visible, peopleIri, onClose, onSaved}) {
|
|
27
23
|
const connectionsStore = useStore('connections');
|
|
28
|
-
const [form, setForm] = useState({imap_port: '993', smtp_port: '587'
|
|
24
|
+
const [form, setForm] = useState({imap_port: '993', smtp_port: '587'});
|
|
29
25
|
const [saving, setSaving] = useState(false);
|
|
30
26
|
const [error, setError] = useState('');
|
|
31
27
|
const set = key => value => setForm(prev => ({...prev, [key]: value}));
|
|
@@ -40,7 +36,7 @@ export default function EmailConnectionModal({visible, peopleIri, onClose, onSav
|
|
|
40
36
|
setError('');
|
|
41
37
|
try {
|
|
42
38
|
await connectionsStore.actions.saveEmailConnection({...form, people: peopleIri});
|
|
43
|
-
setForm({imap_port: '993', smtp_port: '587'
|
|
39
|
+
setForm({imap_port: '993', smtp_port: '587'});
|
|
44
40
|
onSaved?.();
|
|
45
41
|
} catch (e) {
|
|
46
42
|
setError(e?.message || 'Não foi possível salvar a conexão.');
|
|
@@ -59,13 +55,6 @@ export default function EmailConnectionModal({visible, peopleIri, onClose, onSav
|
|
|
59
55
|
As respostas saem por este endereço.
|
|
60
56
|
</Text>
|
|
61
57
|
<ScrollView style={s.scroll}>
|
|
62
|
-
<View style={s.typeRow}>
|
|
63
|
-
{TYPES.map(([value, label]) => (
|
|
64
|
-
<TouchableOpacity key={value} onPress={() => set('type')(value)} style={[s.chip, form.type === value && s.chipActive]}>
|
|
65
|
-
<Text style={[s.chipText, form.type === value && s.chipTextActive]}>{label}</Text>
|
|
66
|
-
</TouchableOpacity>
|
|
67
|
-
))}
|
|
68
|
-
</View>
|
|
69
58
|
{FIELDS.map(([key, label, placeholder]) => (
|
|
70
59
|
<View key={key} style={s.field}>
|
|
71
60
|
<Text style={s.label}>{label}</Text>
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
buildOfficialProviderConfig,
|
|
21
21
|
} from './whatsAppConnectionHelpers';
|
|
22
22
|
import WhatsAppProviderForm from './WhatsAppProviderForm';
|
|
23
|
+
import ConversationContextsCard from './ConversationContextsCard';
|
|
23
24
|
import { isEmbeddedSignupSupported, launchEmbeddedSignup } from './whatsAppEmbeddedSignup';
|
|
24
25
|
import {
|
|
25
26
|
resolveThemePalette,
|
|
@@ -74,7 +75,6 @@ export default function WhatsAppConnectionPage() {
|
|
|
74
75
|
const [accessToken, setAccessToken] = useState('');
|
|
75
76
|
const [phoneNumberId, setPhoneNumberId] = useState('');
|
|
76
77
|
const [apiVersion, setApiVersion] = useState('v22.0');
|
|
77
|
-
const [connectionType, setConnectionType] = useState('support');
|
|
78
78
|
const [qrValue, setQrValue] = useState('');
|
|
79
79
|
const [connectionStatus, setConnectionStatus] = useState('');
|
|
80
80
|
const [lastRequestedPhone, setLastRequestedPhone] = useState('');
|
|
@@ -192,7 +192,6 @@ export default function WhatsAppConnectionPage() {
|
|
|
192
192
|
accessToken: token,
|
|
193
193
|
phoneNumberId: pnid,
|
|
194
194
|
apiVersion: apiVersion || 'v22.0',
|
|
195
|
-
type: connectionType,
|
|
196
195
|
people: peopleIri,
|
|
197
196
|
name: `WhatsApp Oficial ${pnid}`,
|
|
198
197
|
});
|
|
@@ -207,7 +206,7 @@ export default function WhatsAppConnectionPage() {
|
|
|
207
206
|
} finally {
|
|
208
207
|
setSubmitting(false);
|
|
209
208
|
}
|
|
210
|
-
}, [accessToken, phoneNumberId, apiVersion,
|
|
209
|
+
}, [accessToken, phoneNumberId, apiVersion, connectionsActions, peopleIri, loadConnections, showError, showSuccess]);
|
|
211
210
|
|
|
212
211
|
// Meta Embedded Signup only runs in the browser (Facebook JS SDK popup).
|
|
213
212
|
useEffect(() => {
|
|
@@ -236,7 +235,6 @@ export default function WhatsAppConnectionPage() {
|
|
|
236
235
|
const response = await connectionsActions.completeWhatsappEmbeddedSignup({
|
|
237
236
|
...session,
|
|
238
237
|
coexistence,
|
|
239
|
-
type: connectionType,
|
|
240
238
|
people: peopleIri,
|
|
241
239
|
});
|
|
242
240
|
showSuccess(
|
|
@@ -254,7 +252,7 @@ export default function WhatsAppConnectionPage() {
|
|
|
254
252
|
} finally {
|
|
255
253
|
setSubmitting(false);
|
|
256
254
|
}
|
|
257
|
-
}, [embeddedSignupConfig, connectionsActions,
|
|
255
|
+
}, [embeddedSignupConfig, connectionsActions, peopleIri, loadConnections, showError, showSuccess]);
|
|
258
256
|
|
|
259
257
|
const handlePrimaryAction = useCallback(async () => {
|
|
260
258
|
if (providerMode === PROVIDER_OFFICIAL) {
|
|
@@ -419,27 +417,13 @@ export default function WhatsAppConnectionPage() {
|
|
|
419
417
|
onEmbeddedSignup={handleEmbeddedSignup}
|
|
420
418
|
/>
|
|
421
419
|
|
|
422
|
-
<
|
|
423
|
-
{
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
borderColor: connectionType === value ? brandColors.primary : '#CBD5E1',
|
|
430
|
-
backgroundColor: connectionType === value ? brandColors.primary : 'transparent',
|
|
431
|
-
borderRadius: 14,
|
|
432
|
-
paddingHorizontal: 12,
|
|
433
|
-
paddingVertical: 6,
|
|
434
|
-
}}>
|
|
435
|
-
<Text style={{ color: connectionType === value ? '#FFFFFF' : '#334155', fontSize: 12 }}>{label}</Text>
|
|
436
|
-
</TouchableOpacity>
|
|
437
|
-
))}
|
|
438
|
-
</View>
|
|
439
|
-
<Text style={styles.helperText}>
|
|
440
|
-
Sem IA configurada, as conversas deste numero vao para {connectionType === 'support' ? 'Suporte' : 'o CRM'}.
|
|
441
|
-
Com IA, ela atende primeiro e encaminha.
|
|
442
|
-
</Text>
|
|
420
|
+
<ConversationContextsCard
|
|
421
|
+
peopleIri={peopleIri}
|
|
422
|
+
styles={styles}
|
|
423
|
+
brandColors={brandColors}
|
|
424
|
+
showError={showError}
|
|
425
|
+
showSuccess={showSuccess}
|
|
426
|
+
/>
|
|
443
427
|
{providerMode === PROVIDER_OFFICIAL ? (
|
|
444
428
|
<Text style={styles.helperText}>
|
|
445
429
|
Webhook no app Meta: https://api.controleonline.com/webhook/whatsapp-cloud (campo messages).
|
|
@@ -516,10 +500,6 @@ export default function WhatsAppConnectionPage() {
|
|
|
516
500
|
<Text style={styles.connectionMetaLabel}>Telefone</Text>
|
|
517
501
|
<Text style={styles.connectionMetaValue}>{item.phoneLabel}</Text>
|
|
518
502
|
</View>
|
|
519
|
-
<View style={styles.connectionMetaItem}>
|
|
520
|
-
<Text style={styles.connectionMetaLabel}>Tipo</Text>
|
|
521
|
-
<Text style={styles.connectionMetaValue}>{item.type}</Text>
|
|
522
|
-
</View>
|
|
523
503
|
</View>
|
|
524
504
|
|
|
525
505
|
<View style={styles.connectionMetaRow}>
|
|
@@ -56,7 +56,6 @@ export const normalizeConnection = item => {
|
|
|
56
56
|
? item?.status?.status || item?.status?.name
|
|
57
57
|
: item?.status) || 'Pendente',
|
|
58
58
|
statusIri: resolveStatusIri(item?.status),
|
|
59
|
-
type: item?.type || 'Nenhum',
|
|
60
59
|
channel,
|
|
61
60
|
provider: channel,
|
|
62
61
|
phone: item?.phone || {},
|
|
@@ -34,7 +34,6 @@ export const saveOfficialWhatsappConnection = ({ commit }, params = {}) => {
|
|
|
34
34
|
const body = {
|
|
35
35
|
name: params.name || `WA Oficial ${params.phoneNumberId || ""}`.trim().slice(0, 50),
|
|
36
36
|
channel: "whatsapp_official",
|
|
37
|
-
type: params.type || "relationship",
|
|
38
37
|
people: params.people,
|
|
39
38
|
channelConfig: JSON.stringify({
|
|
40
39
|
access_token: params.accessToken,
|
|
@@ -81,7 +80,6 @@ export const saveEmailConnection = ({ commit }, params = {}) => {
|
|
|
81
80
|
const body = {
|
|
82
81
|
name: params.name || `E-mail ${params.from_address || ''}`.trim(),
|
|
83
82
|
channel: 'email',
|
|
84
|
-
type: params.type || 'support',
|
|
85
83
|
people: params.people,
|
|
86
84
|
channelConfig: JSON.stringify({
|
|
87
85
|
from_address: params.from_address,
|
|
@@ -134,7 +132,6 @@ export const completeWhatsappEmbeddedSignup = ({ commit }, params = {}) => {
|
|
|
134
132
|
waba_id: params.wabaId,
|
|
135
133
|
phone_number_id: params.phoneNumberId,
|
|
136
134
|
coexistence: !!params.coexistence,
|
|
137
|
-
type: params.type || null,
|
|
138
135
|
connection: params.connection || null,
|
|
139
136
|
},
|
|
140
137
|
})
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import {readFileSync} from 'node:fs';
|
|
4
|
+
|
|
5
|
+
const source = readFileSync(
|
|
6
|
+
new URL('../../../react/components/RuntimeInfoFooter.js', import.meta.url),
|
|
7
|
+
'utf8',
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
test('footer rotates every 4s only on web', () => {
|
|
11
|
+
assert.match(source, /ROTATION_INTERVAL_MS = 4000/);
|
|
12
|
+
assert.match(source, /const isWeb = Platform\.OS === 'web'/);
|
|
13
|
+
assert.match(source, /shouldRotate = isWeb && !showDebugInfo && rotationEntries\.length > 1/);
|
|
14
|
+
assert.match(source, /setInterval\([\s\S]*ROTATION_INTERVAL_MS\)/);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
test('footer is a continuous ticker only on mobile (native)', () => {
|
|
18
|
+
assert.match(source, /continuous=\{!isWeb\}/);
|
|
19
|
+
assert.match(source, /getRuntimeFooterTickerText/);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test('footer hooks run before the early return', () => {
|
|
23
|
+
assert.ok(source.indexOf('useEffect(() => {\n if (!shouldRotate)') < source.indexOf('if (rotationEntries.length === 0 && !showDebugInfo)'));
|
|
24
|
+
});
|