blob: 5ba1a1bad19912c23d219b70263cc79b7766e218 [file] [log] [blame]
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<div id="nifi-registry-users-administration-perspective" class="mat-elevation-z5">
<div fxFlex class="pad-top-md pad-bottom-sm pad-left-md pad-right-md">
<span class="md-card-title">Authorized Users ({{nfRegistryService.users.length + nfRegistryService.groups.length}})</span>
<div flex class="push-right-sm" fxLayout="row" fxLayoutAlign="end center">
<td-chips class="push-right-sm"
[items]="nfRegistryService.autoCompleteUsersAndGroups"
(add)="nfRegistryService.usersSearchAdd($event)"
(remove)="nfRegistryService.usersSearchRemove($event)"></td-chips>
<div matTooltip="{{(!nfRegistryService.currentUser.resourcePermissions.tenants.canWrite) ? 'You do not have permission. Please contact your system administrator.': ''}}">
<button data-automation-id="add-user-button" class="push-top-sm push-right-sm" color="fds-secondary" mat-raised-button (click)="addUser()" [disabled]="!canEditUsers()">
Add User
</button>
</div>
<button class="push-top-sm" color="fds-primary"
mat-raised-button [matMenuTriggerFor]="userActionMenu">
Actions<i class="fa fa-caret-down" aria-hidden="true"></i>
</button>
</div>
<mat-menu class="fds-primary-dropdown-button-menu" #userActionMenu="matMenu" [overlapTrigger]="false">
<div matTooltip="{{nfRegistryService.disableMultiDeleteAction ? 'Please deselect any non-configurable users or groups to enable multi-delete.': ''}}">
<button mat-menu-item
[disabled]="((nfRegistryService.getSelectedGroups().length === 0) && (nfRegistryService.getSelectedUsers().length === 0)) || nfRegistryService.disableMultiDeleteAction || !canEditUsers()"
(click)="nfRegistryService.deleteSelectedUsersAndGroups()">
<span>Delete</span>
</button>
</div>
<div matTooltip="{{(nfRegistryService.getSelectedGroups().length > 0) ? 'Only users can be added when creating a new group. Please deselect any groups to enable.': (!nfRegistryService.currentUser.resourcePermissions.tenants.canWrite) ? 'You do not have permission. Please contact your system administrator.': ''}}">
<button mat-menu-item [disabled]="(nfRegistryService.getSelectedGroups().length > 0) || !canEditUsers()"
(click)="createNewGroup()">
<span>Create new group</span>
</button>
</div>
</mat-menu>
<div id="nifi-registry-users-administration-list-container-column-header" fxLayout="row"
fxLayoutAlign="space-between center" class="td-data-table">
<div class="td-data-table-column" (click)="nfRegistryService.sortUsersAndGroups(column)"
*ngFor="let column of nfRegistryService.userColumns"
fxFlex="{{column.width}}">
{{column.label}}
<i *ngIf="column.active && column.sortable && column.sortOrder === 'ASC'" class="fa fa-caret-up"
aria-hidden="true"></i>
<i *ngIf="column.active && column.sortable && column.sortOrder === 'DESC'" class="fa fa-caret-down"
aria-hidden="true"></i>
</div>
<div class="td-data-table-column">
<div fxLayout="row" fxLayoutAlign="end center">
<mat-checkbox class="pad-left-sm" [(ngModel)]="nfRegistryService.allUsersAndGroupsSelected"
(checked)="nfRegistryService.allUsersAndGroupsSelected"
(change)="nfRegistryService.toggleUsersSelectAll()"></mat-checkbox>
</div>
</div>
</div>
<div id="nifi-registry-users-administration-list-container">
<div
*ngFor="let row of nfRegistryService.filteredUserGroups"
(click)="row.checked = !row.checked;nfRegistryService.determineAllUsersAndGroupsSelectedState(row)">
<div [ngClass]="{'nonconfigurable' : row.configurable === false, 'selected-nonconfigurable' : (row.checked === true && row.configurable === false), 'selected' : row.checked === true}" *ngFor="let column of nfRegistryService.userColumns" fxLayout="row" fxLayoutAlign="space-between center" class="td-data-table-row">
<div class="td-data-table-cell" fxFlex="{{column.width}}">
<div class="ellipsis" matTooltip="{{column.format ? column.format(row[column.name]) : row[column.name]}}">
<i class="fa fa-users push-right-sm" aria-hidden="true"></i>{{column.format ? column.format(row[column.name]) : row[column.name]}}
</div>
</div>
<div class="td-data-table-cell">
<div>
<div *ngIf="nfRegistryService.userGroupsActions.length <= 4" fxLayout="row" fxLayoutAlign="end center">
<button (click)="row.checked = !row.checked;nfRegistryService.executeGroupAction(action, row)"
*ngFor="let action of nfRegistryService.userGroupsActions"
matTooltip="{{action.tooltip}}" mat-icon-button color="accent"
[disabled]="action.disabled(row)">
<i class="{{action.icon}}" aria-hidden="true"></i>
</button>
<mat-checkbox class="pad-left-sm" [(ngModel)]="row.checked" [checked]="row.checked"
(change)="nfRegistryService.determineAllUsersAndGroupsSelectedState(row)"
(click)="row.checked = !row.checked;nfRegistryService.determineAllUsersAndGroupsSelectedState(row)"></mat-checkbox>
</div>
<div *ngIf="nfRegistryService.userGroupsActions.length > 4" fxLayout="row" fxLayoutAlign="end center">
<button (click)="row.checked = !row.checked" matTooltip="Actions" mat-icon-button
[matMenuTriggerFor]="userTableActionMenu">
<i class="fa fa-ellipsis-h" aria-hidden="true"></i>
</button>
<mat-menu #userTableActionMenu="matMenu" [overlapTrigger]="false">
<button (click)="nfRegistryService.executeGroupAction(action, row)"
*ngFor="let action of nfRegistryService.userGroupsActions"
matTooltip="{{action.tooltip}}" mat-menu-item
[disabled]="action.disabled(row)">
(click)="nfRegistryService.sidenav.toggle()">
<i class="{{action.icon}}" aria-hidden="true"></i>
<span>{{action.name}}</span>
</button>
</mat-menu>
<mat-checkbox class="pad-left-sm" [(ngModel)]="row.checked" [checked]="row.checked"
(change)="nfRegistryService.determineAllUsersAndGroupsSelectedState(row)"
(click)="row.checked = !row.checked;nfRegistryService.determineAllUsersAndGroupsSelectedState(row)"></mat-checkbox>
</div>
</div>
<div *ngIf="!nfRegistryService.userGroupsActions" fxLayout="row" fxLayoutAlign="end center">
<mat-checkbox class="pad-left-sm" [(ngModel)]="row.checked" [checked]="row.checked"
(change)="nfRegistryService.determineAllUsersAndGroupsSelectedState(row)"
(click)="row.checked = !row.checked;nfRegistryService.determineAllUsersAndGroupsSelectedState(row)"></mat-checkbox>
</div>
</div>
</div>
</div>
<div
*ngFor="let row of nfRegistryService.filteredUsers"
(click)="row.checked = !row.checked;nfRegistryService.determineAllUsersAndGroupsSelectedState(row)">
<div [ngClass]="{'nonconfigurable' : row.configurable === false, 'selected-nonconfigurable' : (row.checked === true && row.configurable === false), 'selected' : row.checked === true}" *ngFor="let column of nfRegistryService.userColumns" fxLayout="row" fxLayoutAlign="space-between center" class="td-data-table-row">
<div class="td-data-table-cell" fxFlex="{{column.width}}">
<div class="ellipsis" matTooltip="{{column.format ? column.format(row[column.name]) : row[column.name]}}">
{{column.format ? column.format(row[column.name]) : row[column.name]}}
</div>
</div>
<div class="td-data-table-cell">
<div>
<div *ngIf="nfRegistryService.usersActions.length <= 4" fxLayout="row" fxLayoutAlign="end center">
<button (click)="row.checked = !row.checked;nfRegistryService.executeUserAction(action, row)"
*ngFor="let action of nfRegistryService.usersActions"
matTooltip="{{action.tooltip}}" mat-icon-button color="accent"
[disabled]="action.disabled(row)">
<i class="{{action.icon}}" aria-hidden="true"></i>
</button>
<mat-checkbox class="pad-left-sm" [(ngModel)]="row.checked" [checked]="row.checked"
(change)="nfRegistryService.determineAllUsersAndGroupsSelectedState(row)"
(click)="row.checked = !row.checked;nfRegistryService.determineAllUsersAndGroupsSelectedState(row)"></mat-checkbox>
</div>
<div *ngIf="nfRegistryService.usersActions.length > 4" fxLayout="row" fxLayoutAlign="end center">
<button (click)="row.checked = !row.checked" matTooltip="Actions" mat-icon-button
[matMenuTriggerFor]="userTableActionMenu">
<i class="fa fa-ellipsis-h" aria-hidden="true"></i>
</button>
<mat-menu #userTableActionMenu="matMenu" [overlapTrigger]="false">
<button (click)="nfRegistryService.executeUserAction(action, row)"
*ngFor="let action of nfRegistryService.usersActions"
matTooltip="{{action.tooltip}}" mat-menu-item
[disabled]="action.disabled(row)">
(click)="nfRegistryService.sidenav.toggle()">
<i class="{{action.icon}}" aria-hidden="true"></i>
<span>{{action.name}}</span>
</button>
</mat-menu>
<mat-checkbox class="pad-left-sm" [(ngModel)]="row.checked" [checked]="row.checked"
(change)="nfRegistryService.determineAllUsersAndGroupsSelectedState(row)"
(click)="row.checked = !row.checked;nfRegistryService.determineAllUsersAndGroupsSelectedState(row)"></mat-checkbox>
</div>
</div>
<div *ngIf="!nfRegistryService.usersActions" fxLayout="row" fxLayoutAlign="end center">
<mat-checkbox class="pad-left-sm" [(ngModel)]="row.checked" [checked]="row.checked"
(change)="nfRegistryService.determineAllUsersAndGroupsSelectedState(row)"
(click)="row.checked = !row.checked;nfRegistryService.determineAllUsersAndGroupsSelectedState(row)"></mat-checkbox>
</div>
</div>
</div>
</div>
</div>
<div class="mat-padding" *ngIf="nfRegistryService.filteredUsers.length === 0 && nfRegistryService.filteredUserGroups.length === 0" layout="row"
layout-align="center center">
<h3>No results to display.</h3>
</div>
</div>
</div>
<router-outlet></router-outlet>