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

Make register/create patron form show and make email field optional #579

Conversation

spaceo
Copy link
Contributor

@spaceo spaceo commented Oct 6, 2023

In order to reflect what the purpose of the url actually is. Also use useEffect which is recommended best practise when fetching data in React components.

Link to issue

https://reload.atlassian.net/browse/DDFLSBP-121

Description

Rename loginUrl to userinfoUrl in order to reflect what the purpose of the url actually is. Also use useEffect which is recommended best practise when fetching data in React components.

Additional comments

We should have a talk with DDF how the user experience is in the user creation/update flows for logged in and anonymous users.

@spaceo spaceo force-pushed the DDFLSBP-121-brugeroprettelse-formular-vises-ikke-i-forbindelse-med-oprettelse branch 2 times, most recently from a1c8a40 to 08a7d58 Compare October 7, 2023 15:13
@spaceo spaceo changed the title Rename loginUrl to userinfoUrl Make register/create patron form show and make email field optional Oct 7, 2023
@spaceo spaceo force-pushed the DDFLSBP-121-brugeroprettelse-formular-vises-ikke-i-forbindelse-med-oprettelse branch 2 times, most recently from 15728c3 to 75e5c84 Compare October 7, 2023 18:03
@kasperbirch1 kasperbirch1 removed their assignment Oct 10, 2023
Copy link
Contributor

@kasperg kasperg left a comment

Choose a reason for hiding this comment

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

👍 some nice refactorings.

Please look into the multiple snapshot files before you merge.

I do not think the failing Cypress test has anything to do with the change at hand.

Comment on lines 58 to 62
<h2>Please Log ind..</h2>
<p>
When the flash message/info bar has been implemented, we will use it
here to tell the user to log in.
</p>
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider moving this to a // TODO comment.

Personally I appreciate the effort but am not too keen on this ending up in code that will reach the end user - even during testing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually at the latest meeting we talked about returning 403 in this case. So I will remove the whole thing in return of a comment about that agreement.

src/apps/create-patron-user-info/UserInfo.tsx Show resolved Hide resolved
In order to reflect what the purpose of the url actually is.
Also use useEffect which is recommended best practise when fetching data
in React components.
If the user token is not set the user should be asked to log in.
And add a test for wrapping the contact info depending on that the input
fields should be shown inline or not.
We should get the token in the apps in a unified manner not passing it
as a prop to the app
in contact info. Just to make things more clear.´
Maybe I am wrong but things seemed of and messed around.
This is my attempt to make things look more sensible.
I accidentally swapped the logic. It should be EMAIL that is required.
NOT PHONE.
The hosting application/site should handle this situation
@spaceo spaceo force-pushed the DDFLSBP-121-brugeroprettelse-formular-vises-ikke-i-forbindelse-med-oprettelse branch from 920a9a3 to 7a9a2bc Compare October 10, 2023 14:54
@spaceo spaceo merged commit f87dd9c into danskernesdigitalebibliotek:develop Oct 10, 2023
9 of 10 checks passed
@kasperg kasperg deleted the DDFLSBP-121-brugeroprettelse-formular-vises-ikke-i-forbindelse-med-oprettelse branch October 10, 2023 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants