taskana/web/src/app/administration/access-items-management/access-items-management.com...

150 lines
6.9 KiB
HTML

<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-header">Access items management</h4>
</div>
<div class="panel-body">
<div class="col-md-6 col-md-offset-3 margin">
<taskana-type-ahead #accesId="ngModel" name="accessIdSelected" [(ngModel)]="accessIdSelected" placeHolderMessage="Search for access id..."
(selectedItem)="onSelectAccessId($event)" displayError=true></taskana-type-ahead>
</div>
<div *ngIf="!AccessItemsForm" class="center-block no-detail col-xs-12">
<h3 class="grey">Select an access id</h3>
<svg-icon class="empty-icon" src="./assets/icons/users.svg"></svg-icon>
</div>
<div *ngIf="AccessItemsForm" class="row col-xs-12">
<form [formGroup]="AccessItemsForm">
<table id="table-access-items" class="table table-striped table-center">
<thead>
<tr>
<th>
<taskana-sort [sortingFields]="sortingFields" (performSorting)="sorting($event)" menuPosition="left" [defaultSortBy]="accessItemDefaultSortBy"></taskana-sort>
</th>
<th class="text-align min-width">Workbasket Key</th>
<th colspan="2" class="text-align">Access Id</th>
<th>Read</th>
<th>Open</th>
<th>Append</th>
<th>Transfer</th>
<th>Distribute</th>
<ng-container *ngFor="let customField of customFields$ | async">
<th *ngIf="customField.visible">
{{customField.field}}
</th>
</ng-container>
</tr>
<tr>
<th colspan="2" class="text-align"><input type="text" formControlName="workbasketKeyFilter" (keyup.enter)="searchForAccessItemsWorkbaskets()"
class="form-control" placeholder="Workbasket filter"></th>
<th class="text-align"><input type="text" formControlName="accessIdFilter" (keyup.enter)="searchForAccessItemsWorkbaskets()"
class="form-control" placeholder="Access id filter"></th>
<th>
<button type="button" (click)="searchForAccessItemsWorkbaskets()" class="btn btn-default" data-toggle="tooltip"
title="Search">
<span class="material-icons md-20 blue">search</span>
</button>
</th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody formArrayName="accessItemsGroups">
<tr *ngFor="let accessItem of accessItemsGroups.controls; let index = index;" [formGroupName]="index">
<td colspan="2">
<label class="wrap">{{accessItem.value.workbasketKey}}</label>
</td>
<td *ngIf="(accessItemsCustomization$ | async)?.accessId.lookupField else accessIdInput" colspan="2" class="text-align text-width taskana-type-ahead">
<div>
<taskana-type-ahead formControlName="accessId" placeHolderMessage="* Access id is required"
[validationValue]="toogleValidationAccessIdMap.get(index)" [displayError]="!isFieldValid('accessItem.value.accessId', index)"
[disable]=true></taskana-type-ahead>
</div>
</td>
<ng-template #accessIdInput>
<td colspan="2" class="text-align text-width">
<div>
<input type="text" class="form-control" formControlName="accessId" placeholder="{{accessItem.invalid?
'* Access id is required': ''}}">
</div>
</td>
</ng-template>
<td>
<input id="checkbox-{{index}}-0" type="checkbox" formControlName="permRead" class="regular-checkbox">
<label for="checkbox-{{index}}-0"></label>
</td>
<td>
<input id="checkbox-{{index}}-1" type="checkbox" formControlName="permOpen">
<label for="checkbox-{{index}}-1"></label>
</td>
<td>
<input id="checkbox-{{index}}-2" type="checkbox" formControlName="permAppend">
<label for="checkbox-{{index}}-2"></label>
</td>
<td>
<input id="checkbox-{{index}}-3" type="checkbox" formControlName="permTransfer">
<label for="checkbox-{{index}}-3"></label>
</td>
<td>
<input id="checkbox-{{index}}-4" type="checkbox" formControlName="permDistribute">
<label for="checkbox-{{index}}-4"></label>
</td>
<ng-container *ngFor="let customField of customFields$ | async; let customIndex = index">
<td *ngIf="customField.visible">
<input id="checkbox-{{index}}-{{customIndex + 5}}" type="checkbox" formControlName="permCustom{{customIndex + 1}}">
<label for="checkbox-{{index}}-{{customIndex + 5}}"></label>
</td>
</ng-container>
</tr>
</tbody>
</table>
<button *ngIf="!isGroup" class="btn btn-primary pull-left btn-group" type="button"
data-toggle="modal"
data-target="#myModal">
Belonging groups
</button>
<div class="modal" id="myModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Belonging groups</h4>
<button type="button" class="close" data-dismiss="modal">&times;</button>
</div>
<div class="modal-body">
<ul *ngIf="belongingGroups && belongingGroups.length > 0 " class="list-group">
<li *ngFor="let group of belongingGroups" class="list-group-item">{{group.name}}</li>
</ul>
<p *ngIf="!belongingGroups">The user is not associated to
any groups</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div class="pull-right btn-group">
<button *ngIf="AccessItemsForm" type="button" (click)="revokeAccess()" class="btn btn-default" data-toggle="tooltip"
title="Revoke access" [disabled]=isGroup>
<span class="material-icons md-20 red">clear</span>
</button>
</div>
</form>
</div>
</div>
</div>