[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:
Silviu Popa
2019-05-28 19:37:36 +03:00
committed by Eugenio Romano
parent f2f08a5bf8
commit f62236b916
2 changed files with 1 additions and 17 deletions

View File

@@ -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', () => {

View File

@@ -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 = '';
}