Skip to content

UI: Set min and max attributes for workspace number parameters #14532

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

Closed
toshikish opened this issue Sep 3, 2024 · 1 comment
Closed

UI: Set min and max attributes for workspace number parameters #14532

toshikish opened this issue Sep 3, 2024 · 1 comment
Labels
community Pull Requests and issues created by the community. need-backend Issues that need backend work

Comments

@toshikish
Copy link
Contributor

Currently, the min and max attributes for workspace number parameter input elements are missing.

  • If a user enters a number that is outside the allowed range, an error message appears below the input field.
  • If a user enters numbers that don't follow the expected increasing or decreasing pattern, an error message shows up in an alert box after clicking the submit button.

image

The min and max attribute values should be the following:

Parameter type min attribute max attribute
number (general) min max
number (monotonic=increasing) Previous value max
number (monotonic=decreasing) min Previous value
@coder-labeler coder-labeler bot added bug need-backend Issues that need backend work labels Sep 3, 2024
@matifali matifali removed the feature label Sep 3, 2024
@stirby
Copy link
Collaborator

stirby commented Sep 23, 2024

Thank you for raising this, I'm adding it into our next sprint.

@stirby stirby added the community Pull Requests and issues created by the community. label Sep 23, 2024
@matifali matifali removed the bug label Oct 14, 2024
sreya pushed a commit that referenced this issue Nov 22, 2024
…#15182)

Implements #14532.

This PR sets `min` and `max` attributes for workspace number parameter
`<input>` elements using
[inputProps](https://mui.com/material-ui/api/text-field/#text-field-prop-inputProps).

Note: When we update MUI to v6 or later, it is better to use
`slotProps.htmlInput` instead.

---------

Co-authored-by: Muhammad Atif Ali <atif@coder.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Pull Requests and issues created by the community. need-backend Issues that need backend work
Projects
None yet
Development

No branches or pull requests

3 participants