@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
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import assert from 'node:assert/strict';
|
|
2
|
+
import test from 'node:test';
|
|
3
|
+
|
|
4
|
+
import Translate from '../../../utils/translate.js';
|
|
5
|
+
import {
|
|
6
|
+
installLocalStorage,
|
|
7
|
+
flushAsync,
|
|
8
|
+
createPendingTranslateStore,
|
|
9
|
+
} from './translate.test.helpers.mjs';
|
|
10
|
+
|
|
11
|
+
test('persists missing translations with the normalized configured language', async () => {
|
|
12
|
+
installLocalStorage({language: 'en_US'});
|
|
13
|
+
|
|
14
|
+
const saveCalls = [];
|
|
15
|
+
const translateStore = createPendingTranslateStore({
|
|
16
|
+
getItems: async () => [],
|
|
17
|
+
save: async payload => {
|
|
18
|
+
saveCalls.push(payload);
|
|
19
|
+
return payload;
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
const translate = new Translate(
|
|
23
|
+
[{id: 1}],
|
|
24
|
+
{id: 1},
|
|
25
|
+
{id: 1},
|
|
26
|
+
['contract'],
|
|
27
|
+
translateStore,
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
translate.t('contract', 'empty', 'none_registered_title');
|
|
31
|
+
|
|
32
|
+
await flushAsync();
|
|
33
|
+
|
|
34
|
+
assert.equal(
|
|
35
|
+
saveCalls[0].language,
|
|
36
|
+
'en-us',
|
|
37
|
+
);
|
|
38
|
+
assert.equal(
|
|
39
|
+
translateStore.messages['en-us'].companies[1].contract.empty.none_registered_title,
|
|
40
|
+
'None registered title',
|
|
41
|
+
);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
test('does not fall back to the translates collection during discovery', async () => {
|
|
45
|
+
installLocalStorage();
|
|
46
|
+
|
|
47
|
+
const calls = [];
|
|
48
|
+
const translate = new Translate(
|
|
49
|
+
[{id: 1}, {id: 5}, {id: 9}],
|
|
50
|
+
{id: 1},
|
|
51
|
+
{id: 5},
|
|
52
|
+
['orders', 'crm'],
|
|
53
|
+
createPendingTranslateStore({
|
|
54
|
+
getItems: async params => {
|
|
55
|
+
calls.push(params);
|
|
56
|
+
return [];
|
|
57
|
+
},
|
|
58
|
+
}),
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
await translate.discoveryAll();
|
|
62
|
+
|
|
63
|
+
assert.deepEqual(calls, []);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
test('resolves queued store discovery through the resolve endpoint', async () => {
|
|
67
|
+
installLocalStorage();
|
|
68
|
+
|
|
69
|
+
const getItemsCalls = [];
|
|
70
|
+
const resolveCalls = [];
|
|
71
|
+
const translateStore = createPendingTranslateStore({
|
|
72
|
+
getItems: async params => {
|
|
73
|
+
getItemsCalls.push(params);
|
|
74
|
+
return [];
|
|
75
|
+
},
|
|
76
|
+
resolveQueuedMessages: async payload => {
|
|
77
|
+
resolveCalls.push(payload);
|
|
78
|
+
|
|
79
|
+
return [
|
|
80
|
+
{
|
|
81
|
+
people: '/people/5',
|
|
82
|
+
language: {
|
|
83
|
+
id: 1,
|
|
84
|
+
language: 'pt-br',
|
|
85
|
+
},
|
|
86
|
+
store: 'financial',
|
|
87
|
+
type: 'label',
|
|
88
|
+
key: 'accountsReceivable',
|
|
89
|
+
translate: 'Contas a receber',
|
|
90
|
+
revised: true,
|
|
91
|
+
},
|
|
92
|
+
];
|
|
93
|
+
},
|
|
94
|
+
});
|
|
95
|
+
const translate = new Translate(
|
|
96
|
+
[{id: 1}, {id: 5}],
|
|
97
|
+
{id: 1},
|
|
98
|
+
{id: 5},
|
|
99
|
+
['financial'],
|
|
100
|
+
translateStore,
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
translateStore.actions.queueMissingTranslate({
|
|
104
|
+
language: 'pt-br',
|
|
105
|
+
companyId: 1,
|
|
106
|
+
store: 'financial',
|
|
107
|
+
type: 'label',
|
|
108
|
+
key: 'accountsReceivable',
|
|
109
|
+
translate: 'Accounts Receivable',
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
await translate.discoveryAll();
|
|
113
|
+
|
|
114
|
+
assert.deepEqual(getItemsCalls, []);
|
|
115
|
+
// Discovery resolves against main+current; mock payload people id drives cache company.
|
|
116
|
+
assert.equal(resolveCalls.length >= 1, true);
|
|
117
|
+
assert.equal(resolveCalls[0].people, '/people/1');
|
|
118
|
+
assert.deepEqual(resolveCalls[0].requests, [
|
|
119
|
+
{
|
|
120
|
+
store: 'financial',
|
|
121
|
+
type: 'label',
|
|
122
|
+
keys: ['accountsReceivable'],
|
|
123
|
+
},
|
|
124
|
+
]);
|
|
125
|
+
assert.equal(
|
|
126
|
+
translateStore.messages['pt-br'].companies[5].financial.label.accountsReceivable,
|
|
127
|
+
'Contas a receber',
|
|
128
|
+
);
|
|
129
|
+
assert.deepEqual(translateStore.pendingMessages, {});
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
test('reuses cached store buckets without refetching after in-memory discovery is cleared', async () => {
|
|
133
|
+
installLocalStorage();
|
|
134
|
+
localStorage.setItem('translates', JSON.stringify({
|
|
135
|
+
'pt-br': {
|
|
136
|
+
companies: {
|
|
137
|
+
1: {
|
|
138
|
+
contract: {
|
|
139
|
+
empty: {
|
|
140
|
+
none_registered_title: 'None registered title',
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
}));
|
|
147
|
+
|
|
148
|
+
const calls = [];
|
|
149
|
+
const translateStore = createPendingTranslateStore({
|
|
150
|
+
getItems: async params => {
|
|
151
|
+
calls.push(params);
|
|
152
|
+
return [];
|
|
153
|
+
},
|
|
154
|
+
});
|
|
155
|
+
const translate = new Translate(
|
|
156
|
+
[{id: 1}],
|
|
157
|
+
{id: 1},
|
|
158
|
+
{id: 1},
|
|
159
|
+
['contract'],
|
|
160
|
+
translateStore,
|
|
161
|
+
);
|
|
162
|
+
|
|
163
|
+
translate.discoveredStores.clear();
|
|
164
|
+
|
|
165
|
+
assert.equal(translate.t('contract', 'empty', 'none_registered_title'), 'None registered title');
|
|
166
|
+
|
|
167
|
+
await flushAsync();
|
|
168
|
+
|
|
169
|
+
assert.deepEqual(calls, []);
|
|
170
|
+
});
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
export const installLocalStorage = (config = {language: 'pt-br'}) => {
|
|
2
|
+
const storage = {};
|
|
3
|
+
|
|
4
|
+
global.localStorage = {
|
|
5
|
+
getItem(key) {
|
|
6
|
+
return Object.prototype.hasOwnProperty.call(storage, key)
|
|
7
|
+
? storage[key]
|
|
8
|
+
: null;
|
|
9
|
+
},
|
|
10
|
+
setItem(key, value) {
|
|
11
|
+
storage[key] = String(value);
|
|
12
|
+
},
|
|
13
|
+
removeItem(key) {
|
|
14
|
+
delete storage[key];
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
localStorage.setItem('config', JSON.stringify(config));
|
|
19
|
+
localStorage.setItem('translates', JSON.stringify({}));
|
|
20
|
+
delete global.refreshTranslationsUI;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const flushAsync = async () => {
|
|
24
|
+
await Promise.resolve();
|
|
25
|
+
await new Promise(resolve => setTimeout(resolve, 0));
|
|
26
|
+
await new Promise(resolve => setTimeout(resolve, 0));
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const normalizeLanguage = value =>
|
|
30
|
+
String(value || '')
|
|
31
|
+
.trim()
|
|
32
|
+
.replace(/_/g, '-')
|
|
33
|
+
.toLowerCase();
|
|
34
|
+
|
|
35
|
+
const normalizeId = value =>
|
|
36
|
+
String(value || '')
|
|
37
|
+
.replace(/\D+/g, '')
|
|
38
|
+
.trim();
|
|
39
|
+
|
|
40
|
+
export const createPendingTranslateStore = ({getItems, save, resolveQueuedMessages} = {}) => {
|
|
41
|
+
const store = {
|
|
42
|
+
getters: {
|
|
43
|
+
messages: {},
|
|
44
|
+
pendingMessages: {},
|
|
45
|
+
},
|
|
46
|
+
actions: {},
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const translateActions = {
|
|
50
|
+
getItems: getItems || (async () => []),
|
|
51
|
+
save: save || (async payload => payload),
|
|
52
|
+
...(resolveQueuedMessages
|
|
53
|
+
? {
|
|
54
|
+
resolveQueuedMessages,
|
|
55
|
+
}
|
|
56
|
+
: {}),
|
|
57
|
+
setMessages: nextMessages => {
|
|
58
|
+
store.getters.messages = nextMessages;
|
|
59
|
+
return nextMessages;
|
|
60
|
+
},
|
|
61
|
+
setPendingMessages: nextMessages => {
|
|
62
|
+
store.getters.pendingMessages = nextMessages;
|
|
63
|
+
return nextMessages;
|
|
64
|
+
},
|
|
65
|
+
queueMissingTranslate: ({language, companyId, store: storeName, type, key, translate}) => {
|
|
66
|
+
const normalizedLanguage = normalizeLanguage(language);
|
|
67
|
+
const normalizedCompanyId = normalizeId(companyId);
|
|
68
|
+
const pendingMessages = store.getters.pendingMessages;
|
|
69
|
+
|
|
70
|
+
if (!pendingMessages[normalizedLanguage]) {
|
|
71
|
+
pendingMessages[normalizedLanguage] = {};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (!pendingMessages[normalizedLanguage].companies) {
|
|
75
|
+
pendingMessages[normalizedLanguage].companies = {};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (!pendingMessages[normalizedLanguage].companies[normalizedCompanyId]) {
|
|
79
|
+
pendingMessages[normalizedLanguage].companies[normalizedCompanyId] = {};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (!pendingMessages[normalizedLanguage].companies[normalizedCompanyId][storeName]) {
|
|
83
|
+
pendingMessages[normalizedLanguage].companies[normalizedCompanyId][storeName] = {};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (
|
|
87
|
+
!pendingMessages[normalizedLanguage].companies[normalizedCompanyId][storeName][type]
|
|
88
|
+
) {
|
|
89
|
+
pendingMessages[normalizedLanguage].companies[normalizedCompanyId][storeName][type] =
|
|
90
|
+
{};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
pendingMessages[normalizedLanguage].companies[normalizedCompanyId][storeName][type][
|
|
94
|
+
key
|
|
95
|
+
] = translate;
|
|
96
|
+
|
|
97
|
+
return pendingMessages;
|
|
98
|
+
},
|
|
99
|
+
removePendingTranslate: ({language, companyId, store: storeName, type, key}) => {
|
|
100
|
+
const normalizedLanguage = normalizeLanguage(language);
|
|
101
|
+
const normalizedCompanyId = normalizeId(companyId);
|
|
102
|
+
const pendingMessages = store.getters.pendingMessages;
|
|
103
|
+
const languageBucket = pendingMessages[normalizedLanguage];
|
|
104
|
+
const companyBucket = languageBucket?.companies?.[normalizedCompanyId];
|
|
105
|
+
const storeBucket = companyBucket?.[storeName];
|
|
106
|
+
const typeBucket = storeBucket?.[type];
|
|
107
|
+
|
|
108
|
+
if (!typeBucket || !Object.prototype.hasOwnProperty.call(typeBucket, key)) {
|
|
109
|
+
return pendingMessages;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
delete typeBucket[key];
|
|
113
|
+
|
|
114
|
+
if (Object.keys(typeBucket).length === 0) {
|
|
115
|
+
delete storeBucket[type];
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (Object.keys(storeBucket).length === 0) {
|
|
119
|
+
delete companyBucket[storeName];
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (Object.keys(companyBucket).length === 0) {
|
|
123
|
+
delete languageBucket.companies[normalizedCompanyId];
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (Object.keys(languageBucket.companies || {}).length === 0) {
|
|
127
|
+
delete languageBucket.companies;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (Object.keys(languageBucket).length === 0) {
|
|
131
|
+
delete pendingMessages[normalizedLanguage];
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return pendingMessages;
|
|
135
|
+
},
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
store.actions = translateActions;
|
|
139
|
+
|
|
140
|
+
return {
|
|
141
|
+
getters: store.getters,
|
|
142
|
+
actions: store.actions,
|
|
143
|
+
get messages() {
|
|
144
|
+
return store.getters.messages;
|
|
145
|
+
},
|
|
146
|
+
get pendingMessages() {
|
|
147
|
+
return store.getters.pendingMessages;
|
|
148
|
+
},
|
|
149
|
+
translateActions,
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
|