Uploaded image for project: 'DC/OS'
  1. DC/OS
  2. DCOS_OSS-2065

Catalog package number configuration does not accept floating point

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Done
    • Affects Version/s: DC/OS 1.10.2, DC/OS 1.11.6, DC/OS 1.12, DC/OS 1.13
    • Fix Version/s: None
    • Component/s: dcos-ui
    • Sprint:
      RI-8/2: DC/OS UI Sprint 35, RI-9/1: DC/OS UI, RI9/2 DC/OS UI
    • Story Points:
      2

      Description

      HI!

      While editing the configuration of a package from the catalog (former Universe), if I try to set a number with floating point to a field that is supposed to accept it, validation errors will show up.

      I've checked out the generated HTML code and the input tag is like this:

       

      <input class="form-control" name="cpu" placeholder="" value="0.5" type="number">
      

      This, by default, won't accept floating points. In Firefox a red outline is shown and Chrome deletes the floating point as it's typed.

       

      This tag should have the attribute "step" that enables values with floating points. The value of the attribute "step" should be taken from the configuration's "multipleOf" field in the config.json file, or at least have a default of "0.1" if a number (instead of an integer) is expected. The HTML input tag should look like:

      <input class="form-control" name="cpu" placeholder="" value="0.5" type="number" step="0.1">

      I've been looking at the source and I just don't know React as much as to code the solution myself, but it does not look like a lot of work.

      A possible workaround could be to set the field's type to string and add the field "pattern" with value: "(\\d+(
      .\\d)*)"

      Hope this helps! If there's any information missing, or if I haven't made myself clear enough, please tell me.

       

      Bye!

        Attachments

          Activity

            People

            • Assignee:
              mikeperrotti Mike Perrotti
              Reporter:
              unaipme unaipme
              Team:
              Frontend Team
              Watchers:
              Daniel Schmidt, Dima Rozhkov, Mark Johnson (Inactive), Mike Perrotti, Orlando Hohmeier, unaipme
            • Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: