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) {
|
if (value) {
|
||||||
this.setError();
|
this.setError();
|
||||||
} else {
|
} else {
|
||||||
|
if (!this.isMultipleMode()) {
|
||||||
|
this.removeUser.emit();
|
||||||
|
}
|
||||||
this.clearError();
|
this.clearError();
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
@@ -62,7 +62,7 @@
|
|||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<div fxFlex>
|
<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>
|
||||||
</div>
|
</div>
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
|
@@ -136,6 +136,7 @@ export class StartTaskCloudComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
private loadCurrentUser() {
|
private loadCurrentUser() {
|
||||||
this.currentUser = this.identityUserService.getCurrentUserInfo();
|
this.currentUser = this.identityUserService.getCurrentUserInfo();
|
||||||
|
this.assigneeName = this.currentUser.username;
|
||||||
}
|
}
|
||||||
|
|
||||||
public saveTask() {
|
public saveTask() {
|
||||||
@@ -143,7 +144,7 @@ export class StartTaskCloudComponent implements OnInit, OnDestroy {
|
|||||||
const newTask = Object.assign(this.taskForm.value);
|
const newTask = Object.assign(this.taskForm.value);
|
||||||
newTask.appName = this.getAppName();
|
newTask.appName = this.getAppName();
|
||||||
newTask.dueDate = this.getDueDate();
|
newTask.dueDate = this.getDueDate();
|
||||||
newTask.assignee = this.getAssigneeName();
|
newTask.assignee = this.assigneeName;
|
||||||
this.createNewTask(new TaskDetailsCloudModel(newTask));
|
this.createNewTask(new TaskDetailsCloudModel(newTask));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,10 +174,6 @@ export class StartTaskCloudComponent implements OnInit, OnDestroy {
|
|||||||
return this.appName ? this.appName : '';
|
return this.appName ? this.appName : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
private getAssigneeName(): string {
|
|
||||||
return this.assigneeName ? this.assigneeName : this.currentUser.username;
|
|
||||||
}
|
|
||||||
|
|
||||||
onDateChanged(newDateValue) {
|
onDateChanged(newDateValue) {
|
||||||
this.dateError = false;
|
this.dateError = false;
|
||||||
|
|
||||||
@@ -192,6 +189,10 @@ export class StartTaskCloudComponent implements OnInit, OnDestroy {
|
|||||||
this.assigneeName = assignee ? assignee.username : '';
|
this.assigneeName = assignee ? assignee.username : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onRemoveUser() {
|
||||||
|
this.assigneeName = null;
|
||||||
|
}
|
||||||
|
|
||||||
public whitespaceValidator(control: FormControl) {
|
public whitespaceValidator(control: FormControl) {
|
||||||
const isWhitespace = (control.value || '').trim().length === 0;
|
const isWhitespace = (control.value || '').trim().length === 0;
|
||||||
const isValid = !isWhitespace;
|
const isValid = !isWhitespace;
|
||||||
|
Reference in New Issue
Block a user