-
Notifications
You must be signed in to change notification settings - Fork 6
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
[#2036] Add tab-design for login page #992
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #992 +/- ##
========================================
Coverage 95.07% 95.07%
========================================
Files 955 955
Lines 33961 33961
========================================
Hits 32288 32288
Misses 1673 1673 ☔ View full report in Codecov by Sentry. |
33c8fac
to
1193387
Compare
7fa8ef6
to
2c7ac45
Compare
8cde779
to
d838919
Compare
c043537
to
5477090
Compare
Note: I tried fixing the tests but I'm not sure if we cover every login option (there are quite a few combinations of digid, eherkenning and admin with and without OIDC, plus the regular email login). For each case we need to test multiple situation (new user, updating user, existing email etc) but they get lost in boilerplate. |
6511d6c
to
d533c65
Compare
acaae89
to
f774cab
Compare
54ab64a
to
c81eca4
Compare
be49c34
to
6c89004
Compare
b86d6f5
to
dfd16d9
Compare
'.tab__header[href="/accounts/login/#particulier"]' | ||
) | ||
const zakelijkLink = document.querySelector( | ||
'.tab__header[href="/accounts/login/#zakelijk"]' |
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.
Feedback for later: Django URL's are technically dynamic so we don't want hardcoded URL's in the Javascript (or HTML, CSS etc). This is why there are {% url "xyz" %}
and {% static 'xyz' %}
in the templates (to reverse()
the URLs from whatever is in the urls.py's).
So these Link selectors should be different and not use the href=, but a class or id (possibly chain a .querySelector()
from the Tab elements you grab by ID just below)
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.
OK, @Bartvaderkin I will have to create new id's/selectors here because the tabs are not inside those panels-with-id's;
they are elsewhere in the HTML structure.
const loginformFocuses = document.querySelectorAll(LoginFormFocus.selector) | ||
;[...loginformFocuses].forEach((element) => new LoginFormFocus(element)) |
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.
Feedback for later: The queryselector has a forEach() so you can just chain from that:
document.querySelectorAll(LoginFormFocus.selector).forEach((element) => new LoginFormFocus(element))
const tabpanels = document.querySelectorAll(TabPanel.selector) | ||
;[...tabpanels].forEach((tabpanel) => new TabPanel(tabpanel)) |
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.
😉
window.addEventListener('load', () => { | ||
const hash = window.location.hash | ||
if (hash) { | ||
const tabHeader = document.querySelector(`.tab__header[href="${hash}"]`) |
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 doesn't work as the tabs have the path AND a hash as href now.
And in general I feel it is better to not select on href like this because it often has these issues with unexpected dependencies here or there. (see also the earlier note about LoginForm.js)
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 appended some fixes to the urls in login.html (the next url wasn't applied to both the text and icon url, and some urls were hardcoded).
I also added some comments for later (most just code style, one possible issue but it is not an important feature and doesn't seem to come up in normal use).
I also checked the conditionals so I think this is good to go for acceptance.
issue: https://taiga.maykinmedia.nl/project/open-inwoner/task/2036
Differs a bit in design from the tab we have in 'Mijn uitkeringen'
Log in options are now split in multiple tabs (but Login URL stays the same):
https://www.figma.com/file/iKGhWhstaLIlFSaND2q7cE/OIP---Designs-(new)?type=design&node-id=270-6788&mode=design&t=DpALupfBX7lYWPsm-0
Clicking on "Log in met e-mail adres" will show the hidden log-in form.
Direct link from the outside for business users is "
.../accounts/login/#zakelijk
" because the leading slash indicates the root of the URL path, and the hash anchor is appended to it.Also added two new views:- http://localhost:8000/accounts/login-business/- http://localhost:8000/accounts/login-email/Removed urls/views again.