TSK-487 Fix workbasket related bugs.

This commit is contained in:
Martin Rojas Miguel Angel 2018-05-22 14:44:12 +02:00 committed by Holger Hagen
parent 3f23005fa2
commit 19a489eb9d
15 changed files with 121 additions and 45 deletions

View File

@ -35,7 +35,3 @@ input.filter-input {
.btn-classification-list {
border: 0px solid transparent;
}
.container-no-items {
top: 20vh;
}

View File

@ -100,7 +100,6 @@ export class ClassificationsService {
}
return this.buildHierarchy(data[0]._embedded.classificationSummaryResourceList, data[1]);
})
}
private buildHierarchy(classifications: Array<Classification>, type: string) {

View File

@ -15,6 +15,7 @@
<tr>
<th></th>
<th class="text-align required-header">AccessID</th>
<th>Select all</th>
<th>Read</th>
<th>Open</th>
<th>Append</th>
@ -44,64 +45,83 @@
<td class="input-group text-align text-width taskana-type-ahead" [ngClass]="{
'has-warning': (accessItemsClone[index].accessId !== accessItem.accessId),
'has-error': !accessItem.accessId } ">
<taskana-type-ahead required #accessItemName="ngModel" [(ngModel)]="accessItem.accessId" name="accessItem.accessId-{{index}}"
[(ngModel)]="accessItem.accessIdr" placeHolderMessage="Access id is required"></taskana-type-ahead>
[(ngModel)]="accessItem.accessId" placeHolderMessage="Access id is required"></taskana-type-ahead>
</td>
<td>
<input id="checkbox-{{index}}-00" type="checkbox" (click)="checkAll(index)">
<label for="checkbox-{{index}}-00"></label>
</td>
<td [ngClass]="{'has-changes': (accessItemsClone[index].permRead !== accessItem.permRead)}">
<input type="checkbox" disabled="disabled" name="accessItem.permRead-{{index}}" [(ngModel)]="accessItem.permRead">
<input id="checkbox-{{index}}-0" type="checkbox" disabled="disabled" name="accessItem.permRead-{{index}}" [(ngModel)]="accessItem.permRead"
class="regular-checkbox">
<label for="checkbox-{{index}}-0"></label>
</td>
<td [ngClass]="{'has-changes': (accessItemsClone[index].permOpen !== accessItem.permOpen)}">
<input type="checkbox" name="accessItem.permOpen-{{index}}" [(ngModel)]="accessItem.permOpen">
<input id="checkbox-{{index}}-1" type="checkbox" name="accessItem.permOpen-{{index}}" [(ngModel)]="accessItem.permOpen">
<label for="checkbox-{{index}}-1"></label>
</td>
<td [ngClass]="{'has-changes': (accessItemsClone[index].permAppend !== accessItem.permAppend)}">
<input type="checkbox" name="accessItem.permAppend-{{index}}" [(ngModel)]="accessItem.permAppend">
<input id="checkbox-{{index}}-2" type="checkbox" name="accessItem.permAppend-{{index}}" [(ngModel)]="accessItem.permAppend">
<label for="checkbox-{{index}}-2"></label>
</td>
<td [ngClass]="{'has-changes': (accessItemsClone[index].permTransfer !== accessItem.permTransfer)}">
<input type="checkbox" name="accessItem.permTransfer-{{index}}" [(ngModel)]="accessItem.permTransfer">
<input id="checkbox-{{index}}-3" type="checkbox" name="accessItem.permTransfer-{{index}}" [(ngModel)]="accessItem.permTransfer">
<label for="checkbox-{{index}}-3"></label>
</td>
<td [ngClass]="{'has-changes': (accessItemsClone[index].permDistribute !== accessItem.permDistribute)}">
<input type="checkbox" name="accessItem.permDistribute-{{index}}" [(ngModel)]="accessItem.permDistribute">
<input id="checkbox-{{index}}-4" type="checkbox" name="accessItem.permDistribute-{{index}}" [(ngModel)]="accessItem.permDistribute">
<label for="checkbox-{{index}}-4"></label>
</td>
<td *ngIf="custom1Field.visible" [ngClass]="{'has-changes': (accessItemsClone[index].permCustom1 !== accessItem.permCustom1)}">
<input type="checkbox" name="accessItem.permCustom1-{{index}}" [(ngModel)]="accessItem.permCustom1">
<input id="checkbox-{{index}}-5" type="checkbox" name="accessItem.permCustom1-{{index}}" [(ngModel)]="accessItem.permCustom1">
<label for="checkbox-{{index}}-5"></label>
</td>
<td *ngIf="custom2Field.visible" [ngClass]="{'has-changes': (accessItemsClone[index].permCustom2 !== accessItem.permCustom2)}">
<input type="checkbox" name="accessItem.permCustom2-{{index}}" [(ngModel)]="accessItem.permCustom2">
<input id="checkbox-{{index}}-6" type="checkbox" name="accessItem.permCustom2-{{index}}" [(ngModel)]="accessItem.permCustom2">
<label for="checkbox-{{index}}-6"></label>
</td>
<td *ngIf="custom3Field.visible" [ngClass]="{'has-changes': (accessItemsClone[index].permCustom3 !== accessItem.permCustom3)}">
<input type="checkbox" name="accessItem.permCustom3-{{index}}" [(ngModel)]="accessItem.permCustom3">
<input id="checkbox-{{index}}-7" type="checkbox" name="accessItem.permCustom3-{{index}}" [(ngModel)]="accessItem.permCustom3">
<label for="checkbox-{{index}}-7"></label>
</td>
<td *ngIf="custom4Field.visible" [ngClass]="{'has-changes': (accessItemsClone[index].permCustom4 !== accessItem.permCustom4)}">
<input type="checkbox" name="accessItem.permCustom4-{{index}}" [(ngModel)]="accessItem.permCustom4">
<input id="checkbox-{{index}}-8" type="checkbox" name="accessItem.permCustom4-{{index}}" [(ngModel)]="accessItem.permCustom4">
<label for="checkbox-{{index}}-8"></label>
</td>
<td *ngIf="custom5Field.visible" [ngClass]="{'has-changes': (accessItemsClone[index].permCustom5 !== accessItem.permCustom5)}">
<input type="checkbox" name="accessItem.permCustom5-{{index}}" [(ngModel)]="accessItem.permCustom5">
<input id="checkbox-{{index}}-9" type="checkbox" name="accessItem.permCustom5-{{index}}" [(ngModel)]="accessItem.permCustom5">
<label for="checkbox-{{index}}-9"></label>
</td>
<td *ngIf="custom6Field.visible" [ngClass]="{'has-changes': (accessItemsClone[index].permCustom6 !== accessItem.permCustom6)}">
<input type="checkbox" name="accessItem.permCustom6-{{index}}" [(ngModel)]="accessItem.permCustom6">
<input id="checkbox-{{index}}-10" type="checkbox" name="accessItem.permCustom6-{{index}}" [(ngModel)]="accessItem.permCustom6">
<label for="checkbox-{{index}}-10"></label>
</td>
<td *ngIf="custom7Field.visible" [ngClass]="{'has-changes': (accessItemsClone[index].permCustom7 !== accessItem.permCustom7)}">
<input type="checkbox" name="accessItem.permCustom7-{{index}}" [(ngModel)]="accessItem.permCustom7">
<input id="checkbox-{{index}}-11" type="checkbox" name="accessItem.permCustom7-{{index}}" [(ngModel)]="accessItem.permCustom7">
<label for="checkbox-{{index}}-11"></label>
</td>
<td *ngIf="custom8Field.visible" [ngClass]="{'has-changes': (accessItemsClone[index].permCustom8 !== accessItem.permCustom8)}">
<input type="checkbox" name="accessItem.permCustom8-{{index}}" [(ngModel)]="accessItem.permCustom8">
<input id="checkbox-{{index}}-12" type="checkbox" name="accessItem.permCustom8-{{index}}" [(ngModel)]="accessItem.permCustom8">
<label for="checkbox-{{index}}-12"></label>
</td>
<td *ngIf="custom9Field.visible" [ngClass]="{'has-changes': (accessItemsClone[index].permCustom9 !== accessItem.permCustom9)}">
<input type="checkbox" name="accessItem.permCustom9-{{index}}" [(ngModel)]="accessItem.permCustom9">
<input id="checkbox-{{index}}-13" type="checkbox" name="accessItem.permCustom9-{{index}}" [(ngModel)]="accessItem.permCustom9">
<label for="checkbox-{{index}}-13"></label>
</td>
<td *ngIf="custom10Field.visible" [ngClass]="{'has-changes': (accessItemsClone[index].permCustom10 !== accessItem.permCustom10)}">
<input type="checkbox" name="accessItem.permCustom10-{{index}}" [(ngModel)]="accessItem.permCustom10">
<input id="checkbox-{{index}}-14" type="checkbox" name="accessItem.permCustom10-{{index}}" [(ngModel)]="accessItem.permCustom10">
<label for="checkbox-{{index}}-14"></label>
</td>
<td *ngIf="custom11Field.visible" [ngClass]="{'has-changes': (accessItemsClone[index].permCustom11 !== accessItem.permCustom11)}">
<input type="checkbox" name="accessItem.permCustom11-{{index}}" [(ngModel)]="accessItem.permCustom11">
<input id="checkbox-{{index}}-15" type="checkbox" name="accessItem.permCustom11-{{index}}" [(ngModel)]="accessItem.permCustom11">
<label for="checkbox-{{index}}-15"></label>
</td>
<td *ngIf="custom12Field.visible" [ngClass]="{'has-changes': (accessItemsClone[index].permCustom12 !== accessItem.permCustom12)}">
<input type="checkbox" name="accessItem.permCustom12-{{index}}" [(ngModel)]="accessItem.permCustom12">
<input id="checkbox-{{index}}-16" type="checkbox" name="accessItem.permCustom12-{{index}}" [(ngModel)]="accessItem.permCustom12">
<label for="checkbox-{{index}}-16"></label>
</td>
</tr>
</tbody>
</table>
</form>

