Skip to content

[Merge ATS] Add approval pages - #101105

Merged
yuwenmemon merged 24 commits into
Expensify:mainfrom
bernhardoj:feat/99513-ats-approval-pages
Sep 23, 2026
Merged

yuwenmemon merged 24 commits into
Expensify:mainfrom
bernhardoj:feat/99513-ats-approval-pages

Conversation

@bernhardoj

@bernhardoj bernhardoj commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Fixed Issues

$ #99513
PROPOSAL:

Tests

Same as QA Steps

  • Verify that no errors appear in the JS console

Offline tests

Same as QA Steps

QA Steps

Prerequisite: have a workspace with recruiting enabled, Greenhouse connected and setup completed

  1. Open the workspace Recruiting page
  2. Press the Default approver field
  3. Verify it opens the default approver page with Basic, Advanced, and Custom mode
  4. Select Basic mode
  5. Verify that when Basic mode is selected, it shows an Approver field below
  6. Verify Save button is disabled when the Approver field is empty
  7. Press the Approver field
  8. Verify the final approver page shows
  9. Select any user
  10. Verify the Approver field is updated
  11. Press Save
  12. Verify the Default approver value is updated to Basic approval • [approver_display_name]
  13. Open the default approver page again
  14. Select Advanced mode
  15. Verify that when Advanced mode is selected, it shows a First approver and Final approver field below
  16. Press the First approver field
  17. Verify it opens the First approver page with Recruiter and Recruiting coordinator enabled
  18. Select any value
  19. Verify the First approver field is updated
  20. Verify you can save without the Final approver
  21. Press the Final approver field
  22. Repeat steps 7-9
  23. Press Save
  24. Verify the Default approver value is updated to Advanced approval • [first_approver] -> [approver_display_name]
  25. Open the default approver page again
  26. Select Custom mode
  27. Press Save
  28. Verify the Default approver value is updated to Custom approval
  29. Open the default approver page again
  30. Select another mode
  31. Press Save
  32. Verify it shows a confirmation modal, and pressing Save proceeds with the change
  • 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 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 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
web.mp4

@melvin-bot

melvin-bot Bot commented Sep 14, 2026

Copy link
Copy Markdown

Hey, I noticed you changed src/languages/en.ts in a PR from a fork. For security reasons, translations are not generated automatically for PRs from forks.

If you want to automatically generate translations for other locales, an Expensify employee will have to:

  1. Look at the code and make sure there are no malicious changes.
  2. Run the Generate static translations GitHub workflow. If you have write access and the K2 extension, you can simply click: [this button]

Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running:

npx bun ./scripts/generateTranslations.ts --help

Typically, you'd want to translate only what you changed by running npx bun ./scripts/generateTranslations.ts --compare-ref main

@bernhardoj
bernhardoj marked this pull request as ready for review September 17, 2026 11:36
@bernhardoj
bernhardoj requested review from a team as code owners September 17, 2026 11:36
@melvin-bot
melvin-bot Bot requested review from DylanDylann and joekaufmanexpensify and removed request for a team September 17, 2026 11:36
@melvin-bot

melvin-bot Bot commented Sep 17, 2026

Copy link
Copy Markdown

@DylanDylann 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 requested review from a team and removed request for a team September 17, 2026 11:36
@bernhardoj

Copy link
Copy Markdown
Contributor Author

Found 2 bugs:

After unsetting the Advanced mode final approver, the other policy API will set it back

  1. Clear the final approver
  2. Open another policy page
  3. Go back to the recruiting page
  4. The final approver is back
final.mp4

Can't set the first approver to Recruiting coordinator; the API says it's invalid

invalidcoordinator.mp4

Comment thread src/languages/en.ts Outdated
approvalModeWarningTitle: 'Change approval mode?',
approvalModeWarningPrompt: (providerName: string, helpSiteURL: string) =>
`Are you sure you would like to change the approval mode for this workspace? Learn more about the different ${providerName}-enabled workflow modes in our <a href="${helpSiteURL}">help site</a>.`,
approvalModeWarningConfirm: 'Change approval mode',

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@yuwenmemon please review the copy and run the translation script if it looks good.

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.

@yuwenmemon Kindly bump

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.

For the English copy, I think @Expensify/design can also help review it

@ishpaul777

Copy link
Copy Markdown
Contributor

After unsetting the Advanced mode final approver, the other policy API will set it back

updateMergeApprovalMode only includes finalApprover in the request when it's not undefined:

...(finalApprover !== undefined && {finalApprover}),
When you clear it, the draft value becomes undefined too same as "this mode doesn't have a final approver at all" (Custom). So the key gets dropped from the request entirely, and the backend never sees an instruction to clear anything it just leaves the old value in place.

