ocket8888 commented on code in PR #7000:
URL: https://github.com/apache/trafficcontrol/pull/7000#discussion_r937982380


##########
experimental/traffic-portal/src/app/core/users/tenants/tenants.component.ts:
##########
@@ -80,10 +80,12 @@ export class TenantsComponent implements OnInit, OnDestroy {
 
        public readonly contextMenuItems: ContextMenuItem<Readonly<Tenant>>[] = 
[
                {
+                       disabled: (): boolean => 
!this.auth.hasPermission("TENANT:UPDATE"),
                        href: (t: Tenant): string => `core/tenants/${t.id}`,
                        name: "View Details"
                },
                {
+                       disabled: (): boolean => 
!this.auth.hasPermission("TENANT:UPDATE"),

Review Comment:
   `disabled` should be used when the action doesn't make sense on the selected 
data; controls that the user doesn't have Permissions to use should just be 
hidden.



##########
experimental/traffic-portal/src/app/shared/tree-select/tree-select.component.html:
##########
@@ -14,15 +14,15 @@
 <div class="tree-select-root" role="combobox">
        <mat-form-field>
                <mat-label>{{label}}</mat-label>
-               <input type="text" id="{{handle}}-tree-select" 
name="{{handle}}-tree-select" matInput required readonly 
(click)="toggle($event)" [(ngModel)]="selected.name" [disabled]="disabled"/>
+               <input type="search" id="{{handle}}-tree-select" 
name="{{handle}}-tree-select" matInput required readonly 
(click)="toggle($event)" [(ngModel)]="selected.name" [disabled]="disabled"/>
        </mat-form-field>
        <div class="tree-select-content" *ngIf="shown">
                <mat-form-field appearance="fill" 
(click)="$event.stopPropagation()">
                        <mat-label>Filter</mat-label>
                        <input type="text" (input)="filterChanged($event)" 
id="filter-{{handle}}" name="filter-{{handle}}" matInput/>
                </mat-form-field>
                <mat-tree [dataSource]="treeData" [treeControl]="treeControl">
-                       <mat-tree-node *matTreeNodeDef="let node" 
matTreeNodeToggle [class.hidden-node]="!isVisible(node)">
+                       <mat-tree-node *matTreeNodeDef="let node" 
matTreeNodeToggle [style.display]="!isVisible(node) ? 'none' : 'block'">

Review Comment:
   does `[hidden]="!isVisible(node)"` not work? I have had trouble with doing 
that to `mat-error`s once before



-- 
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