-
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
Shortcut - Workspace avatar next to request shortcut does not update when it is changed #39368
Conversation
…e when it is changed
@jjcoffee |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid-app-2024-04-04_14.47.25.mp4Android: mWeb Chromeandroid-chrome-2024-04-04_14.52.45.mp4iOS: Nativeios-native-2024-04-04_16.03.25.mp4iOS: mWeb Safariios-safari-2024-04-04_16.12.51.mp4MacOS: Chrome / Safaridesktop-chrome-2024-04-04_14.19.50.mp4MacOS: Desktopdesktop-app-2024-04-04_14.22.03.mp4 |
@@ -153,13 +155,16 @@ function FloatingActionButtonAndPopover(props) { | |||
|
|||
const quickActionReport = useMemo(() => (props.quickAction ? ReportUtils.getReport(props.quickAction.chatReportID) : 0), [props.quickAction]); | |||
|
|||
const policy = props.allPolicies ? props.allPolicies[`${ONYXKEYS.COLLECTION.POLICY}${quickActionReport.policyID}`] : undefined; |
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.
const policy = props.allPolicies ? props.allPolicies[`${ONYXKEYS.COLLECTION.POLICY}${quickActionReport.policyID}`] : undefined; | |
const quickActionPolicy = props.allPolicies ? props.allPolicies[`${ONYXKEYS.COLLECTION.POLICY}${quickActionReport.policyID}`] : undefined; |
To keep things consistent 😉
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.
Sound good )
Fixed )
const quickActionAvatars = useMemo(() => { | ||
if (quickActionReport) { | ||
const avatars = ReportUtils.getIcons(quickActionReport, props.personalDetails); | ||
return avatars.length <= 1 || ReportUtils.isPolicyExpenseChat(quickActionReport) ? avatars : _.filter(avatars, (avatar) => avatar.id !== props.session.accountID); | ||
} | ||
return []; | ||
}, [props.personalDetails, props.session.accountID, quickActionReport]); | ||
// eslint-disable-next-line react-hooks/exhaustive-deps |
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 would add a brief explanatory comment here, so future visitors know why we've included policy as a dependency.
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.
Done )
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.
Just some minor tweaks needed, otherwise looks great and tests well! 🙏
const quickActionAvatars = useMemo(() => { | ||
if (quickActionReport) { | ||
const avatars = ReportUtils.getIcons(quickActionReport, props.personalDetails); | ||
return avatars.length <= 1 || ReportUtils.isPolicyExpenseChat(quickActionReport) ? avatars : _.filter(avatars, (avatar) => avatar.id !== props.session.accountID); | ||
} | ||
return []; | ||
}, [props.personalDetails, props.session.accountID, quickActionReport]); | ||
// We added police depending on the fact that if the workspace changes, we would see these changes on Shortcut too |
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 added police depending on the fact that if the workspace changes, we would see these changes on Shortcut too | |
// Policy is needed as a dependency in order to update the shortcut details when the workspace changes |
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!
✋ 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/amyevans in version: 1.4.61-0 🚀
|
🚀 Deployed to staging by https://github.com/amyevans in version: 1.4.61-0 🚀
|
🚀 Deployed to production by https://github.com/Julesssss in version: 1.4.61-8 🚀
|
Details
Shortcut - Workspace avatar next to request shortcut does not update when it is changed
Fixed Issues
$ #39045
PROPOSAL: #39045 (comment)
Tests
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
Android: Native
android.mov
Android: mWeb Chrome
android.mov
iOS: Native
Screen.Recording.2024-04-01.at.18.17.21.mov
iOS: mWeb Safari
Screen.Recording.2024-04-01.at.18.18.21.mov
MacOS: Chrome / Safari
Screen.Recording.2024-04-01.at.14.22.03.mov
MacOS: Desktop
Screen.Recording.2024-04-01.at.18.09.43.mov