@controleonline/ui-common 1.2.71 → 1.2.76
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/actions/workers/manager/action.yml +147 -0
- package/.github/actions/workers/qa/action.yml +44 -0
- package/.github/actions/workers/security/action.yml +44 -0
- package/.github/actions/workers/technical-documenter/action.yml +51 -0
- package/.github/workflows/manager-worker.yml +168 -0
- package/.github/workflows/publish-npm.yml +45 -0
- package/.gitmodules +3 -0
- package/AGENTS.md +6 -0
- package/README.md +14 -0
- package/package.json +3 -2
- package/src/api/fetch.js +1 -1
- package/src/api/index.js +92 -22
- package/src/react/components/AddImportModal.js +94 -110
- package/src/react/components/BottomNavigationBar.config.js +211 -231
- package/src/react/components/CategoryForm.js +52 -35
- package/src/react/components/DefaultProvider.native.js +131 -95
- package/src/react/components/DefaultProvider.web.js +148 -74
- package/src/react/components/NetworkPrinterPreviewModal.js +249 -0
- package/src/react/components/NetworkPrinterPreviewModal.styles.js +159 -0
- package/src/react/components/RuntimeInfoFooter.js +164 -104
- package/src/react/components/RuntimeInfoFooter.styles.js +3 -0
- package/src/react/components/UnifiedPaymentBar.js +7 -4
- package/src/react/components/UserAvatar.js +160 -0
- package/src/react/components/integrations/IntegrationHero/index.js +48 -0
- package/src/react/components/integrations/IntegrationHero/styles.js +57 -0
- package/src/react/components/integrations/IntegrationTabs/index.js +89 -0
- package/src/react/components/integrations/IntegrationTabs/styles.js +44 -0
- package/src/react/config/deviceConfigBootstrap.js +5 -3
- package/src/react/pages/Connections.js +229 -0
- package/src/react/pages/Connections.styles.js +222 -0
- package/src/react/pages/DeviceDetailPage.js +2865 -0
- package/src/react/pages/DeviceDetailPage.styles.js +308 -0
- package/src/react/pages/Devices/currentDevice.js +194 -0
- package/src/react/pages/Devices/deviceTypes/DeviceGroupCard.js +257 -0
- package/src/react/pages/Devices/deviceTypes/all.js +23 -0
- package/src/react/pages/Devices/deviceTypes/device.js +25 -0
- package/src/react/pages/Devices/deviceTypes/deviceListHelpers.js +178 -0
- package/src/react/pages/Devices/deviceTypes/display.js +26 -0
- package/src/react/pages/Devices/deviceTypes/index.js +145 -0
- package/src/react/pages/Devices/deviceTypes/ipCamera.js +35 -0
- package/src/react/pages/Devices/deviceTypes/pdv.js +88 -0
- package/src/react/pages/Devices/deviceTypes/printer.js +37 -0
- package/src/react/pages/Devices/deviceTypes/shared.js +453 -0
- package/src/react/pages/Devices/deviceTypes/useDeviceNetworkConnectivity.js +145 -0
- package/src/react/pages/Devices.js +183 -0
- package/src/react/pages/Devices.styles.js +353 -0
- package/src/react/pages/Food99IntegrationPage/components/Food99CatalogTab.js +219 -0
- package/src/react/pages/Food99IntegrationPage/components/Food99OverviewTab.js +134 -0
- package/src/react/pages/Food99IntegrationPage/components/Food99PreviewModal.js +173 -0
- package/src/react/pages/Food99IntegrationPage/components/Food99ProductCard.js +1 -0
- package/src/react/pages/Food99IntegrationPage/components/Food99QuickWalletModal.js +181 -0
- package/src/react/pages/Food99IntegrationPage/components/Food99SettingsTab.js +306 -0
- package/src/react/pages/Food99IntegrationPage/components/Food99StoreTab.js +417 -0
- package/src/react/pages/Food99IntegrationPage/index.js +1530 -0
- package/src/react/pages/Food99IntegrationPage/styles.js +792 -0
- package/src/react/pages/Food99IntegrationPage/utils.js +155 -0
- package/src/react/pages/Food99IntegrationPage.js +1 -0
- package/src/react/pages/Food99IntegrationPage.styles.js +1 -0
- package/src/react/pages/GenericLogPage.js +42 -167
- package/src/react/pages/IFoodIntegrationPage/components/IFoodCatalogTab.js +8 -0
- package/src/react/pages/IFoodIntegrationPage/components/IFoodOperationsTab.js +420 -0
- package/src/react/pages/IFoodIntegrationPage/components/IFoodOverviewTab.js +118 -0
- package/src/react/pages/IFoodIntegrationPage/components/IFoodPreviewModal.js +103 -0
- package/src/react/pages/IFoodIntegrationPage/components/IFoodProductCard.js +1 -0
- package/src/react/pages/IFoodIntegrationPage/components/IFoodStoreTab.js +150 -0
- package/src/react/pages/IFoodIntegrationPage/index.js +1298 -0
- package/src/react/pages/IFoodIntegrationPage/styles.js +764 -0
- package/src/react/pages/IFoodIntegrationPage/utils.js +91 -0
- package/src/react/pages/IFoodIntegrationPage.js +1 -0
- package/src/react/pages/IFoodIntegrationPage.styles.js +1 -0
- package/src/react/pages/Imports.js +214 -166
- package/src/react/pages/IntegrationConfigPage.js +744 -0
- package/src/react/pages/IntegrationConfigPage.styles.js +269 -0
- package/src/react/pages/Integrations.js +299 -0
- package/src/react/pages/Integrations.styles.js +130 -0
- package/src/react/pages/ManagerOrderNotificationsPage.js +642 -0
- package/src/react/pages/MarketplaceIntegrationPage/components/MarketplaceProductCard.js +205 -0
- package/src/react/pages/MarketplaceIntegrationPage/components/RemoteMarketplaceMenuTab.js +335 -0
- package/src/react/pages/MarketplaceIntegrationPage/index.js +60 -0
- package/src/react/pages/MarketplaceIntegrationPage/utils.js +137 -0
- package/src/react/pages/MercadoLivreIntegrationPage.js +538 -0
- package/src/react/pages/PrinterDeviceDetailPage.js +1916 -0
- package/src/react/pages/PrinterDeviceDetailPage.styles.js +223 -0
- package/src/react/pages/PrinterDeviceFormPage.js +521 -0
- package/src/react/pages/PrinterDeviceFormPage.styles.js +159 -0
- package/src/react/pages/WhatsAppConnectionPage.js +459 -0
- package/src/react/pages/WhatsAppConnectionPage.styles.js +284 -0
- package/src/react/pages/integrationsCatalog.js +399 -0
- package/src/react/services/Cielo/Cielo.js +193 -193
- package/src/react/utils/categoryContexts.js +46 -0
- package/src/react/utils/entityDisplay.js +222 -217
- package/src/react/utils/fileUrl.js +39 -20
- package/src/react/utils/integrationPage.js +16 -0
- package/src/react/utils/runtimeFooter.js +40 -22
- package/src/react/utils/runtimeLanguage.js +50 -9
- package/src/react/utils/runtimeMenu.js +191 -131
- package/src/react/utils/runtimeZoom.js +43 -0
- package/src/react/utils/shopConfig.js +27 -15
- package/src/react/utils/shopFranchises.js +126 -1
- package/src/react/utils/storeColumns.js +23 -4
- package/src/react/utils/userAvatar.js +104 -0
- package/src/store/categories/index.js +48 -20
- package/src/store/device_config/index.js +62 -21
- package/src/store/entity_log/index.js +22 -1
- package/src/store/imports/customActions.js +51 -0
- package/src/store/imports/index.js +89 -88
- package/src/store/status/index.js +11 -11
- package/src/store/themes/index.js +22 -0
- package/src/store/timezones/index.js +3 -1
- package/src/tests/browser/manager/connections.spec.js +143 -0
- package/src/tests/browser/manager/devices-current.spec.js +343 -0
- package/src/tests/browser/manager/mercado-livre-integration.spec.js +268 -0
- package/src/tests/react/api/deviceHeaders.test.js +114 -0
- package/src/tests/react/components/AddImportModal.test.js +166 -0
- package/src/tests/react/components/BottomNavigationBar.config.test.js +20 -0
- package/src/tests/react/components/UserAvatar.test.js +52 -0
- package/src/tests/react/pages/DevicePickerStyles.test.js +47 -0
- package/src/tests/react/pages/Devices/deviceListHelpers.test.js +39 -0
- package/src/tests/react/pages/DevicesCurrentDevice.test.js +198 -0
- package/src/tests/react/pages/connectionsHelpers.test.js +34 -0
- package/src/tests/react/pages/mercadoLivreIntegrationPageContract.test.mjs +16 -0
- package/src/tests/react/services/Cielo.test.js +190 -190
- package/src/tests/react/store/categoriesOrdering.test.js +26 -0
- package/src/tests/react/utils/appDomain.test.js +62 -0
- package/src/tests/react/utils/entityDisplay.test.js +2 -2
- package/src/tests/react/utils/fileUrl.test.js +3 -3
- package/src/tests/react/utils/formatter.test.mjs +33 -0
- package/src/tests/react/utils/runtimeFooter.test.js +29 -4
- package/src/tests/react/utils/runtimeLanguage.test.js +79 -9
- package/src/tests/react/utils/runtimeMenu.test.js +198 -134
- package/src/tests/react/utils/runtimeZoom.test.js +38 -0
- package/src/tests/react/utils/shopConfig.test.js +10 -9
- package/src/tests/react/utils/shopFranchises.test.js +43 -0
- package/src/tests/react/utils/translate.discovery.test.mjs +170 -0
- package/src/tests/react/utils/translate.test.helpers.mjs +152 -0
- package/src/tests/react/utils/translate.test.mjs +141 -349
- package/src/tests/react/utils/userAvatar.test.js +63 -0
- package/src/utils/appDomain.js +15 -4
- package/src/utils/formatter.js +104 -16
- package/src/utils/integrationConfigs.js +80 -80
- package/src/utils/translate.js +222 -438
- package/src/utils/translateDiscovery.js +96 -0
- package/src/utils/translateNormalize.js +33 -0
- package/src/utils/translatePending.js +92 -0
- package/src/utils/translateStorage.js +142 -0
- package/.github/agents/developer.agent.md +0 -30
- package/.github/agents/devops.agent.md +0 -30
- package/.github/agents/qa.agent.md +0 -30
- package/.github/agents/security.agent.md +0 -30
- package/.github/workflows/npmjs.yml +0 -35
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ActivityIndicator, Text, TextInput, TouchableOpacity, View } from 'react-native';
|
|
3
|
+
import Icon from 'react-native-vector-icons/Feather';
|
|
4
|
+
import { colors } from '@controleonline/../../src/styles/colors';
|
|
5
|
+
|
|
6
|
+
import { withOpacity } from '@controleonline/../../src/styles/branding';
|
|
7
|
+
|
|
8
|
+
import styles from '../styles';
|
|
9
|
+
|
|
10
|
+
// Aba responsável pela conexão da empresa com a loja remota do iFood.
|
|
11
|
+
export default function IFoodStoreTab({
|
|
12
|
+
shadowStyle,
|
|
13
|
+
accentColor,
|
|
14
|
+
stores,
|
|
15
|
+
merchantIdInput,
|
|
16
|
+
setMerchantIdInput,
|
|
17
|
+
ifoodCode,
|
|
18
|
+
selectedStore,
|
|
19
|
+
connected,
|
|
20
|
+
actionLoading,
|
|
21
|
+
onConnect,
|
|
22
|
+
onDisconnect,
|
|
23
|
+
onSync,
|
|
24
|
+
palette = colors,
|
|
25
|
+
}) {
|
|
26
|
+
return (
|
|
27
|
+
<View style={[styles.sectionCard, shadowStyle]}>
|
|
28
|
+
<Text style={styles.sectionTitle}>Lojas disponiveis no iFood</Text>
|
|
29
|
+
|
|
30
|
+
<View style={styles.helperRow}>
|
|
31
|
+
<Text style={styles.helperText}>
|
|
32
|
+
Escolha uma loja sugerida pela API ou informe manualmente o `merchant_id` para concluir a vinculacao.
|
|
33
|
+
</Text>
|
|
34
|
+
</View>
|
|
35
|
+
|
|
36
|
+
{stores.length > 0 ? (
|
|
37
|
+
<View style={styles.storesList}>
|
|
38
|
+
{stores.map(store => {
|
|
39
|
+
const storeId = String(store?.merchant_id || '');
|
|
40
|
+
const selected = storeId !== '' && (storeId === merchantIdInput || storeId === ifoodCode);
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<TouchableOpacity
|
|
44
|
+
key={storeId}
|
|
45
|
+
activeOpacity={0.9}
|
|
46
|
+
style={[styles.storeCard, selected && styles.storeCardSelected]}
|
|
47
|
+
onPress={() => setMerchantIdInput(storeId)}>
|
|
48
|
+
<View style={styles.storeTop}>
|
|
49
|
+
<Text style={styles.storeName}>{store?.name || `Loja ${storeId}`}</Text>
|
|
50
|
+
<View
|
|
51
|
+
style={[
|
|
52
|
+
styles.storeStatusChip,
|
|
53
|
+
{
|
|
54
|
+
backgroundColor: withOpacity(
|
|
55
|
+
store?.status === 'AVAILABLE' ? palette.success : palette.textSecondary,
|
|
56
|
+
0.14,
|
|
57
|
+
),
|
|
58
|
+
},
|
|
59
|
+
]}>
|
|
60
|
+
<Text
|
|
61
|
+
style={[
|
|
62
|
+
styles.storeStatusText,
|
|
63
|
+
{ color: store?.status === 'AVAILABLE' ? palette.success : palette.textSecondary },
|
|
64
|
+
]}>
|
|
65
|
+
{store?.status_label || 'Indefinido'}
|
|
66
|
+
</Text>
|
|
67
|
+
</View>
|
|
68
|
+
</View>
|
|
69
|
+
|
|
70
|
+
<Text style={styles.storeCode}>código: {storeId}</Text>
|
|
71
|
+
</TouchableOpacity>
|
|
72
|
+
);
|
|
73
|
+
})}
|
|
74
|
+
</View>
|
|
75
|
+
) : (
|
|
76
|
+
<View style={styles.emptyStores}>
|
|
77
|
+
<Text style={styles.emptyStoresText}>
|
|
78
|
+
Nenhuma loja retornada pela API iFood. Voce ainda pode conectar manualmente por `merchant_id`.
|
|
79
|
+
</Text>
|
|
80
|
+
</View>
|
|
81
|
+
)}
|
|
82
|
+
|
|
83
|
+
<Text style={styles.inputLabel}>Código iFood para vinculação</Text>
|
|
84
|
+
<TextInput
|
|
85
|
+
value={merchantIdInput}
|
|
86
|
+
onChangeText={setMerchantIdInput}
|
|
87
|
+
placeholder="Ex.: c1111111-aaaa-bbbb-cccc-222222222222"
|
|
88
|
+
placeholderTextColor={palette.textSecondary}
|
|
89
|
+
style={styles.input}
|
|
90
|
+
autoCapitalize="none"
|
|
91
|
+
autoCorrect={false}
|
|
92
|
+
/>
|
|
93
|
+
|
|
94
|
+
<View style={styles.actionsRow}>
|
|
95
|
+
<TouchableOpacity
|
|
96
|
+
activeOpacity={0.9}
|
|
97
|
+
style={[styles.actionButton, { backgroundColor: accentColor }]}
|
|
98
|
+
onPress={onConnect}
|
|
99
|
+
disabled={actionLoading !== null}>
|
|
100
|
+
{actionLoading === 'connect' ? (
|
|
101
|
+
<ActivityIndicator color={palette.white} size="small" />
|
|
102
|
+
) : (
|
|
103
|
+
<>
|
|
104
|
+
<Icon name="link" size={16} color={palette.white} />
|
|
105
|
+
<Text style={styles.actionButtonText}>Conectar</Text>
|
|
106
|
+
</>
|
|
107
|
+
)}
|
|
108
|
+
</TouchableOpacity>
|
|
109
|
+
|
|
110
|
+
<TouchableOpacity
|
|
111
|
+
activeOpacity={0.9}
|
|
112
|
+
style={[styles.actionButtonSecondary, !connected && styles.actionButtonSecondaryDisabled]}
|
|
113
|
+
onPress={onDisconnect}
|
|
114
|
+
disabled={actionLoading !== null || !connected}>
|
|
115
|
+
{actionLoading === 'disconnect' ? (
|
|
116
|
+
<ActivityIndicator color={palette.error} size="small" />
|
|
117
|
+
) : (
|
|
118
|
+
<>
|
|
119
|
+
<Icon name="x-circle" size={16} color={palette.error} />
|
|
120
|
+
<Text style={styles.actionButtonSecondaryText}>Desconectar</Text>
|
|
121
|
+
</>
|
|
122
|
+
)}
|
|
123
|
+
</TouchableOpacity>
|
|
124
|
+
</View>
|
|
125
|
+
|
|
126
|
+
<TouchableOpacity
|
|
127
|
+
activeOpacity={0.9}
|
|
128
|
+
style={[styles.syncButton, { borderColor: accentColor }]}
|
|
129
|
+
onPress={onSync}
|
|
130
|
+
disabled={actionLoading !== null}>
|
|
131
|
+
{actionLoading === 'sync' ? (
|
|
132
|
+
<ActivityIndicator color={accentColor} size="small" />
|
|
133
|
+
) : (
|
|
134
|
+
<>
|
|
135
|
+
<Icon name="refresh-cw" size={16} color={accentColor} />
|
|
136
|
+
<Text style={[styles.syncButtonText, { color: accentColor }]}>Sincronizar estado remoto</Text>
|
|
137
|
+
</>
|
|
138
|
+
)}
|
|
139
|
+
</TouchableOpacity>
|
|
140
|
+
|
|
141
|
+
{!!selectedStore && (
|
|
142
|
+
<View style={styles.selectedStoreBox}>
|
|
143
|
+
<Text style={styles.selectedStoreTitle}>Loja selecionada</Text>
|
|
144
|
+
<Text style={styles.selectedStoreText}>{selectedStore?.name || 'Sem nome'}</Text>
|
|
145
|
+
<Text style={styles.selectedStoreText}>código: {selectedStore?.merchant_id}</Text>
|
|
146
|
+
</View>
|
|
147
|
+
)}
|
|
148
|
+
</View>
|
|
149
|
+
);
|
|
150
|
+
}
|