fix table component ids

This commit is contained in:
shibao 2023-05-12 21:50:23 -04:00
parent 49628cb9bb
commit 2179bd5d86
16 changed files with 76 additions and 63 deletions

View File

@ -1,3 +1,6 @@
# v0.10.0
- Code quality fixes
# v0.9.3
- Update dependencies
- Add pack lot number to search

View File

@ -89,7 +89,7 @@ defmodule CanneryWeb.Components.MovePackComponent do
<% else %>
<.live_component
module={CanneryWeb.Components.TableComponent}
id="move_pack_table"
id="move-pack-table"
columns={@columns}
rows={@rows}
/>

View File

@ -141,7 +141,12 @@ defmodule CanneryWeb.Components.PackTableComponent do
def render(assigns) do
~H"""
<div id={@id} class="w-full">
<.live_component module={TableComponent} id={"table-#{@id}"} columns={@columns} rows={@rows} />
<.live_component
module={TableComponent}
id={"pack-table-#{@id}"}
columns={@columns}
rows={@rows}
/>
</div>
"""
end

View File

@ -74,7 +74,7 @@ defmodule CanneryWeb.Components.ShotRecordTableComponent do
<div id={@id} class="w-full">
<.live_component
module={CanneryWeb.Components.TableComponent}
id={"table-#{@id}"}
id={"shot-record-table-#{@id}"}
columns={@columns}
rows={@rows}
initial_key={:date}

View File

@ -192,7 +192,12 @@ defmodule CanneryWeb.Components.TypeTableComponent do
def render(assigns) do
~H"""
<div id={@id} class="w-full">
<.live_component module={TableComponent} id={"table-#{@id}"} columns={@columns} rows={@rows} />
<.live_component
module={TableComponent}
id={"type-table-#{@id}"}
columns={@columns}
rows={@rows}
/>
</div>
"""
end

View File

@ -51,7 +51,7 @@
<%= if @view_table do %>
<.live_component
module={CanneryWeb.Components.ContainerTableComponent}
id="containers_index_table"
id="containers-index-table"
action={@live_action}
containers={@containers}
current_user={@current_user}

View File

@ -120,7 +120,7 @@
<%= if @view_table do %>
<.live_component
module={CanneryWeb.Components.PackTableComponent}
id="type-show-table"
id="pack-show-table"
packs={@packs}
current_user={@current_user}
show_used={false}

View File

@ -115,7 +115,7 @@
<.live_component
module={CanneryWeb.Components.TableComponent}
id="pack_shot_records_table"
id="pack-shot-records-table"
columns={@columns}
rows={@rows}
/>

View File

@ -122,7 +122,7 @@
<% else %>
<.live_component
module={CanneryWeb.Components.ShotRecordTableComponent}
id="shot_records_index_table"
id="shot-records-index-table"
shot_records={@shot_records}
current_user={@current_user}
>

View File

@ -74,7 +74,7 @@
<% else %>
<.live_component
module={CanneryWeb.Components.TypeTableComponent}
id="types_index_table"
id="types-index-table"
action={@live_action}
types={@types}
current_user={@current_user}

View File

@ -500,9 +500,9 @@ msgstr "Schießkladde"
#: lib/cannery_web/components/core_components/pack_card.html.heex:42
#: lib/cannery_web/components/core_components/pack_card.html.heex:47
#: lib/cannery_web/components/pack_table_component.ex:176
#: lib/cannery_web/components/pack_table_component.ex:259
#: lib/cannery_web/components/type_table_component.ex:260
#: lib/cannery_web/components/pack_table_component.ex:181
#: lib/cannery_web/components/pack_table_component.ex:264
#: lib/cannery_web/components/type_table_component.ex:265
#: lib/cannery_web/live/pack_live/show.html.heex:37
#: lib/cannery_web/live/pack_live/show.html.heex:42
#: lib/cannery_web/live/type_live/show.html.heex:150
@ -592,9 +592,9 @@ msgstr "Editiere %{name} Tags"
msgid "Rounds:"
msgstr "Patronen:"
#: lib/cannery_web/components/pack_table_component.ex:173
#: lib/cannery_web/components/pack_table_component.ex:255
#: lib/cannery_web/components/type_table_component.ex:259
#: lib/cannery_web/components/pack_table_component.ex:178
#: lib/cannery_web/components/pack_table_component.ex:260
#: lib/cannery_web/components/type_table_component.ex:264
#: lib/cannery_web/live/type_live/show.html.heex:154
#, elixir-autogen, elixir-format
msgid "No cost information"
@ -780,7 +780,7 @@ msgstr "Behälter"
msgid "Show used"
msgstr ""
#: lib/cannery_web/components/pack_table_component.ex:214
#: lib/cannery_web/components/pack_table_component.ex:219
#: lib/cannery_web/live/pack_live/show.html.heex:19
#, elixir-autogen, elixir-format
msgid "%{percentage}%"
@ -957,7 +957,7 @@ msgid "Average CPR"
msgstr ""
#: lib/cannery_web/components/core_components/pack_card.html.heex:17
#: lib/cannery_web/components/pack_table_component.ex:263
#: lib/cannery_web/components/pack_table_component.ex:268
#, elixir-autogen, elixir-format
msgid "Empty"
msgstr ""
@ -997,7 +997,7 @@ msgstr ""
msgid "Last used on:"
msgstr ""
#: lib/cannery_web/components/pack_table_component.ex:194
#: lib/cannery_web/components/pack_table_component.ex:199
#, elixir-autogen, elixir-format
msgid "Never used"
msgstr ""

