@controleonline/ui-common 1.2.136 → 1.2.140

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.
@@ -1,13 +1,15 @@
1
1
  {
2
- "version": "1.2.136",
2
+ "version": "1.2.140",
3
3
  "rc": 1,
4
- "branch": "rc/1.2.136-rc.1",
5
- "baseMaster": "e9e2c2e18aef6ae9fd7a7b5c81f7abbc4699d412",
4
+ "branch": "rc/1.2.140-rc.1",
5
+ "baseMaster": "208f0d67142877d715cc1f2d7640cfafc8326451",
6
+ "baseTag": "v1.2.137",
6
7
  "tasks": [
7
- 168
8
+ 171,
9
+ 180
8
10
  ],
9
11
  "frozen": true,
10
12
  "repositories": {
11
- "ControleOnline/ui-common": "8bfec2dc492f477e8a1bfe6cfdb17aa8555d4489"
13
+ "ControleOnline/ui-common": "65e6c3f3245bc019e1ee8c97a1819bb3f6a311c8"
12
14
  }
13
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@controleonline/ui-common",
3
- "version": "1.2.136",
3
+ "version": "1.2.140",
4
4
  "author": "ControleOnline",
5
5
  "description": "ControleOnline Common Quasar UI Component",
6
6
  "license": "MIT",
@@ -0,0 +1,120 @@
1
+ import React, { useCallback, useEffect, useState } from 'react';
2
+ import { ActivityIndicator, Text, TouchableOpacity, View } from 'react-native';
3
+ import Icon from 'react-native-vector-icons/Feather';
4
+ import { useStore } from '@store';
5
+ import { fetchPeopleConfigs } from './fetchPeopleConfigs';
6
+
7
+ // Attendance contexts served by the company's numbers/mailboxes (app-community#1764).
8
+ // With more than one enabled, the customer's first message gets a simple menu (no AI)
9
+ // and the request opens in the context the customer picks.
10
+ export const CONVERSATION_CONTEXTS_KEY = 'conversation-contexts';
11
+ export const CONVERSATION_CONTEXTS = [
12
+ ['support', 'Suporte'],
13
+ ['relationship', 'Comercial'],
14
+ ];
15
+ const DEFAULT_CONTEXTS = ['support'];
16
+
17
+ export const parseConversationContexts = value => {
18
+ let list = value;
19
+ if (typeof value === 'string') {
20
+ try {
21
+ list = JSON.parse(value);
22
+ } catch (e) {
23
+ list = value.split(',');
24
+ }
25
+ }
26
+ const valid = CONVERSATION_CONTEXTS.map(([key]) => key);
27
+ const keys = (Array.isArray(list) ? list : [])
28
+ .map(item => String(item || '').trim())
29
+ .filter((item, index, all) => valid.includes(item) && all.indexOf(item) === index);
30
+ return keys.length ? keys : DEFAULT_CONTEXTS;
31
+ };
32
+
33
+ export default function ConversationContextsCard({ peopleIri, styles, brandColors, showError, showSuccess }) {
34
+ const configsStore = useStore('configs');
35
+ const [enabled, setEnabled] = useState(DEFAULT_CONTEXTS);
36
+ const [loading, setLoading] = useState(true);
37
+ const [saving, setSaving] = useState(false);
38
+
39
+ useEffect(() => {
40
+ let active = true;
41
+ setLoading(true);
42
+ fetchPeopleConfigs({ peopleIri, configKeys: [CONVERSATION_CONTEXTS_KEY] })
43
+ .then(items => {
44
+ if (active) setEnabled(parseConversationContexts(items?.[0]?.configValue));
45
+ })
46
+ .catch(() => {})
47
+ .finally(() => {
48
+ if (active) setLoading(false);
49
+ });
50
+ return () => {
51
+ active = false;
52
+ };
53
+ }, [peopleIri]);
54
+
55
+ const toggle = useCallback(async key => {
56
+ const next = enabled.includes(key) ? enabled.filter(item => item !== key) : [...enabled, key];
57
+ if (!next.length) {
58
+ showError?.('Deixe pelo menos um contexto habilitado.');
59
+ return;
60
+ }
61
+ const ordered = CONVERSATION_CONTEXTS.map(([item]) => item).filter(item => next.includes(item));
62
+ setSaving(true);
63
+ try {
64
+ await configsStore.actions.addConfigs({
65
+ configKey: CONVERSATION_CONTEXTS_KEY,
66
+ configValue: JSON.stringify(ordered),
67
+ people: peopleIri,
68
+ visibility: 'private',
69
+ });
70
+ setEnabled(ordered);
71
+ showSuccess?.('Contextos de atendimento atualizados.');
72
+ } catch (error) {
73
+ showError?.(error?.message || 'Nao foi possivel salvar os contextos.');
74
+ } finally {
75
+ setSaving(false);
76
+ }
77
+ }, [configsStore, enabled, peopleIri, showError, showSuccess]);
78
+
79
+ return (
80
+ <View style={{ marginTop: 16 }}>
81
+ <Text style={styles.inputLabel}>Contextos de atendimento</Text>
82
+ {loading ? (
83
+ <ActivityIndicator color={brandColors.primary} />
84
+ ) : (
85
+ <View style={{ flexDirection: 'row', gap: 8, marginTop: 6, flexWrap: 'wrap' }}>
86
+ {CONVERSATION_CONTEXTS.map(([key, label]) => {
87
+ const active = enabled.includes(key);
88
+ return (
89
+ <TouchableOpacity
90
+ key={key}
91
+ disabled={saving}
92
+ onPress={() => toggle(key)}
93
+ style={{
94
+ flexDirection: 'row',
95
+ alignItems: 'center',
96
+ gap: 6,
97
+ borderWidth: 1,
98
+ borderColor: active ? brandColors.primary : '#CBD5E1',
99
+ backgroundColor: active ? brandColors.primary : 'transparent',
100
+ borderRadius: 14,
101
+ paddingHorizontal: 12,
102
+ paddingVertical: 6,
103
+ opacity: saving ? 0.6 : 1,
104
+ }}>
105
+ <Icon name={active ? 'check-square' : 'square'} size={14} color={active ? '#FFFFFF' : '#334155'} />
106
+ <Text style={{ color: active ? '#FFFFFF' : '#334155', fontSize: 12 }}>{label}</Text>
107
+ </TouchableOpacity>
108
+ );
109
+ })}
110
+ </View>
111
+ )}
112
+ <Text style={styles.helperText}>
113
+ {enabled.length > 1
114
+ ? 'Todos os numeros atendem estes contextos. Na primeira mensagem o cliente recebe um menu e o chamado abre no contexto escolhido.'
115
+ : 'Todos os numeros atendem este contexto: o chamado abre direto nele.'}
116
+ {' '}Com IA configurada, ela atende primeiro e encaminha.
117
+ </Text>
118
+ </View>
119
+ );
120
+ }
@@ -18,14 +18,10 @@ const FIELDS = [
18
18
  ['smtp_host', 'Servidor SMTP', 'smtp.gmail.com'],
19
19
  ['smtp_port', 'Porta SMTP', '587'],
20
20
  ];
21
- const TYPES = [
22
- ['support', 'Suporte'],
23
- ['relationship', 'Comercial'],
24
- ];
25
21
 
26
22
  export default function EmailConnectionModal({visible, peopleIri, onClose, onSaved}) {
27
23
  const connectionsStore = useStore('connections');
28
- const [form, setForm] = useState({imap_port: '993', smtp_port: '587', type: 'support'});
24
+ const [form, setForm] = useState({imap_port: '993', smtp_port: '587'});
29
25
  const [saving, setSaving] = useState(false);
30
26
  const [error, setError] = useState('');
31
27
  const set = key => value => setForm(prev => ({...prev, [key]: value}));
@@ -40,7 +36,7 @@ export default function EmailConnectionModal({visible, peopleIri, onClose, onSav
40
36
  setError('');
41
37
  try {
42
38
  await connectionsStore.actions.saveEmailConnection({...form, people: peopleIri});
43
- setForm({imap_port: '993', smtp_port: '587', type: 'support'});
39
+ setForm({imap_port: '993', smtp_port: '587'});
44
40
  onSaved?.();
45
41
  } catch (e) {
46
42
  setError(e?.message || 'Não foi possível salvar a conexão.');
@@ -59,13 +55,6 @@ export default function EmailConnectionModal({visible, peopleIri, onClose, onSav
59
55
  As respostas saem por este endereço.
60
56
  </Text>
61
57
  <ScrollView style={s.scroll}>
62
- <View style={s.typeRow}>
63
- {TYPES.map(([value, label]) => (
64
- <TouchableOpacity key={value} onPress={() => set('type')(value)} style={[s.chip, form.type === value && s.chipActive]}>
65
- <Text style={[s.chipText, form.type === value && s.chipTextActive]}>{label}</Text>
66
- </TouchableOpacity>
67
- ))}
68
- </View>
69
58
  {FIELDS.map(([key, label, placeholder]) => (
70
59
  <View key={key} style={s.field}>
71
60
  <Text style={s.label}>{label}</Text>
@@ -20,6 +20,7 @@ import {
20
20
  buildOfficialProviderConfig,
21
21
  } from './whatsAppConnectionHelpers';
22
22
  import WhatsAppProviderForm from './WhatsAppProviderForm';
23
+ import ConversationContextsCard from './ConversationContextsCard';
23
24
  import { isEmbeddedSignupSupported, launchEmbeddedSignup } from './whatsAppEmbeddedSignup';
24
25
  import {
25
26
  resolveThemePalette,
@@ -74,7 +75,6 @@ export default function WhatsAppConnectionPage() {
74
75
  const [accessToken, setAccessToken] = useState('');
75
76
  const [phoneNumberId, setPhoneNumberId] = useState('');
76
77
  const [apiVersion, setApiVersion] = useState('v22.0');
77
- const [connectionType, setConnectionType] = useState('support');
78
78
  const [qrValue, setQrValue] = useState('');
79
79
  const [connectionStatus, setConnectionStatus] = useState('');
80
80
  const [lastRequestedPhone, setLastRequestedPhone] = useState('');
@@ -192,7 +192,6 @@ export default function WhatsAppConnectionPage() {
192
192
  accessToken: token,
193
193
  phoneNumberId: pnid,
194
194
  apiVersion: apiVersion || 'v22.0',
195
- type: connectionType,
196
195
  people: peopleIri,
197
196
  name: `WhatsApp Oficial ${pnid}`,
198
197
  });
@@ -207,7 +206,7 @@ export default function WhatsAppConnectionPage() {
207
206
  } finally {
208
207
  setSubmitting(false);
209
208
  }
210
- }, [accessToken, phoneNumberId, apiVersion, connectionType, connectionsActions, peopleIri, loadConnections, showError, showSuccess]);
209
+ }, [accessToken, phoneNumberId, apiVersion, connectionsActions, peopleIri, loadConnections, showError, showSuccess]);
211
210
 
212
211
  // Meta Embedded Signup only runs in the browser (Facebook JS SDK popup).
213
212
  useEffect(() => {
@@ -236,7 +235,6 @@ export default function WhatsAppConnectionPage() {
236
235
  const response = await connectionsActions.completeWhatsappEmbeddedSignup({
237
236
  ...session,
238
237
  coexistence,
239
- type: connectionType,
240
238
  people: peopleIri,
241
239
  });
242
240
  showSuccess(
@@ -254,7 +252,7 @@ export default function WhatsAppConnectionPage() {
254
252
  } finally {
255
253
  setSubmitting(false);
256
254
  }
257
- }, [embeddedSignupConfig, connectionsActions, connectionType, peopleIri, loadConnections, showError, showSuccess]);
255
+ }, [embeddedSignupConfig, connectionsActions, peopleIri, loadConnections, showError, showSuccess]);
258
256
 
259
257
  const handlePrimaryAction = useCallback(async () => {
260
258
  if (providerMode === PROVIDER_OFFICIAL) {
@@ -419,27 +417,13 @@ export default function WhatsAppConnectionPage() {
419
417
  onEmbeddedSignup={handleEmbeddedSignup}
420
418
  />
421
419
 
422
- <View style={{ flexDirection: 'row', gap: 8, marginTop: 8 }}>
423
- {[['support', 'Suporte'], ['relationship', 'Comercial']].map(([value, label]) => (
424
- <TouchableOpacity
425
- key={value}
426
- onPress={() => setConnectionType(value)}
427
- style={{
428
- borderWidth: 1,
429
- borderColor: connectionType === value ? brandColors.primary : '#CBD5E1',
430
- backgroundColor: connectionType === value ? brandColors.primary : 'transparent',
431
- borderRadius: 14,
432
- paddingHorizontal: 12,
433
- paddingVertical: 6,
434
- }}>
435
- <Text style={{ color: connectionType === value ? '#FFFFFF' : '#334155', fontSize: 12 }}>{label}</Text>
436
- </TouchableOpacity>
437
- ))}
438
- </View>
439
- <Text style={styles.helperText}>
440
- Sem IA configurada, as conversas deste numero vao para {connectionType === 'support' ? 'Suporte' : 'o CRM'}.
441
- Com IA, ela atende primeiro e encaminha.
442
- </Text>
420
+ <ConversationContextsCard
421
+ peopleIri={peopleIri}
422
+ styles={styles}
423
+ brandColors={brandColors}
424
+ showError={showError}
425
+ showSuccess={showSuccess}
426
+ />
443
427
  {providerMode === PROVIDER_OFFICIAL ? (
444
428
  <Text style={styles.helperText}>
445
429
  Webhook no app Meta: https://api.controleonline.com/webhook/whatsapp-cloud (campo messages).
@@ -516,10 +500,6 @@ export default function WhatsAppConnectionPage() {
516
500
  <Text style={styles.connectionMetaLabel}>Telefone</Text>
517
501
  <Text style={styles.connectionMetaValue}>{item.phoneLabel}</Text>
518
502
  </View>
519
- <View style={styles.connectionMetaItem}>
520
- <Text style={styles.connectionMetaLabel}>Tipo</Text>
521
- <Text style={styles.connectionMetaValue}>{item.type}</Text>
522
- </View>
523
503
  </View>
524
504
 
525
505
  <View style={styles.connectionMetaRow}>
@@ -56,7 +56,6 @@ export const normalizeConnection = item => {
56
56
  ? item?.status?.status || item?.status?.name
57
57
  : item?.status) || 'Pendente',
58
58
  statusIri: resolveStatusIri(item?.status),
59
- type: item?.type || 'Nenhum',
60
59
  channel,
61
60
  provider: channel,
62
61
  phone: item?.phone || {},
@@ -26,182 +26,6 @@ const normalizeRuntimeMenuItem = (menu = {}) => ({
26
26
  sortOrder: Number(menu?.sortOrder ?? menu?.sort_order ?? 0),
27
27
  });
28
28
 
29
- const MANAGER_RUNTIME_MENU_FALLBACK = [
30
- {
31
- id: 'manager-financeiro',
32
- label: 'Financeiro',
33
- icon: 'dollar-sign',
34
- menus: [
35
- {
36
- id: 'financial_hub',
37
- menuKey: 'financial_hub',
38
- label: 'Financeiro',
39
- route: 'FinancialHubPage',
40
- icon: 'dollar-sign',
41
- color: '#0284C7',
42
- sortOrder: 10,
43
- },
44
- {
45
- id: 'income_statement',
46
- menuKey: 'income_statement',
47
- label: 'Demonstrativo de resultados',
48
- route: 'IncomeStatement',
49
- icon: 'bar-chart-2',
50
- color: '#0F766E',
51
- sortOrder: 15,
52
- },
53
- ],
54
- },
55
- {
56
- id: 'manager-operacoes',
57
- label: 'Operacoes',
58
- icon: 'shopping-bag',
59
- menus: [
60
- {
61
- id: 'orders',
62
- menuKey: 'orders',
63
- label: 'Pedidos',
64
- route: 'OrderHistoryPage',
65
- icon: 'shopping-bag',
66
- color: '#0EA5E9',
67
- sortOrder: 20,
68
- },
69
- ],
70
- },
71
- {
72
- id: 'manager-comercial',
73
- label: 'Comercial',
74
- icon: 'users',
75
- menus: [
76
- {
77
- id: 'products',
78
- menuKey: 'products',
79
- label: 'Produtos',
80
- route: 'ProductsPage',
81
- icon: 'package',
82
- color: '#16A34A',
83
- sortOrder: 25,
84
- },
85
- {
86
- id: 'clients',
87
- menuKey: 'clients',
88
- label: 'Cadastro de clientes',
89
- route: 'ClientsIndex',
90
- icon: 'users',
91
- color: '#16A34A',
92
- sortOrder: 30,
93
- },
94
- {
95
- id: 'providers',
96
- menuKey: 'providers',
97
- label: 'Fornecedores',
98
- route: 'ProvidersIndex',
99
- icon: 'truck',
100
- color: '#EA580C',
101
- sortOrder: 35,
102
- },
103
- {
104
- id: 'franchisees',
105
- menuKey: 'franchisees',
106
- label: 'Cadastro de franquias',
107
- route: 'FranchiseesIndex',
108
- icon: 'map-pin',
109
- color: '#0EA5E9',
110
- sortOrder: 40,
111
- },
112
- ],
113
- },
114
- {
115
- id: 'manager-configuracoes',
116
- label: 'Configuracoes',
117
- icon: 'settings',
118
- menus: [
119
- {
120
- id: 'devices',
121
- menuKey: 'devices',
122
- label: 'Dispositivos',
123
- route: 'DevicesIndex',
124
- icon: 'credit-card',
125
- color: '#e67e22',
126
- sortOrder: 50,
127
- },
128
- {
129
- id: 'configurator',
130
- menuKey: 'configurator',
131
- label: 'Configurador',
132
- route: 'ConfiguratorPage',
133
- icon: 'settings',
134
- color: '#64748B',
135
- sortOrder: 60,
136
- },
137
- {
138
- id: 'product_showcases',
139
- menuKey: 'product_showcases',
140
- label: 'Vitrines de preços',
141
- route: 'ProductShowcasesPage',
142
- icon: 'grid',
143
- color: '#0F766E',
144
- sortOrder: 65,
145
- },
146
- ],
147
- },
148
- ];
149
-
150
- const ADMIN_RUNTIME_MENU_FALLBACK = [
151
- {
152
- id: 'admin-configuracoes',
153
- label: 'Configuracoes',
154
- icon: 'settings',
155
- menus: [
156
- {
157
- id: 'menu_access',
158
- menuKey: 'menu_access',
159
- label: 'Menus por perfil',
160
- route: 'MenuAccessConfigPage',
161
- icon: 'list',
162
- color: '#64748B',
163
- sortOrder: 10,
164
- },
165
- {
166
- id: 'test_results',
167
- menuKey: 'test_results',
168
- label: 'Resultados de testes',
169
- route: 'TestsPlaygroundPage',
170
- icon: 'clipboard',
171
- color: '#0EA5E9',
172
- sortOrder: 20,
173
- },
174
- {
175
- id: 'tenancies',
176
- menuKey: 'tenancies',
177
- label: 'Tenancies',
178
- route: 'TenanciesPage',
179
- icon: 'server',
180
- color: '#0F766E',
181
- sortOrder: 25,
182
- },
183
- {
184
- id: 'people_domains',
185
- menuKey: 'people_domains',
186
- label: 'Domínios',
187
- route: 'PeopleDomainsPage',
188
- icon: 'globe',
189
- color: '#0EA5E9',
190
- sortOrder: 30,
191
- },
192
- {
193
- id: 'flowcharts',
194
- menuKey: 'flowcharts',
195
- label: 'Fluxogramas',
196
- route: 'FlowchartsPage',
197
- icon: 'git-branch',
198
- color: '#0F766E',
199
- sortOrder: 40,
200
- },
201
- ],
202
- },
203
- ];
204
-
205
29
  const cloneRuntimeMenuModules = modules =>
206
30
  (Array.isArray(modules) ? modules : []).map(module => ({
207
31
  ...module,
@@ -226,10 +50,7 @@ const resolveRuntimeModuleSortOrder = module => {
226
50
  return 0;
227
51
  };
228
52
 
229
- export const normalizeRuntimeMenuResponse = (
230
- result,
231
- {appType, allowFallback = true} = {},
232
- ) => {
53
+ export const normalizeRuntimeMenuResponse = result => {
233
54
  const modules =
234
55
  result?.response?.data?.modules ||
235
56
  result?.data?.modules ||
@@ -260,16 +81,6 @@ export const normalizeRuntimeMenuResponse = (
260
81
  return normalizedModules;
261
82
  }
262
83
 
263
- const normalizedAppType = String(appType || '').trim().toUpperCase();
264
-
265
- if (allowFallback && normalizedAppType === 'MANAGER') {
266
- return cloneRuntimeMenuModules(MANAGER_RUNTIME_MENU_FALLBACK);
267
- }
268
-
269
- if (allowFallback && normalizedAppType === 'ADMIN') {
270
- return cloneRuntimeMenuModules(ADMIN_RUNTIME_MENU_FALLBACK);
271
- }
272
-
273
84
  return [];
274
85
  };
275
86
 
@@ -34,7 +34,6 @@ export const saveOfficialWhatsappConnection = ({ commit }, params = {}) => {
34
34
  const body = {
35
35
  name: params.name || `WA Oficial ${params.phoneNumberId || ""}`.trim().slice(0, 50),
36
36
  channel: "whatsapp_official",
37
- type: params.type || "relationship",
38
37
  people: params.people,
39
38
  channelConfig: JSON.stringify({
40
39
  access_token: params.accessToken,
@@ -81,7 +80,6 @@ export const saveEmailConnection = ({ commit }, params = {}) => {
81
80
  const body = {
82
81
  name: params.name || `E-mail ${params.from_address || ''}`.trim(),
83
82
  channel: 'email',
84
- type: params.type || 'support',
85
83
  people: params.people,
86
84
  channelConfig: JSON.stringify({
87
85
  from_address: params.from_address,
@@ -134,7 +132,6 @@ export const completeWhatsappEmbeddedSignup = ({ commit }, params = {}) => {
134
132
  waba_id: params.wabaId,
135
133
  phone_number_id: params.phoneNumberId,
136
134
  coexistence: !!params.coexistence,
137
- type: params.type || null,
138
135
  connection: params.connection || null,
139
136
  },
140
137
  })
@@ -153,106 +153,15 @@ describe('runtimeMenu', () => {
153
153
  ).toEqual(['ToolbarPage']);
154
154
  });
155
155
 
156
- it('falls back to the manager core menu when the runtime menu is empty', () => {
157
- const menus = normalizeRuntimeMenuResponse({}, {appType: 'MANAGER'});
158
-
159
- expect(menus).toHaveLength(4);
160
- expect(menus.map(module => module.label)).toEqual([
161
- 'Financeiro',
162
- 'Operacoes',
163
- 'Comercial',
164
- 'Configuracoes',
165
- ]);
166
- expect(menus[0].menus[0]).toMatchObject({
167
- label: 'Financeiro',
168
- menuKey: 'financial_hub',
169
- route: 'FinancialHubPage',
170
- menuType: 'home',
171
- });
172
- expect(menus[0].menus[1]).toMatchObject({
173
- label: 'Demonstrativo de resultados',
174
- menuKey: 'income_statement',
175
- route: 'IncomeStatement',
176
- });
177
- expect(menus[1].menus[0]).toMatchObject({
178
- label: 'Pedidos',
179
- menuKey: 'orders',
180
- route: 'OrderHistoryPage',
181
- });
182
- expect(menus[2].menus[0]).toMatchObject({
183
- label: 'Produtos',
184
- menuKey: 'products',
185
- route: 'ProductsPage',
186
- });
187
- expect(menus[2].menus[1]).toMatchObject({
188
- label: 'Cadastro de clientes',
189
- menuKey: 'clients',
190
- route: 'ClientsIndex',
191
- });
192
- expect(menus[2].menus[2]).toMatchObject({
193
- label: 'Fornecedores',
194
- menuKey: 'providers',
195
- route: 'ProvidersIndex',
196
- });
197
- expect(menus[2].menus[3]).toMatchObject({
198
- label: 'Cadastro de franquias',
199
- menuKey: 'franchisees',
200
- route: 'FranchiseesIndex',
201
- });
202
- expect(menus[3].menus.map(item => item.route)).toEqual([
203
- 'DevicesIndex',
204
- 'ConfiguratorPage',
205
- 'ProductShowcasesPage',
206
- ]);
207
- });
208
-
209
- it('falls back to the admin starter menu when the runtime menu is empty', () => {
210
- const menus = normalizeRuntimeMenuResponse({}, {appType: 'ADMIN'});
211
-
212
- expect(menus).toHaveLength(1);
213
- expect(menus[0].label).toBe('Configuracoes');
214
- expect(menus[0].menus).toHaveLength(5);
215
- expect(menus[0].menus[0]).toMatchObject({
216
- label: 'Menus por perfil',
217
- menuKey: 'menu_access',
218
- route: 'MenuAccessConfigPage',
219
- menuType: 'home',
220
- });
221
- expect(menus[0].menus[1]).toMatchObject({
222
- label: 'Resultados de testes',
223
- menuKey: 'test_results',
224
- route: 'TestsPlaygroundPage',
225
- menuType: 'home',
226
- });
227
- expect(menus[0].menus[2]).toMatchObject({
228
- label: 'Tenancies',
229
- menuKey: 'tenancies',
230
- route: 'TenanciesPage',
231
- menuType: 'home',
232
- });
233
- expect(menus[0].menus[3]).toMatchObject({
234
- label: 'Domínios',
235
- menuKey: 'people_domains',
236
- route: 'PeopleDomainsPage',
237
- menuType: 'home',
238
- });
239
- expect(menus[0].menus[4]).toMatchObject({
240
- label: 'Fluxogramas',
241
- menuKey: 'flowcharts',
242
- route: 'FlowchartsPage',
243
- menuType: 'home',
244
- });
245
- });
246
-
247
- it('does not invent a fallback menu for non-manager apps', () => {
156
+ it('does not invent a fallback menu for the admin app', () => {
248
157
  expect(
249
- normalizeRuntimeMenuResponse({}, {appType: 'SHOP'}),
158
+ normalizeRuntimeMenuResponse({}, {appType: 'ADMIN'}),
250
159
  ).toEqual([]);
251
160
  });
252
161
 
253
- it('can skip the manager fallback when requested', () => {
162
+ it('does not invent a fallback menu for non-manager apps', () => {
254
163
  expect(
255
- normalizeRuntimeMenuResponse({}, {appType: 'MANAGER', allowFallback: false}),
164
+ normalizeRuntimeMenuResponse({}, {appType: 'SHOP'}),
256
165
  ).toEqual([]);
257
166
  });
258
167
  });