Skip to content
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

OBPIH-5805 Approver cannot edit requests - Approvals end to end workflow (fix after QA) #4320

Merged
merged 5 commits into from
Oct 9, 2023

Conversation

alannadolny
Copy link
Collaborator

No description provided.

if (isApprovalRequired) {
// If the request is approved, approver cannot edit request,
// but normal warehouse user can edit it
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do we mean by "normal warehouse user can edit it"?
Below I can see that you check if isUserRequestor, so that would mean that if request is approved, only requestor can edit that, is that true?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot that I did all of the requests from one account - so I was the only requestor here 🫣

if (request.statusCode === RequisitionStatus.APPROVED && isUserApprover) {
return false;
}
// If the location supports request approval, only the requestor is able to edit
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here you answered my question from above, but I'm confused about this "normal warehouse user can edit it".

return isUserRequestor &&
(isLocationDestination || isLocationOrigin) &&
request.statusCode !== RequisitionStatus.REJECTED;
return request.statusCode === RequisitionStatus.APPROVED && !isUserApprover;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't this "normal user" have to be in either destination or origin in order to be able to edit it?

Copy link
Collaborator

@kchelstowski kchelstowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

something still feels weird to me here, but I feel like I don't understand something from "domain level", so I hope someone else will also take a look at it.

request.statusCode !== RequisitionStatus.REJECTED;
}
// If the request is approved, approver cannot edit request,
// but fulfilling user can edit it
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes no sense to me (I understand that it was requested to work that way), but this still makes no sense to me. I see the use case where I have one person doing approvals and fulfilling.

@awalkowiak awalkowiak merged commit b9f59ff into develop Oct 9, 2023
3 checks passed
@awalkowiak awalkowiak deleted the OBPIH-5805-2 branch October 9, 2023 08:45
awalkowiak pushed a commit that referenced this pull request Oct 26, 2023
…low (fix after QA) (#4320)

* OBPIH-5805 enable editing request when it is approved

* OBPIH-5805 Change conditions to fix editing when request is approved but, we are not requestor

* OBPIH-5805 Add origin to condition

* OBPIH-5805 Change comment in permission util

* OBPIH-5805 Allow edit for users who are approvers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants