@controleonline/ui-common 1.2.86 → 1.2.88

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 (73) hide show
  1. package/.github/workflows/integration-source-gate.yml +68 -0
  2. package/.github/workflows/manager-worker.yml +7 -156
  3. package/.github/workflows/publish-npm.yml +73 -27
  4. package/.github/workflows/pull-request-checks.yml +7 -5
  5. package/docs/technical/Device-Detail-Alias-UI-Sync.md +141 -0
  6. package/package.json +13 -8
  7. package/src/react/components/AddImportModal.js +61 -34
  8. package/src/react/components/BottomNavigationBar.js +178 -174
  9. package/src/react/components/BottomNavigationBar.styles.js +139 -118
  10. package/src/react/components/DefaultProvider.native.js +427 -421
  11. package/src/react/components/DefaultProvider.web.js +131 -125
  12. package/src/react/components/RemoteCheckoutService.js +3 -3
  13. package/src/react/components/RuntimeFooterMarqueeText.js +88 -36
  14. package/src/react/components/RuntimeInfoFooter.js +76 -43
  15. package/src/react/components/RuntimeInfoFooter.styles.js +22 -14
  16. package/src/react/config/deviceConfigBootstrap.js +3 -3
  17. package/src/react/pages/Devices/detail/DeviceDetailAlertsCommandsSection.js +4 -22
  18. package/src/react/pages/Devices/detail/DeviceDetailMovementSections.js +6 -2
  19. package/src/react/pages/Devices/detail/DeviceDetailOrdersPrintSection.js +4 -0
  20. package/src/react/pages/Devices/detail/DeviceDetailScreen.js +23 -338
  21. package/src/react/pages/Devices/detail/createDeviceDetailContext.js +20 -0
  22. package/src/react/pages/Devices/detail/useDeviceDetailActions.js +11 -36
  23. package/src/react/pages/Devices/detail/useDeviceDetailLoaders.js +129 -37
  24. package/src/react/pages/Devices/detail/useDeviceDetailSaves.js +11 -38
  25. package/src/react/pages/Devices/detail/useDeviceDetailStateA.js +9 -28
  26. package/src/react/pages/Imports.js +13 -11
  27. package/src/react/pages/IntegrationConfigFields.js +1 -0
  28. package/src/react/pages/IntegrationConfigPage.js +101 -45
  29. package/src/react/pages/IntegrationConfigPage.utils.js +21 -13
  30. package/src/react/pages/fetchPeopleConfigs.js +21 -0
  31. package/src/react/pages/integrationsCatalog.js +15 -110
  32. package/src/react/services/Cielo/Cielo.js +9 -9
  33. package/src/react/services/Getnet/Getnet.web.js +25 -0
  34. package/src/react/utils/companyAuthority.js +36 -0
  35. package/src/react/utils/fileUrl.js +14 -5
  36. package/src/react/utils/paymentDevices.js +375 -270
  37. package/src/react/utils/printerDevices.js +2 -2
  38. package/src/react/utils/runtimeFooter.js +178 -224
  39. package/src/react/utils/runtimeFooterText.js +160 -0
  40. package/src/react/utils/runtimeLanguage.js +5 -5
  41. package/src/react/utils/runtimeZoom.js +29 -5
  42. package/src/react/utils/shopFranchises.js +167 -12
  43. package/src/react/utils/storeColumns.js +235 -217
  44. package/src/react/utils/systemErrorMessage.js +2 -1
  45. package/src/store/imports/customActions.js +42 -2
  46. package/src/store/integration/index.js +43 -0
  47. package/src/tests/browser/manager/device-detail-apply-config-defined.spec.js +31 -0
  48. package/src/tests/browser/manager/device-detail-composition.spec.js +295 -0
  49. package/src/tests/browser/manager/device-detail-copy-config.spec.js +11 -1
  50. package/src/tests/browser/manager/device-detail-pdv-current-company.spec.js +273 -0
  51. package/src/tests/browser/manager/runtime-footer-rotation.spec.js +397 -0
  52. package/src/tests/react/components/DefaultProviderAuthority.test.js +28 -0
  53. package/src/tests/react/components/RuntimeFooterMarqueeText.build.test.js +29 -0
  54. package/src/tests/react/config/deviceConfigBootstrap.test.js +24 -1
  55. package/src/tests/react/pages/applyCurrentDeviceConfig.test.js +85 -0
  56. package/src/tests/react/pages/deviceDetailComposition.test.js +65 -0
  57. package/src/tests/react/pages/deviceDetailHookDependencies.test.mjs +31 -0
  58. package/src/tests/react/pages/deviceDetailLoaderDependencies.test.mjs +28 -0
  59. package/src/tests/react/pages/receitaFederalIntegrationContract.test.mjs +27 -6
  60. package/src/tests/react/services/Cielo.test.js +2 -2
  61. package/src/tests/react/utils/companyAuthority.test.js +53 -0
  62. package/src/tests/react/utils/formatter.test.mjs +6 -0
  63. package/src/tests/react/utils/paymentDevices.test.js +72 -0
  64. package/src/tests/react/utils/runtimeFooter.test.js +35 -0
  65. package/src/tests/react/utils/runtimeFooterText.test.js +88 -0
  66. package/src/tests/react/utils/runtimeLanguage.test.js +4 -4
  67. package/src/tests/react/utils/runtimeZoom.test.js +20 -0
  68. package/src/tests/react/utils/shopFranchises.test.js +32 -13
  69. package/src/tests/react/utils/translate.test.mjs +6 -6
  70. package/src/utils/formatter.js +7 -3
  71. package/src/utils/translate.js +16 -16
  72. package/src/utils/translatePending.js +6 -6
  73. package/src/utils/translateStorage.js +2 -2
@@ -1,98 +1,12 @@
1
- import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
2
- import { Alert, FlatList, Platform, Pressable, ScrollView, Switch, Text, TextInput, TouchableOpacity, View } from 'react-native';
1
+ import React from 'react';
2
+ import { ScrollView, Text, TouchableOpacity, View } from 'react-native';
3
3
  import { SafeAreaView } from 'react-native-safe-area-context';
4
- import { useFocusEffect, useNavigation, useRoute } from '@react-navigation/native';
5
- import {Picker} from '@react-native-picker/picker';
6
- import { useStore } from '@store';
7
- import { api } from '@controleonline/ui-common/src/api';
8
- import Formatter from '@controleonline/ui-common/src/utils/formatter';
4
+
9
5
  import StateStore from '@controleonline/ui-common/src/react/components/StateStore';
