ocket8888 commented on code in PR #6753:
URL: https://github.com/apache/trafficcontrol/pull/6753#discussion_r878446081
##########
experimental/traffic-portal/src/app/shared/tp-header/tp-header.component.html:
##########
@@ -11,30 +11,39 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<mat-toolbar color="primary">
- <img src="/assets/logo.svg" alt="Apache Traffic Control logo"/>
+<mat-toolbar color="primary" *ngIf="!hidden">
+ <img src="/assets/logo.svg" alt="Apache Traffic Control logo"
routerLink="/core/"/>
<h1>{{title ? title : 'Welcome to Traffic Portal!'}}</h1>
<div></div>
<nav id="expanded">
<ul>
- <li><a routerLink="/core/">Home</a></li>
- <li *ngIf="hasPermission('USER:READ')"><a
routerLink="/core/users">Users</a></li>
- <li *ngIf="hasPermission('SERVER:READ')"><a
routerLink="/core/servers">Servers</a></li>
- <li><button class="menubutton" type="button"
(click)="logout()">Logout</button></li>
- <li><a routerLink="/core/me"><svg
xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 16 16"><g
id="surface1"><path d="M 8 2 C 6.347656 2 5 3.347656 5 5 C 5 6.652344 6.347656
8 8 8 C 9.652344 8 11 6.652344 11 5 C 11 3.347656 9.652344 2 8 2 Z M 8 8 C
5.246094 8 3 10.246094 3 13 L 4 13 C 4 10.785156 5.785156 9 8 9 C 10.214844 9
12 10.785156 12 13 L 13 13 C 13 10.246094 10.753906 8 8 8 Z M 8 3 C 9.109375 3
10 3.890625 10 5 C 10 6.109375 9.109375 7 8 7 C 6.890625 7 6 6.109375 6 5 C 6
3.890625 6.890625 3 8 3 Z "></path></g></svg>
- </a></li>
+ <li><button mat-button
routerLink="/core/">Home</button></li>
+ <li *ngIf="hasPermission('USER:READ')"><button
mat-button routerLink="/core/users">Users</button></li>
+ <li *ngIf="hasPermission('SERVER:READ')"><button
mat-button routerLink="/core/servers">Servers</button></li>
+ <li>
+ <button mat-icon-button
[matMenuTriggerFor]="expandedMenu">
+ <mat-icon>manage_accounts</mat-icon>
+ </button>
+ <mat-menu #expandedMenu="matMenu">
+ <button mat-menu-item
routerLink="/core/me">Profile</button>
+ <button mat-menu-item
(click)="logout()">Logout</button>
+ <button mat-menu-item
[matMenuTriggerFor]="themeMenu">Theme</button>
+ </mat-menu>
+ </li>
</ul>
</nav>
<nav id="collapsed">
- <input type="checkbox" hidden id="collapsed-menu"/>
- <label for="collapsed-menu"></label>
- <ul>
- <li><a routerLink="/core/">Home</a></li>
- <li *ngIf="hasPermission('USER:READ')"><a
routerLink="/core/users">Users</a></li>
- <li *ngIf="hasPermission('SERVER:READ')"><a
routerLink="/core/servers">Servers</a></li>
- <li><a href="#">Tools</a></li>
- <li><a href="/core/me">Profile</a></li>
- <li><button type="button" class="menubutton"
(click)="logout()">Logout</button></li>
- </ul>
+ <button mat-icon-button
[matMenuTriggerFor]="collapsedMenu"><mat-icon>menu</mat-icon></button>
+ <mat-menu #collapsedMenu="matMenu">
+ <button mat-menu-item routerLink="/core/">Home</button>
+ <button *ngIf="hasPermission('USER:READ')"
mat-menu-item routerLink="/core/users">Users</button>
+ <button *ngIf="hasPermission('SERVER:READ')"
mat-menu-item routerLink="/core/servers">Servers</button>
+ <button mat-menu-item href="/core/me">Profile</button>
Review Comment:
also those of these buttons that should be buttons, should have their `type`
set to `button`.
--
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]