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

bug: fix missing error message if a label can't be deleted #363

Open
JannikStreek opened this issue Sep 25, 2024 · 0 comments
Open

bug: fix missing error message if a label can't be deleted #363

JannikStreek opened this issue Sep 25, 2024 · 0 comments
Labels
type-bug Something isn't working

Comments

@JannikStreek
Copy link
Member

JannikStreek commented Sep 25, 2024

Further Notes

If a label is used by an idea, it can't be deleted (that is correct). But an error should appear, which doesn't work right now.

Bildschirmfoto 2024-09-25 um 17 03 44

The error is available in the f_label variable inside the .form_for component but it is currently not shown.

Old code: https://github.com/b310-digital/mindwendel/blob/88f7f2d56fce903525d40f82ba262ac3f0d114ab/lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex#L158C15-L168C24

Please also see the commented test: test/mindwendel_web/live/admin/brainstorming_live/edit_test.exs:125

Update: I tried to display the error with:

  <.error :for={msg <- Enum.map(f_label[:idea_idea_labels].errors, &translate_error(&1))}>
    <%= msg %>
  </.error>

The error then appears in html. However, it is assigned the invalid-feedback class and therefore hidden.

See also phoenixframework/phoenix_live_view@ed9268a

Possible related to #362

@JannikStreek JannikStreek added the type-bug Something isn't working label Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant