mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-1108] Task header - Show the parent name as a clickable value (#2098)
* Add a MapItem component inside the CardVied Add a way to define a property clickable * Fix unit test * Add basic documentation Unify css class name * Fix class name * remove unused class
This commit is contained in:
committed by
Eugenio Romano
parent
1214c2ebab
commit
33fc2373ae
@@ -27,7 +27,7 @@ import { Component,
|
||||
ViewChild
|
||||
} from '@angular/core';
|
||||
import { ContentLinkModel, FormModel, FormOutcomeEvent, FormService } from 'ng2-activiti-form';
|
||||
import { AlfrescoAuthenticationService, AlfrescoTranslationService, CardViewUpdateService, LogService, UpdateNotification } from 'ng2-alfresco-core';
|
||||
import { AlfrescoAuthenticationService, AlfrescoTranslationService, CardViewUpdateService, LogService, UpdateNotification, ClickNotification } from 'ng2-alfresco-core';
|
||||
import { TaskQueryRequestRepresentationModel } from '../models/filter.model';
|
||||
import { TaskDetailsModel } from '../models/task-details.model';
|
||||
import { User } from '../models/user.model';
|
||||
@@ -161,6 +161,7 @@ export class TaskDetailsComponent implements OnInit, OnChanges {
|
||||
}
|
||||
|
||||
this.cardViewUpdateService.itemUpdated$.subscribe(this.updateTaskDetails.bind(this));
|
||||
this.cardViewUpdateService.itemClicked$.subscribe(this.clickTaskDetails.bind(this));
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
@@ -206,6 +207,10 @@ export class TaskDetailsComponent implements OnInit, OnChanges {
|
||||
);
|
||||
}
|
||||
|
||||
private clickTaskDetails(clickNotification: ClickNotification) {
|
||||
console.log(clickNotification.target);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the activiti task details
|
||||
* @param taskId
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core';
|
||||
import { AlfrescoTranslationService, CardViewDateItemModel, CardViewItem, CardViewTextItemModel, LogService } from 'ng2-alfresco-core';
|
||||
import { AlfrescoTranslationService, CardViewDateItemModel, CardViewItem, CardViewTextItemModel, CardViewMapItemModel, LogService } from 'ng2-alfresco-core';
|
||||
import { TaskDetailsModel } from '../models/task-details.model';
|
||||
import { TaskListService } from './../services/tasklist.service';
|
||||
|
||||
@@ -54,12 +54,13 @@ export class TaskHeaderComponent implements OnChanges {
|
||||
|
||||
refreshData() {
|
||||
if (this.taskDetails) {
|
||||
|
||||
let valueMap = new Map([[this.taskDetails.processDefinitionId, this.taskDetails.processDefinitionName]])
|
||||
this.properties = [
|
||||
new CardViewTextItemModel({ label: 'Assignee', value: this.taskDetails.getFullName(), key: 'assignee', default: 'No assignee' } ),
|
||||
new CardViewTextItemModel({ label: 'Status', value: this.getTaskStatus(), key: 'status' }),
|
||||
new CardViewDateItemModel({ label: 'Due Date', value: this.taskDetails.dueDate, key: 'dueDate', default: 'No date', editable: true }),
|
||||
new CardViewTextItemModel({ label: 'Category', value: this.taskDetails.category, key: 'category', default: 'No category' }),
|
||||
new CardViewMapItemModel({ label: 'Parent name', value: valueMap, key: 'parentName', default: 'No parent name', clickable: true }),
|
||||
new CardViewTextItemModel({ label: 'Created By', value: this.taskDetails.getFullName(), key: 'created-by', default: 'No assignee' }),
|
||||
new CardViewDateItemModel({ label: 'Created', value: this.taskDetails.created, key: 'created' }),
|
||||
new CardViewTextItemModel({ label: 'Id', value: this.taskDetails.id, key: 'id' }),
|
||||
|
Reference in New Issue
Block a user