View File

@ -494,9 +494,9 @@ msgstr ""
#: lib/cannery_web/components/core_components/pack_card.html.heex:42
#: lib/cannery_web/components/core_components/pack_card.html.heex:47
#: lib/cannery_web/components/pack_table_component.ex:176
#: lib/cannery_web/components/pack_table_component.ex:259
#: lib/cannery_web/components/type_table_component.ex:260
#: lib/cannery_web/components/pack_table_component.ex:181
#: lib/cannery_web/components/pack_table_component.ex:264
#: lib/cannery_web/components/type_table_component.ex:265
#: lib/cannery_web/live/pack_live/show.html.heex:37
#: lib/cannery_web/live/pack_live/show.html.heex:42
#: lib/cannery_web/live/type_live/show.html.heex:150
@ -586,9 +586,9 @@ msgstr ""
msgid "Rounds:"
msgstr ""
#: lib/cannery_web/components/pack_table_component.ex:173
#: lib/cannery_web/components/pack_table_component.ex:255
#: lib/cannery_web/components/type_table_component.ex:259
#: lib/cannery_web/components/pack_table_component.ex:178
#: lib/cannery_web/components/pack_table_component.ex:260
#: lib/cannery_web/components/type_table_component.ex:264
#: lib/cannery_web/live/type_live/show.html.heex:154
#, elixir-autogen, elixir-format
msgid "No cost information"
@ -774,7 +774,7 @@ msgstr ""
msgid "Show used"
msgstr ""
#: lib/cannery_web/components/pack_table_component.ex:214
#: lib/cannery_web/components/pack_table_component.ex:219
#: lib/cannery_web/live/pack_live/show.html.heex:19
#, elixir-autogen, elixir-format
msgid "%{percentage}%"
@ -951,7 +951,7 @@ msgid "Average CPR"
msgstr ""
#: lib/cannery_web/components/core_components/pack_card.html.heex:17
#: lib/cannery_web/components/pack_table_component.ex:263
#: lib/cannery_web/components/pack_table_component.ex:268
#, elixir-autogen, elixir-format
msgid "Empty"
msgstr ""
@ -991,7 +991,7 @@ msgstr ""
msgid "Last used on:"
msgstr ""
#: lib/cannery_web/components/pack_table_component.ex:194
#: lib/cannery_web/components/pack_table_component.ex:199
#, elixir-autogen, elixir-format
msgid "Never used"
msgstr ""

View File

