@controleonline/ui-common 1.2.70

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 (203) hide show
  1. package/.github/agents/developer.agent.md +30 -0
  2. package/.github/agents/devops.agent.md +30 -0
  3. package/.github/agents/qa.agent.md +30 -0
  4. package/.github/agents/security.agent.md +30 -0
  5. package/.github/workflows/npmjs.yml +35 -0
  6. package/.github/workflows/pull-request-checks.yml +19 -0
  7. package/.scrutinizer.yml +24 -0
  8. package/FUNDING.yml +1 -0
  9. package/package.json +28 -0
  10. package/src/api/fetch.js +74 -0
  11. package/src/api/index.js +155 -0
  12. package/src/api/localDB.js +131 -0
  13. package/src/api/queue.js +66 -0
  14. package/src/react/assets/tap.mp3 +0 -0
  15. package/src/react/components/AddImportModal.js +157 -0
  16. package/src/react/components/AddImportModal.styles.js +81 -0
  17. package/src/react/components/BackgroundRuntimeBridge.js +219 -0
  18. package/src/react/components/BottomNavigationBar.config.js +238 -0
  19. package/src/react/components/BottomNavigationBar.js +120 -0
  20. package/src/react/components/BottomNavigationBar.styles.js +110 -0
  21. package/src/react/components/CategoryForm.js +572 -0
  22. package/src/react/components/CategoryForm.styles.js +334 -0
  23. package/src/react/components/ConfirmModal.js +24 -0
  24. package/src/react/components/ConfirmModal.styles.js +43 -0
  25. package/src/react/components/ContextHelpButton.js +69 -0
  26. package/src/react/components/ContextHelpButton.styles.js +62 -0
  27. package/src/react/components/DefaultProvider.native.js +848 -0
  28. package/src/react/components/DefaultProvider.styles.js +21 -0
  29. package/src/react/components/DefaultProvider.web.js +909 -0
  30. package/src/react/components/DeliveryPushBridge.native.js +314 -0
  31. package/src/react/components/DeliveryPushBridge.web.js +5 -0
  32. package/src/react/components/DeviceAlertSoundService.js +499 -0
  33. package/src/react/components/EntityLogContent.js +909 -0
  34. package/src/react/components/EntityLogContent.styles.js +400 -0
  35. package/src/react/components/EventBus.js +12 -0
  36. package/src/react/components/KioskModeBridge.js +65 -0
  37. package/src/react/components/LauncherModeBridge.js +47 -0
  38. package/src/react/components/LinkedOrderProductsTab.js +388 -0
  39. package/src/react/components/LinkedOrderProductsTab.styles.js +180 -0
  40. package/src/react/components/ManagerPushBridge.native.js +345 -0
  41. package/src/react/components/MessageService.js +314 -0
  42. package/src/react/components/Paywall/Google.js +89 -0
  43. package/src/react/components/PrintService.js +778 -0
  44. package/src/react/components/ProductCatalogCacheService.js +45 -0
  45. package/src/react/components/RemoteCheckoutService.js +292 -0
  46. package/src/react/components/RuntimeBottomNavigationBar.js +151 -0
  47. package/src/react/components/RuntimeInfoFooter.js +214 -0
  48. package/src/react/components/RuntimeInfoFooter.styles.js +56 -0
  49. package/src/react/components/SystemErrorToast.js +29 -0
  50. package/src/react/components/SystemErrorToast.styles.js +38 -0
  51. package/src/react/components/TouchFeedbackProvider.js +65 -0
  52. package/src/react/components/UnifiedPaymentBar.js +155 -0
  53. package/src/react/components/UnifiedPaymentBar.styles.js +174 -0
  54. package/src/react/components/WebsocketListener.native.js +487 -0
  55. package/src/react/components/WebsocketListener.web.js +102 -0
  56. package/src/react/components/inputs/IdInput.js +49 -0
  57. package/src/react/components/inputs/IdInput.styles.js +26 -0
  58. package/src/react/components/inputs/InvoiceDueDateFilterInput.js +74 -0
  59. package/src/react/components/inputs/InvoiceDueDateFilterInput.styles.js +34 -0
  60. package/src/react/components/inputs/InvoiceDueDateRangeFilterInput.js +115 -0
  61. package/src/react/components/inputs/InvoiceDueDateRangeFilterInput.styles.js +39 -0
  62. package/src/react/components/lists/CategoriesList.js +56 -0
  63. package/src/react/components/lists/PaymentTypeList.js +55 -0
  64. package/src/react/components/lists/ReceiverList.js +56 -0
  65. package/src/react/components/lists/SelectList.styles.js +18 -0
  66. package/src/react/components/lists/StatusList.js +55 -0
  67. package/src/react/components/lists/WalletList.js +54 -0
  68. package/src/react/components/radio/Spotify.js +144 -0
  69. package/src/react/components/radio/Spotify.styles.js +32 -0
  70. package/src/react/components/radio/YouTube.js +82 -0
  71. package/src/react/components/radio/YouTube.styles.js +16 -0
  72. package/src/react/components/toastConfig.js +16 -0
  73. package/src/react/config/deviceConfigBootstrap.js +571 -0
  74. package/src/react/index.js +4 -0
  75. package/src/react/localStorage.js +30 -0
  76. package/src/react/pages/EntityLogPage.js +124 -0
  77. package/src/react/pages/EntityLogPage.styles.js +17 -0
  78. package/src/react/pages/GenericLogPage.js +760 -0
  79. package/src/react/pages/GenericLogPage.styles.js +401 -0
  80. package/src/react/pages/Imports.js +361 -0
  81. package/src/react/pages/Imports.styles.js +223 -0
  82. package/src/react/pages/SettingsPage/PaymentTypesByWalletTab.js +462 -0
  83. package/src/react/pages/SettingsPage/index.js +1171 -0
  84. package/src/react/pages/SettingsPage/index.styles.js +122 -0
  85. package/src/react/print/jobs.js +147 -0
  86. package/src/react/print/providers/local.js +53 -0
  87. package/src/react/print/providers/remote.js +81 -0
  88. package/src/react/print/selection.js +296 -0
  89. package/src/react/print/usePrintButtonController.js +474 -0
  90. package/src/react/router/routes.js +42 -0
  91. package/src/react/services/NetworkPrinterService.native.js +391 -0
  92. package/src/react/services/NetworkPrinterService.web.js +15 -0
  93. package/src/react/stores/index.js +128 -0
  94. package/src/react/stores/storeErrorBridge.js +36 -0
  95. package/src/react/utils/backgroundRuntimeRegistration.js +69 -0
  96. package/src/react/utils/cashPayment.js +87 -0
  97. package/src/react/utils/commercialDocumentOrders.js +269 -0
  98. package/src/react/utils/dateRangeFilter.js +264 -0
  99. package/src/react/utils/deviceRuntime.js +193 -0
  100. package/src/react/utils/entityDisplay.js +231 -0
  101. package/src/react/utils/entityLog.js +649 -0
  102. package/src/react/utils/fileUrl.js +102 -0
  103. package/src/react/utils/frontendDebugLog.js +45 -0
  104. package/src/react/utils/googleMapsConfig.js +49 -0
  105. package/src/react/utils/importStatus.js +100 -0
  106. package/src/react/utils/invoiceDueDateMessages.js +14 -0
  107. package/src/react/utils/invoicePresentation.js +46 -0
  108. package/src/react/utils/logSettings.js +143 -0
  109. package/src/react/utils/maintenanceSettings.js +53 -0
  110. package/src/react/utils/managerOrderNotifications.js +523 -0
  111. package/src/react/utils/mapNavigation.js +76 -0
  112. package/src/react/utils/menuCatalogConfig.js +8 -0
  113. package/src/react/utils/menuCatalogDownload.js +157 -0
  114. package/src/react/utils/networkCameraDevices.js +175 -0
  115. package/src/react/utils/networkDeviceProfiles.js +135 -0
  116. package/src/react/utils/normalizedCatalogDownload.js +157 -0
  117. package/src/react/utils/notificationNavigation.js +94 -0
  118. package/src/react/utils/notificationSound.js +42 -0
  119. package/src/react/utils/paymentDevices.js +397 -0
  120. package/src/react/utils/paymentGatewayExecution.js +91 -0
  121. package/src/react/utils/paymentOptions.js +88 -0
  122. package/src/react/utils/peopleDisplay.js +39 -0
  123. package/src/react/utils/printerDevices.js +465 -0
  124. package/src/react/utils/remotePayment.js +61 -0
  125. package/src/react/utils/runtimeFooter.js +475 -0
  126. package/src/react/utils/runtimeLanguage.js +50 -0
  127. package/src/react/utils/runtimeMenu.js +224 -0
  128. package/src/react/utils/screenMetrics.js +30 -0
  129. package/src/react/utils/shopConfig.js +294 -0
  130. package/src/react/utils/shopFranchises.js +114 -0
  131. package/src/react/utils/socketRuntimePipeline.js +454 -0
  132. package/src/react/utils/spoolAckTracker.js +77 -0
  133. package/src/react/utils/storeColumns.js +427 -0
  134. package/src/react/utils/systemErrorChannel.js +109 -0
  135. package/src/react/utils/systemErrorMessage.js +67 -0
  136. package/src/react/utils/toastPresentation.js +53 -0
  137. package/src/react/utils/websocketSharedRuntime.js +826 -0
  138. package/src/store/acl/getters.js +4 -0
  139. package/src/store/acl/index.js +19 -0
  140. package/src/store/acl/mutation_types.js +4 -0
  141. package/src/store/acl/mutations.js +17 -0
  142. package/src/store/address/city.js +22 -0
  143. package/src/store/categories/category_file/index.js +25 -0
  144. package/src/store/categories/index.js +93 -0
  145. package/src/store/configs/customActions.js +131 -0
  146. package/src/store/configs/index.js +25 -0
  147. package/src/store/connections/customActions.js +26 -0
  148. package/src/store/connections/index.js +124 -0
  149. package/src/store/device/index.js +22 -0
  150. package/src/store/device_config/customActions.js +190 -0
  151. package/src/store/device_config/index.js +28 -0
  152. package/src/store/entity_log/customActions.js +63 -0
  153. package/src/store/entity_log/index.js +25 -0
  154. package/src/store/extra/data.js +85 -0
  155. package/src/store/extra/fields.js +88 -0
  156. package/src/store/file/actions.js +27 -0
  157. package/src/store/file/index.js +24 -0
  158. package/src/store/imports/index.js +88 -0
  159. package/src/store/print/customActions.js +251 -0
  160. package/src/store/print/index.js +28 -0
  161. package/src/store/printer/customActions.js +54 -0
  162. package/src/store/printer/index.js +26 -0
  163. package/src/store/runtime_debug/customActions.js +71 -0
  164. package/src/store/runtime_debug/index.js +30 -0
  165. package/src/store/status/index.js +65 -0
  166. package/src/store/timezones/index.js +43 -0
  167. package/src/store/websocket/customActions.js +24 -0
  168. package/src/store/websocket/index.js +28 -0
  169. package/src/tests/react/components/LauncherModeBridge.test.js +93 -0
  170. package/src/tests/react/config/deviceConfigBootstrap.test.js +337 -0
  171. package/src/tests/react/print/localPrintProvider.test.js +45 -0
  172. package/src/tests/react/utils/backgroundRuntimeRegistration.test.js +123 -0
  173. package/src/tests/react/utils/cashPayment.test.js +41 -0
  174. package/src/tests/react/utils/dateRangeFilter.test.mjs +29 -0
  175. package/src/tests/react/utils/entityDisplay.test.js +18 -0
  176. package/src/tests/react/utils/googleMapsConfig.test.js +32 -0
  177. package/src/tests/react/utils/importStatus.test.js +85 -0
  178. package/src/tests/react/utils/invoicePresentation.test.mjs +40 -0
  179. package/src/tests/react/utils/managerOrderNotifications.test.js +127 -0
  180. package/src/tests/react/utils/mapNavigation.test.js +58 -0
  181. package/src/tests/react/utils/notificationNavigation.test.js +39 -0
  182. package/src/tests/react/utils/notificationSound.test.js +27 -0
  183. package/src/tests/react/utils/paymentDevices.test.js +88 -0
  184. package/src/tests/react/utils/runtimeFooter.test.js +429 -0
  185. package/src/tests/react/utils/runtimeLanguage.test.js +80 -0
  186. package/src/tests/react/utils/runtimeMenu.test.js +174 -0
  187. package/src/tests/react/utils/shopFranchises.test.js +82 -0
  188. package/src/tests/react/utils/socketRuntimePipeline.test.js +124 -0
  189. package/src/tests/react/utils/spoolAckTracker.test.js +40 -0
  190. package/src/tests/react/utils/storeErrorBridge.test.js +66 -0
  191. package/src/tests/react/utils/systemErrorChannel.test.js +58 -0
  192. package/src/tests/react/utils/systemErrorMessage.test.js +59 -0
  193. package/src/tests/react/utils/toastPresentation.test.js +75 -0
  194. package/src/tests/react/utils/translate.test.mjs +396 -0
  195. package/src/tests/react/utils/websocketSharedRuntime.test.js +245 -0
  196. package/src/utils/apiEntryPoint.js +31 -0
  197. package/src/utils/appDomain.js +50 -0
  198. package/src/utils/config.js +14 -0
  199. package/src/utils/formatter.js +419 -0
  200. package/src/utils/integrationConfigs.js +79 -0
  201. package/src/utils/methods.js +23 -0
  202. package/src/utils/oauth.js +42 -0
  203. package/src/utils/translate.js +620 -0
