Skip to content

Show Reject action to workspace admins, not just the report manager - #101503

Merged
arosiclair merged 9 commits into
Expensify:mainfrom
dukenv0307:fix/678787-part-1
Sep 29, 2026
Merged

arosiclair merged 9 commits into
Expensify:mainfrom
dukenv0307:fix/678787-part-1

Conversation

@dukenv0307

@dukenv0307 dukenv0307 commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Part 1: Show Reject action to workspace admins, not just the report manager. I'll do the part 2 to reject the individual expense sooon

Fixed Issues

$ #101502
PROPOSAL:

Tests

Precondition: A ws with at least 3 members: admin (not approver), approver and submitter

  1. Submitter drafts some expenses -> Submit
  2. Admin open this report in ND
  3. Verify that admin can reject the report
  • Verify that no errors appear in the JS console

Offline tests

Same as above

QA Steps

Same as above

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
653778189-dfc3f85b-0d95-4101-bd17-0ec71c066088.mov

@dukenv0307
dukenv0307 marked this pull request as ready for review September 18, 2026 03:31
@dukenv0307
dukenv0307 requested review from a team as code owners September 18, 2026 03:31
@melvin-bot
melvin-bot Bot requested review from JmillsExpensify and jayeshmangwani and removed request for a team September 18, 2026 03:31
@melvin-bot

melvin-bot Bot commented Sep 18, 2026

Copy link
Copy Markdown

@jayeshmangwani Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot
melvin-bot Bot removed the request for review from a team September 18, 2026 03:31
@JmillsExpensify

Copy link
Copy Markdown
Contributor

This is @flaviadefaria's project.

@jayeshmangwani

Copy link
Copy Markdown
Contributor

@dukenv0307 , can you please re-upload the web video? It’s not showing in the checklist.

Also, could you please clarify in the test step if we need to do anything additional? Right now, I can see the Reject option in the More menu for the admin.

I’m adding a video below—please let me know if there’s any extra step I need to follow.

from-admin-ws.mov

@dukenv0307

Copy link
Copy Markdown
Contributor Author

@jayeshmangwani I have updated the steps, but we are still discussing the expected behavior. I will let you know as soon as everything is ready for review

@jayeshmangwani

Copy link
Copy Markdown
Contributor

Thanks 👍

@dukenv0307

Copy link
Copy Markdown
Contributor Author

@jayeshmangwani It's ready for review. Can you see my video?

@jayeshmangwani

Copy link
Copy Markdown
Contributor

@dukenv0307 If we go to an individual expense and press Reject from the More button, we get a 401 error. Could you please test this on your side and check whether this needs to be fixed on the BE?

Api: https://dev.new.expensify.com:8082/api/RejectMoneyRequest?

Response:

{
    "jsonCode": 401,
    "message": "401 User is not the manager",
    "source": "auth-via-api",
    "onyxData": [],
    "requestID": "a3f918afdf10793b-SJC"
}
Screen.Recording.2026-09-23.at.4.39.06.PM.mov

Comment thread src/libs/ReportUtils.ts Outdated
const isInvoice = isInvoiceReport(report);
const isCurrentUserManager = !!currentUserAccountID && report?.managerID === currentUserAccountID;
const isCurrentUserAdmin = isPolicyAdmin(policy);
const isCurrentUserSubmitter = !!currentUserAccountID && report?.ownerAccountID === currentUserAccountID;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we use the isCurrentUserSubmitter function from above here as well?

App/src/libs/ReportUtils.ts

Lines 1617 to 1619 in be8c9e6

function isCurrentUserSubmitter(report: OnyxEntry<Report>, currentUserAccountID?: number): boolean {
return !!report && report.ownerAccountID === (currentUserAccountID ?? deprecatedCurrentUserAccountID);
}

@github-actions

Copy link
Copy Markdown
Contributor

🚧 flaviadefaria has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions

This comment has been minimized.

@flaviadefaria

Copy link
Copy Markdown
Contributor

I was able to reject an entire report but similarly to @jayeshmangwani when I try to reject an individual expense on a multi-expense report, I get an error:

image

@dukenv0307

Copy link
Copy Markdown
Contributor Author

taking a look...

@dukenv0307

Copy link
Copy Markdown
Contributor Author

I'm about to split into 2 PRs: reject report and reject expense, but it seems like they use the same share helper so I'll raise the BE PR to fix the reject expense case then mark this one as review after it's deployed

@dukenv0307 dukenv0307 changed the title Show Reject action to workspace admins, not just the report manager [Hold BE] Show Reject action to workspace admins, not just the report manager Sep 24, 2026
@dukenv0307 dukenv0307 changed the title [Hold BE] Show Reject action to workspace admins, not just the report manager Show Reject action to workspace admins, not just the report manager Sep 29, 2026
@dukenv0307

Copy link
Copy Markdown
Contributor Author

@jayeshmangwani BE PR has been deployed. Could you please review this PR again? Thanks

@jayeshmangwani

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
Android.mov
Android: mWeb Chrome
mweb-chrome.mov
iOS: HybridApp
ios.mov
iOS: mWeb Safari
mweb-safari.mov
MacOS: Chrome / Safari
web.mov

@jayeshmangwani jayeshmangwani left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 🚀

@melvin-bot
melvin-bot Bot requested a review from arosiclair September 29, 2026 07:25
@arosiclair
arosiclair merged commit 0eaf95e into Expensify:main Sep 29, 2026
35 of 37 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🚧 arosiclair has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/arosiclair in version: 9.4.96-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 cancelled 🔪
🍎 iOS 🍎 cancelled 🔪

@MelvinBot

Copy link
Copy Markdown
Contributor

A help site update is needed. I opened a draft PR: Docs updates for E/A#101503 Workspace Admins can now reject submitted reports.

This PR lets Workspace Admins reject reports they didn't submit, with no beta gate. Both Reject rows in Expense and Report Actions listed only the approver in the "who can" column:

  • "Reject | Submitted reports | Approver"
  • "Reject | On Outstanding reports | Assigned approver"

The docs PR adds Workspace Admins to both rows. It changes nothing else.

@dukenv0307, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR Ready for review

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/arosiclair in version: 9.4.99-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor

A help site update is needed, and a docs PR already exists: [No QA] Docs updates for E/A#101503 Workspace Admins can now reject submitted reports. I didn't open a duplicate. I assigned it to dukenv0307. It already has the HelpDot label and is out of draft.

This PR lets Workspace Admins reject reports they didn't submit, with no beta gate. Both Reject rows in Expense and Report Actions listed only the approver as the role that can reject:

  • "Reject | Submitted reports | Approver"
  • "Reject | On Outstanding reports | Assigned approver"

The docs PR adds Workspace Admins to those two cells and changes nothing else.

@dukenv0307, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR Ready for review


view run

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/Julesssss in version: 9.4.99-2 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

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.

7 participants