Closed JmillsExpensify closed 1 year ago
Triggered auto assignment to @NicMendonca (NewFeature
), see https://stackoverflowteams.com/c/expensify/questions/14418#:~:text=BugZero%20process%20steps%20for%20feature%20requests for more details.
isApproved
const here and to check if report is approved or not, we can use isReportApproved
function from ReportUtils.js
file.const isApproved = ReportUtils.isReportApproved(moneyRequestReport);
isSettled
.shouldShowThreeDotsButton={isActionOwner && !isSettled && !isApproved}
canDeleteReportAction
also in ReportUtils
. For context menu.const report = getReport(reportID);
if (isActionOwner && ReportActionsUtils.isMoneyRequestAction(reportAction) && !isSettled(reportAction.originalMessage.IOUReportID) && !isReportApproved(report)) {
Delete Option
and retain other options (which we currently don't have any on main
branch.)threeDotsMenuItems={[
...(!isApproved
? [
{
icon: Expensicons.Trashcan,
text: props.translate('reportActionContextMenu.deleteAction', {action: parentReportAction}),
onSelected: deleteTransaction,
},
]
: []),
...restOptions,
]}
Job added to Upwork: https://www.upwork.com/jobs/~01bd5a594a7f989566
Current assignees @JmillsExpensify and @NicMendonca are eligible for the External assigner, not assigning anyone new.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @cubuspl42 (External
)
Approved requests show a delete option which should not be available
Currently, we do not have applied conditions to not show delete action in the report header as well in the context menu.
I am assuming when the request is settled up, it also gets approved indirectly(which means the approved fields are set to the correct status).
Consider adding a check isReportApproved
by using ReportUtils.isReportApproved(report)
below places
https://github.com/Expensify/App/blob/b226893b81f1e160bef4a6821cee19c8a03bcd24/src/components/MoneyRequestHeader.js#L84
&& !isReportApproved
Add conditions for the context menu actions also to avoid showing the delete option https://github.com/Expensify/App/blob/b226893b81f1e160bef4a6821cee19c8a03bcd24/src/pages/home/report/ContextMenu/ContextMenuActions.js#L310-L320
const report = getReport(reportAction.originalMessage.IOUReportID)
&& !isReportApproved(report)
(ReportActionsUtils.isMoneyRequestAction(reportAction) && isReportApproved(report)) ||
At the moment I am not able to test as not having the approved feature/permission for my account.
@Pujan92 Isn't this feature behind a beta, like most other features? Typically it's enough to manually opt-in by returning true
from an appropriate function in Permissions.js
.
@Pujan92 Were you able to figure out the beta consideration?
@jeet-dhandha Did you have any issues with testing the proposed solution?
@Pujan92 Also, would you sum up briefly the difference between your proposal and the earlier one?
No i didn't had any issues.
@cubuspl42 @JmillsExpensify actually approve button only shows for the corporate policy with manager account id. Now, I am making it true directly and able to test.
@Pujan92 Also, would you sum up briefly the difference between your proposal and https://github.com/Expensify/App/issues/26419#issuecomment-1701577670?
I see that the earlier proposal has been updated laterwards and now it looks quite similar.
@cubuspl42 Let @Pujan92 have this one 👍 .
I wanted know how we can allow CORPORATE type Workspace/
I wanted know how we can allow CORPORATE type Workspace/
I don't think we have an option for creating corporate policy.
Now, I am making it true directly and able to test.
Seems incorrect permission or data which we passed to ApproveMoneyRequest
api call closing the report(in the backend checks) and make it archived.
https://github.com/Expensify/App/assets/14358475/914b2cc1-7f89-4d75-ae6c-52467f19c5c9
Considering that I think it can be tested correctly only on corporate policy.
Both proposals, in their final form, looked similar and contained convincing root cause analysis and solution plan. Honoring the suggestion by @jeet-dhandha, I say we go with @Pujan92 proposal.
At the implementation phase, we'll need to ensure that we have appropriate permissions and capabilities to test the solution thoroughly.
C+ reviewed 🎀 👀 🎀
Triggered auto assignment to @Julesssss, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
@Julesssss Would you take a look at the discussion above, and help us with figuring out what permissions or other backend state we need to test this solution? How can we put our hands on a "corporate policy"?
To be honest, this is my first encounter with such entity.
Would you take a look at the discussion above, and help us with figuring out what permissions or other backend state we need to test this solution? How can we put our hands on a "corporate policy"?
I'm pretty sure this is just a request made to a workspace. The workspace admin is the manager:
@Pujan92
Considering that I think it can be tested correctly only on corporate policy.
Would you confront the assumption above with tips by @Julesssss?
@cubuspl42 With the tips given by @Julesssss and by commenting below condition I am able to see the Approve button on the admin side. https://github.com/Expensify/App/blob/1e0a249ba030b779d749ba07774a896b0f2c931f/src/components/MoneyReportHeader.js#L76-L78
On approving the request the report has been archived and also on the admin side seeing the crash, is archiving the report intentional in corporate policy too?
Requestor | Manager/Admin |
---|---|
I think it should set the statusNum
to 3 which is approved status instead it set to 2.
On approving the request the report has been archived and also on the admin side seeing the crash, is archiving the report intentional in corporate policy too?
I don't know the answer.
@Julesssss @JmillsExpensify Do you have any idea?
We shouldn't be archiving a report on approval, discussing with the team currently...
is archiving the report intentional in corporate policy too?
Hey @Pujan92 can you please create a bug for this? (to ensure you claim the bounty).
is archiving the report intentional in corporate policy too?
Hey @Pujan92 can you please create a bug for this? (to ensure you claim the bounty).
Created, https://expensify.slack.com/archives/C049HHMV9SM/p1693912029208039
Okay, so with that being treated as a separate issue I think we're good to move forward with @Pujan92's proposal.
📣 @cubuspl42 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!
📣 @Pujan92 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!
Offer link Upwork job Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑💻 Keep in mind: Code of Conduct | Contributing 📖
@Julesssss The condition for solving this issue depends on the report status, so we can't test this change until the report not gets archived and is in the approved state. Can we hold this issue until other issue of approving report correctly takes place?
Ah right. Sure
Issue on hold
Can someone clarify the issue/PR we're holding on please?
Can someone clarify the issue/PR we're holding on please?
https://expensify.slack.com/archives/C049HHMV9SM/p1693912029208039
Applause is unable to reproduce, can anyone spot the missing step that they might need to configure the correct env? They should be included in all betas already 😕
@Julesssss it is shown only for the Corporate Policy as per this comment snippet. In the dev we just commented out the condition to test based on earlier discussion.
But QA should be able to reproduce it then? 😕
But QA should be able to reproduce it then? 😕
Do they create a new corporate policy? If yes then I think can be reproducible for them and able to see approve button for admin.
It's impossible to create a new corporate policy. This only applies to the one policy that we've added for Teachers Unite! Basically something that only Expensify can/has done.
Ok, in that case I am a member of the Teachers Unite and tried splitting the bill and currently I am seeing a request. To test my solution of not providing the delete action option after approval, the admin/manager needs to approve the request. Is that something we can do?
@JmillsExpensify, @cubuspl42, @Julesssss, @Pujan92 Eep! 4 days overdue now. Issues have feelings too...
Sorry for the delay, don't hesitate to reach out via DM on NewDot if you don't get a fast response. I can go in and approve your request now.
Okey, this issue definitely needs an update. Formally, we're holding on https://github.com/Expensify/App/issues/27242, but that one is closed because it's not reproducible (?).
I think we should take this issue off hold as soon as I approve the request shown in the screenshot above.
@Pujan92 Can you try a fresh one in USD? I'm not seeing an approve button and I'm betting it's because you've requested an amount that is less than a dollar.
@JmillsExpensify I just made a new request of greater than 1 USD and hope now approve button is visible to you.
Ok great. Looking
Ok I checked the Onyx for this report. You've set your "principal" and approver as a@a.com. I'm using the volunteer@expensify.com account, but that's only used for payment. So accordingly, I'm not seeing an approve
button since the principal/approver you set is a@a.com. Does that make sense?
Based on that, I think you have the tools you need to test this yourself. Just make sure that when you sign up using the Teachers Unite form that you have access to both the "teacher" and "principal" emails. At that point, you'll be able to verify your solution works.
Thanks @JmillsExpensify , I got your point and I believe I can test with having a known "principal" email bcoz it is set as a manager so surely the approve button should be visible in the report.
Thanks @JmillsExpensify , I got your point and I believe I can test with having a known "principal" email bcoz it is set as a manager so surely the approve button should be visible in the report.
Yes exactly. Thank you!
While we've already implemented logic preventing
paid
requests from being deleted, the same isn't true forapproved
requests, which we've just added. Accordingly, let's remove theDelete request
option from the three dot overflow menu anytime a request has beenapproved
.Here's mock for clarity. Notice how I've removed the
Delete request
option.Upwork Automation - Do Not Edit