@@ -0,0 +1,190 @@
1
+ import {api} from '@controleonline/ui-common/src/api';
2
+ import * as types from '@controleonline/ui-default/src/store/default/mutation_types';
3
+ import {isWebRuntimeDevice} from '@controleonline/ui-common/src/react/utils/deviceRuntime';
4
+
5
+ const normalizePeopleKey = value =>
6
+ String(value || '')
7
+ .replace(/\D+/g, '')
8
+ .trim();
9
+
10
+ const buildPeopleIri = value => {
11
+ const peopleKey = normalizePeopleKey(value);
12
+ return peopleKey ? `/people/${peopleKey}` : '';
13
+ };
14
+
15
+ const getDeviceId = () => {
16
+ const storedDevice = getStoredDevice();
17
+ if (storedDevice?.id) {
18
+ return storedDevice.id;
19
+ }
20
+
21
+ return null;
22
+ };
23
+
24
+ const getStoredDevice = () => {
25
+ if (typeof window !== 'undefined' && typeof localStorage !== 'undefined') {
26
+ try {
27
+ const device = JSON.parse(localStorage.getItem('device') || '{}');
28
+ return device || {};
29
+ } catch (e) {
30
+ console.warn('Erro ao ler device do localStorage:', e);
31
+ }
32
+ }
33
+
34
+ return {};
35
+ };
36
+
37
+ export const addDeviceConfigs = ({commit, getters}, params) => {
38
+ let configsObj = {};
39
+ if (params.configs) {
40
+ if (typeof params.configs === 'string') {
41
+ try {
42
+ configsObj = JSON.parse(params.configs);
43
+ } catch (e) {
44
+ configsObj = {};
45
+ }
46
+ } else if (typeof params.configs === 'object') {
47
+ configsObj = params.configs;
48
+ }
49
+ }
50
+
51
+ const storedDevice = getStoredDevice();
52
+ const updatedParams = {
53
+ ...params,
54
+ device: params.device || getDeviceId(),
55
+ type: params.type || getters.item?.type || storedDevice?.type,
56
+ configs: JSON.stringify(configsObj),
57
+ };
58
+ const isRuntimeWebDevice =
59
+ isWebRuntimeDevice(storedDevice) &&
60
+ updatedParams.device &&
61
+ updatedParams.device === storedDevice?.id;
62
+ const canPersistRuntimeWebDevice =
63
+ isRuntimeWebDevice &&
64
+ !!updatedParams.device &&
65
+ !!updatedParams.people;
66
+
67
+ const nextItem = {
68
+ ...(getters.item || {}),
69
+ type: updatedParams.type || getters.item?.type,
70
+ device:
71
+ getters.item?.device || {
72
+ id: storedDevice.id,
73
+ device: storedDevice.id,
74
+ },
75
+ people: params.people || getters.item?.people,
76
+ configs: {
77
+ ...(getters.item?.configs || {}),
78
+ ...configsObj,
79
+ },
80
+ };
81
+
82
+ if (isRuntimeWebDevice) {
83
+ commit(types.SET_ITEM, nextItem);
84
+ if (!canPersistRuntimeWebDevice) {
85
+ return Promise.resolve(nextItem);
86
+ }
87
+ }
88
+
89
+ let options = {
90
+ method: 'POST',
91
+ body: updatedParams,
92
+ };
93
+ commit(types.SET_ISSAVING, true);
94
+
95
+ return api
96
+ .fetch(getters.resourceEndpoint + '/add-configs', options)
97
+ .then(data => {
98
+ let parsedConfigs = {};
99
+ if (data?.configs) {
100
+ if (typeof data.configs === 'string') {
101
+ try {
102
+ parsedConfigs = JSON.parse(data.configs);
103
+ } catch (e) {
104
+ parsedConfigs = {};
105
+ }
106
+ } else if (typeof data.configs === 'object') {
107
+ parsedConfigs = data.configs;
108
+ }
109
+ }
110
+ const hasParsedConfigs =
111
+ parsedConfigs && Object.keys(parsedConfigs).length > 0;
112
+ const d = {
113
+ ...getters.item,
114
+ ...data,
115
+ type: data?.type || nextItem.type || getters.item?.type,
116
+ configs: hasParsedConfigs
117
+ ? parsedConfigs
118
+ : nextItem.configs || getters.item?.configs || {},
119
+ };
120
+ commit(types.SET_ITEM, d);
121
+ return d;
122
+ })
123
+ .catch(e => {
124
+ console.error('addDeviceConfigs API error:', e);
125
+ commit(types.SET_ERROR, e.message);
126
+ throw e;
127
+ })
128
+ .finally(() => {
129
+ commit(types.SET_ISSAVING, false);
130
+ });
131
+ };
132
+
133
+ export const getCompanyDeviceConfigs = ({commit, getters}, params = {}) => {
134
+ const peopleKey = normalizePeopleKey(params?.people);
135
+ const people = buildPeopleIri(params?.people);
136
+
137
+ if (!peopleKey || !people) {
138
+ return Promise.resolve([]);
139
+ }
140
+
141
+ commit(types.SET_ISLOADING, true);
142
+ if (getters.items != null) commit(types.SET_ITEMS, []);
143
+ commit(types.SET_TOTALITEMS, 0);
144
+ commit(types.SET_SUMMARY, {});
145
+
146
+ return api
147
+ .fetch(getters.resourceEndpoint, {
148
+ params: {
149
+ ...params,
150
+ people,
151
+ },
152
+ })
153
+ .then(data => {
154
+ const items = data?.member || data?.['hydra:member'] || [];
155
+ commit(types.SET_ITEMS, items);
156
+ commit(types.SET_TOTALITEMS, data?.totalItems || items.length || 0);
157
+ commit(types.SET_SUMMARY, data?.summary || {});
158
+ commit(types.SET_LOADED_KEY, peopleKey);
159
+ commit(types.SET_LOADED_AT, Date.now());
160
+ return items;
161
+ })
162
+ .catch(e => {
163
+ commit(types.SET_ERROR, e.message);
164
+ throw e;
165
+ })
166
+ .finally(() => {
167
+ commit(types.SET_ISLOADING, false);
168
+ });
169
+ };
170
+
171
+ export const ensureCompanyDeviceConfigsLoaded = (context, params = {}) => {
172
+ const peopleKey = normalizePeopleKey(params?.people);
173
+ if (!peopleKey) {
174
+ return Promise.resolve([]);
175
+ }
176
+
177
+ if (
178
+ context.getters.loadedKey === peopleKey &&
179
+ Array.isArray(context.getters.items)
180
+ ) {
181
+ return Promise.resolve(context.getters.items);
182
+ }
183
+
184
+ if (context.getters.isLoading) {
185
+ return Promise.resolve(context.getters.items || []);
186
+ }
187
+
188
+ return getCompanyDeviceConfigs(context, params);
189
+ };
190
+
@@ -0,0 +1,28 @@
1
+ import * as actions from '@controleonline/ui-default/src/store/default/actions';
2
+ import * as getters from '@controleonline/ui-default/src/store/default/getters';
3
+ import mutations from '@controleonline/ui-default/src/store/default/mutations';
4
+ import * as customActions from './customActions';
5
+
6
+ export default {
7
+ namespaced: true,
8
+ state: {
9
+ item: {},
10
+ items: [],
11
+ resourceEndpoint: 'device_configs',
12
+ isLoading: false,
13
+ isSaving: false,
14
+ error: '',
15
+ totalItems: 0,messages:[], message:{},
16
+ summary: {},
17
+ loadedKey: '',
18
+ loadedAt: 0,
19
+ filters: {},
20
+ columns: [],
21
+ },
22
+ actions: {
23
+ ...customActions,
24
+ ...actions,
25
+ },
26
+ getters,
27
+ mutations,
28
+ };
@@ -0,0 +1,63 @@
1
+ import {api} from '@controleonline/ui-common/src/api';
2
+
3
+ const extractCollectionItems = response => {
4
+ if (Array.isArray(response)) return response;
5
+ if (Array.isArray(response?.member)) return response.member;
6
+ if (Array.isArray(response?.['hydra:member'])) return response['hydra:member'];
7
+ return [];
8
+ };
9
+
10
+ const extractItem = response => {
11
+ if (response?.response?.data && typeof response.response.data === 'object') {
12
+ return response.response.data;
13
+ }
14
+
15
+ return response && typeof response === 'object' && !Array.isArray(response)
16
+ ? response
17
+ : null;
18
+ };
19
+
20
+ const normalizeEntityIri = entityIri =>
21
+ typeof entityIri === 'string' ? entityIri.trim() : '';
22
+
23
+ // Mantemos o acesso ao backend do historico concentrado nesta store.
24
+ export const getTimeline = ({getters}, params = {}) => {
25
+ const hasExplicitType = Object.prototype.hasOwnProperty.call(params || {}, 'type');
26
+ const hasEntityTarget =
27
+ !!String(params?.class || '').trim() ||
28
+ !!String(params?.entity || '').trim() ||
29
+ Number(params?.row) > 0;
30
+ const query = {
31
+ 'order[createdAt]': 'desc',
32
+ ...(!hasExplicitType && hasEntityTarget ? {type: 'entity'} : {}),
33
+ ...(params || {}),
34
+ };
35
+
36
+ return api.fetch(getters.resourceEndpoint, {params: query}).then(response => {
37
+ const items = extractCollectionItems(response);
38
+
39
+ return {
40
+ items,
41
+ summary: response?.summary || {},
42
+ totalItems: Number(
43
+ response?.totalItems || response?.['hydra:totalItems'] || items.length || 0,
44
+ ),
45
+ };
46
+ });
47
+ };
48
+
49
+ export const getEntityDetail = (_context, entityIri = '') => {
50
+ const normalizedEntityIri = normalizeEntityIri(entityIri);
51
+ if (!normalizedEntityIri) {
52
+ throw new Error('Entidade sem identificador para consulta.');
53
+ }
54
+
55
+ return api.fetch(normalizedEntityIri).then(response => {
56
+ const item = extractItem(response);
57
+ if (!item) {
58
+ throw new Error('Resposta vazia para a entidade.');
59
+ }
60
+
61
+ return item;
62
+ });
63
+ };
@@ -0,0 +1,25 @@
1
+ import * as actions from '@controleonline/ui-default/src/store/default/actions';
2
+ import * as getters from '@controleonline/ui-default/src/store/default/getters';
3
+ import mutations from '@controleonline/ui-default/src/store/default/mutations';
4
+ import * as customActions from './customActions';
5
+
6
+ export default {
7
+ namespaced: true,
8
+ state: {
9
+ item: {},
10
+ items: [],
11
+ resourceEndpoint: 'logs',
12
+ isLoading: false,
13
+ reload: false,
14
+ error: '',
15
+ totalItems: 0,
16
+ summary: {},
17
+ messages: [],
18
+ message: {},
19
+ filters: {},
20
+ columns: [],
21
+ },
22
+ actions: {...actions, ...customActions},
23
+ getters,
24
+ mutations,
25
+ };
@@ -0,0 +1,85 @@
1
+ import * as actions from "@controleonline/ui-default/src/store/default/actions";
2
+ import * as getters from "@controleonline/ui-default/src/store/default/getters";
3
+ import mutations from "@controleonline/ui-default/src/store/default/mutations";
4
+
5
+ export default {
6
+ namespaced: true,
7
+ state: {
8
+ item:{},
9
+ items:[],
10
+ resourceEndpoint: "extra_data",
11
+ isLoading: false,
12
+ error: "",
13
+
14
+ totalItems: 0,messages:[], message:{},
15
+
16
+ summary: {},
17
+ filters: {},
18
+ columns: [
19
+ {
20
+ editable: false,
21
+ isIdentity: true,
22
+ sortable: true,
23
+ name: "id",
24
+ align: "left",
25
+ label: "id",
26
+ sum: false,
27
+ format: function (value) {
28
+ return "#" + value;
29
+ },
30
+ },
31
+ {
32
+ externalFilter: false,
33
+ sortable: true,
34
+ name: "typeValue",
35
+ align: "left",
36
+ label: "typeValue",
37
+ sum: false,
38
+ format: function (value) {
39
+ return value;
40
+ },
41
+ },
42
+ {
43
+ externalFilter: false,
44
+ sortable: true,
45
+ name: "fieldType",
46
+ align: "left",
47
+ label: "fieldType",
48
+ sum: false,
49
+ list: [
50
+ { value: "text", label: "text" },
51
+ { value: "select", label: "select" },
52
+ { value: "date-range", label: "date-range" },
53
+ ],
54
+ format: function (value) {
55
+ return value;
56
+ },
57
+ },
58
+ {
59
+ externalFilter: false,
60
+ sortable: true,
61
+ name: "required",
62
+ align: "left",
63
+ label: "required",
64
+ sum: false,
65
+ format: function (value) {
66
+ return value;
67
+ },
68
+ },
69
+ {
70
+ externalFilter: false,
71
+ sortable: true,
72
+ name: "fieldConfigs",
73
+ align: "left",
74
+ label: "fieldConfigs",
75
+ sum: false,
76
+ format: function (value) {
77
+ return value;
78
+ },
79
+ },
80
+ ],
81
+ },
82
+ actions: actions,
83
+ getters,
84
+ mutations,
85
+ };
@@ -0,0 +1,88 @@
1
+ import * as actions from "@controleonline/ui-default/src/store/default/actions";
2
+ import * as getters from "@controleonline/ui-default/src/store/default/getters";
3
+ import mutations from "@controleonline/ui-default/src/store/default/mutations";
4
+
5
+ export default {
6
+ namespaced: true,
7
+ state: {
8
+ item:{},
9
+ items:[],
10
+ resourceEndpoint: "extra_fields",
11
+ isLoading: false,
12
+ error: "",
13
+
14
+ totalItems: 0,messages:[], message:{},
15
+
16
+ summary: {},
17
+ filters: {},
18
+ columns: [
19
+ {
20
+ editable: false,
21
+ isIdentity: true,
22
+ sortable: true,
23
+ name: "id",
24
+ align: "left",
25
+ label: "id",
26
+ sum: false,
27
+ format: function (value) {
28
+ return "#" + value;
29
+ },
30
+ },
31
+ {
32
+ externalFilter: false,
33
+ sortable: true,
34
+ name: "name",
35
+ align: "left",
36
+ label: "name",
37
+ sum: false,
38
+ format: function (value) {
39
+ return value;
40
+ },
41
+ },
42
+ {
43
+ externalFilter: false,
44
+ sortable: true,
45
+ name: "type",
46
+ align: "left",
47
+ label: "type",
48
+ sum: false,
49
+ list: [
50
+ { value: "text", label: "text" },
51
+ { value: "select", label: "select" },
52
+ { value: "date-range", label: "date-range" },
53
+ ],
54
+ format: function (value) {
55
+ return value;
56
+ },
57
+ },
58
+ {
59
+ externalFilter: false,
60
+ sortable: true,
61
+ name: "required",
62
+ align: "left",
63
+ label: "required",
64
+ sum: false,
65
+ format: function (value) {
66
+ return value;
67
+ },
68
+ saveFormat: function (value) {
69
+ return false;
70
+ },
71
+ },
72
+ {
73
+ externalFilter: false,
74
+ sortable: true,
75
+ name: "configs",
76
+ align: "left",
77
+ label: "configs",
78
+ sum: false,
79
+ format: function (value) {
80
+ return value;
81
+ },
82
+ },
83
+ ],
84
+ },
85
+ actions: actions,
86
+ getters,
87
+ mutations,
88
+ };
@@ -0,0 +1,27 @@
1
+ import { api } from "@controleonline/ui-common/src/api";
2
+
3
+ import * as types from "@controleonline/ui-default/src/store/default/mutation_types";
4
+
5
+ export const convert = ({ commit, getters }, params) => {
6
+ let id = params.id;
7
+ delete params.id;
8
+
9
+ let options = {
10
+ method: "POST",
11
+ body: params,
12
+ };
13
+ commit(types.SET_ISSAVING, true);
14
+
15
+ return api
16
+ .fetch("/files/" + id + "/convert", options)
17
+ .then((data) => {
18
+ return data;
19
+ })
20
+ .catch((e) => {
21
+ commit(types.SET_ERROR, e.message);
22
+ throw e;
23
+ })
24
+ .finally((e) => {
25
+ commit(types.SET_ISSAVING, false);
26
+ });
27
+ };
@@ -0,0 +1,24 @@
1
+ import * as actions from "@controleonline/ui-default/src/store/default/actions";
2
+ import * as getters from "@controleonline/ui-default/src/store/default/getters";
3
+ import mutations from "@controleonline/ui-default/src/store/default/mutations";
4
+ import * as customActions from "./actions";
5
+
6
+ export default {
7
+ namespaced: true,
8
+ state: {
9
+ item:{},
10
+ items:[],
11
+ resourceEndpoint: "files",
12
+ isLoading: false,
13
+ error: "",
14
+
15
+ totalItems: 0,messages:[], message:{},
16
+
17
+ summary: {},
18
+ filters: {},
19
+ columns: [],
20
+ },
21
+ actions: { ...actions, ...customActions },
22
+ getters,
23
+ mutations,
24
+ };
@@ -0,0 +1,88 @@
1
+ import * as actions from "@controleonline/ui-default/src/store/default/actions";
2
+ import * as getters from "@controleonline/ui-default/src/store/default/getters";
3
+ import mutations from "@controleonline/ui-default/src/store/default/mutations";
4
+
5
+ export default {
6
+ namespaced: true,
7
+ state: {
8
+ item: {},
9
+ items: [],
10
+ resourceEndpoint: "imports",
11
+ isLoading: false,
12
+ error: "",
13
+
14
+ totalItems: 0, messages: [], message: {},
15
+
16
+ summary: {},
17
+ filters: {},
18
+ columns: [
19
+ {
20
+ editable: false,
21
+ isIdentity: true,
22
+ sortable: true,
23
+ name: "id",
24
+ align: "left",
25
+ label: "id",
26
+ sum: false,
27
+ format: function (value) {
28
+ return "#" + value;
29
+ },
30
+ },
31
+ {
32
+ externalFilter: false,
33
+ sortable: true,
34
+ name: "field_name",
35
+ align: "left",
36
+ label: "field_name",
37
+ sum: false,
38
+ format: function (value) {
39
+ return value;
40
+ },
41
+ },
42
+ {
43
+ externalFilter: false,
44
+ sortable: true,
45
+ name: "field_type",
46
+ align: "left",
47
+ label: "field_type",
48
+ sum: false,
49
+ list: [
50
+ { value: "text", label: "text" },
51
+ { value: "select", label: "select" },
52
+ { value: "date-range", label: "date-range" },
53
+ ],
54
+ format: function (value) {
55
+ return value;
56
+ },
57
+ },
58
+ {
59
+ externalFilter: false,
60
+ sortable: true,
61
+ name: "required",
62
+ align: "left",
63
+ label: "required",
64
+ sum: false,
65
+ format: function (value) {
66
+ return value;
67
+ },
68
+ saveFormat: function (value) {
69
+ return false;
70
+ },
71
+ },
72
+ {
73
+ externalFilter: false,
74
+ sortable: true,
75
+ name: "field_configs",
76
+ align: "left",
77
+ label: "field_configs",
78
+ sum: false,
79
+ format: function (value) {
80
+ return value;
81
+ },
82
+ },
83
+ ],
84
+ },
85
+ actions: actions,
86
+ getters,
87
+ mutations,
88
+ };