-
Notifications
You must be signed in to change notification settings - Fork 359
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
Users step #5280
Users step #5280
Conversation
8c6d769
to
c69b0e6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will review this tomorrow morning.
ui/webui/src/components/Password.jsx
Outdated
|
||
// eslint-disable-next-line camelcase | ||
import { password_quality } from "cockpit-components-password.jsx"; | ||
import ExclamationCircleIcon from "@patternfly/react-icons/dist/esm/icons/exclamation-circle-icon"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use named imports from @patternfly/react-icons
import { IconONe, IconTwo } from "@patternfly/react-icons"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
return { | ||
id: rule.id, | ||
text: rule.text(policy, password), | ||
satisfied: password.length > 0 ? rule.check(policy, password) : null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
satisfied is a boolean like the isWarning variable. For consistency purposes, let's pick one and use either the pattern 'isMyBoolVariable' or 'myBoolVariable'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
id: "length", | ||
text: (policy) => cockpit.format(_("Must be at least $0 characters"), policy["min-length"].v), | ||
check: (policy, password) => password.length >= policy["min-length"].v, | ||
isWarning: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's more explicit to use isError: false
instead of isWarning: true
. and vice versa. I had to read the code through to understand that isWarning: true
is not causing the password to be invalid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
@@ -303,14 +322,10 @@ export const DiskEncryption = ({ | |||
}) => { | |||
const [password, setPassword] = useState(storageEncryption.password); | |||
const [confirmPassword, setConfirmPassword] = useState(storageEncryption.confirmPassword); | |||
const [passwordStrength, setPasswordStrength] = useState(""); | |||
const [isValid, setIsValid] = useState(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the purpose of maintaining the isValid as a state variable here. I suggest to directly use the setIsFormValid to invalidate or validate the form from the children component and remove this.
- DiskEncryption should always setIsFormValid(true) if the isEncrypted is false.
- The Password form fields should setIsFormValid(satisfied) where satisfied is the password rules result.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
|
||
return ( | ||
<div id={idPrefix + "-create-account"}> | ||
<Stack hasGutter> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using Stack/StackItems you can put everything in a <Form isHorizontal>
, spacings will be correct automatically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The proper way to space form elements it to wrap everything with a '
' and let Patternfly do the trick :)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, this works if I move Form isHorizontal
from Accounts
to Create Account
(having it in Accounts does not work). I wanted the Form to contain also (future) root component. I guess I'll use two forms then - Create Account
and the other one for the root component? Well, it can be addressed when I add the UI for root. For now I'm moving Form to Create Accounts
.
@@ -344,6 +349,8 @@ const Footer = ({ | |||
setStepNotification(); | |||
}, | |||
}); | |||
} else if (activeStep.id === "accounts") { | |||
onNext(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm does this need special condition? The else { does the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is setUsers ? Strange it is not visible here. IIRC I did one rebase of the PR but it was on Wed afternoon, nevermind...
9d061e8
to
0b9d17f
Compare
I think I addressed the remarks above and I am going to work on the items from TODO list in the description. |
@@ -422,6 +423,7 @@ class TestStorageMountPoints(anacondalib.VirtInstallMachineCase, StorageHelpers) | |||
applied_partitioning = s.dbus_get_applied_partitioning() | |||
|
|||
# When adding a new partition a new partitioning should be created | |||
i.back() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will not work for cases where the accounts screen is disabled (eg Workstation). We may need something like reach() for going back.
And run the tests on live.
@rvykydal @KKoukiou So thinking about it. I think the user screen needs to be conventionalized not to show up on Fedora Workstation. They have Gnome Initial Setup for user creation, so the extra screen would change the expected and agreed upon flow (and might break Fedora QA testing if an unexpected screens just shows up). I think the logic should be kinda like this:
I think this logic should either be part of this PR before its merged or alternatively we should not do a new release before the logic id in place via a followup. :) |
I think in scope of this PR just using isBootIso logic similar as with Language selection should do (would disable the users screen at live images in general, including Fedora WS), but yes we may soon need to use the per-product/variant logic rather then simple isBootIso. |
6d0afe5
to
6db2a4d
Compare
Hello @rvykydal! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2023-11-06 11:07:15 UTC |
5718a8b
to
3eb4f91
Compare
|
Need to do a tests update. |
/webui-test |
@KKoukiou I think you didn't review the last 7 commits - mostly adding the tests. Regarding the commits with test updates - in case you look at the commits sequentially just a warning that the I believe the PR is mergeable (see the missing items in the description). |
/kickstart-test --waive webui-only |
/kickstart-test --waive webui-only |
/webui-test |
|
||
return ( | ||
<> | ||
<CreateAccount |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uneeded wrapper on empty compoent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is waiting for the root part. Either I'll keep it or remove when I add root.
@@ -0,0 +1,4 @@ | |||
// Span disk encryption password fields to take slightly more width than the default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ui/webui/test/check-basic
Outdated
@@ -44,7 +45,8 @@ class TestBasic(anacondalib.VirtInstallMachineCase): | |||
# Do not start the installation in non-destructive tests as this performs non revertible changes | |||
# with the pages basically empty of common elements (as those are provided by the top-level installer widget) | |||
# we at least iterate over them to check this works as expected | |||
i.reach(i.steps.REVIEW) | |||
# Create user on the first pass through users step | |||
i.reach(i.steps.REVIEW, step_callbacks={i.steps.ACCOUNTS: lambda: create_user(self)}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like that the callback would be by default set if not specified to avoid repeating code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is fixed in the next commit.
@@ -1045,8 +1045,8 @@ class TestStorageMountPointsEFI(anacondalib.VirtInstallMachineCase): | |||
s.select_mountpoint_row_device(3, f"{dev}3") | |||
s.check_mountpoint_row_format_type(3, "xfs") | |||
|
|||
# Create user on the first pass through users step | |||
i.reach(i.steps.REVIEW, step_callbacks={i.steps.ACCOUNTS: lambda: create_user(self)}) | |||
self.addCleanup(lambda: dbus_reset_users(self.machine)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be added in anacondalib and be run by default for all tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, sounds good, only on destructive tests if failed for me.
I think we can address it in a follow up PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All in all I have some comments, but they are all not blockers. This is a huge chunk of work and in very good state. I am ok to merge this as is, and do the improvements in followups.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed with @rvykydal to block this on fixing the strength indicator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rvykydal I think I have a workaround:
[kkoukiou@sequioa webui]$ git diff
diff --git ui/webui/src/components/users/Accounts.scss ui/webui/src/components/users/Accounts.scss
index f53ec05624..bdce550c8f 100644
--- ui/webui/src/components/users/Accounts.scss
+++ ui/webui/src/components/users/Accounts.scss
@@ -2,3 +2,8 @@
#accounts-create-account {
width: min(60ch, 100%);
}
+
+// FIXME: Undo when fixed upstream: https://github.com/patternfly/patternfly/issues/6032
+#accounts-create-account .pf-v5-c-form__group-label.pf-m-info {
+ align-items: baseline
+}
And since it affects also the disk selection, actually the workaround needs to be on the CSS file of the Password component. Add some helper class there and replace my used ID.
This didn't work for me:
Not sure what you mean by the disk selection. I know about ths issue (using the indicator in horizontal form) only at this place, so the ID would be OK. |
Actually on Chrome the |
I don't like the change that the 'direction: column' does. The design seems of when the strength goes bellow imo. Fine with the flex-start. |
/kickstart-test --waive webui-only |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. As said I dont like the column direction for the strength indicator but I am happy to send a followup fix. Also I think we need to show the new user name in the review step as well? Also fine for followup.
Agreed, I have the review step in the TODO list at the beginning. I would merge this. (I've got the feeling we may end up with completely different indicator, similar to the bar in cockpit or Anaconda.) |
Follow up issues tracked here: https://issues.redhat.com/browse/INSTALLER-3781 |
This is a draft pull request for https://issues.redhat.com/browse/INSTALLER-3205.
I have some questions (some related to specific commits, so it might make sense to follow the PR with the commits) and items for follow up steps.
REQUIRED IN THIS PR] Add account settings to the review screen (perhaps also when root account part is finished).The strenght indicator does not scale for isHorizontal Form
Compare to disk encryption: