[ADF-3676] Task Header - Expose task properties out of the box (#3883)

* #3878 Add support for end date in TaskHeaderComponent

* add duration and parentTaskId
This commit is contained in:
Eugenio Romano
2018-10-13 11:13:29 +01:00
committed by GitHub
parent c8aa627a84
commit 04d42e2535
4 changed files with 1142 additions and 697 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -27,6 +27,8 @@
"PROPERTIES": {
"TASK_NAME": "Task",
"THUMBNAIL": "Thumbnail",
"DURATION": "Duration",
"PARENT_TASK_ID": "Parent task id",
"NAME": "Name",
"ASSIGNEE": "Assignee",
"ASSIGNEE_DEFAULT": "No assignee",
@@ -40,6 +42,7 @@
"PARENT_NAME_DEFAULT": "No parent",
"CREATED_BY": "Created By",
"CREATED": "Created",
"END_DATE": "End date",
"ID": "ID",
"DESCRIPTION": "Description",
"DESCRIPTION_DEFAULT": "No description",

View File

@@ -16,15 +16,17 @@
*/
import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';
import { BpmUserService,
CardViewDateItemModel,
CardViewItem,
CardViewMapItemModel,
CardViewTextItemModel,
CardViewBaseItemModel,
LogService,
TranslationService,
AppConfigService } from '@alfresco/adf-core';
import {
BpmUserService,
CardViewDateItemModel,
CardViewItem,
CardViewMapItemModel,
CardViewTextItemModel,
CardViewBaseItemModel,
LogService,
TranslationService,
AppConfigService
} from '@alfresco/adf-core';
import { TaskDetailsModel } from '../models/task-details.model';
import { TaskListService } from './../services/tasklist.service';
@@ -75,12 +77,12 @@ export class TaskHeaderComponent implements OnChanges, OnInit {
return [
new CardViewTextItemModel(
{
label: 'ADF_TASK_LIST.PROPERTIES.ASSIGNEE',
value: this.taskDetails.getFullName(),
key: 'assignee',
default: this.translationService.instant('ADF_TASK_LIST.PROPERTIES.ASSIGNEE_DEFAULT'),
clickable: !this.isCompleted(),
icon: 'create'
label: 'ADF_TASK_LIST.PROPERTIES.ASSIGNEE',
value: this.taskDetails.getFullName(),
key: 'assignee',
default: this.translationService.instant('ADF_TASK_LIST.PROPERTIES.ASSIGNEE_DEFAULT'),
clickable: !this.isCompleted(),
icon: 'create'
}
),
new CardViewTextItemModel(
@@ -131,6 +133,41 @@ export class TaskHeaderComponent implements OnChanges, OnInit {
key: 'created'
}
),
new CardViewDateItemModel(
{
label: 'ADF_TASK_LIST.PROPERTIES.END_DATE',
value: this.taskDetails.endDate,
key: 'endDate'
}
),
new CardViewTextItemModel(
{
label: 'ADF_TASK_LIST.PROPERTIES.PARENT_NAME',
value: this.taskDetails.parentName,
key: 'parentName'
}
),
new CardViewTextItemModel(
{
label: 'ADF_TASK_LIST.PROPERTIES.DURATION',
value: `${this.taskDetails.duration} ms`,
key: 'duration'
}
),
new CardViewTextItemModel(
{
label: 'ADF_TASK_LIST.PROPERTIES.PARENT_TASK_ID',
value: this.taskDetails.parentTaskId,
key: 'parentTaskId'
}
),
new CardViewDateItemModel(
{
label: 'ADF_TASK_LIST.PROPERTIES.END_DATE',
value: this.taskDetails.endDate,
key: 'endDate'
}
),
new CardViewTextItemModel(
{
label: 'ADF_TASK_LIST.PROPERTIES.ID',

View File

@@ -31,6 +31,7 @@ export class TaskDetailsModel implements TaskRepresentation {
category: string;
created: Date;
description: string;
parentName: string;
dueDate: Date;
duration: number;
endDate: Date;