Restore functionality, which was removed the brainless way (#2725)

This commit is contained in:
Popovics András
2017-11-24 14:17:00 +00:00
committed by Eugenio Romano
parent feb0e17656
commit 92ccf36eb4
4 changed files with 15 additions and 2 deletions

View File

@@ -50,7 +50,7 @@
</button>
</div>
<div class="adf-task-details-core-sidebar">
<adf-info-drawer title="{{ 'ADF_TASK_LIST.DETAILS.LABELS.INFO_DRAWER_TITLE' | translate }}" class="adf-task-details-core-sidebar-drawer">
<adf-info-drawer *ngIf="showHeaderContent" 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
@@ -91,7 +91,7 @@
</adf-info-drawer>
<div class="adf-task-details-core-sidebar-checklist">
<div *ngIf="showHeaderContent" class="adf-task-details-core-sidebar-checklist">
<div *ngIf="showChecklist">
<adf-checklist #activitichecklist
[readOnly]="readOnlyForm"

View File

@@ -278,6 +278,7 @@ 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);
@@ -289,6 +290,7 @@ 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);
@@ -300,6 +302,7 @@ 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);
@@ -311,6 +314,7 @@ 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);
@@ -322,6 +326,7 @@ 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,6 +67,9 @@ export class TaskDetailsComponent implements OnInit, OnChanges {
@Input()
showHeader: boolean = true;
@Input()
showHeaderContent: boolean = true;
@Input()
showInvolvePeople: boolean = true;
@@ -320,6 +323,10 @@ 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;
}