-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Migrate all checkbox inputs to the CheckBoxInput
component
#16813
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
Migrate all checkbox inputs to the CheckBoxInput
component
#16813
Conversation
annotations in the pull request changed, but user is not allowed to start a job |
CheckBoxInput
component
/werft run with-preview 👍 started the job as gitpod-build-migrate-checkbox-component-fork.0 |
26c115b
to
fcbb42a
Compare
fcbb42a
to
d7adb40
Compare
f9b7a2a
to
7e2e8bd
Compare
@gtsiolis This PR is ready for review 🏓, although I wasn't able to test out the UX for the recent change I made in this PR as there are some issues while running the dashboard app locally (have already raised this issue on discord and can confirm that it's not because of the changes made in this PR). Once the UX is good to go, I'll make sure to delete the old Note: Some of the changes in this PR may impact the existing UI of some pages already using the new |
64e7560
to
8f7037a
Compare
@gtsiolis Any updates on whether the UX for the changes made in this PR is good to go or not? |
8f7037a
to
3be4f04
Compare
started the job as gitpod-build-migrate-checkbox-component.5 because the annotations in the pull request description changed |
/werft run with-preview 👍 started the job as gitpod-build-migrate-checkbox-component-fork.1 |
Looking at this now! 👀 |
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 your patience and pushing this forward, @Devansu-Yadav! 🌮 🌮
UX LGTM! 🏁
💡 tip: I've deployed up a preview environment in https://migrate-ch7cf88b5c76.preview.gitpod-dev.com/workspaces.
1️⃣ Left some minor comments below.
2️⃣ There's one more checkbox that was added recently, posting the lines of code here in case you'd like to address this change, too.
gitpod/components/dashboard/src/teams/TeamSettings.tsx
Lines 149 to 161 in 58d8381
<CheckBox | |
title={<span>Workspace Sharing</span>} | |
desc={ | |
<span> | |
Allow workspaces creаted within an Organization to share the workspace with any authenticated user. | |
</span> | |
} | |
checked={!settings?.workspaceSharingDisabled} | |
onChange={({ target }) => | |
handleUpdateTeamSettings({ workspaceSharingDisabled: !target.checked }) | |
} | |
disabled={isLoading} | |
/> |
3️⃣ Once all Checkbox components have been replaced, we can remove that file and component. It should be fine to do this separately if you prefer. Your call. 🏓
@selfcontained could you take a diagonal look at the code changes here? 🏀
components/dashboard/src/components/forms/CheckboxInputField.tsx
Outdated
Show resolved
Hide resolved
components/dashboard/src/components/forms/CheckboxInputField.tsx
Outdated
Show resolved
Hide resolved
label: string | React.ReactNode; | ||
hint?: string | React.ReactNode; |
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: Not sure about this change, but let me loop in @selfcontained who initially added this component.
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 change is made to accommodate for the usage of <CheckBox />
component in certain places (like ProjectSettings
) where React nodes are passed as props to specific attributes instead of text.
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.
Makes sense, thanks! We can simplify it to just the React.ReactNode
type as that allows for the string
type as well.
components/dashboard/src/components/forms/CheckboxInputField.tsx
Outdated
Show resolved
Hide resolved
label="Edit user permissions by adding or removing roles for this user." | ||
className="mt-0" | ||
> | ||
{flags.map((e) => ( |
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: Highlighting this part for other reviewers. 🏓
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 should be rop.map(...
so it shows the roles, not flags.
3be4f04
to
b968bd1
Compare
Thanks for this!
Sure, I have left a comment to explain those changes :)
Sure, I have pushed a commit for this.
@gtsiolis Sure, I would also prefer to remove the old |
DEAL—Sounds great, @Devansu-Yadav! No need to do this here. Opened #17103 to keep track of 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.
UX LGTM. 🌮 🌮
Approving to unblock merging, holding to let someone from the @gitpod-io/engineering-webapp
team to take a closer look at the code changes. 🏓
d7d04d2
to
50aaad4
Compare
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.
Code LGTM
Thanks for taking a look, @svenefftinge. 🌮 🌮 Removing hold and starting a build from the workspace. /unhold |
50aaad4
to
7914735
Compare
/werft run 👍 started the job as gitpod-build-migrate-checkbox-component-fork.2 |
/hold (blocking the merge queue) |
/werft run with-preview 👍 started the job as gitpod-build-migrate-checkbox-component-fork.3 |
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.
Thank you so much for helping with these changes 😄 I left a few pieces of feedback that would great to address as part of this before we merge it.
@@ -14,7 +14,7 @@ export const InputFieldHint: FC<Props> = ({ disabled = false, children }) => { | |||
return ( | |||
<span | |||
className={classNames( | |||
"text-sm", | |||
"text-md", |
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 see why this change was made, but I don't think we want to bump the input field hint font size across the board. Having it as text-sm
is intentional, especially noticeable our other input fields where we want it to be a slightly smaller font size.
For now can we keep this as text-sm
and if we decided we'd like larger text specifically for checkboxes we can either add a property to InputFieldHint
for that variance, or not use InputFieldHint on the checkbox component. Let's leave that as a followup and keep it as text-sm
please though.
|
||
<CheckboxInputContainer> | ||
<CheckboxInput | ||
value="Block Users" |
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.
Could we make value
optional on CheckboxInput
, and then we can leave it off in cases like this where it isn't beneficial to set.
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.
@selfcontained Sure, I'll make the change. Is there anywhere else where I should drop the value
prop?
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 you should be safe to drop the value
prop from all the new places in this PR where we've swapped to the new component if they weren't using it before (I think it's all of them).
label="Edit user permissions by adding or removing roles for this user." | ||
className="mt-0" | ||
> | ||
{flags.map((e) => ( |
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 should be rop.map(...
so it shows the roles, not flags.
components/dashboard/src/components/forms/CheckboxInputField.tsx
Outdated
Show resolved
Hide resolved
7914735
to
bc10b61
Compare
@selfcontained I have addressed almost all the changes you suggested. Do let me know if I missed something 😄 |
Thanks @Devansu-Yadav for all your help here 😄 I'm going to update this PR to merge into a non- Update: New PR w/ some tweaks here. |
4ac6332
into
gitpod-io:bmh/devansu-migrate-checkbox-component
* Migrate all checkbox inputs to the `CheckBoxInput` component (#16813) * [dashboard] migrate to CheckBoxInput (#16768) * [dashboard] remove CheckBox comp usage * [dashboard] remove `CheckBox` on team settings * [dashboard] remove border on checkbox click state * [dashboard] refactor code for `CheckboxInput` * removing values on checkboxes that don't need it * adjusting api a bit * simplify a bit by always setting value --------- Co-authored-by: Devansu Yadav <[email protected]>
@selfcontained Just went through this PR and the code looks a whole lot better now! Thanks for the tweaks 🙌 |
Description
CheckBoxInput
component instead ofCheckBox
component for consistency.Related Issue(s)
Fixes #16768
How to test
Release Notes
Documentation
Build Options:
Run the build with werft instead of GHA
Run Leeway with
--dont-test
Publish Options
Installer Options
Add desired feature flags to the end of the line above, space separated
Preview Environment Options:
If enabled this will build
install/preview
If enabled this will create the environment on GCE infra
Valid options are
all
,workspace
,webapp
,ide
,jetbrains
,vscode
,ssh