10
- import PaymentTypesByWalletTab from '@controleonline/ui-common/src/react/pages/SettingsPage/PaymentTypesByWalletTab';
11
- import { appendScreenMetrics } from '@controleonline/ui-common/src/react/utils/screenMetrics';
12
- import { useMessage } from '@controleonline/ui-common/src/react/components/MessageService';
13
- import { resolveThemePalette, withOpacity } from '@controleonline/../../src/styles/branding';
14
- import { colors } from '@controleonline/../../src/styles/colors';
6
+
15
7
  import Icon from 'react-native-vector-icons/Feather';
16
8
  import styles from '../../DeviceDetailPage.styles';
17
- import packageJson from '@package';
18
- import DefaultTooltip from '@controleonline/ui-default/src/react/components/help/DefaultTooltip';
19
-
20
- import {
21
- canDisplayChangePrinter,
22
- DEVICE_ANDROID_KIOSK_ENABLED_CONFIG_KEY,
23
- DEVICE_ANDROID_LAUNCHER_ENABLED_CONFIG_KEY,
24
- DISPLAY_AUTO_PRINT_PRODUCT_CONFIG_KEY,
25
- DISPLAY_ALLOW_PRINTER_CHANGE_CONFIG_KEY,
26
- DEVICE_ALERT_SOUND_ENABLED_KEY,
27
- DEVICE_ALERT_SOUND_URL_KEY,
28
- DEVICE_ORDER_VISIBILITY_COMPANY,
29
- DEVICE_ORDER_VISIBILITY_DEVICE,
30
- DEVICE_ORDER_VISIBILITY_KEY,
31
- DEVICE_RUNTIME_DEBUG_INFO_ENABLED_KEY,
32
- isPosAutoPrintEnabled,
33
- isPosCashRegisterOpen,
34
- isTruthyValue,
35
- parseConfigsObject,
36
- POS_AUTO_PRINT_ENABLED_CONFIG_KEY,
37
- POS_CASH_MANAGEMENT_MODE_CASH_REGISTER,
38
- POS_CASH_MANAGEMENT_MODE_CONFIG_KEY,
39
- POS_CASH_MANAGEMENT_MODE_DAILY,
40
- POS_CHECK_ORDER_MANAGEMENT_MODE_CONFIG_KEY,
41
- POS_CHECK_ORDER_MANAGEMENT_MODE_EXISTING_ONLY,
42
- POS_CHECK_ORDER_MANAGEMENT_MODE_MANAGE,
43
- POS_CHECK_ORDER_TYPE_CONFIG_KEY,
44
- POS_CHECK_ORDER_TYPE_NONE,
45
- POS_CHECK_ORDER_TYPE_TAB,
46
- POS_CHECK_ORDER_TYPE_TABLE,
47
- POS_CHECK_ORDER_TYPE_STAMP,
48
- POS_DELIVERY_ENABLED_CONFIG_KEY,
49
- POS_OPERATION_MODE_COUNTER,
50
- POS_OPERATION_MODE_CONFIG_KEY,
51
- POS_OPERATION_MODE_OPTIONS,
52
- POS_PRODUCT_SHOWCASE_CONFIG_KEY,
53
- POS_PRINT_MODE_FORM,
54
- POS_PRINT_MODE_ORDER,
55
- getPosOperationModeOption,
56
- isAndroidKioskEnabled,
57
- isAndroidLauncherEnabled,
58
- isPosDeliveryEnabled,
59
- resolvePosCheckOrderManagementMode,
60
- resolvePosCheckOrderType,
61
- resolvePosCheckOrderTypeForShop,
62
- resolveDeviceOrderVisibility,
63
- resolvePosCashManagementMode,
64
- resolvePosOperationMode,
65
- resolvePosPrintMode,
66
- } from '@controleonline/ui-common/src/react/config/deviceConfigBootstrap';
67
9
 
68
- import {
69
- filterDeviceConfigsByCompany,
70
- getCompanyPaymentDeviceOptions,
71
- getPaymentGatewayFromConfigs,
72
- getPaymentGatewayLabel,
73
- isPaymentCapableDeviceConfig,
74
- isPdvPrinterEnabled,
75
- normalizeDeviceId,
76
- normalizeEntityId,
77
- PAYMENT_TYPE_IDS_CONFIG_KEY,
78
- PAYMENT_GATEWAY_CIELO,
79
- PDV_PRINTER_ENABLED_CONFIG_KEY,
80
- ORDER_PAYMENT_DEVICE_CONFIG_KEY,
81
- POS_GATEWAY_CONFIG_KEY,
82
- } from '@controleonline/ui-common/src/react/utils/paymentDevices';
83
- import {
84
- normalizeBooleanConfig,
85
- SHOP_LOYALTY_COUPONS_ENABLED_CONFIG_KEY,
86
- } from '@controleonline/ui-common/src/react/utils/shopConfig';
87
-
88
- import {
89
- getPrinterOptionValue,
90
- getDeviceTypeLabel,
91
- getPrinterLabel,
92
- getPrinterOptions,
93
- } from '@controleonline/ui-common/src/react/utils/printerDevices';
94
- import { buildDeviceAliasStoreUpdates } from '@controleonline/ui-common/src/react/utils/deviceAliasSync';
95
- import { createDeviceDetailRenderers } from './DeviceDetailRenderers';
96
10
  import DeviceDetailHeader from './DeviceDetailHeader';
97
11
  import CopyDeviceConfigModal from '@controleonline/ui-common/src/react/components/CopyDeviceConfigModal';
98
12
  import useDeviceDetailCopyConfig from './useDeviceDetailCopyConfig';
@@ -102,34 +16,9 @@ import DeviceDetailAlertsCommandsSection from './DeviceDetailAlertsCommandsSecti
102
16
  import DeviceDetailMovementSections from './DeviceDetailMovementSections';
103
17
  import DeviceDetailPaymentSection from './DeviceDetailPaymentSection';
104
18
 
