-
Notifications
You must be signed in to change notification settings - Fork 3k
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
fix: copilot with removed access can still edit profile details #52865
Conversation
const isActingAsDelegate = !!account?.delegatedAccess?.delegate; | ||
const delegates = account?.delegatedAccess?.delegates ?? []; | ||
const isAccessRemoved = delegates.findIndex((delegate) => delegate.email === session?.email) === -1; |
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.
Don't use session. The email session is never in account?.delegatedAccess?.delegates
. instead look for account?.delegatedAccess?.delegate
in account?.delegatedAccess?.delegates
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.
@s77rt Here is an example: I have two accounts [email protected]
(account 1) and [email protected]
(account 2) and account 1 is delegating to account 2. And here is the Onyx data:
account?.delegatedAccess?.delegate
is account 1session.email
is account 2
Screen.Recording.2024-11-26.at.15.52.20.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.
Correct and we should use account 1 otherwise isAccessRemoved
would always be true
.
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.
@s77rt Got it, A bit of chaos when doing PR 😄
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.
I updated.
I think we should hold the PR now until backend changes are looked into |
Closed because we have a new PR here |
Explanation of Change
Fixed Issues
$ #51678
PROPOSAL: #51678 (comment)
Tests
DelegateNoAccessModal
is displayedOffline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)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
Android: Native
android.mov
Android: mWeb Chrome
android-mweb.mov
iOS: Native
ios.mov
iOS: mWeb Safari
ios-mweb.mov
MacOS: Chrome / Safari
web-resize.mp4
MacOS: Desktop
desktop.mov