Skip to content

feat: Adjust forms to include Rich Parameters - #5856

Merged
mtojek merged 48 commits into
coder:mainfrom
mtojek:5574-site-1
Feb 1, 2023
Merged

mtojek merged 48 commits into
coder:mainfrom
mtojek:5574-site-1

Conversation

@mtojek

@mtojek mtojek commented Jan 25, 2023 •

Copy link
Copy Markdown
Member

Related: #5574

Changes:

  • feat: modified Create Workspace form to include rich parameters
  • feat: submit Rich Parameters
  • finish validation rules for Create Workspace
  • feat: support for URL params http://localhost:3000/templates/docker-2/workspace?param.Compute%20instances=7
  • unit tests for Create Workspace (frontend)
  • feat: update workspace build to use new or change parameters (support for mutable)
  • feat: "Build parameters" button in dropdown appears conditionally if the template uses rich parameters.

Screenshot 2023-01-31 at 19 29 39

Screenshot 2023-01-31 at 19 30 05

Screenshot 2023-01-31 at 19 29 50

Screenshot 2023-01-31 at 19 33 46

@mtojek mtojek self-assigned this Jan 25, 2023
@mtojek mtojek mentioned this pull request Jan 25, 2023
size="small"
disabled={disabled}
placeholder={parameter.default_value}
value={parameterValue}

@BrunoQuaresma BrunoQuaresma Jan 25, 2023 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This error usually happens when the value changes from string to undefined. Many times, having undefined values is a "bug" warning but in a few cases, it is ok so what you have to do is pass an empty string as a fallback:

value={parameterValue ?? ""}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I introduced the parameterValue as I wasn't able to fix it with formik. It looks like formik has troubles with understanding the concept of array of object, and for some reason, the input goes undefined. I will look into this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I see, so maybe the getFormHelpers has a bug 🤔

@mtojek
mtojek marked this pull request as ready for review January 31, 2023 18:33
@mtojek

mtojek commented Jan 31, 2023

Copy link
Copy Markdown
Member Author

Hey @BrunoQuaresma! I'm done with the implementation, but I need to increase test coverage for Update workspace. I will do this tomorrow, but I appreciate any comments on the code in the mean time. This should be reviewable.

PS. I apologize for the PR size...

@BrunoQuaresma BrunoQuaresma left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

FE code looks very good to me, congrats! I'm going to run a QA before approving it.

@BrunoQuaresma BrunoQuaresma left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I mean, if you already did that and you are confident, feel free to merge it!

@mtojek
mtojek merged commit f9ae105 into coder:main Feb 1, 2023
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 1, 2023
@bpmct bpmct added this to the Rich Parameters GA milestone Feb 28, 2023
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.

3 participants