105
- import { inlineStyle_667_12, inlineStyle_1301_61 } from '../../DeviceDetailPage.styles';
106
-
107
- import {
108
- hex,
109
- DISPLAY_DEVICE_TYPE,
110
- PDV_DEVICE_TYPE,
111
- DISPLAY_DEVICE_LINK_CONFIG_KEY,
112
- DISPLAY_DEVICE_PRINTER_CONFIG_KEY,
113
- PDV_TAB_OPERATION,
114
- PDV_TAB_ORDERS,
115
- PDV_TAB_DEVICE,
116
- PDV_TAB_PAYMENT_TYPES,
117
- PDV_TAB_MOVEMENT,
118
- PDV_DETAIL_TABS,
119
- tt,
120
- } from './deviceDetailConstants';
121
- import {
122
- paymentIcon,
123
- formatApiError,
124
- getDisplayLabel,
125
- getProductShowcaseLabel,
126
- getIsOpen,
127
- confirm,
128
- getDeviceSwitchProps,
129
- } from './deviceDetailHelpers';
130
- import OptionButtonChip from './OptionButtonChip';
131
-
19
+ import { PDV_TAB_PAYMENT_TYPES, PDV_DETAIL_TABS, tt } from './deviceDetailConstants';
132
20
 
21
+ import createDeviceDetailContext from './createDeviceDetailContext';
133
22
  import useDeviceDetailStateA from './useDeviceDetailStateA';
134
23
  import useDeviceDetailStateB from './useDeviceDetailStateB';
135
24
  import useDeviceDetailLoaders from './useDeviceDetailLoaders';
@@ -143,223 +32,18 @@ const DeviceDetailScreen = () => {
143
32
  const loaders = useDeviceDetailLoaders(state);
144
33
  const actions = useDeviceDetailActions({ ...state, ...loaders });
145
34
  const saves = useDeviceDetailSaves({ ...state, ...loaders, ...actions });
35
+ const detailCtx = createDeviceDetailContext(state, loaders, actions, saves);
146
36
  const {
147
- navigation,
148
- deviceId,
149
- deviceConfigStore,
150
- messageApi,
151
- websocketActions,
152
- runtimeCompanyConfigs,
153
- showSystemError,
154
- loyaltyCouponsEnabled,
155
- currentDevice,
156
- currentDeviceConfig,
157
- deviceString,
158
- deviceType,
159
- normalizedInitialConfigs,
160
- initialAlias,
161
- isDisplayDevice,
162
- isPdvDevice,
163
- actionsRef,
164
- stampAutoDisableSignatureRef,
165
- brandColors,
166
- products,
167
- setProducts,
168
- productShowcases,
169
- setProductShowcases,
170
- companyDeviceConfigs,
171
- setCompanyDeviceConfigs,
172
- inflowData,
173
- setInflowData,
174
- configs,
175
- setConfigs,
176
- loadingConfigData,
177
- setLoadingConfigData,
37
+ accent, alias, aliasInput, aliasInputRef, deviceId, deviceString,
38
+ editingAlias, removingDevice, savingAlias, themeColors, brandColors,
39
+ setAliasInput, confirmRemoveDevice, saveAlias, startEditAlias,
40
+ loadingActiveTabData, isPdvDevice, activePdvTab, setActivePdvTab,
41
+ showPdvOperationTab, showPdvOrdersTab, shouldShowOrderVisibility,
42
+ shouldShowDeviceBehavior, shouldShowRemotePayment, shouldShowRemoteCommands,
43
+ actionsRef, currentCompany, loadCompanyConfigs, messageApi,
44
+ refreshCurrentConfig, showSystemError, companyDeviceConfigs,
178
45
  loadingCompanyDeviceConfigs,
179
- setLoadingCompanyDeviceConfigs,
180
- loadingMovementData,
181
- setLoadingMovementData,
182
- actionLoading,
183
- setActionLoading,
184
- activePdvTab,
185
- setActivePdvTab,
186
- savingPaymentTarget,
187
- setSavingPaymentTarget,
188
- savingPdvSettings,
189
- setSavingPdvSettings,
190
- savingPaymentTypes,
191
- setSavingPaymentTypes,
192
- savingPosOperationMode,
193
- setSavingPosOperationMode,
194
- savingProductShowcase,
195
- setSavingProductShowcase,
196
- savingLauncherMode,
197
- setSavingLauncherMode,
198
- savingAlertSound,
199
- setSavingAlertSound,
200
- savingOrderVisibility,
201
- setSavingOrderVisibility,
202
- savingDeviceDeliverySettings,
203
- setSavingDeviceDeliverySettings,
204
- savingRuntimeDebugInfo,
205
- setSavingRuntimeDebugInfo,
206
- sendingCatalogRefresh,
207
- setSendingCatalogRefresh,
208
- loadingProductShowcases,
209
- setLoadingProductShowcases,
210
- search,
211
- setSearch,
212
- devicePaymentTarget,
213
- setDevicePaymentTarget,
214
- pdvGateway,
215
- setPdvGateway,
216
- pdvPrinterEnabled,
217
- setPdvPrinterEnabled,
218
- posOperationMode,
219
- setPosOperationMode,
220
- productShowcaseId,
221
- setProductShowcaseId,
222
- androidKioskEnabled,
223
- setAndroidKioskEnabled,
224
- androidLauncherEnabled,
225
- setAndroidLauncherEnabled,
226
- counterAutoPrintEnabled,
227
- setCounterAutoPrintEnabled,
228
- counterPrintMode,
229
- setCounterPrintMode,
230
- counterCashManagementMode,
231
- setCounterCashManagementMode,
232
- checkOrderType,
233
- setCheckOrderType,
234
- checkOrderManagementMode,
235
- setCheckOrderManagementMode,
236
- deviceOrderVisibility,
237
- setDeviceOrderVisibility,
238
- deviceDeliveryEnabled,
239
- setDeviceDeliveryEnabled,
240
- deviceAlertSoundEnabled,
241
- setDeviceAlertSoundEnabled,
242
- deviceAlertSoundUrl,
243
- setDeviceAlertSoundUrl,
244
- deviceRuntimeDebugInfoEnabled,
245
- setDeviceRuntimeDebugInfoEnabled,
246
- linkedDisplayId,
247
- setLinkedDisplayId,
248
- displayPrinterId,
249
- setDisplayPrinterId,
250
- displayAllowPrinterChange,
251
- setDisplayAllowPrinterChange,
252
- displayAutoPrintProductEnabled,
253
- setDisplayAutoPrintProductEnabled,
254
- savingDisplayPrintingConfig,
255
- setSavingDisplayPrintingConfig,
256
- hasLoadedCurrentConfig,
257
- setHasLoadedCurrentConfig,
258
- hasLoadedCompanyConfigs,
259
- setHasLoadedCompanyConfigs,
260
- hasLoadedMovementData,
261
- setHasLoadedMovementData,
262
- hasLoadedCurrentConfigRef,
263
- hasLoadedCompanyConfigsRef,
264
- hasLoadedMovementDataRef,
265
- hasInitializedPdvTabRef,
266
- alias,
267
- setAlias,
268
- editingAlias,
269
- setEditingAlias,
270
- aliasInput,
271
- setAliasInput,
272
- savingAlias,
273
- setSavingAlias,
274
- removingDevice,
275
- setRemovingDevice,
276
- aliasInputRef,
277
- skipAliasSyncFromStoreRef,
278
- isOpen,
279
- hasLocalPaymentGateway,
280
- paymentDeviceOptions,
281
- displayOptions,
282
- printerOptions,
283
- selectedPosOperationModeOption,
284
- pickerMode,
285
- packageVersion,
286
- appVersion,
287
- runtimeDeviceId,
288
- runtimeDeviceType,
289
- isEditingRuntimeDevice,
290
- resolveDeviceContext,
291
- applyCurrentDeviceConfig,
292
- loadMovementData,
293
- refreshCurrentConfig,
294
- loadCompanyConfigs,
295
- loadProductShowcases,
296
- ensureActiveTabData,
297
- ensureActiveTabDataRef,
298
- handleToggle,
299
- startEditAlias,
300
- cancelEditAlias,
301
- saveAlias,
302
- confirmRemoveDevice,
303
- saveDevicePaymentTarget,
304
- savePdvSettings,
305
- saveProductShowcaseConfig,
306
- savePaymentTypeConfigs,
307
- savePosOperationMode,
308
- saveLauncherMode,
309
- saveDeviceAlertSoundConfig,
310
- saveDeviceOrderVisibility,
311
- saveDeviceDeliverySettings,
312
- saveDeviceRuntimeDebugInfo,
313
- saveDisplayPrintingConfig,
314
- sendCatalogRefreshCommand,
315
- productTotal,
316
- inflowTotal,
317
- wallets,
318
- filteredProducts,
319
- accent,
320
- showPdvOperationTab,
321
- showPdvOrdersTab,
322
- showPdvDeviceTab,
323
- showPdvPaymentTypesTab,
324
- showPdvMovementTab,
325
- loadingActiveTabData,
326
- shouldShowOrderVisibility,
327
- shouldShowRemotePayment,
328
- shouldShowDeviceBehavior,
329
- shouldShowRemoteCommands,
330
- currentCompany,
331
- } = { ...state, ...loaders, ...actions, ...saves };
332
-
333
- const detailCtx = {
334
- themeColors, brandColors, palette,
335
- renderHelpButton, renderOptionButtons, renderSwitchRow, renderProduct,
336
- posOperationMode, setPosOperationMode, savePosOperationMode, savingPosOperationMode,
337
- productShowcaseId, setProductShowcaseId, saveProductShowcaseConfig,
338
- productShowcases, loadingProductShowcases, savingProductShowcase, pickerMode,
339
- counterAutoPrintEnabled, setCounterAutoPrintEnabled,
340
- counterPrintMode, setCounterPrintMode,
341
- checkOrderType, setCheckOrderType,
342
- checkOrderManagementMode, setCheckOrderManagementMode,
343
- cashManagementMode, setCashManagementMode,
344
- androidKioskEnabled, setAndroidKioskEnabled,
345
- androidLauncherEnabled, setAndroidLauncherEnabled,
346
- saveLauncherMode, savingLauncherMode,
347
- orderVisibility, setOrderVisibility, saveDeviceOrderVisibility, savingOrderVisibility,
348
- shouldShowOrderVisibility,
349
- deliveryEnabled, setDeliveryEnabled, saveDeviceDeliverySettings, savingDeliverySettings,
350
- deviceAlertSoundEnabled, setDeviceAlertSoundEnabled, deviceAlertSoundUrl, setDeviceAlertSoundUrl,
351
- saveDeviceAlertSoundConfig, savingAlertSound,
352
- runtimeDebugInfoEnabled, setRuntimeDebugInfoEnabled, saveDeviceRuntimeDebugInfo, savingRuntimeDebugInfo,
353
- devicePaymentTarget, setDevicePaymentTarget, saveDevicePaymentTarget, savingPaymentTarget,
354
- paymentDeviceOptions, displayOptions, printerOptions,
355
- pdvGateway, setPdvGateway, pdvPrinterEnabled, setPdvPrinterEnabled, savePdvSettings, savingPdvSettings,
356
- hasLocalPaymentGateway, loyaltyCouponsEnabled,
357
- sendCatalogRefreshCommand, sendingCatalogRefresh,
358
- showPdvMovementTab, showPdvPaymentTypesTab, showPdvOperationTab,
359
- inflowData, productTotal, wallets, filteredProducts, search, setSearch,
360
- loadingMovementData, deviceId, savePaymentTypeConfigs, savingPaymentTypes,
361
- configs, currentCompany,
362
- };
46
+ } = detailCtx;
363
47
 
