Commit 479c318925fc537fbb02d8c1622dae81bed2aa1a

Authored by Artem Babak
1 parent da5ac890

Edge menu hide

@@ -67,8 +67,7 @@ function UserService($http, $q, $rootScope, adminService, dashboardService, time @@ -67,8 +67,7 @@ function UserService($http, $q, $rootScope, adminService, dashboardService, time
67 isUserTokenAccessEnabled: isUserTokenAccessEnabled, 67 isUserTokenAccessEnabled: isUserTokenAccessEnabled,
68 loginAsUser: loginAsUser, 68 loginAsUser: loginAsUser,
69 setUserCredentialsEnabled: setUserCredentialsEnabled, 69 setUserCredentialsEnabled: setUserCredentialsEnabled,
70 - isEdgesSupportEnabled: isEdgesSupportEnabled,  
71 - loadIsEdgesSupportEnabled: loadIsEdgesSupportEnabled 70 + isEdgesSupportEnabled: isEdgesSupportEnabled
72 } 71 }
73 72
74 reloadUser(); 73 reloadUser();
@@ -147,45 +147,6 @@ function Menu(userService, $state, $rootScope) { @@ -147,45 +147,6 @@ function Menu(userService, $state, $rootScope) {
147 ] 147 ]
148 }]; 148 }];
149 } else if (authority === 'TENANT_ADMIN') { 149 } else if (authority === 'TENANT_ADMIN') {
150 - let edgeMenuSection = {  
151 - side: {  
152 - name: 'edge.management',  
153 - type: 'toggle',  
154 - state: 'home.edges',  
155 - height: '80px',  
156 - icon: 'router',  
157 - pages: [  
158 - {  
159 - name: 'edge.edges',  
160 - type: 'link',  
161 - state: 'home.edges',  
162 - icon: 'router'  
163 - },  
164 - {  
165 - name: 'rulechain.edge-rulechains',  
166 - type: 'link',  
167 - state: 'home.edges.edgeRuleChains',  
168 - icon: 'code'  
169 - }  
170 - ]  
171 - },  
172 - home: {  
173 - name: 'edge.management',  
174 - places: [  
175 - {  
176 - name: 'edge.edges',  
177 - icon: 'router',  
178 - state: 'home.edges'  
179 - },  
180 - {  
181 - name: 'rulechain.edge-rulechains',  
182 - icon: 'code',  
183 - state: 'home.edges.edgeRuleChains'  
184 - }  
185 - ]  
186 -  
187 - }  
188 - }  
189 sections = [ 150 sections = [
190 { 151 {
191 name: 'home.home', 152 name: 'home.home',
@@ -222,7 +183,33 @@ function Menu(userService, $state, $rootScope) { @@ -222,7 +183,33 @@ function Menu(userService, $state, $rootScope) {
222 type: 'link', 183 type: 'link',
223 state: 'home.entityViews', 184 state: 'home.entityViews',
224 icon: 'view_quilt' 185 icon: 'view_quilt'
225 - }, 186 + }];
  187 + if (userService.isEdgesSupportEnabled()) {
  188 + sections.push(
  189 + {
  190 + name: 'edge.management',
  191 + type: 'toggle',
  192 + state: 'home.edges',
  193 + height: '80px',
  194 + icon: 'router',
  195 + pages: [
  196 + {
  197 + name: 'edge.edges',
  198 + type: 'link',
  199 + state: 'home.edges',
  200 + icon: 'router'
  201 + },
  202 + {
  203 + name: 'rulechain.edge-rulechains',
  204 + type: 'link',
  205 + state: 'home.edges.edgeRuleChains',
  206 + icon: 'code'
  207 + }
  208 + ]
  209 + }
  210 + );
  211 + }
  212 + sections.push(
226 { 213 {
227 name: 'widget.widget-library', 214 name: 'widget.widget-library',
228 type: 'link', 215 type: 'link',
@@ -230,17 +217,18 @@ function Menu(userService, $state, $rootScope) { @@ -230,17 +217,18 @@ function Menu(userService, $state, $rootScope) {
230 icon: 'now_widgets' 217 icon: 'now_widgets'
231 }, 218 },
232 { 219 {
233 - name: 'dashboard.dashboards',  
234 - type: 'link',  
235 - state: 'home.dashboards',  
236 - icon: 'dashboards'  
237 - }, 220 + name: 'dashboard.dashboards',
  221 + type: 'link',
  222 + state: 'home.dashboards',
  223 + icon: 'dashboards'
  224 + },
238 { 225 {
239 - name: 'audit-log.audit-logs',  
240 - type: 'link',  
241 - state: 'home.auditLogs',  
242 - icon: 'track_changes'  
243 - }]; 226 + name: 'audit-log.audit-logs',
  227 + type: 'link',
  228 + state: 'home.auditLogs',
  229 + icon: 'track_changes'
  230 + }
  231 + );
244 232
245 homeSections = 233 homeSections =
246 [{ 234 [{
@@ -292,58 +280,52 @@ function Menu(userService, $state, $rootScope) { @@ -292,58 +280,52 @@ function Menu(userService, $state, $rootScope) {
292 state: 'home.entityViews' 280 state: 'home.entityViews'
293 } 281 }
294 ] 282 ]
295 - },  
296 - {  
297 - name: 'dashboard.management',  
298 - places: [  
299 - {  
300 - name: 'widget.widget-library',  
301 - icon: 'now_widgets',  
302 - state: 'home.widgets-bundles'  
303 - },  
304 - {  
305 - name: 'dashboard.dashboards',  
306 - icon: 'dashboard',  
307 - state: 'home.dashboards'  
308 - }  
309 - ]  
310 - },  
311 - {  
312 - name: 'audit-log.audit',  
313 - places: [  
314 - {  
315 - name: 'audit-log.audit-logs',  
316 - icon: 'track_changes',  
317 - state: 'home.auditLogs'  
318 - }  
319 - ]  
320 }]; 283 }];
321 -  
322 if (userService.isEdgesSupportEnabled()) { 284 if (userService.isEdgesSupportEnabled()) {
323 - sections.splice(6, 0, edgeMenuSection.side);  
324 - homeSections.splice(5, 0, edgeMenuSection.home);  
325 - }  
326 -  
327 - } else if (authority === 'CUSTOMER_USER') {  
328 - let edgeMenuSection = {  
329 - side: {  
330 - name: 'edge.edges',  
331 - type: 'link',  
332 - state: 'home.edges',  
333 - icon: 'router'  
334 - },  
335 - home: {  
336 - name: 'edge.edges', 285 + homeSections.push({
  286 + name: 'edge.management',
337 places: [ 287 places: [
338 { 288 {
339 name: 'edge.edges', 289 name: 'edge.edges',
340 icon: 'router', 290 icon: 'router',
341 state: 'home.edges' 291 state: 'home.edges'
  292 + },
  293 + {
  294 + name: 'rulechain.edge-rulechains',
  295 + icon: 'code',
  296 + state: 'home.edges.edgeRuleChains'
342 } 297 }
343 ] 298 ]
344 299
345 - } 300 + });
346 } 301 }
  302 + homeSections.push(
  303 + {
  304 + name: 'dashboard.management',
  305 + places: [
  306 + {
  307 + name: 'widget.widget-library',
  308 + icon: 'now_widgets',
  309 + state: 'home.widgets-bundles'
  310 + },
  311 + {
  312 + name: 'dashboard.dashboards',
  313 + icon: 'dashboard',
  314 + state: 'home.dashboards'
  315 + }
  316 + ]
  317 + },
  318 + {
  319 + name: 'audit-log.audit',
  320 + places: [
  321 + {
  322 + name: 'audit-log.audit-logs',
  323 + icon: 'track_changes',
  324 + state: 'home.auditLogs'
  325 + }
  326 + ]
  327 + });
  328 + } else if (authority === 'CUSTOMER_USER') {
347 sections = [ 329 sections = [
348 { 330 {
349 name: 'home.home', 331 name: 'home.home',
@@ -368,13 +350,25 @@ function Menu(userService, $state, $rootScope) { @@ -368,13 +350,25 @@ function Menu(userService, $state, $rootScope) {
368 type: 'link', 350 type: 'link',
369 state: 'home.entityViews', 351 state: 'home.entityViews',
370 icon: 'view_quilt' 352 icon: 'view_quilt'
371 - }, 353 + }];
  354 + if (userService.isEdgesSupportEnabled()) {
  355 + sections.push(
  356 + {
  357 + name: 'edge.edges',
  358 + type: 'link',
  359 + state: 'home.edges',
  360 + icon: 'router'
  361 + }
  362 + );
  363 + }
  364 + sections.push(
372 { 365 {
373 name: 'dashboard.dashboards', 366 name: 'dashboard.dashboards',
374 type: 'link', 367 type: 'link',
375 state: 'home.dashboards', 368 state: 'home.dashboards',
376 icon: 'dashboard' 369 icon: 'dashboard'
377 - }]; 370 + }
  371 + );
378 372
379 homeSections = 373 homeSections =
380 [{ 374 [{
@@ -406,7 +400,23 @@ function Menu(userService, $state, $rootScope) { @@ -406,7 +400,23 @@ function Menu(userService, $state, $rootScope) {
406 state: 'home.entityViews' 400 state: 'home.entityViews'
407 } 401 }
408 ] 402 ]
409 - }, 403 + }];
  404 + if (userService.isEdgesSupportEnabled()) {
  405 + homeSections.push(
  406 + {
  407 + name: 'edge.edges',
  408 + places: [
  409 + {
  410 + name: 'edge.edges',
  411 + icon: 'router',
  412 + state: 'home.edges'
  413 + }
  414 + ]
  415 +
  416 + }
  417 + );
  418 + }
  419 + homeSections.push(
410 { 420 {
411 name: 'dashboard.view-dashboards', 421 name: 'dashboard.view-dashboards',
412 places: [ 422 places: [
@@ -416,12 +426,8 @@ function Menu(userService, $state, $rootScope) { @@ -416,12 +426,8 @@ function Menu(userService, $state, $rootScope) {
416 state: 'home.dashboards' 426 state: 'home.dashboards'
417 } 427 }
418 ] 428 ]
419 - }];  
420 -  
421 - if (userService.isEdgesSupportEnabled()) {  
422 - sections.splice(4, 0, edgeMenuSection.side);  
423 - homeSections.splice(3, 0, edgeMenuSection.home);  
424 - } 429 + }
  430 + );
425 } 431 }
426 } 432 }
427 } 433 }