//- Copyright (c) 2019 AT&T Intellectual Property. # //- # //- Licensed 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([@routerTransition]) app-page-header([heading]="'User Management'", [icon]="'fa-edit'") .card-mb-12 .pull-left mat-form-field input(matInput, name="filter", value="{{filterString}}", (keyup)="applyFilter($event.target.value)", placeholder="Filter") div(style="width: 100%", [hidden]="!loading") mat-spinner(style="margin: auto", color="primary") table.mat-elevation-z8(mat-table, *ngIf="dataSource.data && dataSource.data.length > 0", [dataSource]="dataSource", style="width: 100%", [hidden]="loading") ng-container(matColumnDef="lastName") th(mat-header-cell, *matHeaderCellDef) lastName td(mat-cell, *matCellDef="let element") {{ element.lastName }} ng-container(matColumnDef="firstName") th(mat-header-cell, *matHeaderCellDef) First Name td(mat-cell, *matCellDef="let element") {{ element.firstName }} ng-container(matColumnDef="email") th(mat-header-cell, *matHeaderCellDef) Email td(mat-cell, *matCellDef="let element") {{ element.email}} ng-container(matColumnDef="addGroups") th(mat-header-cell, *matHeaderCellDef) Add to Group td(mat-cell, *matCellDef="let element") .dropdown(ngbDropdown, autoClose="outside", (openChange)="dropdownChange()", placement="left-top") button(mat-mini-fab, color="primary", ngbDropdownToggle, (click)="null") i.fa.fa-caret-down .dropdown-menu(ngbDropdownMenu) h4.mb-2.ml-1(style="font-weight: bold;") Change Groups input.ml-1(matInput, type='search', placeholder='Search...', color='blue', [(ngModel)]='search.groupName') div(style="max-height: 300px; overflow-y: scroll") .px-4.py-3 .mr-2.ml-2(*ngFor="let group of groups | filterBy:search") mat-checkbox((change)="addRemoveGroupList(element, group._id, $event)", [(ngModel)]="element[group._id]") {{group.groupName}} div(style="text-align: center") button.primary.mr-1(mat-raised-button, [disabled]= "!element.groupsToAddRemove || element.groupsToAddRemove.length <= 0", aria-label='Edit', color="primary", (click)='addGroups(element)') Add button(mat-raised-button, [disabled]= "!element.groupsToAddRemove || element.groupsToAddRemove.length <= 0", color="warn", (click)='removeGroups(element)') Remove //- a.dropdown-item(*ngFor="let group of groups", (click)='addGroupsList(element, group._id)') //- span.pl-1 {{group.groupName}} //- i.fa.fa-check(*ngIf='element.groupsToAdd !== undefined && element.groupsToAdd.includes(group._id)') //- mat-select.mr-1((selectionChange)="onChange(element)", style="width: 30%; background: #80808066",[(ngModel)]="element['groupToAddRemove']") //- mat-option(*ngFor="let group of groups", value="{{group._id}}") {{ group.groupName }} //- button.mr-1(mat-mini-fab, aria-label='Edit', color="primary", (click)='addGroup(element)') //- i.fa.fa-plus //- button.text-white(mat-mini-fab, aria-label='Remove', color='warn', (click)='removeGroup(element)') //- i.fa.fa-remove ng-container(matColumnDef="isVerified") th(mat-header-cell, *matHeaderCellDef) Verified td(mat-cell, *matCellDef="let element") {{element.isVerified ? "Yes" : "No"}} ng-container(matColumnDef="enabled") th(mat-header-cell, *matHeaderCellDef) Enabled td(mat-cell, *matCellDef="let element") mat-slide-toggle([(ngModel)]="element.enabled", "color"="primary", (input)="enableUser($event, element)") //mat-slide-toggle([checked]="element.enabled? true : false", "color"="primary", (input)="enableUser($event, element)") tr(mat-header-row, *matHeaderRowDef="displayedColumns") tr(mat-row, *matRowDef="let row; columns: displayedColumns") mat-paginator([length]="resultsLength", [pageSizeOptions]="[10, 25, 100]", [hidden]="loading")