-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[Advanced Approval Workflows] Cleanup the logic responsible for building policy.employeeList #48411
[Advanced Approval Workflows] Cleanup the logic responsible for building policy.employeeList #48411
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@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] |
}; | ||
}); | ||
|
||
approvalWorkflow.members.forEach(({email}) => { | ||
const submitsTo = type === CONST.APPROVAL_WORKFLOW.TYPE.REMOVE ? '' : firstApprover.email ?? ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When removing the workflow, should we set the submitTo to default approver?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could, but couple of weeks ago we agreed with Tim Golen that it will be easier to use an empty string, here is an issue where it was implemented on the BE.
@DylanDylann back to you! |
Co-authored-by: Tim Golen <tgolen@gmail.com>
Reviewer Checklist
Screenshots/VideosOnly change the API payload Screen.Recording.2024-09-04.at.16.10.58.mov |
@blazejkustra There is an approval workflow:
When updating the first approver from qa.guide@team.expensify.com to dylandylan9112+931, we don't reset Screen.Recording.2024-09-04.at.12.15.56.movWe already have memberToRemove but It seems we missed approverToRemove 😄 |
Everything else looks good to me. |
…m:software-mansion-labs/expensify-app-fork into approval-workflows/cleanup-building-logic
Adjusted in the newest commit! Great catch 🙌 |
Come back now |
@tgolen All yours |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/tgolen in version: 9.0.30-0 🚀
|
Details
Refactor the logic that is responsible for building the data on the frontend that is later sent to update
policy.employeeList
.Having following policy:
When advanced approvals is turned on, the employee list looks like this:
If I edit that workflow to set 2 as the additional approver, the frontend sends this payload:
That's mostly OK, but since submitsTo isn't changing for anyone, the payload could be more simple with just:
Fixed Issues
$ #48341
PROPOSAL: N/A
Tests
submitsTo
orforwardsTo
attributes have changed, particularly test the example above.Offline tests
N/A
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
MacOS: Chrome / Safari
Screen.Recording.2024-09-02.at.16.58.04.mov