From 321c4f48e120da0d501e2ebf43f050bda125c49f Mon Sep 17 00:00:00 2001
From: mihai sirghe <32762007+smihai78@users.noreply.github.com>
Date: Wed, 6 Dec 2017 22:46:28 +0200
Subject: [PATCH] [ADF-1826] Task Header - The priority property should be
editable (#2768)
* [ADF-1826] Task Header - The priority property should be editable
* [ADF-1826] - Fixed isEditble typo
* [ADF-1826] - Adding unit test - checking the priority value is displayed
* [ADF-1826] fixed unit test
* [ADF-1826] fixed unit test (replaced fit with it)
---
docs/card-view.component.md | 2 +-
lib/core/card-view/card-view-textitem.component.html | 4 ++--
lib/core/card-view/card-view-textitem.component.ts | 2 +-
.../task-list/components/task-header.component.spec.ts | 8 ++++++++
.../task-list/components/task-header.component.ts | 3 ++-
5 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/docs/card-view.component.md b/docs/card-view.component.md
index 620c0629ac..f06848068d 100644
--- a/docs/card-view.component.md
+++ b/docs/card-view.component.md
@@ -231,7 +231,7 @@ export class CardViewStarDateItemComponent {
constructor(private cardViewUpdateService: CardViewUpdateService) {}
- isEditble() {
+ isEditable() {
return this.editable && this.property.editable;
}
diff --git a/lib/core/card-view/card-view-textitem.component.html b/lib/core/card-view/card-view-textitem.component.html
index c8fcf87199..fe22f4099d 100644
--- a/lib/core/card-view/card-view-textitem.component.html
+++ b/lib/core/card-view/card-view-textitem.component.html
@@ -1,6 +1,6 @@
{{ property.label | translate }}
-
+
{{ property.displayValue }}
@@ -10,7 +10,7 @@
-
+
{{ property.displayValue }}
diff --git a/lib/core/card-view/card-view-textitem.component.ts b/lib/core/card-view/card-view-textitem.component.ts
index 6e9aea1826..8507473f94 100644
--- a/lib/core/card-view/card-view-textitem.component.ts
+++ b/lib/core/card-view/card-view-textitem.component.ts
@@ -43,7 +43,7 @@ export class CardViewTextItemComponent implements OnChanges {
this.editedValue = this.property.value;
}
- isEditble() {
+ isEditable() {
return this.editable && this.property.editable;
}
diff --git a/lib/process-services/task-list/components/task-header.component.spec.ts b/lib/process-services/task-list/components/task-header.component.spec.ts
index e78ecabf0d..dacbfb492f 100644
--- a/lib/process-services/task-list/components/task-header.component.spec.ts
+++ b/lib/process-services/task-list/components/task-header.component.spec.ts
@@ -107,6 +107,14 @@ describe('TaskHeaderComponent', () => {
expect(formNameEl.nativeElement.innerText).toBe('Wilbur Adams');
});
+ it('should display priority', () => {
+ component.taskDetails.priority = 27;
+ component.ngOnChanges({});
+ fixture.detectChanges();
+ let formNameEl = fixture.debugElement.query(By.css('[data-automation-id="card-textitem-value-priority"]'));
+ expect(formNameEl.nativeElement.innerText).toBe('27');
+ });
+
it('should set editable to false if the task has already completed', () => {
component.taskDetails.endDate = new Date('05/05/2002');
component.ngOnChanges({});
diff --git a/lib/process-services/task-list/components/task-header.component.ts b/lib/process-services/task-list/components/task-header.component.ts
index 049f1655b6..f911f1f653 100644
--- a/lib/process-services/task-list/components/task-header.component.ts
+++ b/lib/process-services/task-list/components/task-header.component.ts
@@ -86,7 +86,8 @@ export class TaskHeaderComponent implements OnChanges, OnInit {
{
label: 'ADF_TASK_LIST.PROPERTIES.PRIORITY',
value: this.taskDetails.priority,
- key: 'priority'
+ key: 'priority',
+ editable: true
}
),
new CardViewDateItemModel(