mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Fix bug start a task without assignee (#4204)
This commit is contained in:
@@ -123,6 +123,9 @@ export class PeopleCloudComponent implements OnInit {
|
||||
if (value) {
|
||||
this.setError();
|
||||
} else {
|
||||
if (!this.isMultipleMode()) {
|
||||
this.removeUser.emit();
|
||||
}
|
||||
this.clearError();
|
||||
}
|
||||
}),
|
||||
|
@@ -62,7 +62,7 @@
|
||||
</mat-form-field>
|
||||
|
||||
<div fxFlex>
|
||||
<adf-cloud-people #peopleInput *ngIf="currentUser" [appName]="appName" [preSelectUsers]="[currentUser]" (selectUser)="onAssigneeSelect($event)"></adf-cloud-people>
|
||||
<adf-cloud-people #peopleInput *ngIf="currentUser" [appName]="appName" [preSelectUsers]="[currentUser]" (selectUser)="onAssigneeSelect($event)" (removeUser)="onRemoveUser()"></adf-cloud-people>
|
||||
</div>
|
||||
</div>
|
||||
</mat-card-content>
|
||||
|
@@ -136,6 +136,7 @@ export class StartTaskCloudComponent implements OnInit, OnDestroy {
|
||||
|
||||
private loadCurrentUser() {
|
||||
this.currentUser = this.identityUserService.getCurrentUserInfo();
|
||||
this.assigneeName = this.currentUser.username;
|
||||
}
|
||||
|
||||
public saveTask() {
|
||||
@@ -143,7 +144,7 @@ export class StartTaskCloudComponent implements OnInit, OnDestroy {
|
||||
const newTask = Object.assign(this.taskForm.value);
|
||||
newTask.appName = this.getAppName();
|
||||
newTask.dueDate = this.getDueDate();
|
||||
newTask.assignee = this.getAssigneeName();
|
||||
newTask.assignee = this.assigneeName;
|
||||
this.createNewTask(new TaskDetailsCloudModel(newTask));
|
||||
}
|
||||
|
||||
@@ -173,10 +174,6 @@ export class StartTaskCloudComponent implements OnInit, OnDestroy {
|
||||
return this.appName ? this.appName : '';
|
||||
}
|
||||
|
||||
private getAssigneeName(): string {
|
||||
return this.assigneeName ? this.assigneeName : this.currentUser.username;
|
||||
}
|
||||
|
||||
onDateChanged(newDateValue) {
|
||||
this.dateError = false;
|
||||
|
||||
@@ -192,6 +189,10 @@ export class StartTaskCloudComponent implements OnInit, OnDestroy {
|
||||
this.assigneeName = assignee ? assignee.username : '';
|
||||
}
|
||||
|
||||
onRemoveUser() {
|
||||
this.assigneeName = null;
|
||||
}
|
||||
|
||||
public whitespaceValidator(control: FormControl) {
|
||||
const isWhitespace = (control.value || '').trim().length === 0;
|
||||
const isValid = !isWhitespace;
|
||||
|
Reference in New Issue
Block a user