-
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
Refactor workspace settings #11615
Refactor workspace settings #11615
Conversation
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
Holding on review until #11039 is merged |
…orkspace-settings
Pulled main! @rushatgabhane Whenever you ready 👍 |
@@ -56,6 +56,9 @@ const propTypes = { | |||
name: PropTypes.string, | |||
}).isRequired, | |||
|
|||
/** Option to not use the default scroll view */ | |||
shouldNotUseScrollView: PropTypes.bool, |
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.
question: wanted to understand a bit more about this prop, why is it needed?
is form being nested inside a ScrollView
causing a problem?
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.
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.
@mollfpr okay, thanks!
If my understanding is correct, if we refactor all pages to use Form.js then we won't be needing this prop and we can directly return the children.
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.
@rushatgabhane Yup, we won’t need that eventually.
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.
Thought: after all pages have been refactored, we'll have to follow by with removing shouldNotUseScrollView
from all pages.
Suggestion: create a shouldUseScrollView
prop that is used by old pages not using Form. This way everything gets removed automatically.
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.
@rushatgabhane the only other solution I came up with was to not use WorkspacePageWithSections
, but I don't think that's better.
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.
alright, thanks for looking into this @luacmartins
@mollfpr please ping me once you've made the 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.
@rushatgabhane I guess we can use shouldUseScrollView
instead but need to update the other pages that use WorkspacePageWithSections
. Are you on board with 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.
@mollfpr yes, that'd be my suggestion. Feel free to disagree/provide your input
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.
@rushatgabhane I agree with your suggestion! I'll update the PR, thanks!
@rushatgabhane I updated the PR and also reverted the |
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.
@mollfpr bug: clicking fix the error message doesn't focus the text input
Screen.Recording.2022-10-20.at.1.59.59.AM.mov
This PR also fixes #12008 (but it should be closed as a dupe as it would have been converted to a refactor issue too) |
…orkspace-settings
@rushatgabhane I just pulled the latest main, it should be fixed the issue by clicking the error text to focus the input. |
const errors = {}; | ||
if (!this.state.name.trim().length) { | ||
errors.nameError = true; | ||
if (!values.name.trim().length) { |
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 thing 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.
I just add more conditions to the name
validation. It will catch the null
or undefined
value.
@mollfpr can you please add tests for the original issue as well? |
@rushatgabhane Added the original issue test and update the checklist with the latest template! |
…orkspace-settings
WebScreen.Recording.2022-10-20.at.6.24.36.AM.movmWebScreen.Recording.2022-10-20.at.8.59.57.PM.movDesktopScreen.Recording.2022-10-20.at.9.04.33.PM.movAndroidScreen.Recording.2022-10-20.at.9.16.16.PM.moviOSScreen.Recording.2022-10-20.at.9.17.00.PM.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.
@Luke9389 LGTM! 🎉
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
@luacmartins looks like this was merged without passing tests. Please add a note explaining why this was done and remove the |
Tests passed. Removing |
✋ 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 @luacmartins in version: 1.2.19-0 🚀
|
|
||
</View> | ||
</ScrollView> | ||
{this.props.shouldUseScrollView |
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 think this.props.shouldUseScrollView
could use a better name.
It should indicate why we want to use scroll view.
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.
Yeah
What do you think of something like isNotUsingForm
? Because we're going to remove this prop whenever all the pages get refactored.
🚀 Deployed to production by @chiragsalian in version: 1.2.19-2 🚀
|
Details
Refactoring workspace settings form to use
Form.js
and dismiss keyboard after form submission.Fixed Issues
$ #11195
$ #11195 (comment)
Tests
Saving a workspace name should close the keyboard
QA Steps
Saving a workspace name should close the keyboard
PR Review Checklist
PR Author Checklist
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
filesWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)PR Reviewer Checklist
The reviewer will copy/paste it into a new comment and complete it after the author checklist is completed
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
).src/languages/*
filesWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
have been tested & I retested again)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Screenshots
Web
5BWorkspaceSettings.5D-Web.mov
Mobile Web - Chrome
WorkspaceSettings.-mWeb.Chrome.Android.mov
Mobile Web - Safari
5BWorkspaceSettings.5D-mWeb.20Safari-iOS.mov
Desktop
WorkspaceSettings.-Desktop.mov
iOS
WorkspaceSettings.-iOS.mov
Android
WorkspaceSettings.-Android.mov