@controleonline/ui-common 1.2.71 → 1.2.75
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 +100 -36
- 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 +2814 -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
|
@@ -19,19 +19,22 @@ import DeliveryPushBridge from '@controleonline/ui-common/src/react/components/D
|
|
|
19
19
|
import ManagerPushBridge from '@controleonline/ui-common/src/react/components/ManagerPushBridge';
|
|
20
20
|
import PrintService from '@controleonline/ui-common/src/react/components/PrintService';
|
|
21
21
|
import RemoteCheckoutService from '@controleonline/ui-common/src/react/components/RemoteCheckoutService';
|
|
22
|
-
import ProductCatalogCacheService from '@controleonline/ui-common/src/react/components/ProductCatalogCacheService';
|
|
23
|
-
import RuntimeInfoFooter from '@controleonline/ui-common/src/react/components/RuntimeInfoFooter';
|
|
22
|
+
import ProductCatalogCacheService from '@controleonline/ui-common/src/react/components/ProductCatalogCacheService';
|
|
23
|
+
import RuntimeInfoFooter from '@controleonline/ui-common/src/react/components/RuntimeInfoFooter';
|
|
24
24
|
import {isPublicRoute} from '../router/publicRoutes';
|
|
25
|
-
import {api} from '@controleonline/ui-common/src/api';
|
|
25
|
+
import {api} from '@controleonline/ui-common/src/api';
|
|
26
26
|
import {app_type} from '@appType';
|
|
27
|
-
import {
|
|
28
|
-
const {
|
|
27
|
+
import {env as APP_ENV} from '@env';
|
|
28
|
+
const {
|
|
29
|
+
buildTranslationBootstrapKey,
|
|
30
|
+
isTranslationBootstrapReady,
|
|
31
|
+
resolveConfiguredLanguage,
|
|
32
|
+
} = require('../utils/runtimeLanguage');
|
|
29
33
|
import {
|
|
30
34
|
applyPaletteToRuntimeColors,
|
|
31
35
|
applyThemeCssVariables,
|
|
32
36
|
resolveThemePalette,
|
|
33
37
|
} from '@controleonline/../../src/styles/branding';
|
|
34
|
-
import {resolveAppDomain} from '@controleonline/ui-common/src/utils/appDomain';
|
|
35
38
|
import {colors as runtimeColors} from '@controleonline/../../src/styles/colors';
|
|
36
39
|
import {
|
|
37
40
|
buildProviderManagedDeviceConfigs,
|
|
@@ -50,6 +53,9 @@ import {
|
|
|
50
53
|
import {
|
|
51
54
|
normalizeRuntimeMenuResponse,
|
|
52
55
|
} from '@controleonline/ui-common/src/react/utils/runtimeMenu';
|
|
56
|
+
import {
|
|
57
|
+
buildRuntimeZoomStyle,
|
|
58
|
+
} from '@controleonline/ui-common/src/react/utils/runtimeZoom';
|
|
53
59
|
import packageJson from '@package';
|
|
54
60
|
import providerStyles from './DefaultProvider.styles';
|
|
55
61
|
|
|
@@ -98,7 +104,11 @@ const resolveDeviceConfigPeopleIri = ({appType, currentCompany, user}) => {
|
|
|
98
104
|
return '';
|
|
99
105
|
};
|
|
100
106
|
|
|
101
|
-
export const DefaultProvider = ({
|
|
107
|
+
export const DefaultProvider = ({
|
|
108
|
+
children,
|
|
109
|
+
currentRouteName = '',
|
|
110
|
+
onBootstrapReady,
|
|
111
|
+
}) => {
|
|
102
112
|
const appType = String(app_type || '').toUpperCase();
|
|
103
113
|
const isShopClientApp = appType === 'SHOP';
|
|
104
114
|
const themeStore = useStore('theme');
|
|
@@ -133,12 +143,13 @@ export const DefaultProvider = ({children, onBootstrapReady}) => {
|
|
|
133
143
|
const {isLogged, sessionChecked, user} = authGetters;
|
|
134
144
|
const hasCurrentCompany =
|
|
135
145
|
!!currentCompany && Object.entries(currentCompany).length > 0;
|
|
136
|
-
const [translateReady, setTranslateReady] = useState(
|
|
146
|
+
const [translateReady, setTranslateReady] = useState(false);
|
|
147
|
+
const [activeTranslateBootstrapKey, setActiveTranslateBootstrapKey] =
|
|
148
|
+
useState('');
|
|
137
149
|
const [deviceConfigFetched, setDeviceConfigFetched] = useState(false);
|
|
138
150
|
const [mainConfigsDiscovered, setMainConfigsDiscovered] = useState(false);
|
|
139
151
|
const [deviceRuntimeConfigSynced, setDeviceRuntimeConfigSynced] =
|
|
140
152
|
useState(false);
|
|
141
|
-
const [currentRouteName, setCurrentRouteName] = useState('');
|
|
142
153
|
const [appState, setAppState] = useState(AppState.currentState || 'active');
|
|
143
154
|
const [, setTranslateVersion] = useState(0);
|
|
144
155
|
const [baseThemeColors, setBaseThemeColors] = useState({});
|
|
@@ -154,12 +165,48 @@ export const DefaultProvider = ({children, onBootstrapReady}) => {
|
|
|
154
165
|
appType: app_type,
|
|
155
166
|
deviceInfo: device || {},
|
|
156
167
|
});
|
|
168
|
+
const runtimeUiScaleStyle = useMemo(
|
|
169
|
+
() => buildRuntimeZoomStyle(APP_ENV?.ZOOM),
|
|
170
|
+
[],
|
|
171
|
+
);
|
|
157
172
|
const deviceConfigPeopleIri = resolveDeviceConfigPeopleIri({
|
|
158
173
|
appType,
|
|
159
174
|
currentCompany,
|
|
160
175
|
user,
|
|
161
176
|
});
|
|
162
177
|
const isPublicRouteActive = isPublicRoute(currentRouteName);
|
|
178
|
+
const currentTranslationConfig = JSON.parse(
|
|
179
|
+
localStorage.getItem('config') || '{}',
|
|
180
|
+
);
|
|
181
|
+
const currentTranslationSession = JSON.parse(
|
|
182
|
+
localStorage.getItem('session') || '{}',
|
|
183
|
+
);
|
|
184
|
+
const configuredTranslationLanguage = resolveConfiguredLanguage({
|
|
185
|
+
currentCompany,
|
|
186
|
+
defaultCompany,
|
|
187
|
+
currentConfig: currentTranslationConfig,
|
|
188
|
+
sessionData: currentTranslationSession,
|
|
189
|
+
});
|
|
190
|
+
const expectedTranslateBootstrapKey = isLogged && hasCurrentCompany
|
|
191
|
+
? buildTranslationBootstrapKey({
|
|
192
|
+
language: configuredTranslationLanguage,
|
|
193
|
+
currentCompanyId: normalizeEntityId(currentCompany?.id),
|
|
194
|
+
defaultCompanyId: normalizeEntityId(defaultCompany?.id),
|
|
195
|
+
})
|
|
196
|
+
: '';
|
|
197
|
+
const requiresTranslateBootstrap = Boolean(
|
|
198
|
+
isLogged &&
|
|
199
|
+
hasCurrentCompany &&
|
|
200
|
+
currentRouteName &&
|
|
201
|
+
!isPublicRouteActive,
|
|
202
|
+
);
|
|
203
|
+
const isTranslateBootstrapReady = isTranslationBootstrapReady({
|
|
204
|
+
activeKey: activeTranslateBootstrapKey,
|
|
205
|
+
expectedKey: expectedTranslateBootstrapKey,
|
|
206
|
+
required: requiresTranslateBootstrap,
|
|
207
|
+
ready: translateReady,
|
|
208
|
+
translator: global.t,
|
|
209
|
+
});
|
|
163
210
|
const shouldRunForegroundRealtimeServices =
|
|
164
211
|
Platform.OS !== 'android' || appState === 'active';
|
|
165
212
|
const registerBottomNavigation = useCallback(() => {
|
|
@@ -226,30 +273,13 @@ export const DefaultProvider = ({children, onBootstrapReady}) => {
|
|
|
226
273
|
};
|
|
227
274
|
}, []);
|
|
228
275
|
|
|
229
|
-
useEffect(() => {
|
|
230
|
-
global.setRuntimeRouteName = routeName => {
|
|
231
|
-
const normalizedRouteName = String(routeName || '').trim();
|
|
232
|
-
|
|
233
|
-
setCurrentRouteName(previousRouteName =>
|
|
234
|
-
previousRouteName === normalizedRouteName
|
|
235
|
-
? previousRouteName
|
|
236
|
-
: normalizedRouteName,
|
|
237
|
-
);
|
|
238
|
-
};
|
|
239
|
-
|
|
240
|
-
return () => {
|
|
241
|
-
if (global.setRuntimeRouteName) {
|
|
242
|
-
delete global.setRuntimeRouteName;
|
|
243
|
-
}
|
|
244
|
-
};
|
|
245
|
-
}, []);
|
|
246
|
-
|
|
247
276
|
useEffect(() => {
|
|
248
277
|
if (isLogged && !isPublicRouteActive) {
|
|
249
278
|
return;
|
|
250
279
|
}
|
|
251
280
|
|
|
252
281
|
setTranslateReady(true);
|
|
282
|
+
setActiveTranslateBootstrapKey('');
|
|
253
283
|
translateBootstrapKeyRef.current = '';
|
|
254
284
|
translateActions.setMessages({});
|
|
255
285
|
translateActions.setPendingMessages?.({});
|
|
@@ -257,7 +287,7 @@ export const DefaultProvider = ({children, onBootstrapReady}) => {
|
|
|
257
287
|
if (global.t) {
|
|
258
288
|
delete global.t;
|
|
259
289
|
}
|
|
260
|
-
}, [isLogged, isPublicRouteActive]);
|
|
290
|
+
}, [isLogged, isPublicRouteActive, translateActions]);
|
|
261
291
|
|
|
262
292
|
useEffect(() => {
|
|
263
293
|
const subscription = AppState.addEventListener('change', nextState => {
|
|
@@ -642,58 +672,49 @@ export const DefaultProvider = ({children, onBootstrapReady}) => {
|
|
|
642
672
|
}
|
|
643
673
|
}, [currentCompany, isLogged, mainConfigsDiscovered]);
|
|
644
674
|
|
|
645
|
-
useEffect(() => {
|
|
646
|
-
if (
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
!
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
if (currentConfig.language !== configuredLanguage) {
|
|
689
|
-
const nextConfig = {...currentConfig, language: configuredLanguage};
|
|
690
|
-
localStorage.setItem(
|
|
691
|
-
'config',
|
|
692
|
-
JSON.stringify(nextConfig),
|
|
693
|
-
);
|
|
694
|
-
}
|
|
695
|
-
|
|
696
|
-
translateBootstrapKeyRef.current = nextTranslateBootstrapKey;
|
|
675
|
+
useEffect(() => {
|
|
676
|
+
if (!currentRouteName || isPublicRouteActive) {
|
|
677
|
+
return;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
if (
|
|
681
|
+
!isLogged ||
|
|
682
|
+
!hasCurrentCompany ||
|
|
683
|
+
!deviceConfigFetched ||
|
|
684
|
+
!expectedTranslateBootstrapKey
|
|
685
|
+
) {
|
|
686
|
+
return;
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
const currentConfig = JSON.parse(localStorage.getItem('config') || '{}');
|
|
690
|
+
|
|
691
|
+
if (
|
|
692
|
+
translateBootstrapKeyRef.current === expectedTranslateBootstrapKey &&
|
|
693
|
+
global.t
|
|
694
|
+
) {
|
|
695
|
+
global.t.companies = companies;
|
|
696
|
+
global.t.currentCompany = currentCompany;
|
|
697
|
+
global.t.defaultCompany = defaultCompany;
|
|
698
|
+
setActiveTranslateBootstrapKey(expectedTranslateBootstrapKey);
|
|
699
|
+
setTranslateReady(true);
|
|
700
|
+
|
|
701
|
+
return;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
setTranslateReady(false);
|
|
705
|
+
|
|
706
|
+
if (currentConfig.language !== configuredTranslationLanguage) {
|
|
707
|
+
const nextConfig = {
|
|
708
|
+
...currentConfig,
|
|
709
|
+
language: configuredTranslationLanguage,
|
|
710
|
+
};
|
|
711
|
+
localStorage.setItem(
|
|
712
|
+
'config',
|
|
713
|
+
JSON.stringify(nextConfig),
|
|
714
|
+
);
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
translateBootstrapKeyRef.current = expectedTranslateBootstrapKey;
|
|
697
718
|
global.t = new Translate(
|
|
698
719
|
companies,
|
|
699
720
|
defaultCompany,
|
|
@@ -701,25 +722,39 @@ export const DefaultProvider = ({children, onBootstrapReady}) => {
|
|
|
701
722
|
Object.keys(stores),
|
|
702
723
|
translateStore,
|
|
703
724
|
);
|
|
725
|
+
setActiveTranslateBootstrapKey(expectedTranslateBootstrapKey);
|
|
704
726
|
setTranslateReady(true);
|
|
705
727
|
global.refreshTranslationsUI?.();
|
|
706
728
|
}, [
|
|
707
729
|
companies,
|
|
730
|
+
configuredTranslationLanguage,
|
|
708
731
|
currentCompany,
|
|
709
732
|
currentRouteName,
|
|
710
733
|
defaultCompany,
|
|
711
734
|
deviceConfigFetched,
|
|
735
|
+
expectedTranslateBootstrapKey,
|
|
736
|
+
hasCurrentCompany,
|
|
712
737
|
isLogged,
|
|
713
738
|
isPublicRouteActive,
|
|
714
|
-
|
|
739
|
+
translateStore,
|
|
715
740
|
]);
|
|
716
741
|
|
|
717
742
|
|
|
718
|
-
useEffect(() => {
|
|
719
|
-
if (
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
743
|
+
useEffect(() => {
|
|
744
|
+
if (
|
|
745
|
+
!isLogged ||
|
|
746
|
+
!hasCurrentCompany ||
|
|
747
|
+
(currentRouteName && isTranslateBootstrapReady)
|
|
748
|
+
) {
|
|
749
|
+
onBootstrapReady?.();
|
|
750
|
+
}
|
|
751
|
+
}, [
|
|
752
|
+
currentRouteName,
|
|
753
|
+
hasCurrentCompany,
|
|
754
|
+
isLogged,
|
|
755
|
+
isTranslateBootstrapReady,
|
|
756
|
+
onBootstrapReady,
|
|
757
|
+
]);
|
|
723
758
|
|
|
724
759
|
|
|
725
760
|
useEffect(() => {
|
|
@@ -766,14 +801,10 @@ export const DefaultProvider = ({children, onBootstrapReady}) => {
|
|
|
766
801
|
|
|
767
802
|
useEffect(() => {
|
|
768
803
|
const fetchColors = async () => {
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
const cssText = await api.fetch('themes-colors.css', {
|
|
774
|
-
responseType: 'text',
|
|
775
|
-
params,
|
|
776
|
-
});
|
|
804
|
+
try {
|
|
805
|
+
const cssText = await api.fetch('themes-colors.css', {
|
|
806
|
+
responseType: 'text',
|
|
807
|
+
});
|
|
777
808
|
const parsedColors = parseThemeCss(cssText);
|
|
778
809
|
setBaseThemeColors(parsedColors);
|
|
779
810
|
actions.setColors(parsedColors);
|
|
@@ -804,6 +835,11 @@ export const DefaultProvider = ({children, onBootstrapReady}) => {
|
|
|
804
835
|
|
|
805
836
|
actions.setColors(mergedThemeColors);
|
|
806
837
|
}, [actions, baseThemeColors, currentCompany?.id, currentCompany?.theme?.colors]);
|
|
838
|
+
|
|
839
|
+
if (requiresTranslateBootstrap && !isTranslateBootstrapReady) {
|
|
840
|
+
return <View style={providerStyles.loadingContainer} />;
|
|
841
|
+
}
|
|
842
|
+
|
|
807
843
|
return (
|
|
808
844
|
<>
|
|
809
845
|
{runtimeBridges}
|
|
@@ -817,7 +853,7 @@ export const DefaultProvider = ({children, onBootstrapReady}) => {
|
|
|
817
853
|
backgroundColor: colors?.background || runtimeColors.background,
|
|
818
854
|
},
|
|
819
855
|
]}>
|
|
820
|
-
<View style={providerStyles.content}>{children}</View>
|
|
856
|
+
<View style={[providerStyles.content, runtimeUiScaleStyle]}>{children}</View>
|
|
821
857
|
{!isShopClientApp && bottomNavigationCount === 0 && (
|
|
822
858
|
<RuntimeInfoFooter
|
|
823
859
|
appVersion={appVersion}
|