mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-3876] StartTaskCloud - Be able to start a task with a form (#4590)
* [ADF-3876] Added form cloud model * [ADF-3876] Added service to get forms * [ADF-3876] Added form selection to start task * [ADF-3876] Added tests * [ADF-3876] StartTaskCloud - Be able to start a task with a form * [ADF-3876] StartTaskCloud - Be able to start a task with a form * [ADF-3876] StartTaskCloud - Be able to start a task with a form * [ADF-3876] Added form cloud model * [ADF-3876] Added service to get forms * [ADF-3876] Added form selection to start task * [ADF-3876] Added tests * [ADF-3876] StartTaskCloud - Be able to start a task with a form * [ADF-3876] StartTaskCloud - changed name to component * [ADF-3876] StartTaskCloud - Renamed component * Rename form-selector-cloud.component.md to form-definition-selector-cloud.component.md * [ADF-3876] Improve and clean code and fix service * [ADF-3876] Fix unit test * Update app.module.ts * fix module * move components in the right folders * fix e2e task list
This commit is contained in:
committed by
Eugenio Romano
parent
11688f5778
commit
b371929170
@@ -97,6 +97,8 @@ export class StartTaskCloudComponent implements OnInit, OnDestroy {
|
||||
|
||||
currentUser: IdentityUserModel;
|
||||
|
||||
formKey: string;
|
||||
|
||||
private localeSub: Subscription;
|
||||
private createTaskSub: Subscription;
|
||||
|
||||
@@ -112,7 +114,6 @@ export class StartTaskCloudComponent implements OnInit, OnDestroy {
|
||||
this.userPreferencesService.select(UserPreferenceValues.Locale).subscribe((locale) => {
|
||||
this.dateAdapter.setLocale(locale);
|
||||
});
|
||||
|
||||
this.loadCurrentUser();
|
||||
this.buildForm();
|
||||
}
|
||||
@@ -131,7 +132,8 @@ export class StartTaskCloudComponent implements OnInit, OnDestroy {
|
||||
this.taskForm = this.formBuilder.group({
|
||||
name: new FormControl(this.name, [Validators.required, Validators.maxLength(this.getMaxNameLength()), this.whitespaceValidator]),
|
||||
priority: new FormControl(),
|
||||
description: new FormControl('', [this.whitespaceValidator])
|
||||
description: new FormControl('', [this.whitespaceValidator]),
|
||||
formKey: new FormControl()
|
||||
});
|
||||
}
|
||||
|
||||
@@ -151,7 +153,9 @@ export class StartTaskCloudComponent implements OnInit, OnDestroy {
|
||||
newTask.appName = this.appName;
|
||||
newTask.dueDate = this.dueDate;
|
||||
newTask.assignee = this.assigneeName;
|
||||
newTask.formKey = this.formKey;
|
||||
newTask.candidateGroups = this.candidateGroupNames;
|
||||
|
||||
this.createNewTask(new TaskDetailsCloudModel(newTask));
|
||||
}
|
||||
|
||||
@@ -192,15 +196,17 @@ export class StartTaskCloudComponent implements OnInit, OnDestroy {
|
||||
this.assigneeName = '';
|
||||
}
|
||||
|
||||
onCandiateGroupSelect(candidateGroup: any) {
|
||||
onCandidateGroupSelect(candidateGroup: any) {
|
||||
if (candidateGroup.name) {
|
||||
this.candidateGroupNames.push(candidateGroup.name);
|
||||
}
|
||||
}
|
||||
|
||||
onCandiateGroupRemove(candidateGroup: any) {
|
||||
onCandidateGroupRemove(candidateGroup: any) {
|
||||
if (candidateGroup.name) {
|
||||
this.candidateGroupNames = this.candidateGroupNames.filter((name: string) => { return name !== candidateGroup.name; });
|
||||
this.candidateGroupNames = this.candidateGroupNames.filter((name: string) => {
|
||||
return name !== candidateGroup.name;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -217,4 +223,8 @@ export class StartTaskCloudComponent implements OnInit, OnDestroy {
|
||||
get priorityController(): AbstractControl {
|
||||
return this.taskForm.get('priority');
|
||||
}
|
||||
|
||||
onFormSelect(formKey: string) {
|
||||
this.formKey = formKey || '';
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user