Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: extract checkbox label from dynamic parameter styling prop #17651

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

Merged
merged 4 commits into from
May 8, 2025

Conversation

jaaydenh
Copy link
Contributor

@jaaydenh jaaydenh commented May 1, 2025

resolves #17474

A label will only be shown next to the checkbox If there is a value for label in the styling prop for the dynamic parameter

Screenshot 2025-05-01 at 21 35 32

@jaaydenh jaaydenh self-assigned this May 1, 2025
@jaaydenh jaaydenh requested a review from aslilac May 1, 2025 20:35
Copy link
Member

@aslilac aslilac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to fix whatever the type of parameter.styling is here. even if it's just Record<string, string>, that's better than one off type assertions littered all over the place.

@jaaydenh
Copy link
Contributor Author

jaaydenh commented May 5, 2025

@aslilac improved the handling of parameter styling

@jaaydenh jaaydenh requested a review from aslilac May 5, 2025 21:12
@@ -470,6 +471,7 @@ export const CreateWorkspacePageViewExperimental: FC<

<div className="flex flex-col gap-9">
{parameters.map((parameter, index) => {
const styling = parameter.styling as ParameterStyling;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah but this is still an inline cast. whatever the type of parameter is here should have a styling: ParameterStyling; member.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the styling type in coder/preview

@jaaydenh jaaydenh force-pushed the jaaydenh/checkbox-label branch from 0fca373 to 81e4f77 Compare May 7, 2025 21:15
@jaaydenh jaaydenh changed the title fix: get checkbox label from dynamic parameter styling prop fix: extract checkbox label from dynamic parameter styling prop May 7, 2025
@jaaydenh jaaydenh requested a review from aslilac May 7, 2025 21:15
@jaaydenh jaaydenh merged commit c66e80e into main May 8, 2025
39 checks passed
@jaaydenh jaaydenh deleted the jaaydenh/checkbox-label branch May 8, 2025 12:02
@github-actions github-actions bot locked and limited conversation to collaborators May 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

parameters: how can/should we support a different checkbox value from the title
2 participants