@controleonline/ui-common 1.2.112 → 1.2.114
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/.release/rc-manifest.json +6 -6
- package/package.json +1 -1
- package/src/react/components/CategoryForm.js +539 -539
- package/src/react/components/DefaultProvider.native.js +2 -2
- package/src/react/components/DefaultProvider.web.js +2 -2
- package/src/react/components/integrations/IntegrationHero/index.js +1 -1
- package/src/react/components/integrations/IntegrationHero/styles.js +2 -2
- package/src/react/components/integrations/IntegrationTabs/index.js +1 -1
- package/src/react/components/integrations/IntegrationTabs/styles.js +1 -1
- package/src/react/pages/AiProviderConfigPage.js +304 -0
- package/src/react/pages/Connections.js +96 -18
- package/src/react/pages/Connections.styles.js +72 -72
- package/src/react/pages/Devices/detail/DeviceDetailHeader.js +1 -1
- package/src/react/pages/Devices/detail/DeviceDetailMovementSections.js +1 -1
- package/src/react/pages/Devices/detail/useDeviceDetailStateA.js +2 -2
- package/src/react/pages/Devices/detail/useDeviceDetailStateB.js +2 -2
- package/src/react/pages/Devices/deviceTypes/DeviceGroupCard.js +1 -1
- package/src/react/pages/Devices/deviceTypes/shared.js +2 -2
- package/src/react/pages/Devices.js +2 -2
- package/src/react/pages/Devices.styles.js +353 -353
- package/src/react/pages/Food99IntegrationPage/components/Food99CatalogTab.js +219 -219
- package/src/react/pages/Food99IntegrationPage/components/Food99OverviewTab.js +134 -134
- package/src/react/pages/Food99IntegrationPage/components/Food99PreviewModal.js +173 -173
- package/src/react/pages/Food99IntegrationPage/components/Food99QuickWalletModal.js +1 -1
- package/src/react/pages/Food99IntegrationPage/components/Food99SettingsTab.js +306 -306
- package/src/react/pages/Food99IntegrationPage/components/Food99StoreTab.js +417 -417
- package/src/react/pages/Food99IntegrationPage/index.js +1530 -1530
- package/src/react/pages/Food99IntegrationPage/styles.js +792 -792
- package/src/react/pages/IFoodIntegrationPage/components/IFoodOperationsTab.js +267 -267
- package/src/react/pages/IFoodIntegrationPage/components/IFoodOverviewTab.js +118 -118
- package/src/react/pages/IFoodIntegrationPage/components/IFoodPreviewModal.js +101 -101
- package/src/react/pages/IFoodIntegrationPage/components/IFoodStoreTab.js +150 -150
- package/src/react/pages/IFoodIntegrationPage/index.js +1298 -1298
- package/src/react/pages/Imports.js +1 -1
- package/src/react/pages/Imports.styles.js +223 -223
- package/src/react/pages/IntegrationConfigPage.js +2 -2
- package/src/react/pages/Integrations.js +15 -2
- package/src/react/pages/Integrations.styles.js +130 -130
- package/src/react/pages/LinkedInIntegrationPage.js +2 -2
- package/src/react/pages/ManagerOrderNotificationsPage.js +642 -642
- package/src/react/pages/MarketplaceIntegrationPage/components/MarketplaceProductCard.js +205 -205
- package/src/react/pages/MercadoLivreIntegrationPage.js +2 -2
- package/src/react/pages/PrinterDeviceDetailPage.js +1915 -1915
- package/src/react/pages/PrinterDeviceFormPage.js +2 -2
- package/src/react/pages/WhatsAppConnectionPage.js +364 -280
- package/src/react/pages/WhatsAppConnectionPage.styles.js +279 -315
- package/src/react/pages/WhatsAppProviderForm.js +1 -1
- package/src/react/pages/integrationsCatalog.js +184 -0
- package/src/react/pages/whatsAppConnectionHelpers.js +10 -38
- package/src/react/router/publicRoutes.js +0 -3
- package/src/react/utils/fileUrl.js +1 -1
- package/src/store/connections/customActions.js +14 -16
- package/src/store/connections/index.js +105 -109
- package/src/react/router/__tests__/publicRoutes.test.js +0 -12
|
@@ -90,6 +90,70 @@ export const INTEGRATION_LIST = [
|
|
|
90
90
|
accent: '#0EA5E9',
|
|
91
91
|
icon: 'truck',
|
|
92
92
|
},
|
|
93
|
+
{
|
|
94
|
+
key: 'ai-grok',
|
|
95
|
+
label: 'Grok (xAI)',
|
|
96
|
+
route: 'AiProviderConfigPage',
|
|
97
|
+
routeParams: {providerKey: 'grok'},
|
|
98
|
+
accent: '#111827',
|
|
99
|
+
icon: 'cpu',
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
key: 'ai-openai',
|
|
103
|
+
label: 'Codex / OpenAI',
|
|
104
|
+
route: 'AiProviderConfigPage',
|
|
105
|
+
routeParams: {providerKey: 'openai'},
|
|
106
|
+
accent: '#10A37F',
|
|
107
|
+
icon: 'cpu',
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
key: 'ai-gemini',
|
|
111
|
+
label: 'Gemini',
|
|
112
|
+
route: 'AiProviderConfigPage',
|
|
113
|
+
routeParams: {providerKey: 'gemini'},
|
|
114
|
+
accent: '#4285F4',
|
|
115
|
+
icon: 'cpu',
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
key: 'ai-claude',
|
|
119
|
+
label: 'Claude',
|
|
120
|
+
route: 'AiProviderConfigPage',
|
|
121
|
+
routeParams: {providerKey: 'claude'},
|
|
122
|
+
accent: '#D97706',
|
|
123
|
+
icon: 'cpu',
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
key: 'google-oauth',
|
|
127
|
+
label: 'Google Login',
|
|
128
|
+
route: 'IntegrationConfigPage',
|
|
129
|
+
routeParams: {providerKey: 'google-oauth'},
|
|
130
|
+
accent: '#EA4335',
|
|
131
|
+
icon: 'log-in',
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
key: 'cielo',
|
|
135
|
+
label: 'Cielo',
|
|
136
|
+
route: 'IntegrationConfigPage',
|
|
137
|
+
routeParams: {providerKey: 'cielo'},
|
|
138
|
+
accent: '#00A4E0',
|
|
139
|
+
icon: 'credit-card',
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
key: 'new-relic',
|
|
143
|
+
label: 'New Relic',
|
|
144
|
+
route: 'IntegrationConfigPage',
|
|
145
|
+
routeParams: {providerKey: 'new-relic'},
|
|
146
|
+
accent: '#1CE783',
|
|
147
|
+
icon: 'activity',
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
key: 'spotify',
|
|
151
|
+
label: 'Spotify',
|
|
152
|
+
route: 'IntegrationConfigPage',
|
|
153
|
+
routeParams: {providerKey: 'spotify'},
|
|
154
|
+
accent: '#1DB954',
|
|
155
|
+
icon: 'music',
|
|
156
|
+
},
|
|
93
157
|
];
|
|
94
158
|
|
|
95
159
|
export const INTEGRATION_CONFIGS = {
|
|
@@ -350,7 +414,127 @@ export const INTEGRATION_CONFIGS = {
|
|
|
350
414
|
placeholder: 'Codigo do conveniado (se aplicavel)',
|
|
351
415
|
},
|
|
352
416
|
],
|
|
417
|
+
},,
|
|
418
|
+
|
|
419
|
+
'google-oauth': {
|
|
420
|
+
key: 'google-oauth',
|
|
421
|
+
label: 'Google Login',
|
|
422
|
+
accent: '#EA4335',
|
|
423
|
+
icon: 'log-in',
|
|
424
|
+
description:
|
|
425
|
+
'Client ID OAuth Google da empresa principal. Controla o botao Entrar com Google no login web.',
|
|
426
|
+
visibility: 'public',
|
|
427
|
+
requiredKeys: [],
|
|
428
|
+
fields: [
|
|
429
|
+
{
|
|
430
|
+
key: 'OAUTH_GOOGLE_CLIENT_ID',
|
|
431
|
+
label: 'OAUTH_GOOGLE_CLIENT_ID',
|
|
432
|
+
placeholder: 'xxxxx.apps.googleusercontent.com',
|
|
433
|
+
},
|
|
434
|
+
],
|
|
353
435
|
},
|
|
436
|
+
cielo: {
|
|
437
|
+
key: 'cielo',
|
|
438
|
+
label: 'Cielo',
|
|
439
|
+
accent: '#00A4E0',
|
|
440
|
+
icon: 'credit-card',
|
|
441
|
+
description:
|
|
442
|
+
'Credenciais Cielo vinculadas a empresa principal (pagamento).',
|
|
443
|
+
bundleKey: 'CIELO',
|
|
444
|
+
visibility: 'private',
|
|
445
|
+
requiredKeys: ['ACCESS_TOKEN', 'CLIENT_ID'],
|
|
446
|
+
fields: [
|
|
447
|
+
{
|
|
448
|
+
key: 'ACCESS_TOKEN',
|
|
449
|
+
label: 'ACCESS_TOKEN',
|
|
450
|
+
placeholder: 'Token da integracao Cielo',
|
|
451
|
+
secureTextEntry: true,
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
key: 'CLIENT_ID',
|
|
455
|
+
label: 'CLIENT_ID',
|
|
456
|
+
placeholder: 'Client ID da Cielo',
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
key: 'EMAIL',
|
|
460
|
+
label: 'EMAIL',
|
|
461
|
+
placeholder: 'financeiro@empresa.com.br',
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
key: 'MERCHANT_CODE',
|
|
465
|
+
label: 'MERCHANT_CODE',
|
|
466
|
+
placeholder: 'Codigo do estabelecimento',
|
|
467
|
+
},
|
|
468
|
+
],
|
|
469
|
+
},
|
|
470
|
+
'new-relic': {
|
|
471
|
+
key: 'new-relic',
|
|
472
|
+
label: 'New Relic',
|
|
473
|
+
accent: '#1CE783',
|
|
474
|
+
icon: 'activity',
|
|
475
|
+
description: 'Observabilidade centralizada na empresa principal.',
|
|
476
|
+
bundleKey: 'NEW_RELIC',
|
|
477
|
+
visibility: 'private',
|
|
478
|
+
requiredKeys: [],
|
|
479
|
+
fields: [
|
|
480
|
+
{
|
|
481
|
+
key: 'LICENSE_KEY',
|
|
482
|
+
label: 'LICENSE_KEY',
|
|
483
|
+
placeholder: 'License key',
|
|
484
|
+
secureTextEntry: true,
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
key: 'APPLICATION_ID',
|
|
488
|
+
label: 'APPLICATION_ID',
|
|
489
|
+
placeholder: 'Application ID',
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
key: 'ACCOUNT_ID',
|
|
493
|
+
label: 'ACCOUNT_ID',
|
|
494
|
+
placeholder: 'Account ID',
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
key: 'TRUST_KEY',
|
|
498
|
+
label: 'TRUST_KEY',
|
|
499
|
+
placeholder: 'Trust key',
|
|
500
|
+
secureTextEntry: true,
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
key: 'BEACON',
|
|
504
|
+
label: 'BEACON',
|
|
505
|
+
placeholder: 'bam.nr-data.net',
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
key: 'ERROR_BEACON',
|
|
509
|
+
label: 'ERROR_BEACON',
|
|
510
|
+
placeholder: 'bam.nr-data.net',
|
|
511
|
+
},
|
|
512
|
+
],
|
|
513
|
+
},
|
|
514
|
+
spotify: {
|
|
515
|
+
key: 'spotify',
|
|
516
|
+
label: 'Spotify',
|
|
517
|
+
accent: '#1DB954',
|
|
518
|
+
icon: 'music',
|
|
519
|
+
description: 'Credenciais Spotify da empresa principal.',
|
|
520
|
+
bundleKey: 'SPOTIFY',
|
|
521
|
+
visibility: 'private',
|
|
522
|
+
requiredKeys: [],
|
|
523
|
+
fields: [
|
|
524
|
+
{
|
|
525
|
+
key: 'CLIENT_ID',
|
|
526
|
+
label: 'CLIENT_ID',
|
|
527
|
+
placeholder: 'Spotify Client ID',
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
key: 'CLIENT_SECRET',
|
|
531
|
+
label: 'CLIENT_SECRET',
|
|
532
|
+
placeholder: 'Spotify Client Secret',
|
|
533
|
+
secureTextEntry: true,
|
|
534
|
+
},
|
|
535
|
+
],
|
|
536
|
+
},
|
|
537
|
+
|
|
354
538
|
};
|
|
355
539
|
|
|
356
540
|
export const getIntegrationListItem = key =>
|
|
@@ -19,29 +19,6 @@ export const formatPhoneLabel = phone => {
|
|
|
19
19
|
return ddd ? `(${ddd}) ${firstPart}-${lastFour}` : `${firstPart}-${lastFour}`;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
const resolveStatusIri = status => {
|
|
23
|
-
if (!status) return null;
|
|
24
|
-
if (typeof status === 'string') {
|
|
25
|
-
if (status.startsWith('/') || status.startsWith('http')) return status;
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
if (typeof status === 'object') {
|
|
29
|
-
const iri = status['@id'] || status.id;
|
|
30
|
-
if (iri == null) return null;
|
|
31
|
-
const asString = String(iri);
|
|
32
|
-
if (asString.startsWith('/') || asString.startsWith('http')) return asString;
|
|
33
|
-
return `/statuses/${asString}`;
|
|
34
|
-
}
|
|
35
|
-
return null;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
const resolveNumericId = item => {
|
|
39
|
-
const raw = item?.id ?? item?.['@id'];
|
|
40
|
-
if (raw == null) return null;
|
|
41
|
-
const digits = String(raw).replace(/\D/g, '');
|
|
42
|
-
return digits ? Number(digits) : null;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
22
|
export const normalizeConnection = item => {
|
|
46
23
|
const channel =
|
|
47
24
|
item?.channel === CHANNEL_WHATSAPP_OFFICIAL
|
|
@@ -49,18 +26,15 @@ export const normalizeConnection = item => {
|
|
|
49
26
|
: CHANNEL_WHATSAPP;
|
|
50
27
|
return {
|
|
51
28
|
id: item?.id || item?.['@id'] || `connection-${Math.random()}`,
|
|
52
|
-
numericId: resolveNumericId(item),
|
|
53
29
|
name: item?.name || 'Sem nome',
|
|
54
|
-
status:
|
|
55
|
-
(typeof item?.status === 'object'
|
|
56
|
-
? item?.status?.status || item?.status?.name
|
|
57
|
-
: item?.status) || 'Pendente',
|
|
58
|
-
statusIri: resolveStatusIri(item?.status),
|
|
30
|
+
status: item?.status?.status || item?.status || 'Pendente',
|
|
59
31
|
type: item?.type || 'Nenhum',
|
|
60
32
|
channel,
|
|
61
|
-
|
|
33
|
+
/** alias used by list UI */
|
|
34
|
+
provider: channel === CHANNEL_WHATSAPP_OFFICIAL ? CHANNEL_WHATSAPP_OFFICIAL : CHANNEL_WHATSAPP,
|
|
62
35
|
phone: item?.phone || {},
|
|
63
36
|
phoneLabel: formatPhoneLabel(item?.phone),
|
|
37
|
+
channelConfig: item?.channelConfig || item?.channel_config || null,
|
|
64
38
|
};
|
|
65
39
|
};
|
|
66
40
|
|
|
@@ -74,18 +48,10 @@ export const toArray = response => {
|
|
|
74
48
|
export const formatApiError = error => {
|
|
75
49
|
if (!error) return 'Nao foi possivel concluir a operacao.';
|
|
76
50
|
if (typeof error === 'string') return error;
|
|
77
|
-
const violations = error?.violations || error?.data?.violations;
|
|
78
|
-
if (Array.isArray(violations) && violations.length) {
|
|
79
|
-
return violations
|
|
80
|
-
.map(v => v?.message || v?.propertyPath)
|
|
81
|
-
.filter(Boolean)
|
|
82
|
-
.join(' · ');
|
|
83
|
-
}
|
|
84
51
|
return (
|
|
85
52
|
error?.message ||
|
|
86
53
|
error?.description ||
|
|
87
54
|
error?.errmsg ||
|
|
88
|
-
error?.hydra?.description ||
|
|
89
55
|
'Nao foi possivel concluir a operacao.'
|
|
90
56
|
);
|
|
91
57
|
};
|
|
@@ -103,3 +69,9 @@ export const buildOfficialChannelConfig = ({
|
|
|
103
69
|
if (version) config.api_version = version;
|
|
104
70
|
return config;
|
|
105
71
|
};
|
|
72
|
+
|
|
73
|
+
export const maskToken = token => {
|
|
74
|
+
const value = String(token || '');
|
|
75
|
+
if (value.length <= 8) return value ? '••••••••' : '';
|
|
76
|
+
return `${value.slice(0, 4)}…${value.slice(-4)}`;
|
|
77
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {env as APP_ENV} from '@env';
|
|
2
2
|
import {filterApiHeaders, isTrustedApiUrl} from '../../utils/trustedApiUrl';
|
|
3
|
-
import {buildAssetUrl} from '@controleonline
|
|
3
|
+
import {buildAssetUrl} from '@controleonline/../../src/styles/branding';
|
|
4
4
|
import {
|
|
5
5
|
resolveAppDomain,
|
|
6
6
|
resolveCompanyDomain,
|
|
@@ -4,18 +4,19 @@ import * as types from "@controleonline/ui-default/src/store/default/mutation_ty
|
|
|
4
4
|
export const createWhatsappConnection = ({ commit, getters }, params = {}) => {
|
|
5
5
|
commit(types.SET_ISLOADING, true);
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
let options = {
|
|
8
8
|
method: "POST",
|
|
9
9
|
body: params,
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
return api
|
|
13
|
-
.fetch("/whatsapp/create-session", options)
|
|
14
|
-
.then(data => {
|
|
13
|
+
.fetch("/whatsapp/create-session" , options)
|
|
14
|
+
.then((data) => {
|
|
15
15
|
commit(types.SET_ITEM, data);
|
|
16
|
+
|
|
16
17
|
return data;
|
|
17
18
|
})
|
|
18
|
-
.catch(e => {
|
|
19
|
+
.catch((e) => {
|
|
19
20
|
commit(types.SET_ERROR, e.message);
|
|
20
21
|
throw e;
|
|
21
22
|
})
|
|
@@ -25,37 +26,34 @@ export const createWhatsappConnection = ({ commit, getters }, params = {}) => {
|
|
|
25
26
|
};
|
|
26
27
|
|
|
27
28
|
/**
|
|
28
|
-
* Persist official Meta Cloud API WhatsApp connection.
|
|
29
|
-
* channel=whatsapp_official
|
|
29
|
+
* Persist an official (Meta Cloud API) WhatsApp connection.
|
|
30
|
+
* Uses connections.channel = whatsapp_official and channelConfig for credentials.
|
|
30
31
|
*/
|
|
31
|
-
export const saveOfficialWhatsappConnection = ({ commit }, params = {}) => {
|
|
32
|
+
export const saveOfficialWhatsappConnection = ({ commit, getters }, params = {}) => {
|
|
32
33
|
commit(types.SET_ISLOADING, true);
|
|
33
34
|
|
|
34
35
|
const body = {
|
|
35
|
-
name: params.name || `
|
|
36
|
-
channel:
|
|
37
|
-
type: params.type ||
|
|
36
|
+
name: params.name || `WhatsApp Oficial ${params.phoneNumberId || ''}`.trim(),
|
|
37
|
+
channel: 'whatsapp_official',
|
|
38
|
+
type: params.type || null,
|
|
38
39
|
people: params.people,
|
|
39
40
|
channelConfig: JSON.stringify({
|
|
40
41
|
access_token: params.accessToken,
|
|
41
42
|
phone_number_id: params.phoneNumberId,
|
|
42
|
-
api_version: params.apiVersion ||
|
|
43
|
+
api_version: params.apiVersion || 'v22.0',
|
|
43
44
|
}),
|
|
44
45
|
};
|
|
45
46
|
|
|
46
|
-
if (params.status) {
|
|
47
|
-
body.status = params.status;
|
|
48
|
-
}
|
|
49
47
|
if (params.phone) {
|
|
50
48
|
body.phone = params.phone;
|
|
51
49
|
}
|
|
52
50
|
|
|
53
51
|
const options = {
|
|
54
|
-
method: params.id ?
|
|
52
|
+
method: params.id ? 'PUT' : 'POST',
|
|
55
53
|
body,
|
|
56
54
|
};
|
|
57
55
|
|
|
58
|
-
const endpoint = params.id ? `/connections/${params.id}` :
|
|
56
|
+
const endpoint = params.id ? `/connections/${params.id}` : '/connections';
|
|
59
57
|
|
|
60
58
|
return api
|
|
61
59
|
.fetch(endpoint, options)
|
|
@@ -1,105 +1,101 @@
|
|
|
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: "connections",
|
|
12
|
-
isLoading: false,
|
|
13
|
-
reload: false,
|
|
14
|
-
error: "",
|
|
15
|
-
totalItems: 0,
|
|
16
|
-
summary: {},
|
|
17
|
-
messages: [],
|
|
18
|
-
message: {},
|
|
19
|
-
filters: {},
|
|
20
|
-
columns: [
|
|
21
|
-
{
|
|
22
|
-
editable: false,
|
|
23
|
-
isIdentity: true,
|
|
24
|
-
sortable: true,
|
|
25
|
-
name: "id",
|
|
26
|
-
align: "left",
|
|
27
|
-
label: "id",
|
|
28
|
-
sum: false,
|
|
29
|
-
format: function (value) {
|
|
30
|
-
return "#" + value;
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
externalFilter: false,
|
|
35
|
-
sortable: true,
|
|
36
|
-
name: "name",
|
|
37
|
-
align: "left",
|
|
38
|
-
label: "name",
|
|
39
|
-
format: function (value) {
|
|
40
|
-
return value;
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
externalFilter: false,
|
|
45
|
-
sortable: true,
|
|
46
|
-
editable: false,
|
|
47
|
-
name: "phone",
|
|
48
|
-
align: "left",
|
|
49
|
-
label: "phone",
|
|
50
|
-
format: function (value, row, column) {
|
|
51
|
-
const phone = String(value.phone);
|
|
52
|
-
const lastFour = phone.slice(-4);
|
|
53
|
-
const firstPart = phone.slice(0, -4);
|
|
54
|
-
return `(${value?.ddd}) ${firstPart}-${lastFour}`;
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
|
|
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: "connections",
|
|
12
|
+
isLoading: false,
|
|
13
|
+
reload: false,
|
|
14
|
+
error: "",
|
|
15
|
+
totalItems: 0,
|
|
16
|
+
summary: {},
|
|
17
|
+
messages: [],
|
|
18
|
+
message: {},
|
|
19
|
+
filters: {},
|
|
20
|
+
columns: [
|
|
21
|
+
{
|
|
22
|
+
editable: false,
|
|
23
|
+
isIdentity: true,
|
|
24
|
+
sortable: true,
|
|
25
|
+
name: "id",
|
|
26
|
+
align: "left",
|
|
27
|
+
label: "id",
|
|
28
|
+
sum: false,
|
|
29
|
+
format: function (value) {
|
|
30
|
+
return "#" + value;
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
externalFilter: false,
|
|
35
|
+
sortable: true,
|
|
36
|
+
name: "name",
|
|
37
|
+
align: "left",
|
|
38
|
+
label: "name",
|
|
39
|
+
format: function (value) {
|
|
40
|
+
return value;
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
externalFilter: false,
|
|
45
|
+
sortable: true,
|
|
46
|
+
editable: false,
|
|
47
|
+
name: "phone",
|
|
48
|
+
align: "left",
|
|
49
|
+
label: "phone",
|
|
50
|
+
format: function (value, row, column) {
|
|
51
|
+
const phone = String(value.phone);
|
|
52
|
+
const lastFour = phone.slice(-4);
|
|
53
|
+
const firstPart = phone.slice(0, -4);
|
|
54
|
+
return `(${value?.ddd}) ${firstPart}-${lastFour}`;
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
|
|
58
58
|
{
|
|
59
59
|
externalFilter: false,
|
|
60
60
|
sortable: true,
|
|
61
61
|
name: "type",
|
|
62
62
|
align: "left",
|
|
63
63
|
label: "type",
|
|
64
|
-
list: [
|
|
65
|
-
{
|
|
66
|
-
value: "crm",
|
|
67
|
-
label: "CRM",
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
value: "support",
|
|
71
|
-
label: "Suporte",
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
value: null,
|
|
75
|
-
label: "Nenhum",
|
|
76
|
-
},
|
|
77
|
-
],
|
|
78
|
-
format: function (value) {
|
|
79
|
-
return value;
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
|
|
64
|
+
list: [
|
|
65
|
+
{
|
|
66
|
+
value: "crm",
|
|
67
|
+
label: "CRM",
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
value: "support",
|
|
71
|
+
label: "Suporte",
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
value: null,
|
|
75
|
+
label: "Nenhum",
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
format: function (value) {
|
|
79
|
+
return value;
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
|
|
83
83
|
{
|
|
84
84
|
sortable: true,
|
|
85
85
|
editable: false,
|
|
86
86
|
name: "channel",
|
|
87
87
|
align: "left",
|
|
88
88
|
label: "channel",
|
|
89
|
-
list: [
|
|
90
|
-
{
|
|
91
|
-
value: "whatsapp",
|
|
92
|
-
label: "
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
format: function (value) {
|
|
100
|
-
return value;
|
|
101
|
-
},
|
|
102
|
-
},
|
|
89
|
+
list: [
|
|
90
|
+
{
|
|
91
|
+
value: "whatsapp",
|
|
92
|
+
label: "Whatsapp",
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
format: function (value) {
|
|
96
|
+
return value;
|
|
97
|
+
},
|
|
98
|
+
},
|
|
103
99
|
{
|
|
104
100
|
editable: false,
|
|
105
101
|
externalFilter: false,
|
|
@@ -107,22 +103,22 @@ export default {
|
|
|
107
103
|
name: "status",
|
|
108
104
|
align: "left",
|
|
109
105
|
label: "status",
|
|
110
|
-
list: "status/getItems",
|
|
111
|
-
searchParam: "status",
|
|
112
|
-
format: function (value) {
|
|
113
|
-
return value?.status;
|
|
114
|
-
},
|
|
115
|
-
saveFormat: function (value) {
|
|
116
|
-
return value ? "/statuses/" + (value.value || value) : null;
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
name: "connection",
|
|
121
|
-
},
|
|
122
|
-
],
|
|
123
|
-
print: [],
|
|
124
|
-
},
|
|
125
|
-
actions: { ...actions, ...customActions },
|
|
126
|
-
getters,
|
|
127
|
-
mutations,
|
|
128
|
-
};
|
|
106
|
+
list: "status/getItems",
|
|
107
|
+
searchParam: "status",
|
|
108
|
+
format: function (value) {
|
|
109
|
+
return value?.status;
|
|
110
|
+
},
|
|
111
|
+
saveFormat: function (value) {
|
|
112
|
+
return value ? "/statuses/" + (value.value || value) : null;
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: "connection",
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
print: [],
|
|
120
|
+
},
|
|
121
|
+
actions: { ...actions, ...customActions },
|
|
122
|
+
getters,
|
|
123
|
+
mutations,
|
|
124
|
+
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import {isPublicRoute, PUBLIC_ROUTES} from '../publicRoutes'
|
|
2
|
-
|
|
3
|
-
describe('publicRoutes', () => {
|
|
4
|
-
it('treats MCP OAuth consent as public (ManagerLayout gate)', () => {
|
|
5
|
-
expect(PUBLIC_ROUTES.has('McpOAuthConsentPage')).toBe(true)
|
|
6
|
-
expect(isPublicRoute('McpOAuthConsentPage')).toBe(true)
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
it('keeps SignIn public', () => {
|
|
10
|
-
expect(isPublicRoute('SignInPage')).toBe(true)
|
|
11
|
-
})
|
|
12
|
-
})
|