-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[No QA]: Restricted action: Restrict actions of Delegate Submitter #48485
Conversation
@rushatgabhane 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] |
Just calling out here (because it might not have been clear in the issue!) that this should cover showing the delegate in the app for report actions (right @rushatgabhane? I don't think we're including that elsewhere?) It should be the full "Using the product as a copilot" section Also @rushatgabhane would you like another C+ to take primary review of this, so you can focus on your PRs? |
@dangrous that i agree with. but @allgandalf is doing it in two parts.
yeah that would be okay |
oh great, missed that it was in two parts - that makes sense! looping in @DylanDylann for pinch hit reviewing! |
BUG: The modal isn't closed when click outside Please add onClose props |
@allgandalf We also need to prevent users from putting them on hold |
@DylanDylann , I hope i addressed all your questions , thanks |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-09-06.at.11.06.46.movAndroid: mWeb ChromeScreen.Recording.2024-09-06.at.10.57.50.moviOS: NativeScreen.Recording.2024-09-06.at.10.58.40.moviOS: mWeb SafariScreen.Recording.2024-09-06.at.11.04.33.movMacOS: Chrome / SafariScreen.Recording.2024-09-06.at.10.48.47.movMacOS: DesktopScreen.Recording.2024-09-06.at.10.53.42.mov |
Oops, idk how that happened ;) |
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.
Couple of minor edits, and then let's make sure isDelegateOnlySubmitter
is working correctly if there are multiple delegates for a delegator.
Thanks!
src/libs/AccountUtils.ts
Outdated
if (!delegate) { | ||
return false; | ||
} | ||
return delegate?.role === CONST.DELEGATE_ROLE.SUBMITTER; |
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.
Will this work if there is more than one delegate? That is, if the delegator has multiple delegates, we need to make sure we're checking if the correct one is a submitter. We should look for the email match
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.
Fixed the code now, tested and works fine, thanks for pointing that out @dangrous
Screen.Recording.2024-09-07.at.1.36.30.AM.mov
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.
oh and btw, for the warning prompt, if we do not have the display name of the delegator in case of restricted access, it falls back to the email of the delegator
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.
Let's do it!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Details
A copilot with the role submitter cannot approve, pay, hold, or reject expenses.
In all components that use any of IOU.approveMoneyRequest, IOU.payMoneyRequest, IOU.payInvoice, IOU.putOnHold, or IOU.unapproveExpenseReport we will check if the copilot has the role submitter and show a ConfirmModal.
Fixed Issues
$ #46926
PROPOSAL: https://expensify.slack.com/archives/C02NK2DQWUX/p1725046112539189?thread_ts=1725040927.420699&cid=C02NK2DQWUX
Tests
Precondition: Copilot beta enabled and Set an email as a delegate with
submitter
only access.Verify that a modal shows up which informs the delegate of restricted access with the email of the delegator, the modal for all cases will be:
Offline tests
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 methodSTYLE.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 and/or tagged@Expensify/design
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-04.at.3.09.17.PM.mov
Screen.Recording.2024-09-04.at.3.09.38.PM.mov
MacOS: Desktop
Screen.Recording.2024-09-04.at.3.16.04.PM.mov
Android: Native
Android: mWeb Chrome
iOS: Native
Screen.Recording.2024-09-04.at.4.10.30.PM.mov
iOS: mWeb Safari
Screen.Recording.2024-09-04.at.4.12.11.PM.mov