summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk
diff options
context:
space:
mode:
authormravula <mr257h@att.com>2019-09-19 16:33:23 -0400
committermravula <mr257h@att.com>2019-09-19 16:33:23 -0400
commit71ff35c368938e9c0f7bdfee75f962945556070b (patch)
tree6d7b99cd1a29f0c870c637313bdafff55418563a /ecomp-sdk
parent3a522400d1296fa30d54df90bbedbf81bc357639 (diff)
updated sidebar to display menu items even if action is empty
Issue-ID: PORTAL-742 Change-Id: Ia0490d3a936b57aae83c75f8818ad3b517b04984 Signed-off-by: mravula <mr257h@att.com>
Diffstat (limited to 'ecomp-sdk')
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/components/sidebar/sidebar.component.ts17
1 files changed, 11 insertions, 6 deletions
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/components/sidebar/sidebar.component.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/components/sidebar/sidebar.component.ts
index 988ebcc1..314245b1 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/components/sidebar/sidebar.component.ts
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/components/sidebar/sidebar.component.ts
@@ -82,8 +82,8 @@ export class SidebarComponent implements OnInit {
this.leftParentData = JSON.parse(this.result.data);
this.leftChildData = JSON.parse(this.result.data2);
- for (var i = 0; i < this.leftParentData.length; i++) {
- var parentItem={
+ for (let i = 0; i < this.leftParentData.length; i++) {
+ let parentItem={
name:null,
imageSrc:null,
href:null,
@@ -94,12 +94,14 @@ export class SidebarComponent implements OnInit {
parentItem.name = this.leftParentData[i].label;
parentItem.imageSrc = this.leftParentData[i].imageSrc;
// Add link to items with no subitems
- if (this.leftChildData[i].length == 0)
- parentItem.href = this.leftParentData[i].action;
+ if (this.leftChildData[i].length === 0){
+ parentItem.href = this.leftParentData[i].action;
+ }else{
+
- for (var j = 0; j < this.leftChildData[i].length; j++) {
+ for (let j = 0; j < this.leftChildData[i].length; j++) {
- var childItem={
+ let childItem={
name:null,
href:null,
router:null
@@ -107,12 +109,15 @@ export class SidebarComponent implements OnInit {
if (this.leftChildData[i][j].label != null && this.leftChildData[i][j].label.length > 0) {
childItem.name = this.leftChildData[i][j].label;
+ if(null!==this.leftChildData[i][j].action){
if(this.leftChildData[i][j].action.match('v2/*'))
childItem.router = '/'+ this.leftChildData[i][j].action;
else childItem.href = this.leftChildData[i][j].action;
parentItem.menuItems.push(childItem)
+ }
}
}
+ }
this.menuData.push(parentItem);
console.log(this.menuData);
}