Fix: send an explicit empty string when the mode has the field but it was cleared, instead of omitting the key. Pushed a fix for this.

  1. "Recruiting coordinator" rejected as invalid

The backend only accepts the literal value coordinator for the approver field — not recruitingCoordinator.

Bug 2 — "Recruiting coordinator" rejected as invalid

App's CONST.MERGE.ATS_APPROVER_FIELD.RECRUITING_COORDINATOR = 'recruitingCoordinator' (src/CONST/index.ts:3365).

Backend only ever accepted 'coordinator'

@joekaufmanexpensify joekaufmanexpensify 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.

Core design doc issue

@bernhardoj

Copy link
Copy Markdown
Contributor Author

@ishpaul777 thanks!

Fixed it.

@bernhardoj

Copy link
Copy Markdown
Contributor Author

@DylanDylann Fixed

z.mp4

@dubielzyk-expensify

Copy link
Copy Markdown
Contributor

@Expensify/design Would love to hear your thoughts on this PR

Can you invite me to a test workspace I can try it out on? jon@expensifail.com?

@bernhardoj

Copy link
Copy Markdown
Contributor Author

@dubielzyk-expensify invited you as an admin

@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions

This comment has been minimized.

@DylanDylann

DylanDylann commented Sep 23, 2026 •

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 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 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 and each prop has a /** comment above it */
    • The file is named correctly
    • 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
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • 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 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 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
Screen.Recording.2026-09-23.at.16.03.50.mov
Android: mWeb Chrome
Screen.Recording.2026-09-23.at.15.56.59.mov
iOS: HybridApp
Screen.Recording.2026-09-23.at.16.04.18.mov
iOS: mWeb Safari
Screen.Recording.2026-09-23.at.15.55.48.mov
MacOS: Chrome / Safari
Screen.Recording.2026-09-23.at.15.53.27.mov

@DylanDylann

Copy link
Copy Markdown
Contributor

@Expensify/design I noticed that when selecting Advanced Approval → First approver: Recruiting Coordinator → Final approver, the final approver text gets truncated in almost all cases on mobile, this is inconvenient for users. Should we redesign this to display it across 2 lines?

Screenshot 2026-09-23 at 15 56 40

@shawnborton

Copy link
Copy Markdown
Contributor

Should we redesign this to display it across 2 lines?

That makes sense to me, I am down with that idea 👍

Comment on lines +201 to +204
if (connectionName === CONST.POLICY.CONNECTIONS.NAME.MERGE_ATS) {
parameters.approverField = approverField;
parameters.finalApprover = finalApprover;
}

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.

Let's define additional parameters more clearly for each case, only setting them when needed, to avoid setting parameters to undefined/null values. This helps prevent unexpected bugs

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If the value is undefined, then the param is not passed to the API.

@DylanDylann

Copy link
Copy Markdown
Contributor

The rest looks good to me. @bernhardoj Let me know when you resolve the above issues. Thanks

@bernhardoj

Copy link
Copy Markdown
Contributor Author

Updated to make it 2 lines

image

@melvin-bot
melvin-bot Bot requested a review from yuwenmemon September 23, 2026 16:17
@yuwenmemon
yuwenmemon merged commit d5115ee into Expensify:main Sep 23, 2026
36 of 38 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🚧 yuwenmemon 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/yuwenmemon in version: 9.4.93-0 🚀

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

@IuliiaHerets

Copy link
Copy Markdown

Hi @bernhardoj. QA team faced with #101105 (comment) during testing this PR

bandicam.2026-09-24.17-52-47-795.mp4

cc @yuwenmemon @joekaufmanexpensify

@bernhardoj

Copy link
Copy Markdown
Contributor Author

@IuliiaHerets hmm, I can't reproduce it. Do you connect to Greenhouse through the Onyx operation? I think the API needs a real connection.

@IuliiaHerets

Copy link
Copy Markdown

@bernhardoj No, QA team used a real connection

@bernhardoj

Copy link
Copy Markdown
Contributor Author

Hmm, then there might be an issue with the connection

cc: @yuwenmemon can you check it?

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/lakchote in version: 9.4.93-3 🚀

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

Bundle Size Analysis (Sentry):

@yuwenmemon

Copy link
Copy Markdown
Contributor

I checked the staging logs. The Greenhouse connection on workspace EF68DD18E7F90185 was disconnected at 14:51:51 UTC, shortly before this recording began. The UI was still showing a stale Greenhouse card, but the backend no longer had a merge_ats connection. Therefore, the Basic approval request at 14:53:19 UTC failed with InsufficientPrivileges.
Please reconnect Greenhouse, refresh the App, and retest with the active connection. The current PR already sends coordinator for Recruiting coordinator and an explicit empty string when clearing the final approver.
Separately, the stale connection card remaining visible after another tab disconnects the integration may be worth tracking if it is reproducible.

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.

9 participants