-
Notifications
You must be signed in to change notification settings - Fork 261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ACA-3448] Candidate user is able to complete a task without a form attached before claiming it #5780
[ACA-3448] Candidate user is able to complete a task without a form attached before claiming it #5780
Changes from all commits
f53cb8d
030f603
4b2e235
836eca0
ffcea23
7739a80
d86de49
389964a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -272,15 +272,26 @@ export class TaskFormComponent implements OnInit { | |
} | ||
|
||
isReadOnlyForm(): boolean { | ||
return this.internalReadOnlyForm || !(this.isAssignedToMe() || this.canInitiatorComplete()); | ||
let readOnlyForm: boolean; | ||
if (this.isCandidateMember()) { | ||
readOnlyForm = this.internalReadOnlyForm || !this.isAssignedToMe(); | ||
} else { | ||
readOnlyForm = this.internalReadOnlyForm || !(this.isAssignedToMe() || (this.canInitiatorComplete() && this.isProcessInitiator())); | ||
} | ||
|
||
return readOnlyForm; | ||
} | ||
|
||
isProcessInitiator(): boolean { | ||
return this.currentLoggedUser && ( this.currentLoggedUser.id === +this.taskDetails.processInstanceStartUserId); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +this.taskDetails.processInstanceStartUserId is something wanted? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah we need it, where UserRepresentation id is a number type and taskDetails.processInstanceStartUserId is string type. |
||
} | ||
|
||
isSaveButtonVisible(): boolean { | ||
return this.showFormSaveButton && (!this.canInitiatorComplete() || this.isAssignedToMe()); | ||
} | ||
|
||
canCompleteTask(): boolean { | ||
return !this.isCompletedTask() && this.isAssignedToMe(); | ||
canCompleteNoFormTask(): boolean { | ||
return this.isReadOnlyForm(); | ||
} | ||
|
||
getCompletedTaskTranslatedMessage(): Observable<string> { | ||
|
@@ -307,7 +318,15 @@ export class TaskFormComponent implements OnInit { | |
this.taskClaimed.emit(taskId); | ||
} | ||
|
||
onClaimTaskError(error: any) { | ||
this.error.emit(error); | ||
} | ||
|
||
onUnclaimTask(taskId: string) { | ||
this.taskUnclaimed.emit(taskId); | ||
} | ||
|
||
onUnclaimTaskError(error: any) { | ||
this.error.emit(error); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any unit test related to this part. do we have it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have unit test for this case, here is the unit test https://github.com/Alfresco/alfresco-ng2-components/pull/5780/files#diff-33411bc1a3aec7d706037f6f3a5cec1fR166