View File

@ -66,11 +66,8 @@ export class AccessItemsComponent implements OnChanges, OnDestroy {
private savingWorkbaskets: SavingWorkbasketService,
private requestInProgressService: RequestInProgressService,
private customFieldService: CustomFieldsService) {
}
ngOnChanges(changes: SimpleChanges): void {
if (!this.initialized && changes.active && changes.active.currentValue === 'accessItems') {
this.init();
@ -139,6 +136,26 @@ export class AccessItemsComponent implements OnChanges, OnDestroy {
return false;
}
checkAll(row: number) {
this.accessItems[row].permCustom1 = !this.accessItems[row].permRead;
this.accessItems[row].permCustom2 = !this.accessItems[row].permRead;
this.accessItems[row].permCustom3 = !this.accessItems[row].permRead;
this.accessItems[row].permCustom4 = !this.accessItems[row].permRead;
this.accessItems[row].permCustom5 = !this.accessItems[row].permRead;
this.accessItems[row].permCustom6 = !this.accessItems[row].permRead;
this.accessItems[row].permCustom7 = !this.accessItems[row].permRead;
this.accessItems[row].permCustom8 = !this.accessItems[row].permRead;
this.accessItems[row].permCustom9 = !this.accessItems[row].permRead;
this.accessItems[row].permCustom10 = !this.accessItems[row].permRead;
this.accessItems[row].permCustom11 = !this.accessItems[row].permRead;
this.accessItems[row].permCustom12 = !this.accessItems[row].permRead;
this.accessItems[row].permAppend = !this.accessItems[row].permRead;
this.accessItems[row].permDistribute = !this.accessItems[row].permRead;
this.accessItems[row].permOpen = !this.accessItems[row].permRead;
this.accessItems[row].permTransfer = !this.accessItems[row].permRead;
this.accessItems[row].permRead = !this.accessItems[row].permRead;
}
private setBadge() {
if (this.action === ACTION.COPY) {
this.badgeMessage = `Copying workbasket: ${this.workbasket.key}`;

View File

@ -64,6 +64,7 @@ export class WorkbasketDetailsComponent implements OnInit, OnDestroy {
return;
}
this.action = ACTION.COPY;
this.workbasket.key = undefined;
this.workbasketCopy = this.workbasket;
id = undefined
this.getWorkbasketInformation(id, this.selectedId);

View File

@ -3,7 +3,7 @@
<div #wbToolbar>
<taskana-workbasket-list-toolbar [workbaskets]="workbaskets" (performFilter)="performFilter($event)" (performSorting)="performSorting ($event)"></taskana-workbasket-list-toolbar>
</div>
<div>
<div *ngIf="(workbaskets && workbaskets.length > 0) else empty_workbaskets">
<ul #wbList id="wb-list-container" class="list-group">
<li class="list-group-item no-space">
<div class="row"></div>
@ -26,7 +26,12 @@
</ul>
</div>
<taskana-spinner [isRunning]="requestInProgress"></taskana-spinner>
<ng-template #empty_workbaskets>
<div class="col-xs-12 container-no-items center-block">
<h3 class="grey">There are no workbaskets</h3>
<svg-icon class="img-responsive empty-icon" src="./assets/icons/wb-empty.svg"></svg-icon>
</div>
</ng-template>
</div>
<taskana-pagination [(workbasketsResource)]="workbasketsResource" (changePage)="changePage($event)"></taskana-pagination>
</div>

View File

@ -8,7 +8,7 @@
</div>
<div class="{{showDetail? 'hidden': 'hidden-xs hidden-sm col-md-8 container-no-items'}}">
<div *ngIf="currentRoute === 'workbaskets'" class="center-block no-detail">
<h3 class="grey">Select a worbasket</h3>
<h3 class="grey">Select a workbasket</h3>
<svg-icon class="img-responsive empty-icon" src="./assets/icons/wb-empty.svg"></svg-icon>
</div>
<div *ngIf="currentRoute === 'classifications'" class="center-block no-detail">

View File

@ -23,7 +23,7 @@ export class HttpClientInterceptor implements HttpInterceptor {
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
req = req.clone({ headers: req.headers.set('Content-Type', 'application/hal+json') });
if (!environment.production) {
req = req.clone({ headers: req.headers.set('Authorization', 'Basic VEVBTUxFQURfMTpURUFNTEVBRF8x') });
req = req.clone({ headers: req.headers.set('Authorization', 'Basic YWRtaW46YWRtaW4=') });
}
return next.handle(req).do(event => {

View File

@ -19,9 +19,7 @@ const noop = () => {
useExisting: forwardRef(() => TypeAheadComponent),
multi: true
}
]
})
export class TypeAheadComponent implements OnInit, ControlValueAccessor {

View File

@ -0,0 +1,44 @@
input[type=checkbox] {
display: none;
}
input[type=checkbox] + label {
background-color: #fafafa;
border: 1px solid $blue;
box-shadow: 0 1px 2px rgba(0,0,0,0.05), inset 0px -15px 10px -12px rgba(0,0,0,0.05);
padding: 9px;
border-radius: 3px;
display: inline-block;
position: relative;
cursor: pointer;
margin-bottom: 0px;
}
input[type=checkbox][disabled]:checked + label {
background-color: $light-grey;
cursor: not-allowed
}
input[type=checkbox][disabled]:not(:checked) + label {
background-color: $light-grey;
cursor: not-allowed;
}
input[type=checkbox] + label:active, input[type=checkbox]:checked + label:active {
box-shadow: 0 1px 2px rgba(0,0,0,0.05), inset 0px 1px 3px rgba(0,0,0,0.1);
}
input[type=checkbox]:checked + label {
background-color: white;
border: 1px solid $grey;
box-shadow: 0 1px 2px rgba(0,0,0,0.05), inset 0px -15px 10px -12px rgba(0,0,0,0.05), inset 15px 10px -12px rgba(255,255,255,0.1);
color: $blue;
}
input[type=checkbox]:checked + label:after {
content: '\2714';
font-size: 14px;
position: absolute;
top: 0px;
left: 3px;
color: $blue;
}

View File

@ -2,6 +2,7 @@ $blue-green: #11c584;
$blue: #2e9eca;
$green: #246972;
$grey: grey;
$light-grey: #ddd;
$brown: #f0ad4e;
$invalid: #a94442;
$aquamarine: #22a39f;

View File

@ -314,8 +314,8 @@ li.list-group-item:hover, {
}
.container-no-items {
top:30vh;
height: 65vh;
top: 20vh;
height: 60vh;
}
.center-block {

View File

@ -4,4 +4,5 @@
@import 'site';
@import 'forms';
@import 'tree';
@import 'type-ahead';
@import 'type-ahead';
@import 'checkboxes';

View File

@ -56,12 +56,6 @@ tree-node-expander .toggle-children-wrapper-expanded {
}
}
}
/*
.node-content-wrapper-focused {
background: none;
box-shadow: none;
}
*/
/* START Children branch lines*/
.node-content-wrapper::before {

View File

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 16 16"><defs><clipPath id="b"/><clipPath id="c"/><clipPath id="d"><use xlink:href="#a" width="100%" height="100%"/></clipPath><clipPath id="e"/></defs><path d="M16.02 14.074v-1.51l-.072.068-.073.068-5.501-.008-5.502-.008 1.887-1.837 1.886-1.836 1.084-.001 1.083-.002.022-.488c.027-.624.035-.662.164-.81l.107-.125 1.844-.01c1.015-.005 1.856-.02 1.87-.034.014-.014-.03-.126-.096-.249-.293-.537-.807-1.451-1.152-2.05l-.374-.65.33-.326c.181-.18.335-.32.342-.313.006.008.39.684.852 1.503l1.07 1.893.228.403.009-3.738c.005-2.056.012-.294.016 3.916s0 7.654-.008 7.654c-.009 0-.016-.68-.016-1.51zM.976 15.414c-.334-.117-.523-.55-.4-.918.03-.087 1.574-1.608 7.023-6.917 3.842-3.744 7.03-6.831 7.085-6.86.186-.103.5-.051.673.11.181.166.26.479.187.742-.038.138-.378.476-6.21 6.153-3.393 3.303-6.55 6.38-7.015 6.837-.698.685-.868.836-.971.865a.494.494 0 0 1-.372-.011zm-.812-2.832l-.116-.118V7.875l.63-1.07c.743-1.26 1.803-3.011 1.974-3.262.066-.097.152-.199.19-.225.063-.043.52-.048 4.314-.047h4.245l-.36.34-.36.338-3.195.01-3.194.009-.019 1.163c-.02 1.345-.022 1.353-.259 1.442-.18.068-.332.043-.467-.076-.097-.086-.102-.101-.121-.394a22.726 22.726 0 0 1-.027-.941c-.004-.35-.016-.725-.027-.834-.019-.186-.023-.194-.07-.14-.093.106-1.747 2.864-1.92 3.2l-.078.154.191.02c.105.01.94.02 1.856.02h1.664l.099.1a.71.71 0 0 1 .133.193c.019.05.043.325.053.61l.02.52.078.01c.068.007-.177.257-1.805 1.847L1.71 12.699H.28zm5.027-6.14L5.2 6.17l1.612-.008 1.613-.008-.28.28-.282.279H5.182zm7.041.134c-.171-.061-.213-.148-.235-.5l-.02-.31.443-.434.443-.434-.012.684c-.013.762-.029.825-.243.968-.116.077-.214.084-.376.026zm-7.041-.972l.009-.272 2.03-.008c1.117-.004 2.026.003 2.02.016a4.483 4.483 0 0 1-.278.28l-.269.255H5.182zm0-.9l.009-.271 2.505-.008 2.505-.008-.28.28-.282.279H5.182z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M5.605 14.114l-5.414-.01-.1-.124-.099-.125V7.816l.65-1.42c1.28-2.8 1.954-4.214 2.088-4.378l.095-.117 5.32-.01 5.32-.012.565 1.296 1.267 2.902L16 7.683v6.291l-.07.084-.07.085-2.42-.01c-1.33-.005-4.857-.014-7.835-.02zM10.8 8.79c.031-.84.044-.924.163-1.127l.105-.177h1.074c.591 0 1.43-.012 1.864-.026.675-.022.79-.034.79-.084 0-.086-.248-.668-1.544-3.627-.183-.417-.35-.802-.37-.854-.032-.079-.04.12-.04 1.168-.003 1.302-.031 1.908-.096 2.008-.104.163-.373.221-.531.115-.175-.117-.192-.174-.219-.751a30.198 30.198 0 0 1-.027-1.102c0-.31-.01-.788-.02-1.06l-.02-.497H4.234l-.002.205c-.005.857-.06 2.834-.082 2.929-.074.332-.505.395-.71.103-.066-.095-.105-.746-.108-1.797-.001-.713-.027-1.167-.065-1.167-.034 0-.145.228-1.008 2.09-.856 1.847-1.03 2.248-.994 2.295.014.018.853.038 1.864.045l1.84.013.07.104c.163.237.166.25.198 1.022l.03.737 2.756-.01 2.755-.01zM5.138 6.01v-.348l1.196-.012c.657-.007 2.025-.006 3.039 0l1.843.012v.696H5.138V6.01zm0-1.092v-.35h6.078v.7H5.138zm0-1.168V3.4h6.078v.7H5.138z"/></svg>

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB