Skip to content
Snippets Groups Projects
Commit db03e678 authored by Joanna Kaźmierczak's avatar Joanna Kaźmierczak
Browse files

users view

parent a262c82c
No related branches found
No related tags found
2 merge requests!152Release/1.9.0,!51Draft: Resolve "New portal layout"
...@@ -69,21 +69,7 @@ tr.clickable { ...@@ -69,21 +69,7 @@ tr.clickable {
:host ::ng-deep .p-paginator .p-dropdown .p-dropdown-label{ :host ::ng-deep .p-paginator .p-dropdown .p-dropdown-label{
padding-right: 10px; padding-right: 10px;
} }
::ng-deep.p-selectbutton .p-button.p-highlight{
background: var(--primary-button-color) !important;
border-color: var(--primary-button-color);
}
:host ::ng-deep .p-selectbutton .p-button{
background: #fff;
}
:host ::ng-deep .p-button .p-button-label{
font-weight: normal;
}
:host ::ng-deep .p-selectbutton .p-button:not(.p-disabled):not(.p-highlight):hover{
background: var(--primary-button-color);
border-color: var(--primary-button-color);
color: var(--background);
}
label{ label{
padding-left:5px; padding-left:5px;
display: unset; display: unset;
... ...
......
...@@ -61,6 +61,7 @@ import {InputTextModule} from 'primeng/inputtext'; ...@@ -61,6 +61,7 @@ import {InputTextModule} from 'primeng/inputtext';
import { DomainNamespaceAnnotationsComponent } from './domain-namespace-annotations/domain-namespace-annotations.component'; import { DomainNamespaceAnnotationsComponent } from './domain-namespace-annotations/domain-namespace-annotations.component';
import { provideZxvbnServiceForPSM } from 'angular-password-strength-meter/zxcvbn'; import { provideZxvbnServiceForPSM } from 'angular-password-strength-meter/zxcvbn';
import { LeftMenuComponent } from './left-menu/left-menu.component'; import { LeftMenuComponent } from './left-menu/left-menu.component';
import {TableModule} from 'primeng/table';
@NgModule({ @NgModule({
...@@ -80,6 +81,7 @@ import { LeftMenuComponent } from './left-menu/left-menu.component'; ...@@ -80,6 +81,7 @@ import { LeftMenuComponent } from './left-menu/left-menu.component';
DropdownModule, DropdownModule,
InputTextModule, InputTextModule,
FormioModule, FormioModule,
TableModule,
], ],
declarations: [ declarations: [
RateComponent, RateComponent,
... ...
......
...@@ -23,10 +23,6 @@ tr.clickable { ...@@ -23,10 +23,6 @@ tr.clickable {
align-items: center; align-items: center;
} }
:host ::ng-deep .p-dropdown {
width: 170px;
}
.space-between { .space-between {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
...@@ -36,3 +32,50 @@ li::marker { ...@@ -36,3 +32,50 @@ li::marker {
content: ''; content: '';
font-size: 0em; font-size: 0em;
} }
:host ::ng-deep .p-datatable .p-datatable-thead > tr > th{
border: 1px solid #E0E2E5;
background:transparent;
border-width: 0 0 1px 0;
}
:host ::ng-deep .p-datatable .p-datatable-tbody > tr > td {
text-align: left;
border: 1px solid #E0E2E5;
border-width: 0 0 1px 0;
padding: 1rem 1rem;
}
:host ::ng-deep .p-datatable .p-paginator-bottom{
height: 40px;
background: transparent;
border: none;
margin-top:10px;
}
:host ::ng-deep .p-datatable .p-datatable-tbody > tr{
background: transparent;
}
:host ::ng-deep .p-paginator .p-paginator-pages .p-paginator-page{
transition: unset;
border-radius: 50%;
min-width:3.5rem;
height:3.5rem;
margin:0 5px;
font-size: 14px;
}
:host ::ng-deep .p-paginator-element{
border-radius:50%;
margin:0 5px;
min-width:3.5rem;
height:3.5rem;
font-size: 14px;
}
:host ::ng-deep .p-paginator .p-dropdown{
height:3rem;
}
:host ::ng-deep .p-paginator-icon{
height: 1.5rem;
width: 1.5rem;
}
:host ::ng-deep .p-paginator .p-dropdown .p-dropdown-label{
padding-right: 10px;
}
<div class="col-sm-12 col-sm-10 col-md-12">
<h3>
{{ 'USERS.TITLE' | translate }}</h3>
<div class="flex space-between">
<div class="flex">
<button *ngIf="authService.hasDomainRole(domainId, 'ROLE_DOMAIN_ADMIN') || authService.hasDomainRole(domainId, 'ROLE_VL_DOMAIN_ADMIN')"
class="btn btn-primary" (click)="changeMode()">
<span *ngIf="isModeAllowed(ComponentMode.DELETE)">{{'USERS.ADD_TO_DOMAIN_BUTTON' | translate}}</span>
<span *ngIf="isModeAllowed(ComponentMode.EDIT)">{{'USERS.GO_BACK_BUTTON' | translate}}</span>
</button>
</div>
<div class="" style="display: flex"> <div class="" style="display: flex">
<div *ngIf="isModeAllowed(ComponentMode.DELETE)" class="flex "> <!-- <div *ngIf="isModeAllowed(ComponentMode.DELETE)" class="flex ">-->
<span class="mt-2 pr-1">{{ 'USERS.ITEMS_PER_PAGE' | translate }}:</span> <!-- <span class="mt-2 pr-1">{{ 'USERS.ITEMS_PER_PAGE' | translate }}:</span>-->
<span id="selectionItems" class="dropdown" <!-- <span id="selectionItems" class="dropdown"-->
style="vertical-align: middle; display: inline-block; margin-right: 1rem;"> <!-- style="vertical-align: middle; display: inline-block; margin-right: 1rem;">-->
<button class="dropdown-toggle btn" data-toggle="dropdown" data-close-others="true"> <!-- <button class="dropdown-toggle btn" data-toggle="dropdown" data-close-others="true">-->
{{maxItemsOnPage}} <!-- {{maxItemsOnPage}}-->
</button> <!-- </button>-->
<ul class="dropdown-menu"> <!-- <ul class="dropdown-menu">-->
<li *ngFor="let item of itemsPerPage" [ngClass]="{'active': maxItemsOnPage == item}"> <!-- <li *ngFor="let item of itemsPerPage" [ngClass]="{'active': maxItemsOnPage == item}">-->
<a (click)="setItems(item)"> <!-- <a (click)="setItems(item)">-->
<span>{{item.toString()}}</span> <!-- <span>{{item.toString()}}</span>-->
</a> <!-- </a>-->
</li> <!-- </li>-->
</ul> <!-- </ul>-->
</span> <!-- </span>-->
</div> <!-- </div>-->
<div *ngIf="isModeAllowed(ComponentMode.EDIT)" <div *ngIf="isModeAllowed(ComponentMode.EDIT)"
style="margin-right: 15px; padding-top: 5px;"> {{'USERS.SEARCH' | translate}}</div> style="margin-right: 15px; padding-top: 5px;"> {{'USERS.SEARCH' | translate}}</div>
...@@ -33,19 +22,25 @@ ...@@ -33,19 +22,25 @@
<input pInputText name="searchTextDomain" id="searchTextDomain" placeholder="Search" type="text" <input pInputText name="searchTextDomain" id="searchTextDomain" placeholder="Search" type="text"
(keyup)="searchUsers($event.target.value)"> (keyup)="searchUsers($event.target.value)">
</div> </div>
<div *ngIf="isModeAllowed(ComponentMode.DELETE)" class="flex"> <div *ngIf="isModeAllowed(ComponentMode.DELETE)" class="flex" style="margin-right:20px">
<span class="p-input-icon-right" style="width: 100%">
<i class="pi pi-search" style="font-size: 13px; top: 16px; margin-right: 5px;"></i>
<input pInputText name="searchText" id="searchText" placeholder="Search" type="text" <input pInputText name="searchText" id="searchText" placeholder="Search" type="text"
class="form-control" (keyup)="onSearch($event.target.value)"> class="form-control" (keyup)="onSearch($event.target.value)">
</span>
</div> </div>
<button *ngIf="authService.hasDomainRole(domainId, 'ROLE_DOMAIN_ADMIN') || authService.hasDomainRole(domainId, 'ROLE_VL_DOMAIN_ADMIN')"
class="btn btn-primary" (click)="changeMode()">
<span *ngIf="isModeAllowed(ComponentMode.DELETE)" >{{'USERS.ADD_TO_DOMAIN_BUTTON' | translate}}</span>
<span *ngIf="isModeAllowed(ComponentMode.EDIT)">{{'USERS.GO_BACK_BUTTON' | translate}}</span>
</button>
</div> </div>
<h4 style="margin-top:40px; font-weight: bold"> {{ 'USERS.TITLE' | translate }}</h4>
</div> <div class="background-section">
<p-table #dt [value]="displayUsers" [paginator]="true" [rows]="maxItemsOnPage"
<br> [rowsPerPageOptions]="[15, 20, 25, 30, 50]" >
<table class="table table-hover table-condensed" sortable-table (sorted)="onSorted($event)" <ng-template pTemplate="header">
aria-describedby="Users list" style="margin-top: 15px">
<thead>
<tr> <tr>
<th scope="col" class="column-sortable" sortable-column="username" <th scope="col" class="column-sortable" sortable-column="username"
sort-direction="asc">{{ 'USERS.USER_NAME' | translate }}</th> sort-direction="asc">{{ 'USERS.USER_NAME' | translate }}</th>
...@@ -66,24 +61,17 @@ ...@@ -66,24 +61,17 @@
<th *ngIf="!isModeAllowed(ComponentMode.EDIT)" scope="col">&nbsp;</th> <th *ngIf="!isModeAllowed(ComponentMode.EDIT)" scope="col">&nbsp;</th>
<th *ngIf="isModeAllowed(ComponentMode.EDIT)" scope="col">&nbsp;</th> <th *ngIf="isModeAllowed(ComponentMode.EDIT)" scope="col">&nbsp;</th>
</tr> </tr>
</thead> </ng-template>
<tbody> <ng-template pTemplate="body" let-user>
<tr *ngFor="let user of displayUsers | paginate: {itemsPerPage: maxItemsOnPage, currentPage: pageNumber, id: paginatorName}" <tr (click)="view(user.id)">
[ngClass]="{'clickable!' : domainMode}" (click)="view(user.id)">
<td>{{ user.username }}</td> <td>{{ user.username }}</td>
<td>{{(user.firstname || '') + ' ' + (user.lastname || '')}}</td> <td>{{(user.firstname || '') + ' ' + (user.lastname || '')}}</td>
<td *ngIf="!domainMode">{{user.email}}</td> <td *ngIf="!domainMode">{{user.email}}</td>
<td *ngIf="domainId === domainService.getGlobalDomainId()"> <td *ngIf="domainId === domainService.getGlobalDomainId()">
<div *ngFor="let role of filterDomainNames(user); last as isLast"> <span *ngFor="let role of filterDomainNames(user); let isLast = last">
<span *ngIf="!isLast" style="float:left;padding-right: 3px"> {{ getDomainName(role.domainId) | async }}{{ !isLast ? ', ' : '' }}
{{getDomainName(role.domainId) | async}},
</span>
<span *ngIf="isLast" style="float:left;padding-right: 3px">
{{getDomainName(role.domainId) | async}}
</span> </span>
</div>
<br>
</td> </td>
<td *ngIf="domainId === domainService.getGlobalDomainId()"> <td *ngIf="domainId === domainService.getGlobalDomainId()">
<span>{{"ENUM.USER_ROLES." + getGlobalRole(user).toUpperCase() | translate}}</span> <span>{{"ENUM.USER_ROLES." + getGlobalRole(user).toUpperCase() | translate}}</span>
...@@ -97,7 +85,9 @@ ...@@ -97,7 +85,9 @@
class="dropdown-toggle" data-toggle="dropdown" class="dropdown-toggle" data-toggle="dropdown"
role="button"> role="button">
<span style="color: black;">{{"ENUM.USER_ROLES." + getOnlyDomainRoles(user)?.role | translate}} <span style="color: black;">{{"ENUM.USER_ROLES." + getOnlyDomainRoles(user)?.role | translate}}
<strong class="caret"></strong></span></a> <strong class="caret"></strong>
</span>
</a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li *ngFor="let role of getAllowedRoles()"> <li *ngFor="let role of getAllowedRoles()">
<a (click)="changeUserRole(user,domainId, {value:role})">{{"ENUM.USER_ROLES." + Role[role].toUpperCase() | translate}}</a> <a (click)="changeUserRole(user,domainId, {value:role})">{{"ENUM.USER_ROLES." + Role[role].toUpperCase() | translate}}</a>
...@@ -111,19 +101,20 @@ ...@@ -111,19 +101,20 @@
</span> </span>
</div> </div>
</div> </div>
<div *roles="['ROLE_SYSTEM_ADMIN']"> <div *roles="['ROLE_SYSTEM_ADMIN']">
<div> <div>
{{"ENUM.USER_ROLES." + getOnlyDomainRoles(user)?.role | translate}} {{"ENUM.USER_ROLES." + getOnlyDomainRoles(user)?.role | translate}}
</div> </div>
</div> </div>
</td> </td>
<td *ngIf="!isModeAllowed(ComponentMode.EDIT) && !domainMode">{{user.firstLoginDate | date:'dd-MM-yyyy HH:mm'}}</td> <td *ngIf="!isModeAllowed(ComponentMode.EDIT) && !domainMode">
<td *ngIf="!isModeAllowed(ComponentMode.EDIT) && !domainMode">{{user.lastSuccessfulLoginDate | date:'dd-MM-yyyy HH:mm'}}</td> {{ user.firstLoginDate | date:'dd-MM-yyyy HH:mm' }}
</td>
<td *ngIf="!isModeAllowed(ComponentMode.EDIT) && !domainMode">
{{ user.lastSuccessfulLoginDate | date:'dd-MM-yyyy HH:mm' }}
</td>
<td> <td>
<span class="glyphicon glyphicon-ok" *ngIf="user?.enabled"></span> <i class="pi" [ngClass]="{'pi-check': user?.enabled, 'pi-times': !user?.enabled}"></i>
<span class="glyphicon glyphicon-remove" *ngIf="!(user?.enabled)"></span>
</td> </td>
<td *ngIf="!domainMode && !isModeAllowed(ComponentMode.EDIT)"> <td *ngIf="!domainMode && !isModeAllowed(ComponentMode.EDIT)">
<span class="dropdown"> <span class="dropdown">
...@@ -139,29 +130,31 @@ ...@@ -139,29 +130,31 @@
</a> </a>
</li> </li>
<li *ngIf="user.enabled && authService.hasRole('ROLE_SYSTEM_ADMIN') && user.username!==authService.getUsername()"> <li *ngIf="user.enabled && authService.hasRole('ROLE_SYSTEM_ADMIN') && user.username!==authService.getUsername()">
<a (click)="changeUserStatus(user, false);$event.stopPropagation()" <a (click)="changeUserStatus(user, false);$event.stopPropagation()"> <!--user should not be able to disable himself -->
> <!--user should not be able to disable himself --> {{ 'USERS.DISABLE_BUTTON' | translate }}
{{ 'USERS.DISABLE_BUTTON' | translate }}</a> </a>
</li> </li>
<li *ngIf="!user.enabled && authService.hasRole('ROLE_SYSTEM_ADMIN')"> <li *ngIf="!user.enabled && authService.hasRole('ROLE_SYSTEM_ADMIN')">
<a (click)="changeUserStatus(user, true);$event.stopPropagation()" <a (click)="changeUserStatus(user, true);$event.stopPropagation()">
> {{ 'USERS.ENABLE_BUTTON' | translate }}
{{ 'USERS.ENABLE_BUTTON' | translate }}</a> </a>
</li> </li>
<li *ngIf="isModeAllowed(ComponentMode.EDIT) && <li *ngIf="isModeAllowed(ComponentMode.EDIT) &&
domainId != domainService.getGlobalDomainId() && domainId != domainService.getGlobalDomainId() &&
isGlobalGuestAndHasNoRoleInThisDomain(user)"> isGlobalGuestAndHasNoRoleInThisDomain(user)">
<a <a (click)="addToCurrentDomain(user);$event.stopPropagation()">
(click)="addToCurrentDomain(user);$event.stopPropagation()">{{'USERS.GRANT_USER_ROLE_IN_CURRENT_DOMAIN_BUTTON' | translate}}</a> {{'USERS.GRANT_USER_ROLE_IN_CURRENT_DOMAIN_BUTTON' | translate}}
</a>
</li> </li>
<li *ngIf="isModeAllowed(ComponentMode.DELETE) && domainId != domainService.getGlobalDomainId() && user.username!==authService.getUsername()"> <li *ngIf="isModeAllowed(ComponentMode.DELETE) && domainId != domainService.getGlobalDomainId() && user.username!==authService.getUsername()">
<a role="button" <a role="button" (click)="onRemoveFromDomain.emit(user);$event.stopPropagation()">
{{ 'USERS.REMOVE_FROM_DOMAIN_BUTTON' | translate }}
(click)="onRemoveFromDomain.emit(user);$event.stopPropagation()">{{ 'USERS.REMOVE_FROM_DOMAIN_BUTTON' | translate }}</a> </a>
</li> </li>
<li *ngIf="isModeAllowed(ComponentMode.DELETE) && authService.hasRole('ROLE_SYSTEM_ADMIN') && user.username!==authService.getUsername() && canUserBeDeleted(user)"> <li *ngIf="isModeAllowed(ComponentMode.DELETE) && authService.hasRole('ROLE_SYSTEM_ADMIN') && user.username!==authService.getUsername() && canUserBeDeleted(user)">
<a role="button" <a role="button" (click)="onDelete.emit(user);$event.stopPropagation()">
(click)="onDelete.emit(user);$event.stopPropagation()">{{ 'USERS.DELETE_BUTTON' | translate }}</a> {{ 'USERS.DELETE_BUTTON' | translate }}
</a>
</li> </li>
</ul> </ul>
</span> </span>
...@@ -180,13 +173,153 @@ ...@@ -180,13 +173,153 @@
(click)="addToCurrentDomain(user)"> {{'USERS.ADD_TO_DOMAIN_BUTTON' | translate}}</button> (click)="addToCurrentDomain(user)"> {{'USERS.ADD_TO_DOMAIN_BUTTON' | translate}}</button>
</td> </td>
</tr> </tr>
</tbody> </ng-template>
</table> </p-table>
<pagination-controls class="text-right" (pageChange)="pageNumber = $event" id="{{ paginatorName }}"
previousLabel="{{ 'PAGINATION.PREVIOUS' | translate }}"
nextLabel="{{ 'PAGINATION.NEXT' | translate }}"
screenReaderPaginationLabel="{{ 'PAGINATION.SCREEN_READER.PAGINATION' | translate }}"
screenReaderPageLabel="{{ 'PAGINATION.SCREEN_READER.PAGE' | translate }}"
screenReaderCurrentLabel="{{ 'PAGINATION.SCREEN_READER.CURRENT' | translate }}"></pagination-controls>
</div> </div>
<!-- <table class="table table-hover table-condensed" sortable-table (sorted)="onSorted($event)"-->
<!-- aria-describedby="Users list" style="margin-top: 15px">-->
<!-- <thead>-->
<!-- <tr>-->
<!-- <th scope="col" class="column-sortable" sortable-column="username"-->
<!-- sort-direction="asc">{{ 'USERS.USER_NAME' | translate }}</th>-->
<!-- <th scope="col" class="column-sortable" sortable-column="lastname">{{'USERS.NAME' | translate}}</th>-->
<!-- <th *ngIf="!domainMode" scope="col" class="column-sortable"-->
<!-- sortable-column="email">{{'USERS.EMAIL' | translate}}</th>-->
<!-- <th scope="col" class="column-sortable" sortable-column="domains"-->
<!-- *ngIf="domainId === domainService.getGlobalDomainId()">{{ 'USERS.DOMAINS' | translate }}</th>-->
<!-- <th scope="col" class="column-sortable" sortable-column="globalRole"-->
<!-- *ngIf="domainId === domainService.getGlobalDomainId()">{{ 'USERS.GLOBAL_ROLE' | translate }}</th>-->
<!-- <th scope="col" class="column-sortable" sortable-column="roles"-->
<!-- *ngIf="domainId !== domainService.getGlobalDomainId() && !isModeAllowed(ComponentMode.EDIT)">{{ 'USERS.ROLES' | translate }}</th>-->
<!-- <th scope="col" class="column-sortable" *ngIf="!isModeAllowed(ComponentMode.EDIT) && !domainMode"-->
<!-- sortable-column="firstLoginDate">{{ 'USERS.FIRST_LOGIN' | translate }}</th>-->
<!-- <th scope="col" class="column-sortable" *ngIf="!isModeAllowed(ComponentMode.EDIT) && !domainMode"-->
<!-- sortable-column="lastSuccessfulLoginDate">{{ 'USERS.LAST_SUCCESSFUL_LOGIN' | translate }}</th>-->
<!-- <th scope="col" class="column-sortable" sortable-column="enabled">{{ 'USERS.ENABLED' | translate }}</th>-->
<!-- <th *ngIf="!isModeAllowed(ComponentMode.EDIT)" scope="col">&nbsp;</th>-->
<!-- <th *ngIf="isModeAllowed(ComponentMode.EDIT)" scope="col">&nbsp;</th>-->
<!-- </tr>-->
<!-- </thead>-->
<!-- <tbody>-->
<!-- <tr *ngFor="let user of displayUsers | paginate: {itemsPerPage: maxItemsOnPage, currentPage: pageNumber, id: paginatorName}"-->
<!-- [ngClass]="{'clickable!' : domainMode}" (click)="view(user.id)">-->
<!-- <td>{{user.username}}</td>-->
<!-- <td>{{(user.firstname || '') + ' ' + (user.lastname || '')}}</td>-->
<!-- <td *ngIf="!domainMode">{{user.email}}</td>-->
<!-- <td *ngIf="domainId === domainService.getGlobalDomainId()">-->
<!-- <div *ngFor="let role of filterDomainNames(user); last as isLast">-->
<!-- <span *ngIf="!isLast" style="float:left;padding-right: 3px">-->
<!-- {{getDomainName(role.domainId) | async}},-->
<!-- </span>-->
<!-- <span *ngIf="isLast" style="float:left;padding-right: 3px">-->
<!-- {{getDomainName(role.domainId) | async}}-->
<!-- </span>-->
<!-- </div>-->
<!-- <br>-->
<!-- </td>-->
<!-- <td *ngIf="domainId === domainService.getGlobalDomainId()">-->
<!-- <span>{{"ENUM.USER_ROLES." + getGlobalRole(user).toUpperCase() | translate}}</span>-->
<!-- </td>-->
<!-- <td *ngIf="domainId !== domainService.getGlobalDomainId() && !isModeAllowed(ComponentMode.EDIT)">-->
<!-- <div *roles="['ROLE_DOMAIN_ADMIN'];excluded:['ROLE_SYSTEM_ADMIN']">-->
<!-- <div *ngIf="!checkUserIfIsCurrentUser(user.username)">-->
<!-- <li [routerLinkActiveOptions]="{exact:true}"-->
<!-- [routerLinkActive]="['active']" class="dropdown dropdown-domains">-->
<!-- <a aria-expanded="false" data-close-others="true" aria-haspopup="true"-->
<!-- class="dropdown-toggle" data-toggle="dropdown"-->
<!-- role="button">-->
<!-- <span style="color: black;">{{"ENUM.USER_ROLES." + getOnlyDomainRoles(user)?.role | translate}}-->
<!-- <strong class="caret"></strong></span></a>-->
<!-- <ul class="dropdown-menu">-->
<!-- <li *ngFor="let role of getAllowedRoles()">-->
<!-- <a (click)="changeUserRole(user,domainId, {value:role})">{{"ENUM.USER_ROLES." + Role[role].toUpperCase() | translate}}</a>-->
<!-- </li>-->
<!-- </ul>-->
<!-- </li>-->
<!-- </div>-->
<!-- <div *ngIf="checkUserIfIsCurrentUser(user.username)">-->
<!-- <span>-->
<!-- {{"ENUM.USER_ROLES." + getOnlyDomainRoles(user)?.role | translate}}-->
<!-- </span>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div *roles="['ROLE_SYSTEM_ADMIN']">-->
<!-- <div>-->
<!-- {{"ENUM.USER_ROLES." + getOnlyDomainRoles(user)?.role | translate}}-->
<!-- </div>-->
<!-- </div>-->
<!-- </td>-->
<!-- <td *ngIf="!isModeAllowed(ComponentMode.EDIT) && !domainMode">{{user.firstLoginDate | date:'dd-MM-yyyy HH:mm'}}</td>-->
<!-- <td *ngIf="!isModeAllowed(ComponentMode.EDIT) && !domainMode">{{user.lastSuccessfulLoginDate | date:'dd-MM-yyyy HH:mm'}}</td>-->
<!-- <td>-->
<!-- <span class="glyphicon glyphicon-ok" *ngIf="user?.enabled"></span>-->
<!-- <span class="glyphicon glyphicon-remove" *ngIf="!(user?.enabled)"></span>-->
<!-- </td>-->
<!-- <td *ngIf="!domainMode && !isModeAllowed(ComponentMode.EDIT)">-->
<!-- <span class="dropdown">-->
<!-- <a style="display: inline-block" class="dropdown-toggle " aria-expanded="false"-->
<!-- aria-haspopup="true"-->
<!-- data-toggle="dropdown" href="#" role="button">-->
<!-- <em class="fas fa-cog icon-black icon-bigger"></em>-->
<!-- </a>-->
<!-- <ul class="dropdown-menu pull-right-drop">-->
<!-- <li *ngIf="isModeAllowed(ComponentMode.VIEW)">-->
<!-- <a (click)="view(user.id);$event.stopPropagation()">-->
<!-- {{ 'USERS.DETAILS_BUTTON' | translate }}-->
<!-- </a>-->
<!-- </li>-->
<!-- <li *ngIf="user.enabled && authService.hasRole('ROLE_SYSTEM_ADMIN') && user.username!==authService.getUsername()">-->
<!-- <a (click)="changeUserStatus(user, false);$event.stopPropagation()"-->
<!-- > &lt;!&ndash;user should not be able to disable himself &ndash;&gt;-->
<!-- {{ 'USERS.DISABLE_BUTTON' | translate }}</a>-->
<!-- </li>-->
<!-- <li *ngIf="!user.enabled && authService.hasRole('ROLE_SYSTEM_ADMIN')">-->
<!-- <a (click)="changeUserStatus(user, true);$event.stopPropagation()">-->
<!-- {{ 'USERS.ENABLE_BUTTON' | translate }}</a>-->
<!-- </li>-->
<!-- <li *ngIf="isModeAllowed(ComponentMode.EDIT) &&-->
<!-- domainId != domainService.getGlobalDomainId() &&-->
<!-- isGlobalGuestAndHasNoRoleInThisDomain(user)">-->
<!-- <a-->
<!-- (click)="addToCurrentDomain(user);$event.stopPropagation()">{{'USERS.GRANT_USER_ROLE_IN_CURRENT_DOMAIN_BUTTON' | translate}}</a>-->
<!-- </li>-->
<!-- <li *ngIf="isModeAllowed(ComponentMode.DELETE) && domainId != domainService.getGlobalDomainId() && user.username!==authService.getUsername()">-->
<!-- <a role="button"-->
<!-- (click)="onRemoveFromDomain.emit(user);$event.stopPropagation()">{{ 'USERS.REMOVE_FROM_DOMAIN_BUTTON' | translate }}</a>-->
<!-- </li>-->
<!-- <li *ngIf="isModeAllowed(ComponentMode.DELETE) && authService.hasRole('ROLE_SYSTEM_ADMIN') && user.username!==authService.getUsername() && canUserBeDeleted(user)">-->
<!-- <a role="button"-->
<!-- (click)="onDelete.emit(user);$event.stopPropagation()">{{ 'USERS.DELETE_BUTTON' | translate }}</a>-->
<!-- </li>-->
<!-- </ul>-->
<!-- </span>-->
<!-- </td>-->
<!-- <td *ngIf="domainMode && !isModeAllowed(ComponentMode.EDIT)">-->
<!-- <span *ngIf="!checkUserIfIsCurrentUser(user.username)">-->
<!-- <a style="display: inline-block" class="" aria-expanded="false"-->
<!-- aria-haspopup="true" role="button"-->
<!-- (click)="onRemoveFromDomain.emit(user);$event.stopPropagation()">-->
<!-- <em class="fas fa-trash icon-black "></em>-->
<!-- </a>-->
<!-- </span>-->
<!-- </td>-->
<!-- <td *ngIf="isModeAllowed(ComponentMode.EDIT)" style="width: 170px">-->
<!-- <button class="btn btn-secondary" role="button"-->
<!-- (click)="addToCurrentDomain(user)"> {{'USERS.ADD_TO_DOMAIN_BUTTON' | translate}}</button>-->
<!-- </td>-->
<!-- </tr>-->
<!-- </tbody>-->
<!-- </table>-->
<!-- <pagination-controls class="text-right" (pageChange)="pageNumber = $event" id="{{ paginatorName }}"-->
<!-- previousLabel="{{ 'PAGINATION.PREVIOUS' | translate }}"-->
<!-- nextLabel="{{ 'PAGINATION.NEXT' | translate }}"-->
<!-- screenReaderPaginationLabel="{{ 'PAGINATION.SCREEN_READER.PAGINATION' | translate }}"-->
<!-- screenReaderPageLabel="{{ 'PAGINATION.SCREEN_READER.PAGE' | translate }}"-->
<!-- screenReaderCurrentLabel="{{ 'PAGINATION.SCREEN_READER.CURRENT' | translate }}"></pagination-controls>-->
...@@ -11,6 +11,7 @@ import {NgxPaginationModule} from 'ngx-pagination'; ...@@ -11,6 +11,7 @@ import {NgxPaginationModule} from 'ngx-pagination';
import {RouterTestingModule} from '@angular/router/testing'; import {RouterTestingModule} from '@angular/router/testing';
import {of} from 'rxjs'; import {of} from 'rxjs';
import createSpyObj = jasmine.createSpyObj; import createSpyObj = jasmine.createSpyObj;
import { CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from '@angular/core';
describe('UserslistComponent', () => { describe('UserslistComponent', () => {
let component: UsersListComponent; let component: UsersListComponent;
...@@ -57,7 +58,8 @@ describe('UserslistComponent', () => { ...@@ -57,7 +58,8 @@ describe('UserslistComponent', () => {
} }
}, },
{provide: UserService, useValue: {}}, {provide: UserService, useValue: {}},
] ],
schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA],
}) })
.compileComponents(); .compileComponents();
})); }));
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment