-
Notifications
You must be signed in to change notification settings - Fork 3.5k
fix: when deleting a workspace offline, the layout breaks #17639
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
Conversation
|
@mountiny @eVoloshchak One of you needs to 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] |
mountiny
left a comment
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 @akinwale Can you highlight the changes compared to the previous PR?
Also can you please leave the same tests and QA which were for the previous PR we still need to test for this here since it was not QAed in staging
The only new change is this commit: 3bcbdfb Every other prior commit is from https://github.com/Expensify/App/pull/17310/commits (except the merge with main since this PR is rebased on the current main).
Done. I changed the steps for the offline tests to cover the workspace deletion operation. |
|
Thanks for the update 🙇 |
| MenuItem.displayName = 'MenuItem'; | ||
|
|
||
| export default MenuItem; | ||
| const MenuItemWithWindowDimensions = withWindowDimensions(React.forwardRef((props, ref) => ( |
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.
That is a weird bug.
Thanks for coming up with a fix so fast, but I wonder why this is happening and how could we fix this without applying workarounds.
I'll try to investigate this further a bit before we can merge this
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.
Sounds good. I have an additional fix incoming for this issue: #17656. Just need to verify the details first.
|
@eVoloshchak You can find more details about my approach with the latest commit here: #17656 (comment) |
|
Thanks @akinwale I have also linked the other bug to this PR in the body, can you also update the QA/tests to cover that strikethrough styling? |
Done. |
eVoloshchak
left a comment
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.
This problem appears when we have a component created with React.forwardRef and we clone it using React.cloneElement.
This comment suggests we might change the way we apply defaultProps, started a discussion here
Looks like I'd also have to move the For Update: Moving them causes eslint and console errors, so I'll just leave things the way they are for now. |
|
@eVoloshchak @mountiny Just checking in to see if there will be any potential responses in the Slack discussion thread. I think that's the only thing left to close out this PR. Thanks. |
|
Bumped the thread, I see there are merge conflicts, we can resolve those after we get agreement on the thread |
|
The merge conflict appears to be minor, just a new style added to |
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-04-24.at.17.12.10.movMobile Web - ChromeScreen_Recording_20230424-170804_Chrome.mp4Mobile Web - SafariIMG_0038.MP4DesktopScreen.Recording.2023-04-24.at.17.11.02.moviOSIMG_0037.MP4AndroidScreen_Recording_20230424-170555_New.Expensify.mp4 |
eVoloshchak
left a comment
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.
Tests well on all platforms
cc: @mountiny
mountiny
left a comment
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.
One question
| * @param {String} url | ||
| * @param {String} [url] the url path | ||
| * @param {String} [shortLivedAuthToken] | ||
| * | ||
| * @returns {Promise<string>} | ||
| */ | ||
| function openOldDotLink(url) { | ||
| /** | ||
| * @param {String} [shortLivedAuthToken] | ||
| * @returns {Promise<string>} | ||
| */ | ||
| function buildOldDotURL(shortLivedAuthToken) { | ||
| const hasHashParams = url.indexOf('#') !== -1; | ||
| const hasURLParams = url.indexOf('?') !== -1; | ||
| function buildOldDotURL(url, shortLivedAuthToken) { | ||
| const hasHashParams = url.indexOf('#') !== -1; | ||
| const hasURLParams = url.indexOf('?') !== -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.
@akinwale @eVoloshchak can you remind me please why is this change 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.
To summarise: Some of the menu items made use of the openOldDotLink(url) method, which built the URLs using the inner defined buildOldDotURL method. Since the original issue scope was to make the "Copy to clipboard" behaviour happen for all links, I had to refactor this method to the outer scope.
You can follow the discussion here for more details: #17310 (comment)
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.
@akinwale Ok thank you, can you also add a Qa test which will check the deeplink works as expected, also tehre is a merge conflict, I will merge once this is resolved, thank you!
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.
@mountiny All done!
|
🚀 Deployed to staging by https://github.com/mountiny in version: 1.3.5-0 🚀
|
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.5-6 🚀
|
Details
Updated PR for #17310 rebased on the main branch.
This PR includes an additional commit to fix #17580. Wrapping the
MenuItemwith a HOC or usingReact.forwardRefseems to be disregarding (or discarding?) some or all of thedefaultProps, which includes thedefaultProps.stylechange introduced by commit a453d1e.This can be observed when
applyStrikeThroughis called on the children of anOfflineWithFeedbackcomponent, when the children areMenuItemcomponents.This PR applies the
defaultPropsto a reference of the wrapped component before the export call.Fixed Issues
$ #16946
$ #17656
PROPOSAL: #16946 (comment)
Tests
Offline tests
QA Steps
https://<oldDotDomain>/domain_companycardswhere<oldDotDomain>is the configured old dot domain for that particular environment.PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Web
Mobile Web - Chrome
16946-android-chrome.webm
Mobile Web - Safari
16946-ios-safari.mov
Desktop
iOS
16946-ios-native.mov
Android
16946-android-native.webm