-
Notifications
You must be signed in to change notification settings - Fork 4
[NAE-2085] Refactor User #281
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
a01b465
[NAE-2085] Refactor User
camperko 80f687e
Merge remote-tracking branch 'origin/release/7.0.0-rev4' into NAE-2085
camperko 00bb71e
[NAE-2085] Refactor User
camperko 4240a93
Merge remote-tracking branch 'origin/release/7.0.0-rev4' into NAE-2085
machacjozef 35d0fb0
Merge remote-tracking branch 'origin/NAE-2085' into NAE-2085
machacjozef fd05a1c
7.0.0-rc.4
machacjozef 86dc2cc
7.0.0-rc.4
machacjozef 594157f
merge 0.4.0
machacjozef 7b05e6c
merge 0.4.0
machacjozef fe22730
merge 0.4.0
machacjozef 03a560d
merge 0.4.0
machacjozef 6ae1503
[NAE-2085] Refactor User
camperko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,8 +77,11 @@ export class DelegateTaskService extends TaskHandlingService { | |
{ | ||
roles: Object.keys(this._safeTask.roles).filter(role => | ||
this._safeTask.roles[role]['assign'] !== undefined && this._safeTask.roles[role]['assign']), | ||
// value: !this._safeTask.user ? undefined : new UserValue( | ||
// this._safeTask.user.id, this._safeTask.user.realmId, this._safeTask.user.firstName, this._safeTask.user.lastName, this._safeTask.user.username | ||
// ), | ||
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. Please remove commented code if not needed. |
||
value: !this._safeTask.userId ? undefined : new UserValue( | ||
this._safeTask.userId, '', '', '' | ||
this._safeTask.userId, '', '', '', '' | ||
), | ||
machacjozef marked this conversation as resolved.
Show resolved
Hide resolved
|
||
negativeRoles: Object.keys(this._safeTask.roles).filter(role => | ||
this._safeTask.roles[role]['assign'] !== undefined && !this._safeTask.roles[role]['assign']) | ||
|
@@ -115,39 +118,39 @@ export class DelegateTaskService extends TaskHandlingService { | |
this._taskState.startLoading(delegatedTaskId); | ||
this._taskResourceService.delegateTask(this._safeTask.stringId, delegatedUserId).pipe(take(1)).subscribe( | ||
(outcomeResource: EventOutcomeMessageResource) => { | ||
this._taskState.stopLoading(delegatedTaskId); | ||
if (!this.isTaskRelevant(delegatedTaskId)) { | ||
this._log.debug('current task changed before the delegate response could be received, discarding...'); | ||
nextEvent.resolve(false); | ||
return; | ||
} | ||
this._taskState.stopLoading(delegatedTaskId); | ||
if (!this.isTaskRelevant(delegatedTaskId)) { | ||
this._log.debug('current task changed before the delegate response could be received, discarding...'); | ||
nextEvent.resolve(false); | ||
return; | ||
} | ||
|
||
if (outcomeResource.success) { | ||
this._taskContentService.updateStateData(outcomeResource.outcome as DelegateTaskEventOutcome); | ||
const changedFieldsMap: ChangedFieldsMap = this._eventService | ||
.parseChangedFieldsFromOutcomeTree(outcomeResource.outcome); | ||
if (!!changedFieldsMap) { | ||
this._changedFieldsService.emitChangedFields(changedFieldsMap); | ||
if (outcomeResource.success) { | ||
this._taskContentService.updateStateData(outcomeResource.outcome as DelegateTaskEventOutcome); | ||
const changedFieldsMap: ChangedFieldsMap = this._eventService | ||
.parseChangedFieldsFromOutcomeTree(outcomeResource.outcome); | ||
if (!!changedFieldsMap) { | ||
this._changedFieldsService.emitChangedFields(changedFieldsMap); | ||
} | ||
this.completeSuccess(afterAction, nextEvent, outcomeResource.outcome as DelegateTaskEventOutcome); | ||
} else if (outcomeResource.error) { | ||
this._snackBar.openErrorSnackBar(outcomeResource.error); | ||
this.completeActions(afterAction, nextEvent, false); | ||
} | ||
this.completeSuccess(afterAction, nextEvent, outcomeResource.outcome as DelegateTaskEventOutcome); | ||
} else if (outcomeResource.error) { | ||
this._snackBar.openErrorSnackBar(outcomeResource.error); | ||
this.completeActions(afterAction, nextEvent, false); | ||
} | ||
}, error => { | ||
this._taskState.stopLoading(delegatedTaskId); | ||
this._log.debug('getting task data failed', error); | ||
}, error => { | ||
this._taskState.stopLoading(delegatedTaskId); | ||
this._log.debug('getting task data failed', error); | ||
|
||
if (!this.isTaskRelevant(delegatedTaskId)) { | ||
this._log.debug('current task changed before the delegate error could be received'); | ||
nextEvent.resolve(false); | ||
return; | ||
} | ||
if (!this.isTaskRelevant(delegatedTaskId)) { | ||
this._log.debug('current task changed before the delegate error could be received'); | ||
nextEvent.resolve(false); | ||
return; | ||
} | ||
|
||
this._snackBar.openErrorSnackBar(`${this._translate.instant('tasks.snackbar.assignTask')} | ||
this._snackBar.openErrorSnackBar(`${this._translate.instant('tasks.snackbar.assignTask')} | ||
${this._task} ${this._translate.instant('tasks.snackbar.failed')}`); | ||
this.completeActions(afterAction, nextEvent, false); | ||
}); | ||
this.completeActions(afterAction, nextEvent, false); | ||
}); | ||
} | ||
|
||
/** | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.