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

Redesign and refactoring of installation dialogs #84

Merged
merged 11 commits into from
Jan 28, 2016

Conversation

ancorgs
Copy link
Contributor

@ancorgs ancorgs commented Jan 25, 2016

This pull request tries to address the usability problems reported for the "create user" screen during installation.

Problems of the previous dialog for user creation

Here you can see the previous screen.

createnewuser_-_old_state

There is quite some functionality hidden there:

  • You can select the password encryption method (clicking on "Change...")
  • You can select one and only one of these options:
    • Create a user (Obvious)
    • Skip user creation (Leaving the form blank and clicking "Next", see pop-up on screenshot)
    • Import users from a previous installation. (Really well hidden, clicking on "Change..." and then checking the corresponding checkbox -only visible if users are detected- under the section "authentication method"). Rather buggy sub-dialog.
  • Last but not least, the dialog exposes a feature that is not there. The summary suggest that you can change the authentication method, but the only supported option is "local /etc/password".

Apart from the usability problems, the source code was in really bad shape. Poorly structured, with no unit tests, with a lot of duplication and dead code and with some bugs.

The new dialog

The normal installation workflow have now 2 steps:

  1. Creation of user. This is how it looks in a clean system and in a system with previous users
    step1-clean
    step1-import

  2. Root's password. As usual, this step is skipped if "use this password for system administrator" is checked. It looks like always (not worth an additional screenshot).

That's it. No more hidden functionality.

But you could be wondering where the encryption method selector ended up. That depends on the content of the proposal section of the control.xml of the distribution.

Option a) Nothing (current) - The option is simply not there anymore

Option b) users proposal - The installation summary looks like this (check "users settings" section)
user_proposal

Option c) users_encryption proposal - Summary looks like this (check the "password encryption type" section)
encryption_proposal

With both options b and c, clicking on the name of the method will take the user to this screen
encryption

Code refactoring

As important as the visual and workflow redesign it the code refactoring, which adds object orientation and some unit tests. As a side effect of that refactoring, the InstallerDialog class dialog was added to yast2.rpm for further reuse all along YaST in the future. See yast/yast-yast2#427 for details

- WIP: encryption method was removed from the dialogs and has
  not be added elsewhere yet
- Three options are now presented (new, import and skip)
- Code moved to lib/users/dialogs reusing dialogs infrastructure
  when possible
- Fixed the rpm to build correctly
- Still a lot of old code, this is not intended as a full rewrite

module Yast
class InstUserFirstDialog
include ::UI::EventDispatcher
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

at least document why it cannot be used

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Dialog class assumes a non-wizard dialog (it calls to UI.CloseDialog, for example). Using it in this context means overriding almost the whole class (only the includes are really useful). We could, of course, also thing about modifying Dialog to play more nicely with installation wizards.

Copy link
Member

Choose a reason for hiding this comment

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

thanks for answer, so plase at least document it in code why it is not used. Dialog can be of course also adapted to work nicely in wizard dialogs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Expect a pull request today adding a InstallationDialog class to yast2 (I have already needed it twice).

Copy link
Member

Choose a reason for hiding this comment

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

Please do not call it InstallationDialog as wizard is used e.g. also in bootloader which is not only installation dialog. Better WizardDialog?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In its current form, it is really InstallationDialog, since it uses Yast::GetInstArgs, makes accept_handler kind of an alias for next_handler and that kind of installation specific stuff.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jreidinger Here you are the premiere yast/yast-yast2#427 I'll add tests tomorrow morning.

)
end
deep_copy(@ret)
ret
Copy link
Member

Choose a reason for hiding this comment

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

if you touch this file I really recommend to use ProposalClient as base class - https://github.com/yast/yast-yast2/blob/master/library/general/src/lib/installation/proposal_client.rb

@ancorgs ancorgs changed the title [Do not merge yet] Redesign and refactoring of installation dialogs Redesign and refactoring of installation dialogs Jan 27, 2016
@ancorgs ancorgs added the blog label Jan 27, 2016
@jreidinger
Copy link
Member

hidden value in else is medium serious for me. another one is nitpick. so almost LGTM 😉

@kobliha
Copy link
Member

kobliha commented Jan 28, 2016

I have one little nitpicking: The dialog title is "Local Users" even if there is nothing to import and thus you can create just one "Local User". So, either I'd like to have it different dependent on this fact or just "Local User" (one).

@jreidinger
Copy link
Member

for me LGTM

@kobliha
Copy link
Member

kobliha commented Jan 28, 2016

LGTM, thanks for the changes!

ancorgs added a commit that referenced this pull request Jan 28, 2016
Redesign and refactoring of installation dialogs
@ancorgs ancorgs merged commit 6ed5c58 into yast:master Jan 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants