-
Notifications
You must be signed in to change notification settings - Fork 902
feat: Support booleans for parameters input #3437
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
site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.stories.tsx
Outdated
Show resolved
Hide resolved
import { FC } from "react" | ||
import { ParameterSchema } from "../../api/typesGenerated" | ||
import { MONOSPACE_FONT_FAMILY } from "../../theme/constants" | ||
|
||
const isBoolean = (schema: ParameterSchema) => { | ||
return schema.validation_value_type === "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.
would be nice to have an enum for 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.
That is true, but I would wait until we use it more often or with different values.
name: "disable_docker", | ||
description: "Disable Docker?", | ||
validation_value_type: "bool", | ||
default_source_value: "false", |
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.
Do we have testing entities for these objects?
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.
No, we don't. Do you think it would be interesting to have?
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 don't know! I haven't worked extensively with these inputs. If you think it will be used in other stories, great. If not, no worries.
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 didn't have time to pull down but the code looks good!
…ries.tsx Co-authored-by: Kira Pilot <kira@coder.com>
Can the display names be more human-friendly.? |
I think this is a good suggestion. We already have a description so I think what we can do is if there is a description, display it as a label, if not, display the variable name. What do you think? Also, I think this work could be in a diff PR, so I'm going to merge this one, but feel free to keep the discussion here if you want to. |
Seem's like a good idea. |
@matifali sure thing, here is coder/site/src/components/ParameterInput/ParameterInput.tsx Lines 15 to 24 in 758eb21
|
Any plans for to this? |
Closes #2659
Preview:
PS: I tried with
Checkbox
but for the current design, having a Radio Group fits better when together with other fields, but I'm open. Here is what the checkbox looks like: