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 Layout and basic code to native sign-up #3737

Open
wants to merge 15 commits into
base: develop
Choose a base branch
from

Conversation

mrudultora
Copy link
Contributor

@mrudultora mrudultora commented Jan 15, 2021

Description

• Created SignupActivity
• Added basic code to SignupActivity.kt and completed layout of SignupActivity
• Added related strings in strings.xml

Related issues

Related PRs

Screenshots

img

@teolemon
Copy link
Member

We should probably have some consent for the TOS and the Open Food Facts newsletter, and possibly support for teams ?

@teolemon teolemon linked an issue Jan 15, 2021 that may be closed by this pull request
@mrudultora
Copy link
Contributor Author

mrudultora commented Jan 15, 2021

Should I add 3 chekbox (each for TOS, newsletter and Professional Account) and one Edittext for Team (optional) ?

@teolemon
Copy link
Member

@mrudultora let's see how it looks like
TOS: https://world.openfoodfacts.org/terms-of-use

@teolemon
Copy link
Member

teolemon commented Jan 21, 2021

  • I agree to the Open Food Facts terms of use and contribution.
  • I am a food producer.
  • I'd like to subscribe to the Open Food Facts newsletter (Note: You can unsubscribe from it at any time).

@mrudultora
Copy link
Contributor Author

mrudultora commented Jan 22, 2021

@teolemon How's this ?

img

@teolemon
Copy link
Member

@stephanegigandet ? @VaiTon ? What do you think ?
I would rename "Name" into "Display Name", and mention that the username cannot contain spaces, caps or special characters.

@mrudultora
Copy link
Contributor Author

@teolemon In which direction shall I proceed now ?

@mrudultora
Copy link
Contributor Author

@teolemon Is there any minimum length fixed for username ?

@mrudultora
Copy link
Contributor Author

@teolemon I have made the changes and added a regex check for username. Also mentioned in the layout about the conditions for username. And changed the strings accordingly.

img

@teolemon
Copy link
Member

@stephanegigandet should we ask for the organisation name if the producer box is ticked

@mrudultora
Copy link
Contributor Author

@teolemon Any Updates ?

@teolemon
Copy link
Member

teolemon commented Feb 5, 2021

Let's add it, since it's in the web form https://world.pro.openfoodfacts.org/cgi/user.pl
image

@mrudultora
Copy link
Contributor Author

@teolemon Added. Producer or Brand name textInputEditText will be visible when food producer checkbox is ticked and hides when that checkbox is unticked.
Also, will you please provide me the drawables for username, food producer, email. I will replace them in textInputEditText.

img

@teolemon teolemon force-pushed the NativeSignupDraftPR branch from 9527cdc to 10adf03 Compare February 10, 2021 18:57
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@mrudultora
Copy link
Contributor Author

Now, I guess just small part is remaining. So, please provide me the url of API for signup so that this native signup is implemented soon. @teolemon @VaiTon

@teolemon teolemon changed the title Added Layout and basic code to native sign-up feat: Added Layout and basic code to native sign-up Feb 27, 2021
@teolemon teolemon removed the request for review from stephanegigandet April 18, 2021 17:55
@teolemon teolemon marked this pull request as ready for review April 18, 2021 17:55
@teolemon teolemon marked this pull request as draft April 18, 2021 17:57
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 1 Security Hotspot
Code Smell A 3 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@teolemon
Copy link
Member

teolemon commented Apr 23, 2021

HTTP POST
Endpoint: https://world.openfoodfacts.org/cgi/user.pl
Encode: multipart/form-data
Fields:

  • name - name
  • email - email address
  • userid - user name (non-accented letters, digits and/or dashes) (Add a normalizing function):
  • password
  • confirm_password - confirm password

Professional account
If you work for a producer or brand and will add or complete data for your own products only, you can get access to our completely free Platform for Producers.
The platform for producers allows manufacturers to easily import data and photos for all their products, to mark them as official, and to get free analysis of improvement opportunities for their products.

<input type="checkbox" id="pro" name="pro" checked="">
<input type="hidden" name="pro_checkbox" value="1"> This is a producer or brand account.

Additional fields:

  • requested_org - producer or brand
    Please enter the name of your organization (company name or brand).
  • newsletter=on or nothing
    Subscribe to the newsletter (2 emails per month maximum)
    You can unsubscribe from the lists at any time.
  • action=process (Hidden)
  • type=add (Hidden)
<input type="submit" name=".submit" class="button">

@VaiTon
Copy link
Member

VaiTon commented Apr 28, 2021

action=process (Hidden)
type=add (Hidden)

Are these mandatory for every account or only for producer accounts?

@teolemon
Copy link
Member

teolemon commented May 8, 2021

@VaiTon I believe that kind of thing is for all accounts. It's something @stephanegigandet adds frequently to his forms

@teolemon teolemon marked this pull request as ready for review June 20, 2021 14:38
@teolemon
Copy link
Member

@mrudultora fixed the merge conflicts and rebased

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 1 Security Hotspot
Code Smell A 3 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@teolemon
Copy link
Member

@mrudultora @VaiTon fixed the merge conflicts and rebased

@teolemon
Copy link
Member

rebased @mrudultora @VaiTon Can we go the simple route, and use the current url to send the form ?
https://world.openfoodfacts.org/cgi/user.pl

@teolemon teolemon mentioned this pull request Aug 29, 2021
4 tasks
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 1 Security Hotspot
Code Smell A 2 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 1 Security Hotspot
Code Smell A 2 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@teolemon
Copy link
Member

teolemon commented Dec 26, 2021

i've rebased on latest develop, but this PR currently doesn't use databinding. As a result:

Execution failed for task ':app:mergeOffPlaystoreScreenshotsResources'.
> /home/runner/work/openfoodfacts-androidapp/openfoodfacts-androidapp/app/src/main/res/layout/activity_signup.xml: Error: ERROR: Found <layout> but data binding is not enabled.
  
  Add buildFeatures.dataBinding = true to your build.gradle to enable it. file:///home/runner/work/openfoodfacts-androidapp/openfoodfacts-androidapp/app/src/main/res/layout/activity_signup.xml

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 1 Security Hotspot
Code Smell A 2 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make the signup process native
3 participants