364
48
  const {
365
49
  copyModalVisible,
@@ -378,7 +62,6 @@ const DeviceDetailScreen = () => {
378
62
  showSystemError,
379
63
  });
380
64
 
381
-
382
65
  return (
383
66
  <SafeAreaView style={[styles.container, { backgroundColor: brandColors.background }]}>
384
67
  <ScrollView contentContainerStyle={styles.scroll} showsVerticalScrollIndicator={false}>
@@ -467,13 +150,15 @@ const DeviceDetailScreen = () => {
467
150
  <DeviceDetailMovementSections {...detailCtx} />
468
151
 
469
152
  {showPdvOperationTab && (
470
- <>
471
- <DeviceDetailPdvConfigSection {...detailCtx} />
472
- <DeviceDetailOrdersPrintSection {...detailCtx} />
473
- <DeviceDetailAlertsCommandsSection {...detailCtx} />
474
- </>
153
+ <DeviceDetailPdvConfigSection {...detailCtx} />
475
154
  )}
476
155
 
156
+ {(showPdvOrdersTab || shouldShowOrderVisibility || detailCtx.isDisplayDevice) && (
157
+ <DeviceDetailOrdersPrintSection {...detailCtx} />
158
+ )}
159
+ {(shouldShowDeviceBehavior || shouldShowRemotePayment || shouldShowRemoteCommands) && (
160
+ <DeviceDetailAlertsCommandsSection {...detailCtx} />
161
+ )}
477
162
  <DeviceDetailPaymentSection {...detailCtx} />
478
163
 
479
164
  </ScrollView>
@@ -0,0 +1,20 @@
1
+ /** Connect section props to the existing state and save contracts. */
2
+ export default function createDeviceDetailContext(state, loaders, actions, saves) {
3
+ return {
4
+ ...state,
5
+ ...loaders,
6
+ ...actions,
7
+ ...saves,
8
+ palette: state.brandColors,
9
+ orderVisibility: state.deviceOrderVisibility,
10
+ setOrderVisibility: state.setDeviceOrderVisibility,
11
+ deliveryEnabled: state.deviceDeliveryEnabled,
12
+ setDeliveryEnabled: state.setDeviceDeliveryEnabled,
13
+ savingDeliverySettings: state.savingDeviceDeliverySettings,
14
+ displayAutoPrintProduct: state.displayAutoPrintProductEnabled,
15
+ setDisplayAutoPrintProduct: state.setDisplayAutoPrintProductEnabled,
16
+ savingDisplayPrinting: state.savingDisplayPrintingConfig,
17
+ runtimeDebugInfoEnabled: state.deviceRuntimeDebugInfoEnabled,
18
+ setRuntimeDebugInfoEnabled: state.setDeviceRuntimeDebugInfoEnabled,
19
+ };
20
+ }
@@ -1,43 +1,18 @@
1
- import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
2
- import { useNavigation, useRoute } from '@react-navigation/native';
3
- import { useStore } from '@store';
4
- import { useMessage } from '@controleonline/ui-common/src/react/components/MessageService';
5
- import { resolveThemePalette } from '@controleonline/../../src/styles/branding';
6
- import { colors } from '@controleonline/../../src/styles/colors';
7
- import packageJson from '@package';
8
- import {
9
- canDisplayChangePrinter, DEVICE_ANDROID_KIOSK_ENABLED_CONFIG_KEY, DEVICE_ANDROID_LAUNCHER_ENABLED_CONFIG_KEY,
10
- DISPLAY_AUTO_PRINT_PRODUCT_CONFIG_KEY, DISPLAY_ALLOW_PRINTER_CHANGE_CONFIG_KEY, DEVICE_ALERT_SOUND_ENABLED_KEY,
11
- DEVICE_ALERT_SOUND_URL_KEY, DEVICE_ORDER_VISIBILITY_COMPANY, DEVICE_ORDER_VISIBILITY_DEVICE, DEVICE_ORDER_VISIBILITY_KEY,
12
- DEVICE_RUNTIME_DEBUG_INFO_ENABLED_KEY, isPosAutoPrintEnabled, isPosCashRegisterOpen, isTruthyValue, parseConfigsObject,
13
- POS_AUTO_PRINT_ENABLED_CONFIG_KEY, POS_CASH_MANAGEMENT_MODE_CASH_REGISTER, POS_CASH_MANAGEMENT_MODE_CONFIG_KEY,
14
- POS_CASH_MANAGEMENT_MODE_DAILY, POS_CHECK_ORDER_MANAGEMENT_MODE_CONFIG_KEY, POS_CHECK_ORDER_MANAGEMENT_MODE_EXISTING_ONLY,
15
- POS_CHECK_ORDER_MANAGEMENT_MODE_MANAGE, POS_CHECK_ORDER_TYPE_CONFIG_KEY, POS_CHECK_ORDER_TYPE_NONE, POS_CHECK_ORDER_TYPE_TAB,
16
- POS_CHECK_ORDER_TYPE_TABLE, POS_CHECK_ORDER_TYPE_STAMP, POS_DELIVERY_ENABLED_CONFIG_KEY, POS_OPERATION_MODE_COUNTER,
17
- POS_OPERATION_MODE_CONFIG_KEY, POS_OPERATION_MODE_OPTIONS, POS_PRODUCT_SHOWCASE_CONFIG_KEY, POS_PRINT_MODE_FORM,
18
- POS_PRINT_MODE_ORDER, getPosOperationModeOption, isAndroidKioskEnabled, isAndroidLauncherEnabled, isPosDeliveryEnabled,
19
- resolvePosCheckOrderManagementMode, resolvePosCheckOrderType, resolvePosCheckOrderTypeForShop, resolveDeviceOrderVisibility,
20
- resolvePosCashManagementMode, resolvePosOperationMode, resolvePosPrintMode,
21
- } from '@controleonline/ui-common/src/react/config/deviceConfigBootstrap';
22
- import {
23
- filterDeviceConfigsByCompany, getCompanyPaymentDeviceOptions, getPaymentGatewayFromConfigs, getPaymentGatewayLabel,
24
- isPaymentCapableDeviceConfig, isPdvPrinterEnabled, normalizeDeviceId, normalizeEntityId, PAYMENT_TYPE_IDS_CONFIG_KEY,
25
- PAYMENT_GATEWAY_CIELO, PDV_PRINTER_ENABLED_CONFIG_KEY, ORDER_PAYMENT_DEVICE_CONFIG_KEY, POS_GATEWAY_CONFIG_KEY,
26
- } from '@controleonline/ui-common/src/react/utils/paymentDevices';
27
- import { normalizeBooleanConfig, SHOP_LOYALTY_COUPONS_ENABLED_CONFIG_KEY } from '@controleonline/ui-common/src/react/utils/shopConfig';
28
- import { getPrinterOptionValue, getDeviceTypeLabel, getPrinterLabel, getPrinterOptions } from '@controleonline/ui-common/src/react/utils/printerDevices';
29
- import { hex, DISPLAY_DEVICE_TYPE, PDV_DEVICE_TYPE, DISPLAY_DEVICE_LINK_CONFIG_KEY, DISPLAY_DEVICE_PRINTER_CONFIG_KEY,
30
- PDV_TAB_OPERATION, PDV_TAB_ORDERS, PDV_TAB_DEVICE, PDV_TAB_PAYMENT_TYPES, PDV_TAB_MOVEMENT, PDV_DETAIL_TABS, tt,
31
- } from './deviceDetailConstants';
32
- import { paymentIcon, formatApiError, getDisplayLabel, getProductShowcaseLabel, getIsOpen, confirm } from './deviceDetailHelpers';
33
- import { api } from '@controleonline/ui-common/src/api';
34
- import { buildDeviceAliasStoreUpdates } from '@controleonline/ui-common/src/react/utils/deviceAliasSync';
35
- import { createDeviceDetailRenderers } from './DeviceDetailRenderers';
1
+ import { appendScreenMetrics } from '@controleonline/ui-common/src/react/utils/screenMetrics';
2
+ import { useCallback, useEffect } from 'react';
3
+
4
+ import { DEVICE_ANDROID_KIOSK_ENABLED_CONFIG_KEY, POS_AUTO_PRINT_ENABLED_CONFIG_KEY, POS_CASH_MANAGEMENT_MODE_CONFIG_KEY, POS_CHECK_ORDER_MANAGEMENT_MODE_CONFIG_KEY, POS_CHECK_ORDER_MANAGEMENT_MODE_MANAGE, POS_CHECK_ORDER_TYPE_CONFIG_KEY, POS_CHECK_ORDER_TYPE_NONE, POS_CHECK_ORDER_TYPE_STAMP, POS_OPERATION_MODE_COUNTER, POS_OPERATION_MODE_CONFIG_KEY, POS_PRODUCT_SHOWCASE_CONFIG_KEY, resolvePosCheckOrderType, resolvePosCheckOrderTypeForShop } from '@controleonline/ui-common/src/react/config/deviceConfigBootstrap';
5
+ import { normalizeEntityId, PAYMENT_TYPE_IDS_CONFIG_KEY, PDV_PRINTER_ENABLED_CONFIG_KEY, ORDER_PAYMENT_DEVICE_CONFIG_KEY, POS_GATEWAY_CONFIG_KEY } from '@controleonline/ui-common/src/react/utils/paymentDevices';
36
6
 
7
+ import { PDV_TAB_MOVEMENT } from './deviceDetailConstants';
8
+ import { confirm } from './deviceDetailHelpers';
9
+
10
+ import { buildDeviceAliasStoreUpdates } from '@controleonline/ui-common/src/react/utils/deviceAliasSync';
37
11
 
38
12
  export default function useDeviceDetailActions(deps) {
39
13
  const {
40
- navigation, deviceId, deviceConfigStore, messageApi, websocketActions, runtimeCompanyConfigs, showSystemError, loyaltyCouponsEnabled, currentDevice, currentDeviceConfig, deviceString, deviceType,
14
+ runtimeDevice, runtimeDeviceConfig,
15
+ navigation, deviceId, deviceConfigStore, messageApi, websocketActions, runtimeCompanyConfigs, showSystemError, loyaltyCouponsEnabled, currentCompany, currentDevice, currentDeviceConfig, deviceString, deviceType,
41
16
  normalizedInitialConfigs, initialAlias, isDisplayDevice, isPdvDevice, actionsRef, stampAutoDisableSignatureRef, brandColors, products, setProducts, productShowcases, setProductShowcases, companyDeviceConfigs,
42
17
  setCompanyDeviceConfigs, inflowData, setInflowData, configs, setConfigs, loadingConfigData, setLoadingConfigData, loadingCompanyDeviceConfigs, setLoadingCompanyDeviceConfigs, loadingMovementData, setLoadingMovementData, actionLoading,
43
18
  setActionLoading, activePdvTab, setActivePdvTab, savingPaymentTarget, setSavingPaymentTarget, savingPdvSettings, setSavingPdvSettings, savingPaymentTypes, setSavingPaymentTypes, savingPosOperationMode, setSavingPosOperationMode, savingProductShowcase,
@@ -1,44 +1,16 @@
1
- import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
2
- import { useNavigation, useRoute } from '@react-navigation/native';
3
- import { useStore } from '@store';
4
- import { useMessage } from '@controleonline/ui-common/src/react/components/MessageService';
5
- import { resolveThemePalette } from '@controleonline/../../src/styles/branding';
6
- import { colors } from '@controleonline/../../src/styles/colors';
7
- import packageJson from '@package';
8
- import {
9
- canDisplayChangePrinter, DEVICE_ANDROID_KIOSK_ENABLED_CONFIG_KEY, DEVICE_ANDROID_LAUNCHER_ENABLED_CONFIG_KEY,
10
- DISPLAY_AUTO_PRINT_PRODUCT_CONFIG_KEY, DISPLAY_ALLOW_PRINTER_CHANGE_CONFIG_KEY, DEVICE_ALERT_SOUND_ENABLED_KEY,
11
- DEVICE_ALERT_SOUND_URL_KEY, DEVICE_ORDER_VISIBILITY_COMPANY, DEVICE_ORDER_VISIBILITY_DEVICE, DEVICE_ORDER_VISIBILITY_KEY,
12
- DEVICE_RUNTIME_DEBUG_INFO_ENABLED_KEY, isPosAutoPrintEnabled, isPosCashRegisterOpen, isTruthyValue, parseConfigsObject,
13
- POS_AUTO_PRINT_ENABLED_CONFIG_KEY, POS_CASH_MANAGEMENT_MODE_CASH_REGISTER, POS_CASH_MANAGEMENT_MODE_CONFIG_KEY,
14
- POS_CASH_MANAGEMENT_MODE_DAILY, POS_CHECK_ORDER_MANAGEMENT_MODE_CONFIG_KEY, POS_CHECK_ORDER_MANAGEMENT_MODE_EXISTING_ONLY,
15
- POS_CHECK_ORDER_MANAGEMENT_MODE_MANAGE, POS_CHECK_ORDER_TYPE_CONFIG_KEY, POS_CHECK_ORDER_TYPE_NONE, POS_CHECK_ORDER_TYPE_TAB,
16
- POS_CHECK_ORDER_TYPE_TABLE, POS_CHECK_ORDER_TYPE_STAMP, POS_DELIVERY_ENABLED_CONFIG_KEY, POS_OPERATION_MODE_COUNTER,
17
- POS_OPERATION_MODE_CONFIG_KEY, POS_OPERATION_MODE_OPTIONS, POS_PRODUCT_SHOWCASE_CONFIG_KEY, POS_PRINT_MODE_FORM,
18
- POS_PRINT_MODE_ORDER, getPosOperationModeOption, isAndroidKioskEnabled, isAndroidLauncherEnabled, isPosDeliveryEnabled,
19
- resolvePosCheckOrderManagementMode, resolvePosCheckOrderType, resolvePosCheckOrderTypeForShop, resolveDeviceOrderVisibility,
20
- resolvePosCashManagementMode, resolvePosOperationMode, resolvePosPrintMode,
21
- } from '@controleonline/ui-common/src/react/config/deviceConfigBootstrap';
22
- import {
23
- filterDeviceConfigsByCompany, getCompanyPaymentDeviceOptions, getPaymentGatewayFromConfigs, getPaymentGatewayLabel,
24
- isPaymentCapableDeviceConfig, isPdvPrinterEnabled, normalizeDeviceId, normalizeEntityId, PAYMENT_TYPE_IDS_CONFIG_KEY,
25
- PAYMENT_GATEWAY_CIELO, PDV_PRINTER_ENABLED_CONFIG_KEY, ORDER_PAYMENT_DEVICE_CONFIG_KEY, POS_GATEWAY_CONFIG_KEY,
26
- } from '@controleonline/ui-common/src/react/utils/paymentDevices';
27
- import { normalizeBooleanConfig, SHOP_LOYALTY_COUPONS_ENABLED_CONFIG_KEY } from '@controleonline/ui-common/src/react/utils/shopConfig';
28
- import { getPrinterOptionValue, getDeviceTypeLabel, getPrinterLabel, getPrinterOptions } from '@controleonline/ui-common/src/react/utils/printerDevices';
29
- import { hex, DISPLAY_DEVICE_TYPE, PDV_DEVICE_TYPE, DISPLAY_DEVICE_LINK_CONFIG_KEY, DISPLAY_DEVICE_PRINTER_CONFIG_KEY,
30
- PDV_TAB_OPERATION, PDV_TAB_ORDERS, PDV_TAB_DEVICE, PDV_TAB_PAYMENT_TYPES, PDV_TAB_MOVEMENT, PDV_DETAIL_TABS, tt,
31
- } from './deviceDetailConstants';
32
- import { paymentIcon, formatApiError, getDisplayLabel, getProductShowcaseLabel, getIsOpen, confirm } from './deviceDetailHelpers';
33
- import { api } from '@controleonline/ui-common/src/api';
34
- import { buildDeviceAliasStoreUpdates } from '@controleonline/ui-common/src/react/utils/deviceAliasSync';
35
- import { createDeviceDetailRenderers } from './DeviceDetailRenderers';
36
- import { Alert, Platform } from 'react-native';
1
+ import { useCallback, useEffect, useRef } from 'react';
2
+ import { useFocusEffect } from '@react-navigation/native';
3
+
4
+ import { canDisplayChangePrinter, DISPLAY_AUTO_PRINT_PRODUCT_CONFIG_KEY, DEVICE_ALERT_SOUND_ENABLED_KEY, DEVICE_ALERT_SOUND_URL_KEY, DEVICE_ORDER_VISIBILITY_DEVICE, DEVICE_RUNTIME_DEBUG_INFO_ENABLED_KEY, isPosAutoPrintEnabled, isTruthyValue, parseConfigsObject, POS_PRODUCT_SHOWCASE_CONFIG_KEY, isAndroidKioskEnabled, isAndroidLauncherEnabled, isPosDeliveryEnabled, resolvePosCheckOrderManagementMode, resolvePosCheckOrderTypeForShop, resolveDeviceOrderVisibility, resolvePosCashManagementMode, resolvePosOperationMode, resolvePosPrintMode } from '@controleonline/ui-common/src/react/config/deviceConfigBootstrap';
5
+ import { filterDeviceConfigsByCompany, getPaymentGatewayFromConfigs, isPdvPrinterEnabled, normalizeDeviceId, normalizeEntityId, ORDER_PAYMENT_DEVICE_CONFIG_KEY } from '@controleonline/ui-common/src/react/utils/paymentDevices';
37
6
 
7
+ import { DISPLAY_DEVICE_LINK_CONFIG_KEY, DISPLAY_DEVICE_PRINTER_CONFIG_KEY, PDV_TAB_OPERATION, PDV_TAB_ORDERS, PDV_TAB_MOVEMENT } from './deviceDetailConstants';
8
+
9
+ import { api } from '@controleonline/ui-common/src/api';
38
10
 
39
11
  export default function useDeviceDetailLoaders(deps) {
40
12
  const {
41
- navigation, deviceId, deviceConfigStore, messageApi, websocketActions, runtimeCompanyConfigs, showSystemError, loyaltyCouponsEnabled, currentDevice, currentDeviceConfig, deviceString, deviceType,
13
+ navigation, deviceId, deviceConfigStore, messageApi, websocketActions, runtimeCompanyConfigs, showSystemError, loyaltyCouponsEnabled, currentCompany, currentDevice, currentDeviceConfig, deviceString, deviceType,
42
14
  normalizedInitialConfigs, initialAlias, isDisplayDevice, isPdvDevice, actionsRef, stampAutoDisableSignatureRef, brandColors, products, setProducts, productShowcases, setProductShowcases, companyDeviceConfigs,
43
15
  setCompanyDeviceConfigs, inflowData, setInflowData, configs, setConfigs, loadingConfigData, setLoadingConfigData, loadingCompanyDeviceConfigs, setLoadingCompanyDeviceConfigs, loadingMovementData, setLoadingMovementData, actionLoading,
44
16
  setActionLoading, activePdvTab, setActivePdvTab, savingPaymentTarget, setSavingPaymentTarget, savingPdvSettings, setSavingPdvSettings, savingPaymentTypes, setSavingPaymentTypes, savingPosOperationMode, setSavingPosOperationMode, savingProductShowcase,
@@ -50,7 +22,126 @@ export default function useDeviceDetailLoaders(deps) {
50
22
  setSavingDisplayPrintingConfig, hasLoadedCurrentConfig, setHasLoadedCurrentConfig, hasLoadedCompanyConfigs, setHasLoadedCompanyConfigs, hasLoadedMovementData, setHasLoadedMovementData, hasLoadedCurrentConfigRef, hasLoadedCompanyConfigsRef, hasLoadedMovementDataRef, hasInitializedPdvTabRef, alias,
51
23
  setAlias, editingAlias, setEditingAlias, aliasInput, setAliasInput, savingAlias, setSavingAlias, removingDevice, setRemovingDevice, aliasInputRef, skipAliasSyncFromStoreRef, isOpen,
52
24
  hasLocalPaymentGateway, paymentDeviceOptions, displayOptions, printerOptions, selectedPosOperationModeOption, pickerMode, packageVersion, appVersion, runtimeDeviceId, runtimeDeviceType, isEditingRuntimeDevice, resolveDeviceContext,
25
+ displayStore, printerStore,
53
26
  } = deps;
27
+ const applyCurrentDeviceConfig = useCallback((scopedItems, context = {}) => {
28
+ const currentDeviceString = String(
29
+ context.deviceString || deviceString || '',
30
+ ).trim();
31
+ const currentDeviceType = String(
32
+ context.deviceType || deviceType || '',
33
+ )
34
+ .trim()
35
+ .toUpperCase();
36
+ const currentDeviceConfigId = normalizeEntityId(
37
+ context.deviceId || deviceId,
38
+ );
39
+ const dc = (scopedItems || []).find(d => {
40
+ const currentConfigType = String(d?.type || d?.device?.type || '')
41
+ .trim()
42
+ .toUpperCase();
43
+ const nextDeviceId = normalizeEntityId(
44
+ d?.device?.id ||
45
+ d?.device?.['@id'] ||
46
+ d?.deviceId ||
47
+ d?.device?.deviceId,
48
+ );
49
+
50
+ if (currentDeviceConfigId && nextDeviceId === currentDeviceConfigId) {
51
+ return true;
52
+ }
53
+
54
+ return (
55
+ d?.device?.device === currentDeviceString &&
56
+ currentConfigType === currentDeviceType
57
+ );
58
+ });
59
+
60
+ if (dc) {
61
+ const nextConfigs = parseConfigsObject(dc.configs);
62
+ actionsRef.current.deviceConfigActions.setItem({
63
+ ...dc,
64
+ configs: nextConfigs,
65
+ });
66
+ setConfigs(nextConfigs);
67
+ setDevicePaymentTarget(
68
+ normalizeDeviceId(nextConfigs[ORDER_PAYMENT_DEVICE_CONFIG_KEY]),
69
+ );
70
+ setPdvGateway(getPaymentGatewayFromConfigs(nextConfigs));
71
+ setPdvPrinterEnabled(isPdvPrinterEnabled(nextConfigs));
72
+ setPosOperationMode(resolvePosOperationMode(nextConfigs));
73
+ setProductShowcaseId(
74
+ normalizeEntityId(nextConfigs[POS_PRODUCT_SHOWCASE_CONFIG_KEY]),
75
+ );
76
+ setAndroidKioskEnabled(isAndroidKioskEnabled(nextConfigs));
77
+ setAndroidLauncherEnabled(isAndroidLauncherEnabled(nextConfigs));
78
+ setCounterAutoPrintEnabled(isPosAutoPrintEnabled(nextConfigs));
79
+ setCounterPrintMode(resolvePosPrintMode(nextConfigs));
80
+ setCounterCashManagementMode(resolvePosCashManagementMode(nextConfigs));
81
+ setCheckOrderType(
82
+ resolvePosCheckOrderTypeForShop(nextConfigs, runtimeCompanyConfigs),
83
+ );
84
+ setCheckOrderManagementMode(
85
+ resolvePosCheckOrderManagementMode(nextConfigs),
86
+ );
87
+ setDeviceOrderVisibility(
88
+ resolveDeviceOrderVisibility(nextConfigs),
89
+ );
90
+ setDeviceDeliveryEnabled(
91
+ isPosDeliveryEnabled(nextConfigs),
92
+ );
93
+ setDeviceAlertSoundEnabled(
94
+ isTruthyValue(nextConfigs[DEVICE_ALERT_SOUND_ENABLED_KEY]),
95
+ );
96
+ setDeviceAlertSoundUrl(
97
+ String(nextConfigs[DEVICE_ALERT_SOUND_URL_KEY] || ''),
98
+ );
99
+ setDeviceRuntimeDebugInfoEnabled(
100
+ isTruthyValue(nextConfigs[DEVICE_RUNTIME_DEBUG_INFO_ENABLED_KEY]),
101
+ );
102
+ setLinkedDisplayId(
103
+ normalizeEntityId(nextConfigs[DISPLAY_DEVICE_LINK_CONFIG_KEY]),
104
+ );
105
+ setDisplayPrinterId(
106
+ normalizeDeviceId(nextConfigs[DISPLAY_DEVICE_PRINTER_CONFIG_KEY]),
107
+ );
108
+ setDisplayAllowPrinterChange(
109
+ canDisplayChangePrinter(nextConfigs),
110
+ );
111
+ setDisplayAutoPrintProductEnabled(
112
+ isTruthyValue(nextConfigs[DISPLAY_AUTO_PRINT_PRODUCT_CONFIG_KEY]),
113
+ );
114
+ return;
115
+ }
116
+
117
+ actionsRef.current.deviceConfigActions.setItem({});
118
+
119
+ setConfigs({});
120
+ setDevicePaymentTarget('');
121
+ setPdvGateway('');
122
+ setPdvPrinterEnabled(true);
123
+ setPosOperationMode(resolvePosOperationMode({}));
124
+ setProductShowcaseId('');
125
+ setAndroidKioskEnabled(false);
126
+ setAndroidLauncherEnabled(false);
127
+ setCounterAutoPrintEnabled(isPosAutoPrintEnabled({}));
128
+ setCounterPrintMode(resolvePosPrintMode({}));
129
+ setCounterCashManagementMode(resolvePosCashManagementMode({}));
130
+ setCheckOrderType(
131
+ resolvePosCheckOrderTypeForShop({}, runtimeCompanyConfigs),
132
+ );
133
+ setCheckOrderManagementMode(resolvePosCheckOrderManagementMode({}));
134
+ setDeviceOrderVisibility(DEVICE_ORDER_VISIBILITY_DEVICE);
135
+ setDeviceDeliveryEnabled(isPosDeliveryEnabled({}));
136
+ setDeviceAlertSoundEnabled(false);
137
+ setDeviceAlertSoundUrl('');
138
+ setDeviceRuntimeDebugInfoEnabled(false);
139
+ setLinkedDisplayId('');
140
+ setDisplayPrinterId('');
141
+ setDisplayAllowPrinterChange(false);
142
+ setDisplayAutoPrintProductEnabled(false);
143
+ }, [deviceId, deviceString, deviceType, runtimeCompanyConfigs]);
144
+
54
145
  const loadMovementData = useCallback(async () => {
55
146
  if (!isPdvDevice) {
56
147
  setProducts([]);
@@ -317,6 +408,7 @@ export default function useDeviceDetailLoaders(deps) {
317
408
  );
318
409
 
319
410
  return {
411
+ applyCurrentDeviceConfig,
320
412
  loadMovementData,
321
413
  refreshCurrentConfig,
322
414
  loadCompanyConfigs,