Skip to content

Approving requests from ApprovalsSidesheetComponent doesn't work #413

@asattler

Description

@asattler

Is this a regression?

Yes

Severity

🔴 Critical – blocks key functionality

Please provide the branch(es) you discovered this issue in

v92

Environment Details

OneIM 9.2.0 with various backend hotfixes, angular is on latest github code from v92

Please provide a minimal set of steps to reproduce the issue

  1. Create something that can be added to itshop, e.g. ESet or QERReuse along with service item and add it to IT Shop
  2. Assign an approval policy that is not self service
  3. Have an identity order a request for the given object
  4. Login to web portal with a member of Request & Fulfillment\IT Shop\Chief Approval Team. This person should not be a regular approver in the workflow.
  5. Go to requests | pending requests
  6. click on an request in the table to open the sidesheet
  7. click "approve" button
  8. click on "save" to submit the approval

Description

The problem seems to be that the userUid is undefined.
If you check the approvals-sidesheet.component.html you'll notice that the parameter isn't handed to the methods actionService.approve / actionService.deny.

this is the cause for the issue.

Describe what you expected to happen versus what actually happened

I would expect that the approver can submit his approval....

Relevant logs or console output

Error: Uncaught (in promise): TypeError: Reduce of empty array with no initial value
TypeError: Reduce of empty array with no initial value
    at Array.reduce (<anonymous>)
    at getWorkflowDataWithSmallestSublevel (decision-step.service.ts:114:6)
    at getSubLevel (decision-step.service.ts:91:16)
    at Object.<anonymous> (workflow-action.service.ts:370:21)
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (asyncToGenerator.js:3:1)
    at _next (asyncToGenerator.js:25:1)
    at _ZoneDelegate.invoke (zone.js:409:30)
    at Object.onInvoke (core.mjs:26274:33)
    at _ZoneDelegate.invoke (zone.js:408:56)
    at Array.reduce (<anonymous>)
    at getWorkflowDataWithSmallestSublevel (decision-step.service.ts:114:6)
    at getSubLevel (decision-step.service.ts:91:16)
    at Object.<anonymous> (workflow-action.service.ts:370:21)

Add a screenshot(s) if that helps illustrate the problem

No response

Suggested Fix

Replace previous lines

<button mat-stroked-button data-imx-identifier="approvals-sidesheet-button-approve" (click)="actionService.approve([data.pwo])">{{ '#LDS#Approve' | translate }}</button>
    <button mat-stroked-button data-imx-identifier="approvals-sidesheet-button-deny" (click)="actionService.deny([data.pwo])">{{ '#LDS#Deny' | translate }}</button>

by

<button mat-stroked-button data-imx-identifier="approvals-sidesheet-button-approve" (click)="actionService.approve([data.pwo], currentUserId)">{{ '#LDS#Approve' | translate }}</button>
    <button mat-stroked-button data-imx-identifier="approvals-sidesheet-button-deny" (click)="actionService.deny([data.pwo], currentUserId)">{{ '#LDS#Deny' | translate }}</button>

Anything else?

It might be related to #411 but in my case we're not in escalation mode (chief approval team). my case is reproducable just as a regular approver.

Before submitting...

  • I have searched for existing issues that match this one on github and on the community support page
  • I have included all necessary details to reproduce this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    DevOps:621262Linked to internal DevOps issue #621262bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions