mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4329][ASD-5330] plus Improve e2e (#6580)
Improve e2e Fix SSO user avatar Fix Priority for APS1
This commit is contained in:
@@ -267,7 +267,6 @@ export class TaskDetailsComponent implements OnInit, OnChanges, OnDestroy {
|
||||
*/
|
||||
private loadDetails(taskId: string) {
|
||||
this.taskPeople = [];
|
||||
this.taskFormName = null;
|
||||
|
||||
if (taskId) {
|
||||
this.taskListService.getTaskDetails(taskId).subscribe(
|
||||
@@ -339,6 +338,7 @@ export class TaskDetailsComponent implements OnInit, OnChanges, OnDestroy {
|
||||
}
|
||||
|
||||
onCompleteAttachForm() {
|
||||
this.taskFormName = null;
|
||||
this.showAttachForm = false;
|
||||
this.taskFormComponent.loadTask(this.taskId);
|
||||
this.loadDetails(this.taskId);
|
||||
|
@@ -15,16 +15,17 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, EventEmitter, Input, OnChanges, OnInit, Output } from '@angular/core';
|
||||
import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';
|
||||
import {
|
||||
BpmUserService,
|
||||
CardViewDateItemModel,
|
||||
CardViewItem,
|
||||
CardViewMapItemModel,
|
||||
CardViewTextItemModel,
|
||||
CardViewBaseItemModel,
|
||||
TranslationService,
|
||||
AppConfigService
|
||||
AppConfigService,
|
||||
CardViewIntItemModel,
|
||||
CardViewItemLengthValidator
|
||||
} from '@alfresco/adf-core';
|
||||
import { TaskDetailsModel } from '../models/task-details.model';
|
||||
import { TaskDescriptionValidator } from '../validators/task-description.validator';
|
||||
@@ -52,13 +53,13 @@ export class TaskHeaderComponent implements OnChanges, OnInit {
|
||||
@Output()
|
||||
claim: EventEmitter<any> = new EventEmitter<any>();
|
||||
|
||||
/** Emitted when the task is unclaimed (ie, requeued). */
|
||||
/** Emitted when the task is unclaimed (ie, requeue). */
|
||||
@Output()
|
||||
unclaim: EventEmitter<any> = new EventEmitter<any>();
|
||||
|
||||
private currentUserId: number;
|
||||
|
||||
properties: CardViewItem [];
|
||||
properties: any [] = [];
|
||||
inEdit: boolean = false;
|
||||
displayDateClearAction = false;
|
||||
dateFormat: string;
|
||||
@@ -73,13 +74,19 @@ export class TaskHeaderComponent implements OnChanges, OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
this.loadCurrentBpmUserId();
|
||||
this.initData();
|
||||
}
|
||||
|
||||
ngOnChanges() {
|
||||
this.refreshData();
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
const taskDetailsChange = changes['taskDetails'];
|
||||
if (taskDetailsChange?.currentValue?.id !== taskDetailsChange?.previousValue?.id) {
|
||||
this.initData();
|
||||
} else {
|
||||
this.refreshData();
|
||||
}
|
||||
}
|
||||
|
||||
private initDefaultProperties(parentInfoMap) {
|
||||
private initDefaultProperties(parentInfoMap): any[] {
|
||||
return [
|
||||
new CardViewTextItemModel(
|
||||
{
|
||||
@@ -98,12 +105,13 @@ export class TaskHeaderComponent implements OnChanges, OnInit {
|
||||
key: 'status'
|
||||
}
|
||||
),
|
||||
new CardViewTextItemModel(
|
||||
new CardViewIntItemModel(
|
||||
{
|
||||
label: 'ADF_TASK_LIST.PROPERTIES.PRIORITY',
|
||||
value: this.taskDetails.priority,
|
||||
key: 'priority',
|
||||
editable: true
|
||||
editable: true,
|
||||
validators: [new CardViewItemLengthValidator(1, 10)]
|
||||
}
|
||||
),
|
||||
new CardViewDateItemModel(
|
||||
@@ -200,7 +208,7 @@ export class TaskHeaderComponent implements OnChanges, OnInit {
|
||||
/**
|
||||
* Refresh the card data
|
||||
*/
|
||||
refreshData() {
|
||||
initData() {
|
||||
if (this.taskDetails) {
|
||||
const parentInfoMap = this.getParentInfo();
|
||||
const defaultProperties = this.initDefaultProperties(parentInfoMap);
|
||||
@@ -209,6 +217,26 @@ export class TaskHeaderComponent implements OnChanges, OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Refresh the card data
|
||||
*/
|
||||
refreshData() {
|
||||
this.properties = this.properties.map((cardItem) => {
|
||||
if (cardItem.key === 'formName' && cardItem.value !== this.formName) {
|
||||
return new CardViewTextItemModel({
|
||||
label: 'ADF_TASK_LIST.PROPERTIES.FORM_NAME',
|
||||
value: this.formName,
|
||||
key: 'formName',
|
||||
default: this.translationService.instant('ADF_TASK_LIST.PROPERTIES.FORM_NAME_DEFAULT'),
|
||||
clickable: this.isFormClickable(),
|
||||
icon: 'create'
|
||||
});
|
||||
} else {
|
||||
return cardItem;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private isValidSelection(filteredProperties: string[], cardItem: CardViewBaseItemModel): boolean {
|
||||
return filteredProperties ? filteredProperties.indexOf(cardItem.key) >= 0 : true;
|
||||
}
|
||||
@@ -236,7 +264,7 @@ export class TaskHeaderComponent implements OnChanges, OnInit {
|
||||
* Does the task have an assignee
|
||||
*/
|
||||
public hasAssignee(): boolean {
|
||||
return !!this.taskDetails.assignee ? true : false;
|
||||
return !!this.taskDetails.assignee;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user