Remove sidebar functionality from task details (#2719)

This commit is contained in:
Popovics András 2017-11-23 19:42:50 +00:00 committed by Eugenio Romano
parent 440759c66b
commit 16428a8109
4 changed files with 6 additions and 27 deletions

View File

@ -37,7 +37,6 @@ Shows the details of the task id passed in input
| showFormCompleteButton | boolean | true | Toggle rendering of the Form `Complete` outcome button |
| peopleIconImageUrl | string | | Define a custom people icon image |
| showHeader | boolean | true | Toggle task details Header component |
| showHeaderContent | boolean | true | Toggle collapsed/expanded state of the Header component |
| showInvolvePeople | boolean | true | Toggle `Involve People` feature for Header component |
| showComments | boolean | true | Toggle `Comments` feature for Header component |
| showChecklist | boolean | true | Toggle `Checklist` feature for Header component |

View File

@ -10,19 +10,15 @@
<div *ngIf="taskDetails" class="adf-task-details">
<div *ngIf="showHeader" class="adf-task-details-header">
<h2 class="activiti-task-details__header" (click)="toggleHeaderContent()">
<h2 class="activiti-task-details__header">
<span>{{taskDetails.name || 'No name'}}</span>
</h2>
<div matRipple [matRippleUnbounded]="true" [matRippleCentered]="true" class="adf-task-details-header-toggle">
<mat-icon *ngIf="!showHeaderContent" (click)="toggleHeaderContent()">web</mat-icon>
<mat-icon *ngIf="showHeaderContent" (click)="toggleHeaderContent()">web_asset</mat-icon>
</div>
</div>
<div class="adf-task-details-core"
fxLayout="column"
fxLayoutGap="8px"
fxLayout.lt-lg="column">
fxLayout="column"
fxLayoutGap="8px"
fxLayout.lt-lg="column">
<div class="adf-task-details-core-form">
<div *ngIf="isAssigned()">
@ -54,11 +50,7 @@
</button>
</div>
<div class="adf-task-details-core-sidebar">
<adf-info-drawer *ngIf="showHeaderContent" title="{{ 'ADF_TASK_LIST.DETAILS.LABELS.INFO_DRAWER_TITLE' | translate }}" class="adf-task-details-core-sidebar-drawer">
<div info-drawer-buttons>
<mat-icon (click)="toggleHeaderContent()">clear</mat-icon>
</div>
<adf-info-drawer title="{{ 'ADF_TASK_LIST.DETAILS.LABELS.INFO_DRAWER_TITLE' | translate }}" class="adf-task-details-core-sidebar-drawer">
<adf-info-drawer-tab label="{{ 'ADF_TASK_LIST.DETAILS.LABELS.INFO_DRAWER_TAB_DETAILS_TITLE' | translate }}">
<div class="assignment-container" *ngIf="showAssignee">
<adf-people-search
@ -99,7 +91,7 @@
</adf-info-drawer>
<div *ngIf="showHeaderContent" class="adf-task-details-core-sidebar-checklist">
<div class="adf-task-details-core-sidebar-checklist">
<div *ngIf="showChecklist">
<adf-checklist #activitichecklist
[readOnly]="readOnlyForm"

View File

@ -278,7 +278,6 @@ describe('TaskDetailsComponent', () => {
it('should comments be readonly if the task is complete and no user are involved', () => {
component.showComments = true;
component.showHeaderContent = true;
component.ngOnChanges({'taskId': new SimpleChange('123', '456', true)});
component.taskPeople = [];
component.taskDetails = new TaskDetailsModel(taskDetailsMock);
@ -290,7 +289,6 @@ describe('TaskDetailsComponent', () => {
it('should comments be readonly if the task is complete and user are NOT involved', () => {
component.showComments = true;
component.showHeaderContent = true;
component.ngOnChanges({'taskId': new SimpleChange('123', '456', true)});
component.taskPeople = [];
component.taskDetails = new TaskDetailsModel(taskDetailsMock);
@ -302,7 +300,6 @@ describe('TaskDetailsComponent', () => {
it('should comments NOT be readonly if the task is NOT complete and user are NOT involved', () => {
component.showComments = true;
component.showHeaderContent = true;
component.ngOnChanges({'taskId': new SimpleChange('123', '456', true)});
component.taskPeople = [fakeUser];
component.taskDetails = new TaskDetailsModel(taskDetailsMock);
@ -314,7 +311,6 @@ describe('TaskDetailsComponent', () => {
it('should comments NOT be readonly if the task is complete and user are involved', () => {
component.showComments = true;
component.showHeaderContent = true;
component.ngOnChanges({'taskId': new SimpleChange('123', '456', true)});
component.taskPeople = [fakeUser];
component.taskDetails = new TaskDetailsModel(taskDetailsMock);
@ -326,7 +322,6 @@ describe('TaskDetailsComponent', () => {
it('should comments be present if showComments is true', () => {
component.showComments = true;
component.showHeaderContent = true;
component.ngOnChanges({'taskId': new SimpleChange('123', '456', true)});
component.taskPeople = [];
component.taskDetails = new TaskDetailsModel(taskDetailsMock);

View File

@ -67,9 +67,6 @@ export class TaskDetailsComponent implements OnInit, OnChanges {
@Input()
showHeader: boolean = true;
@Input()
showHeaderContent: boolean = true;
@Input()
showInvolvePeople: boolean = true;
@ -323,10 +320,6 @@ export class TaskDetailsComponent implements OnInit, OnChanges {
this.loadDetails(taskId);
}
toggleHeaderContent(): void {
this.showHeaderContent = !this.showHeaderContent;
}
isCompletedTask(): boolean {
return this.taskDetails && this.taskDetails.endDate ? true : undefined;
}