mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4598] StartTask - revert start task assignee and candidateGroups validations (#4785)
* [NO_ISSUE] - revert start task assignee and candidateGroups validations * [ADF-4598] - fix unit tests
This commit is contained in:
committed by
Eugenio Romano
parent
f2f08a5bf8
commit
f62236b916
@@ -153,18 +153,6 @@ describe('StartTaskCloudComponent', () => {
|
||||
expect(createNewTaskSpy).toHaveBeenCalledWith(taskRequest);
|
||||
});
|
||||
}));
|
||||
|
||||
it('should cannot start a task if assigne or candidate group is invalid', async(() => {
|
||||
component.taskForm.controls['name'].setValue('fakeName');
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then( () => {
|
||||
const createTaskButton = <HTMLElement> element.querySelector('#button-start');
|
||||
component.assignee.searchUserCtrl.setValue('');
|
||||
component.candidateGroups.searchGroupsControl.setValue('');
|
||||
fixture.detectChanges();
|
||||
expect(createTaskButton.hasAttribute('disabled')).toEqual(true);
|
||||
});
|
||||
}));
|
||||
});
|
||||
|
||||
it('should select logged in user as assignee by default', () => {
|
||||
|
@@ -99,7 +99,7 @@ export class StartTaskCloudComponent implements OnInit, OnDestroy {
|
||||
|
||||
formKey: string;
|
||||
|
||||
private assigneeForm: AbstractControl = new FormControl('', [Validators.required]);
|
||||
private assigneeForm: AbstractControl = new FormControl('');
|
||||
private groupForm: AbstractControl = new FormControl('');
|
||||
|
||||
private localeSub: Subscription;
|
||||
@@ -193,13 +193,9 @@ export class StartTaskCloudComponent implements OnInit, OnDestroy {
|
||||
|
||||
onAssigneeSelect(assignee: IdentityUserModel) {
|
||||
this.assigneeName = assignee ? assignee.username : '';
|
||||
this.groupForm.clearValidators();
|
||||
this.groupForm.updateValueAndValidity();
|
||||
}
|
||||
|
||||
onAssigneeRemove() {
|
||||
this.groupForm.setValidators(Validators.required);
|
||||
this.groupForm.updateValueAndValidity();
|
||||
this.assigneeName = '';
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user