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 👍 |
| }).isRequired, | ||
|
|
||
| /** Option to not use the default scroll view */ | ||
| shouldNotUseScrollView: PropTypes.bool, |
There was a problem hiding this comment.
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.
@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.
@rushatgabhane Yup, we won’t need that eventually.
There was a problem hiding this comment.
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.
@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.
alright, thanks for looking into this @luacmartins
@mollfpr please ping me once you've made the changes 🙇♂️
There was a problem hiding this comment.
@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.
@mollfpr yes, that'd be my suggestion. Feel free to disagree/provide your input
There was a problem hiding this comment.
@rushatgabhane I agree with your suggestion! I'll update the PR, thanks!
|
@rushatgabhane I updated the PR and also reverted the |
rushatgabhane
left a comment
There was a problem hiding this comment.
@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.
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
|
|
@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.
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.
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.jsand 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 Issuessection aboveTestssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*filesWaiting 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)PR Reviewer Checklist
The reviewer will copy/paste it into a new comment and complete it after the author checklist is completed
### Fixed Issuessection aboveTestssectionQA stepssectiontoggleReportand notonIconClick).src/languages/*filesWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarhave been tested & I retested again)/** 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)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