Tuleap 40 register
Merge request reports
Activity
requested review from @csimiand
assigned to @Sebastien
This merge request references: TULEAP-40.
added 15 commits
-
1adf4820...14f74419 - 4 commits from branch
main
- 06499ed2 - Create simple user entity
- e6acd9ac - Migration for simple user
- eef8cbcf - set User compatible to the production database
- a30313b4 - Add View and controllers for user registration
- a0d47256 - Add webpack-encore for symfony project
- c9b538e8 - restore lost dependencies webpack and verify-email
- c2e76d83 - Add page mail sent on post registration
- e78925ac - Add image support on assets
- a864d2dd - Reorganise bootstrap SASS configuration
- 9dd5faf4 - On mail verification success redirection on login page + message
- 610d07fb - Add user story application test
Toggle commit list-
1adf4820...14f74419 - 4 commits from branch
- Resolved by Camille Simiand
- Resolved by Camille Simiand
- Resolved by Camille Simiand
- src/Form/RegistrationFormType.php 0 → 100644
14 use Symfony\Component\OptionsResolver\OptionsResolver; 15 use Symfony\Component\Validator\Constraints\IsTrue; 16 use Symfony\Component\Validator\Constraints\Length; 17 use Symfony\Component\Validator\Constraints\NotBlank; 18 use Symfony\Component\DependencyInjection\Loader\Configurator; 19 20 class RegistrationFormType extends AbstractType 21 { 22 private string $byPass; 23 public function __construct(string $byPass){ 24 $this->byPass = $byPass; 25 } 26 27 public function buildForm(FormBuilderInterface $builder, array $options): void 28 { 29 $row_attr = ['class' => 'form-group d-flex flex-column m-auto mb-4 col-6',]; IMO, keeping in mind good development practices, we should aim to a straight separation between logic and style.
Following the official documentation, here we could use twig configuration to customize form: https://symfony.com/doc/current/form/form_customization.html
What do you think ?
I'm not 100% sure but I think it can be quick if you can reuse the bootstrap theme or the symfony built-in form theme:
Ok, I saw it but I still can't get why can't you add class attributes directly in
registration.html.twig
instead of passing it as a variable in this controller.Example:
{{ form_start(registrationForm) }} <div class="form-group d-flex flex-column m-auto mb-4 col-6"> <div> {{ form_row(registrationForm.firstName) }} </div> <div> {{ form_row(registrationForm.lastName) }} </div> <div> {{ form_row(registrationForm.email) }} </div> </div> {{ form_end(registrationForm) }}
The following solution theoretically works (https://symfony.com/doc/current/form/form_customization.html#form-variables-reference) but, I've tried it, in practice it doesn't work.
{{ form_start(registrationForm, {'attr': {'class': 'd-flex flex-column justify-content-center'}}) }} {{ form_row(registrationForm.firstName, {'attr': {'class' : 'form-group d-flex flex-column m-auto mb-4 col-6'}}) }} {{ form_row(registrationForm.lastName, {'attr': {'class' : 'form-group d-flex flex-column m-auto mb-4 col-6'}}) }} {{ form_row(registrationForm.email, {'attr': {'class' : 'form-group d-flex flex-column m-auto mb-4 col-6'}}) }} {{ form_row(registrationForm.submit, {'attr': {'class' : 'form-group d-flex flex-column m-auto mb-4 col-6'}}) }} {{ form_end(registrationForm) }}
changed this line in version 8 of the diff
- Resolved by Camille Simiand
- templates/registration.base.html.twig 0 → 100644
4 <meta charset="UTF-8"> 5 <title>{% block title %}MemoRekall{% endblock %}</title> 6 {# Run `composer require symfony/webpack-encore-bundle` 7 and uncomment the following Encore helpers to start using Symfony UX #} 8 {% block stylesheets %} 9 {{ encore_entry_link_tags('app') }} 10 {% endblock %} 11 12 {% block javascripts %} 13 {{ encore_entry_script_tags('app') }} 14 {% endblock %} 15 </head> 16 <body class="container"> 17 <div class="d-flex flex-row justify-content-center mb-5"> 18 <div class="d-flex flex-column"> 19 <a href="/my_capsules"><img id="header-memorekall-logo" class="memorekall-logo" src="{{ asset('build/images/MemoRekall.png') }}"></a> Nope : the aim of this US associated to this MR is not login. But only register.
In the current branch, on login you get an exception, it won't be testable.
I put in the tuleap-45-login MR to remember this discussion.
Edited by Sebastienchanged this line in version 6 of the diff
I understand what you're saying but I am not completely convinced. IMO, we shouldn't introduce a broken feature: clicking on MemoRekall logo from
/register
is currently broken.I suggest to redirect to
/home
for this MR (it will be updated later with "login" feature MR) where we will see only:- the logo
- the login button
- the register button
- no forms displayed
--> What do you think about creating this new page inside this MR?
- templates/registration.base.html.twig 0 → 100644
1 <!DOCTYPE html> changed this line in version 6 of the diff
- templates/registration.base.html.twig 0 → 100644
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="UTF-8"> 5 <title>{% block title %}MemoRekall{% endblock %}</title> 6 {# Run `composer require symfony/webpack-encore-bundle` 7 and uncomment the following Encore helpers to start using Symfony UX #} 8 {% block stylesheets %} 9 {{ encore_entry_link_tags('app') }} 10 {% endblock %} 11 12 {% block javascripts %} 13 {{ encore_entry_script_tags('app') }} 14 {% endblock %} 15 </head> 16 <body class="container"> changed this line in version 6 of the diff
- Resolved by Camille Simiand
4 4 SYMFONY_DEPRECATIONS_HELPER=999999 5 5 PANTHER_APP_ENV=panther 6 6 PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots 7 8 DATABASE_URL="mysql://rekallfrwsmember:sm4SyZVPu6wpjZfg@mysql:3306/rekallfrwsmember?serverVersion=5.6&charset=utf8" 9 BY_PASS_CODE=ed156b9188ecddf0c556d5712f0a84cc changed this line in version 7 of the diff
- src/Controller/RegistrationController.php 0 → 100644
- src/Controller/SecurityController.php 0 → 100644
- src/Entity/User.php 0 → 100644
- src/Form/RegistrationFormType.php 0 → 100644