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

[Zipcode] Validation à la création d'un User ou d'un Partner #597

Merged
merged 8 commits into from
Apr 30, 2021

Conversation

navidemad
Copy link
Collaborator

Ajout d'une validation de presence d'un code postale pour les adresse uniquement lors d'une création d'un utilisateur ou d'un centre, j'ai rajouté une validation pour être sûr d'avoir un code postale au minima dans l'adresse, ca nous assure entre guillemets qu'il est cliqué sur un des éléments proposé par Algolia ou bien quand Algolia est down d'avoir au minima le code postale. La page de confirmation des matchs passe comme c'est déjà le cas car c'est un update et pas un create

@codecov
Copy link

codecov bot commented Apr 26, 2021

Codecov Report

Merging #597 (a9e939e) into master (44463c3) will decrease coverage by 0.72%.
The diff coverage is 12.90%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #597      +/-   ##
==========================================
- Coverage   50.17%   49.44%   -0.73%     
==========================================
  Files          73       74       +1     
  Lines        1694     1719      +25     
==========================================
  Hits          850      850              
- Misses        844      869      +25     
Impacted Files Coverage Δ
app/models/user.rb 0.00% <0.00%> (ø)
app/validators/postal_address_validator.rb 0.00% <0.00%> (ø)
app/controllers/users_controller.rb 89.55% <75.00%> (-0.16%) ⬇️
app/models/vaccination_center.rb 63.29% <100.00%> (+0.47%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 44463c3...a9e939e. Read the comment docs.

@navidemad navidemad changed the title Valider l'adresse zipcode on create context only for User and Partner [Zipcode] Validation à la création d'un User ou d'un Partner Apr 26, 2021
@mathieuripert
Copy link
Member

⚠️ conflicts to resolve

@@ -78,7 +78,7 @@ def prepare_phone_number
end

def user_params
params.require(:user).permit(:email, :phone_number, :toc, :lat, :lon, :birthdate, :password, :statement)
params.require(:user).permit(:email, :phone_number, :toc, :address, :lat, :lon, :birthdate, :password, :statement)
Copy link
Member

Choose a reason for hiding this comment

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

+1

@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 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@mathieuripert mathieuripert merged commit 8b7581e into master Apr 30, 2021
@mathieuripert mathieuripert deleted the navidemad/validates-zipcode-address-on-create branch April 30, 2021 14:57
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.

Empêcher les partenaires d'ajouter un centre avec une addresse incomplète
2 participants