@ -494,9 +494,9 @@ msgstr ""
#: lib/cannery_web/components/core_components/pack_card.html.heex:42
#: lib/cannery_web/components/core_components/pack_card.html.heex:47
#: lib/cannery_web/components/pack_table_component.ex:176
#: lib/cannery_web/components/pack_table_component.ex:259
#: lib/cannery_web/components/type_table_component.ex:260
#: lib/cannery_web/components/pack_table_component.ex:181
#: lib/cannery_web/components/pack_table_component.ex:264
#: lib/cannery_web/components/type_table_component.ex:265
#: lib/cannery_web/live/pack_live/show.html.heex:37
#: lib/cannery_web/live/pack_live/show.html.heex:42
#: lib/cannery_web/live/type_live/show.html.heex:150
@ -586,9 +586,9 @@ msgstr ""
msgid "Rounds:"
msgstr ""
#: lib/cannery_web/components/pack_table_component.ex:173
#: lib/cannery_web/components/pack_table_component.ex:255
#: lib/cannery_web/components/type_table_component.ex:259
#: lib/cannery_web/components/pack_table_component.ex:178
#: lib/cannery_web/components/pack_table_component.ex:260
#: lib/cannery_web/components/type_table_component.ex:264
#: lib/cannery_web/live/type_live/show.html.heex:154
#, elixir-autogen, elixir-format
msgid "No cost information"
@ -774,7 +774,7 @@ msgstr ""
msgid "Show used"
msgstr ""
#: lib/cannery_web/components/pack_table_component.ex:214
#: lib/cannery_web/components/pack_table_component.ex:219
#: lib/cannery_web/live/pack_live/show.html.heex:19
#, elixir-autogen, elixir-format
msgid "%{percentage}%"
@ -951,7 +951,7 @@ msgid "Average CPR"
msgstr ""
#: lib/cannery_web/components/core_components/pack_card.html.heex:17
#: lib/cannery_web/components/pack_table_component.ex:263
#: lib/cannery_web/components/pack_table_component.ex:268
#, elixir-autogen, elixir-format
msgid "Empty"
msgstr ""
@ -991,7 +991,7 @@ msgstr ""
msgid "Last used on:"
msgstr ""
#: lib/cannery_web/components/pack_table_component.ex:194
#: lib/cannery_web/components/pack_table_component.ex:199
#, elixir-autogen, elixir-format
msgid "Never used"
msgstr ""

View File

@ -501,9 +501,9 @@ msgstr "Registro de tiros"
#: lib/cannery_web/components/core_components/pack_card.html.heex:42
#: lib/cannery_web/components/core_components/pack_card.html.heex:47
#: lib/cannery_web/components/pack_table_component.ex:176
#: lib/cannery_web/components/pack_table_component.ex:259
#: lib/cannery_web/components/type_table_component.ex:260
#: lib/cannery_web/components/pack_table_component.ex:181
#: lib/cannery_web/components/pack_table_component.ex:264
#: lib/cannery_web/components/type_table_component.ex:265
#: lib/cannery_web/live/pack_live/show.html.heex:37
#: lib/cannery_web/live/pack_live/show.html.heex:42
#: lib/cannery_web/live/type_live/show.html.heex:150
@ -593,9 +593,9 @@ msgstr "Editar etiquetas de %{name}"
msgid "Rounds:"
msgstr "Balas:"
#: lib/cannery_web/components/pack_table_component.ex:173
#: lib/cannery_web/components/pack_table_component.ex:255
#: lib/cannery_web/components/type_table_component.ex:259
#: lib/cannery_web/components/pack_table_component.ex:178
#: lib/cannery_web/components/pack_table_component.ex:260
#: lib/cannery_web/components/type_table_component.ex:264
#: lib/cannery_web/live/type_live/show.html.heex:154
#, elixir-autogen, elixir-format
msgid "No cost information"
@ -782,7 +782,7 @@ msgstr "Contenedor:"
msgid "Show used"
msgstr "Mostrar usadas"
#: lib/cannery_web/components/pack_table_component.ex:214
#: lib/cannery_web/components/pack_table_component.ex:219
#: lib/cannery_web/live/pack_live/show.html.heex:19
#, elixir-autogen, elixir-format
msgid "%{percentage}%"
@ -959,7 +959,7 @@ msgid "Average CPR"
msgstr ""
#: lib/cannery_web/components/core_components/pack_card.html.heex:17
#: lib/cannery_web/components/pack_table_component.ex:263
#: lib/cannery_web/components/pack_table_component.ex:268
#, elixir-autogen, elixir-format
msgid "Empty"
msgstr "Vacio"
@ -999,7 +999,7 @@ msgstr "Usada por última vez en"
msgid "Last used on:"
msgstr "Usada por última vez en:"
#: lib/cannery_web/components/pack_table_component.ex:194
#: lib/cannery_web/components/pack_table_component.ex:199
#, elixir-autogen, elixir-format
msgid "Never used"
msgstr "Nunca usada"

View File

