Skip to content

Commit

Permalink
fix modal close bug
Browse files Browse the repository at this point in the history
  • Loading branch information
JannikStreek committed Dec 19, 2024
1 parent d996916 commit 87bbef8
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 43 deletions.
2 changes: 2 additions & 0 deletions lib/mindwendel_web/components/core_components.ex
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ defmodule MindwendelWeb.CoreComponents do
"""
attr :id, :string, required: true
attr :title, :string, required: false
attr :phx_update, :string, default: "replace"
attr :show, :boolean, default: false
attr :on_cancel, JS, default: %JS{}
slot :inner_block, required: true
Expand All @@ -53,6 +54,7 @@ defmodule MindwendelWeb.CoreComponents do
tabindex="-1"
aria-hidden="true"
aria-labelledby="{@id}-title"
phx-update={@phx_update}
>
<div class="modal-dialog modal-lg">
<div class="modal-content">
Expand Down
2 changes: 2 additions & 0 deletions lib/mindwendel_web/live/brainstorming_live/show.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,14 @@
show
on_cancel={JS.patch(~p"/brainstormings/#{@brainstorming.id}")}
title={gettext("New idea")}
phx_update="ignore"
>
<.live_component
module={MindwendelWeb.IdeaLive.FormComponent}
id={:new}
action={:new}
brainstorming={@brainstorming}
filtered_labels={@filtered_labels}
current_user={@current_user}
idea={@idea}
/>
Expand Down
2 changes: 1 addition & 1 deletion lib/mindwendel_web/live/idea_live/form_component.ex
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ defmodule MindwendelWeb.IdeaLive.FormComponent do
|> Map.put("user_id", socket.assigns.current_user.id)
|> Map.put(
"idea_labels",
IdeaLabels.get_idea_labels(socket.assigns.brainstorming.filter_labels_ids)
IdeaLabels.get_idea_labels(socket.assigns.filtered_labels)
)
|> Map.put("tmp_attachments", tmp_attachments)

Expand Down
28 changes: 14 additions & 14 deletions priv/gettext/de/LC_MESSAGES/default.po
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ msgstr "Mindwendel Brainstorming"
msgid "Share"
msgstr "Teilen"

#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:176
#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:178
#, elixir-autogen, elixir-format
msgid "Share brainstorming"
msgstr "Teile Dein Brainstorming"
Expand All @@ -278,7 +278,7 @@ msgstr "Download als SVG"
msgid "Brainstorming delete are you sure"
msgstr "Bist du sicher, dass das Brainstorming gelöscht werden soll?"

#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:143
#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:145
#, elixir-autogen, elixir-format
msgid "Update idea"
msgstr "Idee bearbeiten"
Expand Down Expand Up @@ -319,43 +319,43 @@ msgstr "Nutzern das Verschieben und Sortieren von Ideen erlauben"
msgid "Back"
msgstr "Zurück"

#: lib/mindwendel_web/components/core_components.ex:528
#: lib/mindwendel_web/components/core_components.ex:530
#, elixir-autogen, elixir-format
msgid "Actions"
msgstr ""

#: lib/mindwendel_web/components/core_components.ex:156
#: lib/mindwendel_web/components/core_components.ex:158
#, elixir-autogen, elixir-format
msgid "Attempting to reconnect"
msgstr ""

#: lib/mindwendel_web/components/core_components.ex:147
#: lib/mindwendel_web/components/core_components.ex:149
#, elixir-autogen, elixir-format
msgid "Error!"
msgstr ""

#: lib/mindwendel_web/components/core_components.ex:168
#: lib/mindwendel_web/components/core_components.ex:170
#, elixir-autogen, elixir-format
msgid "Hang in there while we get back on track"
msgstr ""

#: lib/mindwendel_web/components/core_components.ex:163
#: lib/mindwendel_web/components/core_components.ex:165
#, elixir-autogen, elixir-format
msgid "Something went wrong!"
msgstr ""

#: lib/mindwendel_web/components/core_components.ex:146
#: lib/mindwendel_web/components/core_components.ex:148
#, elixir-autogen, elixir-format
msgid "Success!"
msgstr ""

#: lib/mindwendel_web/components/core_components.ex:151
#: lib/mindwendel_web/components/core_components.ex:153
#, elixir-autogen, elixir-format
msgid "We can't find the internet"
msgstr ""

#: lib/mindwendel_web/components/core_components.ex:71
#: lib/mindwendel_web/components/core_components.ex:126
#: lib/mindwendel_web/components/core_components.ex:73
#: lib/mindwendel_web/components/core_components.ex:128
#, elixir-autogen, elixir-format, fuzzy
msgid "close"
msgstr "Schließen"
Expand Down Expand Up @@ -402,13 +402,13 @@ msgstr "Name"

#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:37
#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:39
#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:126
#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:128
#: lib/mindwendel_web/live/lane_live/index_component.html.heex:130
#, elixir-autogen, elixir-format
msgid "New lane"
msgstr "Neue Spalte"

#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:160
#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:162
#, elixir-autogen, elixir-format, fuzzy
msgid "Update lane"
msgstr "Spalte bearbeiten"
Expand Down Expand Up @@ -553,7 +553,7 @@ msgstr "Impressum"
msgid "Privacy"
msgstr "Datenschutzerklärung"

#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:109
#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:111
#, elixir-autogen, elixir-format
msgid "Idea details"
msgstr "Detailansicht"
Expand Down
28 changes: 14 additions & 14 deletions priv/gettext/default.pot
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ msgstr ""
msgid "Share"
msgstr ""

#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:176
#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:178
#, elixir-autogen, elixir-format
msgid "Share brainstorming"
msgstr ""
Expand All @@ -277,7 +277,7 @@ msgstr ""
msgid "Brainstorming delete are you sure"
msgstr ""

#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:143
#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:145
#, elixir-autogen, elixir-format
msgid "Update idea"
msgstr ""
Expand Down Expand Up @@ -318,43 +318,43 @@ msgstr ""
msgid "Back"
msgstr ""

#: lib/mindwendel_web/components/core_components.ex:528
#: lib/mindwendel_web/components/core_components.ex:530
#, elixir-autogen, elixir-format
msgid "Actions"
msgstr ""

#: lib/mindwendel_web/components/core_components.ex:156
#: lib/mindwendel_web/components/core_components.ex:158
#, elixir-autogen, elixir-format
msgid "Attempting to reconnect"
msgstr ""

#: lib/mindwendel_web/components/core_components.ex:147
#: lib/mindwendel_web/components/core_components.ex:149
#, elixir-autogen, elixir-format
msgid "Error!"
msgstr ""

#: lib/mindwendel_web/components/core_components.ex:168
#: lib/mindwendel_web/components/core_components.ex:170
#, elixir-autogen, elixir-format
msgid "Hang in there while we get back on track"
msgstr ""

#: lib/mindwendel_web/components/core_components.ex:163
#: lib/mindwendel_web/components/core_components.ex:165
#, elixir-autogen, elixir-format
msgid "Something went wrong!"
msgstr ""

#: lib/mindwendel_web/components/core_components.ex:146
#: lib/mindwendel_web/components/core_components.ex:148
#, elixir-autogen, elixir-format
msgid "Success!"
msgstr ""

#: lib/mindwendel_web/components/core_components.ex:151
#: lib/mindwendel_web/components/core_components.ex:153
#, elixir-autogen, elixir-format
msgid "We can't find the internet"
msgstr ""

#: lib/mindwendel_web/components/core_components.ex:71
#: lib/mindwendel_web/components/core_components.ex:126
#: lib/mindwendel_web/components/core_components.ex:73
#: lib/mindwendel_web/components/core_components.ex:128
#, elixir-autogen, elixir-format
msgid "close"
msgstr ""
Expand Down Expand Up @@ -401,13 +401,13 @@ msgstr ""

#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:37
#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:39
#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:126
#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:128
#: lib/mindwendel_web/live/lane_live/index_component.html.heex:130
#, elixir-autogen, elixir-format
msgid "New lane"
msgstr ""

#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:160
#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:162
#, elixir-autogen, elixir-format
msgid "Update lane"
msgstr ""
Expand Down Expand Up @@ -552,7 +552,7 @@ msgstr ""
msgid "Privacy"
msgstr ""

#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:109
#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:111
#, elixir-autogen, elixir-format
msgid "Idea details"
msgstr ""
Expand Down
28 changes: 14 additions & 14 deletions priv/gettext/en/LC_MESSAGES/default.po
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ msgstr "Mindwendel Brainstorming"
msgid "Share"
msgstr "Share"

#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:176
#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:178
#, elixir-autogen, elixir-format
msgid "Share brainstorming"
msgstr "Share brainstorming"
Expand All @@ -278,7 +278,7 @@ msgstr "Download as svg"
msgid "Brainstorming delete are you sure"
msgstr "Are you sure that you want to delete this brainstorming?"

#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:143
#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:145
#, elixir-autogen, elixir-format
msgid "Update idea"
msgstr ""
Expand Down Expand Up @@ -319,43 +319,43 @@ msgstr "Allow users to change the order of ideas"
msgid "Back"
msgstr ""

#: lib/mindwendel_web/components/core_components.ex:528
#: lib/mindwendel_web/components/core_components.ex:530
#, elixir-autogen, elixir-format
msgid "Actions"
msgstr ""

#: lib/mindwendel_web/components/core_components.ex:156
#: lib/mindwendel_web/components/core_components.ex:158
#, elixir-autogen, elixir-format
msgid "Attempting to reconnect"
msgstr ""

#: lib/mindwendel_web/components/core_components.ex:147
#: lib/mindwendel_web/components/core_components.ex:149
#, elixir-autogen, elixir-format
msgid "Error!"
msgstr ""

#: lib/mindwendel_web/components/core_components.ex:168
#: lib/mindwendel_web/components/core_components.ex:170
#, elixir-autogen, elixir-format
msgid "Hang in there while we get back on track"
msgstr ""

#: lib/mindwendel_web/components/core_components.ex:163
#: lib/mindwendel_web/components/core_components.ex:165
#, elixir-autogen, elixir-format
msgid "Something went wrong!"
msgstr ""

#: lib/mindwendel_web/components/core_components.ex:146
#: lib/mindwendel_web/components/core_components.ex:148
#, elixir-autogen, elixir-format
msgid "Success!"
msgstr ""

#: lib/mindwendel_web/components/core_components.ex:151
#: lib/mindwendel_web/components/core_components.ex:153
#, elixir-autogen, elixir-format
msgid "We can't find the internet"
msgstr ""

#: lib/mindwendel_web/components/core_components.ex:71
#: lib/mindwendel_web/components/core_components.ex:126
#: lib/mindwendel_web/components/core_components.ex:73
#: lib/mindwendel_web/components/core_components.ex:128
#, elixir-autogen, elixir-format, fuzzy
msgid "close"
msgstr ""
Expand Down Expand Up @@ -402,13 +402,13 @@ msgstr ""

#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:37
#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:39
#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:126
#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:128
#: lib/mindwendel_web/live/lane_live/index_component.html.heex:130
#, elixir-autogen, elixir-format
msgid "New lane"
msgstr ""

#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:160
#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:162
#, elixir-autogen, elixir-format, fuzzy
msgid "Update lane"
msgstr ""
Expand Down Expand Up @@ -553,7 +553,7 @@ msgstr ""
msgid "Privacy"
msgstr ""

#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:109
#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:111
#, elixir-autogen, elixir-format
msgid "Idea details"
msgstr ""
Expand Down

0 comments on commit 87bbef8

Please sign in to comment.