Skip to content

Commit

Permalink
lib: Change width of password progress
Browse files Browse the repository at this point in the history
  • Loading branch information
skobyda authored and martinpitt committed Oct 31, 2023
1 parent 5657c87 commit 6a9640c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pkg/lib/cockpit-components-password.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ export const PasswordFormFields = ({
else
variant = "danger";

let passwordStrengthValue = Number.isInteger(passwordStrength) ? passwordStrength : 0;

return (
<>
<FormGroup label={password_label}
Expand Down Expand Up @@ -127,12 +129,12 @@ export const PasswordFormFields = ({
</InputGroup>
<div>
<Progress id={idPrefix + "-meter"}
className={"ct-password-strength-meter " + variant}
title={_("password quality")}
size={ProgressSize.sm}
measureLocation={ProgressMeasureLocation.none}
variant={variant}
value={Number.isInteger(passwordStrength) ? passwordStrength : 0} />
className={"ct-password-strength-meter " + variant}
title={_("password quality")}
size={ProgressSize.sm}
measureLocation={ProgressMeasureLocation.none}
variant={variant}
value={passwordStrengthValue} />
<div id={idPrefix + "-password-meter-message"} className="pf-v5-c-form__helper-text" aria-live="polite">{passwordMessage}</div>
</div>
{error_password && <FormHelperText>
Expand Down
1 change: 1 addition & 0 deletions pkg/lib/cockpit-components-password.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.ct-password-strength-meter {
grid-gap: var(--pf-v5-global--spacer--xs);
inline-size: var(--pf-v5-global--spacer--2xl);

.pf-v5-c-progress__description, .pf-v5-c-progress__status {
display: none;
Expand Down

0 comments on commit 6a9640c

Please sign in to comment.