@ -502,9 +502,9 @@ msgstr "Évènements de tir"
#: lib/cannery_web/components/core_components/pack_card.html.heex:42
#: lib/cannery_web/components/core_components/pack_card.html.heex:47
#: lib/cannery_web/components/pack_table_component.ex:176
#: lib/cannery_web/components/pack_table_component.ex:259
#: lib/cannery_web/components/type_table_component.ex:260
#: lib/cannery_web/components/pack_table_component.ex:181
#: lib/cannery_web/components/pack_table_component.ex:264
#: lib/cannery_web/components/type_table_component.ex:265
#: lib/cannery_web/live/pack_live/show.html.heex:37
#: lib/cannery_web/live/pack_live/show.html.heex:42
#: lib/cannery_web/live/type_live/show.html.heex:150
@ -594,9 +594,9 @@ msgstr "Éditer les tags de %{name}"
msgid "Rounds:"
msgstr "Cartouches:"
#: lib/cannery_web/components/pack_table_component.ex:173
#: lib/cannery_web/components/pack_table_component.ex:255
#: lib/cannery_web/components/type_table_component.ex:259
#: lib/cannery_web/components/pack_table_component.ex:178
#: lib/cannery_web/components/pack_table_component.ex:260
#: lib/cannery_web/components/type_table_component.ex:264
#: lib/cannery_web/live/type_live/show.html.heex:154
#, elixir-autogen, elixir-format
msgid "No cost information"
@ -783,7 +783,7 @@ msgstr "Conteneur"
msgid "Show used"
msgstr ""
#: lib/cannery_web/components/pack_table_component.ex:214
#: lib/cannery_web/components/pack_table_component.ex:219
#: lib/cannery_web/live/pack_live/show.html.heex:19
#, elixir-autogen, elixir-format
msgid "%{percentage}%"
@ -960,7 +960,7 @@ msgid "Average CPR"
msgstr ""
#: lib/cannery_web/components/core_components/pack_card.html.heex:17
#: lib/cannery_web/components/pack_table_component.ex:263
#: lib/cannery_web/components/pack_table_component.ex:268
#, elixir-autogen, elixir-format
msgid "Empty"
msgstr ""
@ -1000,7 +1000,7 @@ msgstr ""
msgid "Last used on:"
msgstr ""
#: lib/cannery_web/components/pack_table_component.ex:194
#: lib/cannery_web/components/pack_table_component.ex:199
#, elixir-autogen, elixir-format
msgid "Never used"
msgstr ""

View File

@ -496,9 +496,9 @@ msgstr ""
#: lib/cannery_web/components/core_components/pack_card.html.heex:42
#: lib/cannery_web/components/core_components/pack_card.html.heex:47
#: lib/cannery_web/components/pack_table_component.ex:176
#: lib/cannery_web/components/pack_table_component.ex:259
#: lib/cannery_web/components/type_table_component.ex:260
#: lib/cannery_web/components/pack_table_component.ex:181
#: lib/cannery_web/components/pack_table_component.ex:264
#: lib/cannery_web/components/type_table_component.ex:265
#: lib/cannery_web/live/pack_live/show.html.heex:37
#: lib/cannery_web/live/pack_live/show.html.heex:42
#: lib/cannery_web/live/type_live/show.html.heex:150
@ -588,9 +588,9 @@ msgstr ""
msgid "Rounds:"
msgstr ""
#: lib/cannery_web/components/pack_table_component.ex:173
#: lib/cannery_web/components/pack_table_component.ex:255
#: lib/cannery_web/components/type_table_component.ex:259
#: lib/cannery_web/components/pack_table_component.ex:178
#: lib/cannery_web/components/pack_table_component.ex:260
#: lib/cannery_web/components/type_table_component.ex:264
#: lib/cannery_web/live/type_live/show.html.heex:154
#, elixir-autogen, elixir-format
msgid "No cost information"
@ -776,7 +776,7 @@ msgstr ""
msgid "Show used"
msgstr ""
#: lib/cannery_web/components/pack_table_component.ex:214
#: lib/cannery_web/components/pack_table_component.ex:219
#: lib/cannery_web/live/pack_live/show.html.heex:19
#, elixir-autogen, elixir-format
msgid "%{percentage}%"
@ -953,7 +953,7 @@ msgid "Average CPR"
msgstr ""
#: lib/cannery_web/components/core_components/pack_card.html.heex:17
#: lib/cannery_web/components/pack_table_component.ex:263
#: lib/cannery_web/components/pack_table_component.ex:268
#, elixir-autogen, elixir-format
msgid "Empty"
msgstr ""
@ -993,7 +993,7 @@ msgstr ""
msgid "Last used on:"
msgstr ""
#: lib/cannery_web/components/pack_table_component.ex:194
#: lib/cannery_web/components/pack_table_component.ex:199
#, elixir-autogen, elixir-format
msgid "Never used"
msgstr ""