-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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: App uses data from other workspace when assigning card in different workspace #55482
Conversation
@brunovjk sorry, these new tests took a lot of time to get sorted, The PR is ready you can continue testing, I will upload platform videos tomorrow morning as it is late for me right now, opening up for your 👀 , thanks for your patience |
|
||
const {currentStep} = issueNewCard ?? {}; | ||
|
||
const policyID = policy?.id ?? '-1'; | ||
const policyID = policy?.id; |
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.
NAB: But can we use the policyID
declaration in useOnyx('${ONYXKEYS.COLLECTION.ISSUE_NEW_EXPENSIFY_CARD}${policy?.id}')
above?
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 honestly don't mind updating it like this, I followed the approach used at other places in the app, totally fine either ways 😄 , let me know if we still want to update this one
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.
Can I check why we removed the fallback to -1? I would assume that it is more protective?
Updating to @brunovjk's suggestion sounds good 👍
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.
@brunovjk I updated the code, please check when you're online
Can I check why we removed the fallback to -1? I would assume that it is more protective?
@Julesssss the new ESLint rules state that we must not fallback to a string for values likepolicyID
hence i removed that the tests were failing
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.
Great! Thank you. @twilight2294, what do you think about getting back the fallback? But instead of using the hardcoded -1
we can use the CONST
.
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.
policyID
is a string right?, we fallback to CONST only when there is a number there, correct me if i am wrong here
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 have a new policy to always provide a fallback to a const, regardless of type. So I thiiiink -1 makes sense here for policy.
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.
Thanks for clarifying @Julesssss
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb Chrome55482_android_web.moviOS: Native55482_ios_native.moviOS: mWeb Safari55482_ios_web.movMacOS: Chrome / Safari55482_web_chrome.movMacOS: Desktop55482_web_desktop.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.
LGTM
@@ -22,30 +22,32 @@ type LimitTypeStepProps = { | |||
function LimitTypeStep({policy}: LimitTypeStepProps) { | |||
const {translate} = useLocalize(); | |||
const styles = useThemeStyles(); | |||
const [issueNewCard] = useOnyx(ONYXKEYS.ISSUE_NEW_EXPENSIFY_CARD); | |||
const policyID = policy?.id; |
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.
And here as well? The policyID fallback.
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.
same as here
I retested, and everything looks good to me. @Julesssss all yours 🚀 |
src/pages/workspace/expensifyCard/issueNew/IssueNewCardPage.tsx
Outdated
Show resolved
Hide resolved
src/pages/workspace/expensifyCard/issueNew/IssueNewCardPage.tsx
Outdated
Show resolved
Hide resolved
Ah sorry @twilight2294 there's a conflict now |
@Julesssss thanks for the review, fixed the conflicts |
✋ 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/Julesssss in version: 9.0.90-0 🚀
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.0.90-6 🚀
|
Explanation of Change
Fixed Issues
$ #55125
PROPOSAL: #55125 (comment)
Tests
Same as QA test
Offline tests
Same as QA test
QA Steps
Verify that: The card assignment flow should start from the beginning because it is a different workspace.
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
Screen_recording_20250121_141244.mp4
Android: mWeb Chrome
Screen_recording_20250121_141821.mp4
iOS: Native
Simulator.Screen.Recording.-.Expensify.testing.-.2025-01-21.at.11.34.43.mp4
iOS: mWeb Safari
Simulator.Screen.Recording.-.Expensify.testing.-.2025-01-21.at.11.39.41.mp4
MacOS: Chrome / Safari
Screen.Recording.2025-01-21.at.11.20.58.AM.mov
MacOS: Desktop
Screen.Recording.2025-01-21.at.11.25.28.AM.mov