shamrickus commented on code in PR #6914:
URL: https://github.com/apache/trafficcontrol/pull/6914#discussion_r904067710


##########
experimental/traffic-portal/src/app/shared/tp-header/tp-header.component.ts:
##########
@@ -37,17 +37,55 @@ export class TpHeaderComponent implements OnInit {
 
        public hidden = false;
 
+       // Will try to display each of these navs on the header, space allowing.
+       public horizNavs: Array<HeaderNavigation> = new 
Array<HeaderNavigation>();
+       // Navs that are not directly displayed on the header.
+       public vertNavs: Array<HeaderNavigation> = new 
Array<HeaderNavigation>();
+
        /**
         * Angular lifecycle hook
         */
        public ngOnInit(): void {
+               this.headerSvc.addHorizontalNav({
+                       routerLink: "/core",
+                       text: "Home",
+                       type: "anchor",
+               }, "home");
+               this.headerSvc.addHorizontalNav({
+                       routerLink: "/core/users",
+                       text: "Users",
+                       type: "anchor",
+                       visible: () => this.hasPermission("USER:READ"),
+               }, "Users");
+               this.headerSvc.addHorizontalNav({
+                       routerLink: "/core/servers",
+                       text: "Servers",
+                       type: "anchor",
+                       visible: () => this.hasPermission("SERVER:READ"),
+               }, "Servers");
+               this.headerSvc.addVerticalNav({
+                       routerLink: "/core/me",
+                       text: "Profile",
+                       type: "anchor"
+               }, "Profile");
+               this.headerSvc.addVerticalNav({
+                       click: async () => this.logout(),
+                       text: "Logout",
+                       type: "anchor"
+               }, "Logout");
+
                this.headerSvc.headerTitle.subscribe(title => {
                        this.title = title;
                });
-
                this.headerSvc.headerHidden.subscribe(hidden => {
                        this.hidden = hidden;
                });
+               this.headerSvc.horizontalNavsUpdated.subscribe(navs => {
+                       this.horizNavs = navs;
+               });
+               this.headerSvc.verticalNavsUpdated.subscribe(navs => {
+                       this.vertNavs = navs;
+               });

Review Comment:
   Will do. For the record, It only redid the inserts on the initial creation 
of the component, which should only happen once.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to