Skip to content
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

storage: Put the minimum of a slider at the far left #19515

Merged
merged 1 commit into from
Oct 26, 2023

Conversation

mvollmer
Copy link
Member

Instead of always putting zero at the far left.

The previous code was written for a older version of the slider that could be restricted, and would not allow the user to slide below the minimum. Patternfly sliders can not be restricted in this way and will allow the user to slide the knob into every position. Thus, we need to make the far left the minimum to avoid confusion.

@mvollmer mvollmer temporarily deployed to gh-cockpituous October 23, 2023 12:08 — with GitHub Actions Inactive
@mvollmer mvollmer requested a review from jelly October 23, 2023 12:08
@jelly
Copy link
Member

jelly commented Oct 24, 2023

Slider tests fail:

    self.wait_js_cond("%s(%s)" % (func, ','.join(map(jsquote, args))))
  File "/work/bots/make-checkout-workdir/test/common/testlib.py", line 588, in wait_js_cond
    self.raise_cdp_exception("timeout\nwait_js_cond", cond, result["exceptionDetails"], trailer)
  File "/work/bots/make-checkout-workdir/test/common/testlib.py", line 292, in raise_cdp_exception
    raise Error("%s(%s): %s" % (func, arg, msg))
testlib.Error: timeout
wait_js_cond(ph_has_val("#dialog [data-field=\"size\"] .size-text input","27.3")): Uncaught (in promise) Error: condition did not become true

@jelly
Copy link
Member

jelly commented Oct 24, 2023

Code looks code, tests need fixing.

@mvollmer mvollmer temporarily deployed to gh-cockpituous October 24, 2023 11:32 — with GitHub Actions Inactive
@mvollmer
Copy link
Member Author

mvollmer commented Oct 24, 2023

Code looks code, tests need fixing.

I have changed the code a bit as well, setting a "step" attribute that actually does something visible. The default is "1", which used to mean 1 percent, but now would mean 1 byte, which is too small.

Instead of always putting zero at the far left.

The previous code was written for a older version of the slider that
could be restricted, and would not allow the user to slide below the
minimum. Patternfly sliders can not be restricted in this way and will
allow the user to slide the knob into every position. Thus, we need to
make the far left the minimum to avoid confusion.

We also need to adapt the step size, so that the cursor keys actually
move the slider noticeable.
@mvollmer mvollmer temporarily deployed to gh-cockpituous October 25, 2023 07:38 — with GitHub Actions Inactive
Copy link
Member

@jelly jelly left a comment

Choose a reason for hiding this comment

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

Nice, thanks!

@jelly jelly merged commit 6f22497 into cockpit-project:main Oct 26, 2023
99 of 100 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants