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

Uncrispify AccountForm in useradmin #3168

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

johannaengland
Copy link
Contributor

@johannaengland johannaengland commented Nov 7, 2024

Closes #3135.

This is quite a bit more complicated of a refactor. So I would suggest reading it commit by commit.

The form can look four different ways:

  1. Creating a new user: login, name, password fields are empty and read&write, submit field says "Create account"
  2. The default user - only the name can be changed, login and password fields are greyed out/read-only
  3. Normal user - similar to a new user, all fields are read&write, but have current information in them when loading and submit field says "Save changes
  4. Externally managed user (e.g. ldap) - only login and name are visible, but login read-only, has an additional blue info box "External authenticator: {{ authenticator }}"

Urls (when using a dump of the sikt-vk):
http://localhost/useradmin/account/new/ (1. New user)
http://localhost/useradmin/account/0/ (2. Default user)
http://localhost/useradmin/account/1/ (3. Normal user)
http://localhost/useradmin/account/1093/ (4. External user)

As already in the code suggested I split these forms up into two different forms: AccountForm for use cases 1-3 and ExternalAccountForm for use case 4.

@podliashanyk and I made the decision to move the blue "External authenticator" box to the top of the fieldset, that made it much easier to override the template and makes it look more cohesive

Screenshots of that change:
Previously:
IMG_20241107_121309

Now:
IMG_20241107_121341

Copy link

github-actions bot commented Nov 7, 2024

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ PYTHON black 992 0 11.38s
✅ PYTHON ruff 987 0 0.1s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

@johannaengland johannaengland force-pushed the refactor/uncrispify-account-form-useradmin branch from f39d574 to 4d3a367 Compare November 7, 2024 11:28
Copy link

github-actions bot commented Nov 7, 2024

Test results

    9 files      9 suites   8m 51s ⏱️
2 138 tests 2 138 ✅ 0 💤 0 ❌
4 015 runs  4 015 ✅ 0 💤 0 ❌

Results for commit 4d8eea0.

♻️ This comment has been updated with latest results.

Copy link

codecov bot commented Nov 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.38%. Comparing base (3f0faab) to head (4d8eea0).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3168      +/-   ##
==========================================
- Coverage   60.39%   60.38%   -0.02%     
==========================================
  Files         605      605              
  Lines       43704    43699       -5     
  Branches       48       48              
==========================================
- Hits        26396    26388       -8     
- Misses      17296    17299       +3     
  Partials       12       12              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

External means managed by ldap for example and internal is a user made by nav
The information box about externally managed accounts is moved into HTML templates
@johannaengland johannaengland force-pushed the refactor/uncrispify-account-form-useradmin branch from bf39719 to 4d8eea0 Compare November 13, 2024 08:28
Copy link

sonarcloud bot commented Nov 13, 2024

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.

Uncrispify AccountForm in useradmin
1 participant