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

feat: added deeplinking for the sign up page #4169 #5332

Merged
merged 7 commits into from
Jun 7, 2024

Conversation

jnnabugwu
Copy link
Contributor

@jnnabugwu jnnabugwu commented Jun 2, 2024

### What
Added deep linking for the sign-up page. Also, reset the users onboarding settings so that it shows them onboarding right after they sign up.

To test the screen before releasing it, a deep link is now available: https://fr.openfoodfacts.org/_signup/

Screenshot

8mb.video-BWs-td0VSE0s.mp4

Fixes bug(s)

  • Fixes:

Part of

### What
<!-- Added deep linking for the sign up page-->
- <!-- Changed x to achieve y -->
<!--
Please name your pull request following this scheme: `type: What you did` this allows us to automatically generate the changelog
Following `type`s are allowed:
  - `feat`, for Features
  - `fix`, for Bug Fixes
  - `docs`, for Documentation
  - `ci`, for Automation
  - `refactor`, for code Refactoring
  - `chore`, for Miscellaneous things
-->
### Screenshot
<!-- Insert a screenshot to provide visual record of your changes, if visible -->

### Fixes bug(s)
<!-- change by appropriate issues. -->
<!-- Please use a linking keyword https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword -->
- Fixes: <!-- openfoodfacts#1 Note: you can also use Closes: -->

### Part of
- openfoodfacts#525 <!-- Add the most granular issue possible -->
@jnnabugwu jnnabugwu requested a review from a team as a code owner June 2, 2024 17:09
@github-actions github-actions bot added the 👥 User management Account login, signup, signout label Jun 2, 2024
Copy link
Contributor Author

@jnnabugwu jnnabugwu left a comment

Choose a reason for hiding this comment

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

feat: Added deeplinking for sign up page & resest user preferences for onboarding once sign up is finished

@g123k
Copy link
Collaborator

g123k commented Jun 3, 2024

Thanks for your PR @jnnabugwu.
Be careful, the URL we wan to catch is fr.openfoodfacts.org/signup (w<ithout the underscore).

The idea in the app is to catch public URLs (eg: /signup) and redirect to internal pages (eg: /_signup)

@jnnabugwu
Copy link
Contributor Author

Thanks for your PR @jnnabugwu. Be careful, the URL we wan to catch is fr.openfoodfacts.org/signup (w<ithout the underscore).

The idea in the app is to catch public URLs (eg: /signup) and redirect to internal pages (eg: /_signup)

I'll fix this.

@jnnabugwu
Copy link
Contributor Author

Thanks for your PR @jnnabugwu. Be careful, the URL we wan to catch is fr.openfoodfacts.org/signup (w<ithout the underscore).

The idea in the app is to catch public URLs (eg: /signup) and redirect to internal pages (eg: /_signup)

Thanks for your PR @jnnabugwu. Be careful, the URL we wan to catch is fr.openfoodfacts.org/signup (w<ithout the underscore).

The idea in the app is to catch public URLs (eg: /signup) and redirect to internal pages (eg: /_signup)

Its fixed

Copy link
Collaborator

@g123k g123k left a comment

Choose a reason for hiding this comment

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

For the deep link, it now seems to be OK 👌
However storing preferences is unnecessary in this screen

@@ -46,8 +47,20 @@ class _SignUpPageState extends State<SignUpPage> with TraceableClientMixin {
bool _subscribe = false;
bool _disagreed = false;

late UserPreferences _userPreferences;
Copy link
Collaborator

Choose a reason for hiding this comment

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

UserPreferences is only used after a successful registration.
For all other scenarios, it's totally unnecessary.

Instead, you just need to access the preferences when you need it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

okay I see what you are saying

@override
void initState() {
super.initState();
getUserPreferences();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Be careful about formatting your code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you mean by this?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Launch the dartfmt command
https://docs.flutter.dev/tools/formatting

@@ -411,6 +425,8 @@ class _SignUpPageState extends State<SignUpPage> with TraceableClientMixin {
if (!mounted) {
return;
}
debugPrint('Reseting Onboarding');
_userPreferences.resetOnboarding();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just get the preferences here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do

@@ -411,6 +425,8 @@ class _SignUpPageState extends State<SignUpPage> with TraceableClientMixin {
if (!mounted) {
return;
}
debugPrint('Reseting Onboarding');
Copy link
Collaborator

Choose a reason for hiding this comment

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

For debugging purposes, you have our custom Log class

Copy link
Collaborator

@g123k g123k left a comment

Choose a reason for hiding this comment

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

That's OK for me, thanks for your contribution!

@teolemon teolemon merged commit 2e44edb into openfoodfacts:develop Jun 7, 2024
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👥 User management Account login, signup, signout
Development

Successfully merging this pull request may close these issues.

Add deep-link capture for Signup (https://world.openfoodfacts.org/cgi/user.pl)
3 participants