mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[AAE-3638] - implement priority drodpown widget (#6351)
* [AAE-3638] - implement priority drodpown widget * refactor task cloud service function * fix remove value on card view text item and move priorities values in app.config.json * revert app config unnecary changes * PR changes * fix unit test * fix more unit tests * PR changes * create task cloud response model * remove commented code * fix e2e * fix start task e2e and add return type
This commit is contained in:
@@ -33,6 +33,7 @@ import { GroupCloudComponent } from '../../../group/components/group-cloud.compo
|
||||
import { TaskCloudService } from '../../services/task-cloud.service';
|
||||
import { StartTaskCloudRequestModel } from '../models/start-task-cloud-request.model';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { TaskPriorityOption } from '../../models/task.model';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-cloud-start-task',
|
||||
@@ -100,6 +101,8 @@ export class StartTaskCloudComponent implements OnInit, OnDestroy {
|
||||
|
||||
formKey: string;
|
||||
|
||||
priorities: TaskPriorityOption[];
|
||||
|
||||
private assigneeForm: AbstractControl = new FormControl('');
|
||||
private groupForm: AbstractControl = new FormControl('');
|
||||
private onDestroy$ = new Subject<boolean>();
|
||||
@@ -119,6 +122,7 @@ export class StartTaskCloudComponent implements OnInit, OnDestroy {
|
||||
.subscribe(locale => this.dateAdapter.setLocale(locale));
|
||||
this.loadCurrentUser();
|
||||
this.buildForm();
|
||||
this.loadDefaultPriorities();
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
@@ -129,7 +133,7 @@ export class StartTaskCloudComponent implements OnInit, OnDestroy {
|
||||
buildForm() {
|
||||
this.taskForm = this.formBuilder.group({
|
||||
name: new FormControl(this.name, [Validators.required, Validators.maxLength(this.getMaxNameLength()), this.whitespaceValidator]),
|
||||
priority: new FormControl(),
|
||||
priority: new FormControl(''),
|
||||
description: new FormControl('', [this.whitespaceValidator]),
|
||||
formKey: new FormControl()
|
||||
});
|
||||
@@ -145,6 +149,10 @@ export class StartTaskCloudComponent implements OnInit, OnDestroy {
|
||||
this.assigneeName = this.currentUser.username;
|
||||
}
|
||||
|
||||
private loadDefaultPriorities() {
|
||||
this.priorities = this.taskService.priorities;
|
||||
}
|
||||
|
||||
public saveTask() {
|
||||
this.submitted = true;
|
||||
const newTask = Object.assign(this.taskForm.value);
|
||||
|
Reference in New Issue
Block a user