[op-18418] Sign up errors are showing behind new account creation modal#24306
[op-18418] Sign up errors are showing behind new account creation modal#24306bsatarnejad wants to merge 13 commits into
Conversation
|
Warning Flaky specs
🤖 Ask Copilot to investigateCopy the prompt below into a new comment on this PR to delegate the investigation to GitHub Copilot. It will look into the flakiness and open a separate pull request with you as reviewer. |
HDinger
left a comment
There was a problem hiding this comment.
This might work, but feels somehow cumbersome to remember the error by hand and then render it in the modal. Further, it will be obsolete as soon as we migrate the page to Primer.. Maybe I am missing something here, but I see no reason that this needs to be in Angular. Also, I don't think that this have to be a dialog.
Imho, it would be best to migrate the form to a primer form, get rid of the dialog and just render the form. We can still center the form if desired.
65e3882 to
86f4697
Compare
registration modal instead of using the page-level flash area.
83fca9f to
f621a0b
Compare
|
Warning Flaky specs
🤖 Ask Copilot to investigateCopy the prompt below into a new comment on this PR to delegate the investigation to GitHub Copilot. It will look into the flakiness and open a separate pull request with you as reviewer. |
|
Warning Flaky specs
🤖 Ask Copilot to investigateCopy the prompt below into a new comment on this PR to delegate the investigation to GitHub Copilot. It will look into the flakiness and open a separate pull request with you as reviewer. |
HDinger
left a comment
There was a problem hiding this comment.
I think the error handling is the biggest issue here at the moment.. It feels like you are overcomplicating it a bit and in the final result is somehow confusing in code as well as in the final UI.
| class Account::LostPasswordForm < ApplicationForm | ||
| form do |form| | ||
| form.text_field( | ||
| name: :mail, |
There was a problem hiding this comment.
| name: :mail, | |
| name: :mail, | |
| type: :email |
| label: User.human_attribute_name(:new_password), | ||
| type: :password, | ||
| required: true, | ||
| autocomplete: "off", |
There was a problem hiding this comment.
| autocomplete: "off", | |
| autocomplete: "new-password", |
| label: User.human_attribute_name(:password_confirmation), | ||
| type: :password, | ||
| required: true, | ||
| autocomplete: "off", |
There was a problem hiding this comment.
| autocomplete: "off", | |
| autocomplete: "current-password", |
There was a problem hiding this comment.
I was intruiged to learn about these fancy new autocomplete attributes ("new" refers to "new to me").
However, I found it confusing that the password recovery form would have autocompletion for the "current password". Are you sure this is correct?
According to MDN (I didn't dig deeper than that):
- new-password
- A new password. When creating a new account or changing passwords, this should be used for an "Enter your new password" or "Confirm new password" field, as opposed to a general "Enter your current password" field that might be present. This may be used by the browser both to avoid accidentally filling in an existing password and to offer assistance in creating a secure password.
- current-password
- The user's current password.
| @@ -0,0 +1,13 @@ | |||
| # frozen_string_literal: true | |||
There was a problem hiding this comment.
The copyright header is missing
| @@ -0,0 +1,27 @@ | |||
| # frozen_string_literal: true | |||
|
|
|||
There was a problem hiding this comment.
The copyright header is missing
| ++#%> | ||
| <% html_title t(:label_password_lost) %> | ||
|
|
||
| <%= error_messages_for @user if @user&.errors&.any? %> |
There was a problem hiding this comment.
Instead of rendering the errors manually, you sould show them inline in the form. Therefore you need to set the model to the form which should be initialized on GET and not only when there is an error
| helpers.format_text(helpers.user_consent_instructions(I18n.locale), target: "_blank") | ||
| end | ||
| form.check_box(name: :consent_check, | ||
| scope_name_to_model: false, |
There was a problem hiding this comment.
Why is scope to model false? If i submit a form with errors, the checkbox is not checked any more as it has lost the connection to the model.
| <%= error_messages_for :user %> | ||
|
|
||
| <%= primer_form_with( | ||
| model: @user, | ||
| url: account_register_path, | ||
| id: "new_user", | ||
| data: { turbo: false, test_selector: "registration-form" } |
| invite: Meghívás | ||
| message: | ||
| description: Küldünk egy e-mailt a %{principal} címre, amelyhez itt hozzáadhat egy személyes üzenetet. Hasznos lehet egy magyarázat a meghívóhoz, vagy esetleg egy kis információ a projekttel kapcsolatban, hogy segítsen az elindulásban. | ||
| description: Küldünk egy e-mailt a felhasználónak, amelyhez itt hozzáadhat egy személyes üzenetet. Hasznos lehet egy magyarázat a meghívóhoz, vagy esetleg egy kis információ a projekttel kapcsolatban, hogy segítsen az elindulásban. |
There was a problem hiding this comment.
Crowdin strings should never be fixed in code as they get overwritten with the next update. The issue has been fixed by now on the base branch. So I suggest you revert this commit
| return true unless user_consent_required? | ||
| return true if consent_param? | ||
|
|
||
| user.errors.add(:base, I18n.t("consent.failure_message")) |
There was a problem hiding this comment.
Why do you add the error to base and not to the field directly?
|
Since this has bigger dimension by now, I'd suggest we move it 17.8. Wdyt? |
Agree, it is more than a bug fix effort. |
…ehind-new-account-creation-modal
| wclass = local_assigns[:wide] ? "wide" : "" | ||
| %> | ||
| <% if auth_provider_html.strip != '' %> | ||
| <% if auth_provider_html.to_s.match?(/auth-provider/) %> |
There was a problem hiding this comment.
This is very surprising. I guess this is the fix/workaround for showing the "or login via" line even when no providers are available.
Do you have an explanation for why this new check works and the old one didn't? It looks even more like a hack now than it looked before 🙈

Ticket
https://community.openproject.org/wp/OP-18418
Screenshots
What approach did you choose and why?