From 8ef51470780127e5e11fbb366535c4c95996c5be Mon Sep 17 00:00:00 2001 From: shibao Date: Tue, 14 Mar 2023 23:51:50 -0400 Subject: [PATCH] remove data-qa --- changelog.md | 3 + .../components/contexts_table_component.ex | 6 +- .../components/notes_table_component.ex | 6 +- .../components/pipelines_table_component.ex | 6 +- .../live/context_live/index.html.heex | 4 +- .../live/context_live/show.html.heex | 2 +- .../live/invite_live/index.html.heex | 5 +- lib/memex_web/live/live_helpers.ex | 1 - lib/memex_web/live/note_live/index.html.heex | 4 +- lib/memex_web/live/note_live/show.html.heex | 2 +- .../live/pipeline_live/index.html.heex | 4 +- .../live/pipeline_live/show.html.heex | 11 ++- mix.exs | 2 +- priv/gettext/actions.pot | 6 +- priv/gettext/de/LC_MESSAGES/actions.po | 6 +- priv/gettext/de/LC_MESSAGES/default.po | 78 +++++++++++++++++-- priv/gettext/de/LC_MESSAGES/prompts.po | 8 +- priv/gettext/default.pot | 78 +++++++++++++++++-- priv/gettext/en/LC_MESSAGES/actions.po | 6 +- priv/gettext/en/LC_MESSAGES/default.po | 78 +++++++++++++++++-- priv/gettext/en/LC_MESSAGES/prompts.po | 8 +- priv/gettext/prompts.pot | 8 +- test/memex_web/live/context_live_test.exs | 8 +- test/memex_web/live/invite_live_test.exs | 9 ++- test/memex_web/live/note_live_test.exs | 8 +- test/memex_web/live/pipeline_live_test.exs | 22 +++--- 26 files changed, 288 insertions(+), 91 deletions(-) diff --git a/changelog.md b/changelog.md index 7d7ea92..4eb42d3 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,6 @@ +# v0.1.10 +- Improve accessibility + # v0.1.9 - Improve server log - Style 大一點 diff --git a/lib/memex_web/components/contexts_table_component.ex b/lib/memex_web/components/contexts_table_component.ex index ccb176d..5d35a19 100644 --- a/lib/memex_web/components/contexts_table_component.ex +++ b/lib/memex_web/components/contexts_table_component.ex @@ -92,11 +92,7 @@ defmodule MemexWeb.Components.ContextsTableComponent do assigns = %{slug: slug} slug_block = ~H""" - <.link - navigate={Routes.context_show_path(Endpoint, :show, @slug)} - class="link" - data-qa={"context-show-#{@slug}"} - > + <.link navigate={Routes.context_show_path(Endpoint, :show, @slug)} class="link"> <%= @slug %> """ diff --git a/lib/memex_web/components/notes_table_component.ex b/lib/memex_web/components/notes_table_component.ex index eef4b9e..10dd258 100644 --- a/lib/memex_web/components/notes_table_component.ex +++ b/lib/memex_web/components/notes_table_component.ex @@ -92,11 +92,7 @@ defmodule MemexWeb.Components.NotesTableComponent do assigns = %{slug: slug} slug_block = ~H""" - <.link - navigate={Routes.note_show_path(Endpoint, :show, @slug)} - class="link" - data-qa={"note-show-#{@slug}"} - > + <.link navigate={Routes.note_show_path(Endpoint, :show, @slug)} class="link"> <%= @slug %> """ diff --git a/lib/memex_web/components/pipelines_table_component.ex b/lib/memex_web/components/pipelines_table_component.ex index 9bdc406..2d2eb68 100644 --- a/lib/memex_web/components/pipelines_table_component.ex +++ b/lib/memex_web/components/pipelines_table_component.ex @@ -93,11 +93,7 @@ defmodule MemexWeb.Components.PipelinesTableComponent do assigns = %{slug: slug} slug_block = ~H""" - <.link - navigate={Routes.pipeline_show_path(Endpoint, :show, @slug)} - class="link" - data-qa={"pipeline-show-#{@slug}"} - > + <.link navigate={Routes.pipeline_show_path(Endpoint, :show, @slug)} class="link"> <%= @slug %> """ diff --git a/lib/memex_web/live/context_live/index.html.heex b/lib/memex_web/live/context_live/index.html.heex index 2a94b79..6fb9ce5 100644 --- a/lib/memex_web/live/context_live/index.html.heex +++ b/lib/memex_web/live/context_live/index.html.heex @@ -33,7 +33,7 @@ <.link :if={is_owner?(context, @current_user)} patch={Routes.context_index_path(@socket, :edit, context.slug)} - data-qa={"context-edit-#{context.id}"} + aria-label={gettext("edit %{context_slug}", context_slug: context.slug)} > <%= dgettext("actions", "edit") %> @@ -43,7 +43,7 @@ phx-click="delete" phx-value-id={context.id} data-confirm={dgettext("prompts", "are you sure?")} - data-qa={"delete-context-#{context.id}"} + aria-label={gettext("delete %{context_slug}", context_slug: context.slug)} > <%= dgettext("actions", "delete") %> diff --git a/lib/memex_web/live/context_live/show.html.heex b/lib/memex_web/live/context_live/show.html.heex index 96e9f7a..7bc895e 100644 --- a/lib/memex_web/live/context_live/show.html.heex +++ b/lib/memex_web/live/context_live/show.html.heex @@ -36,7 +36,7 @@ class="btn btn-primary" phx-click="delete" data-confirm={dgettext("prompts", "are you sure?")} - data-qa={"delete-context-#{@context.id}"} + aria-label={gettext("delete %{context_slug}", context_slug: @context.slug)} > <%= dgettext("actions", "delete") %> diff --git a/lib/memex_web/live/invite_live/index.html.heex b/lib/memex_web/live/invite_live/index.html.heex index 8380b70..965ec73 100644 --- a/lib/memex_web/live/invite_live/index.html.heex +++ b/lib/memex_web/live/invite_live/index.html.heex @@ -21,6 +21,7 @@ type="submit" class="mx-2 my-1 btn btn-secondary" phx-click={JS.dispatch("memex:clipcopy", to: "#code-#{invite.id}")} + aria-label={gettext("copy invite link for %{invite_name}", invite_name: invite.name)} > <%= dgettext("actions", "copy") %> @@ -29,7 +30,7 @@ <.link patch={Routes.invite_index_path(Endpoint, :edit, invite)} class="text-primary-400 link" - data-qa={"edit-#{invite.id}"} + aria-label={gettext("edit invite for %{invite_name}", invite_name: invite.name)} > @@ -44,7 +45,7 @@ invite_name: invite.name ) } - data-qa={"delete-#{invite.id}"} + aria-label={gettext("delete invite for %{invite_name}", invite_name: invite.name)} > diff --git a/lib/memex_web/live/live_helpers.ex b/lib/memex_web/live/live_helpers.ex index 2900a75..68210cd 100644 --- a/lib/memex_web/live/live_helpers.ex +++ b/lib/memex_web/live/live_helpers.ex @@ -102,7 +102,6 @@ defmodule MemexWeb.LiveHelpers do value={@value} checked={@value} class="sr-only peer" - data-qa={@id} { if assigns |> Map.has_key?(:target), do: %{"phx-click": @action, "phx-value-value": @value, "phx-target": @target}, diff --git a/lib/memex_web/live/note_live/index.html.heex b/lib/memex_web/live/note_live/index.html.heex index 4554787..860ed06 100644 --- a/lib/memex_web/live/note_live/index.html.heex +++ b/lib/memex_web/live/note_live/index.html.heex @@ -33,7 +33,7 @@ <.link :if={is_owner?(note, @current_user)} patch={Routes.note_index_path(@socket, :edit, note.slug)} - data-qa={"note-edit-#{note.id}"} + aria-label={gettext("edit %{note_slug}", note_slug: note.slug)} > <%= dgettext("actions", "edit") %> @@ -43,7 +43,7 @@ phx-click="delete" phx-value-id={note.id} data-confirm={dgettext("prompts", "are you sure?")} - data-qa={"delete-note-#{note.id}"} + aria-label={gettext("delete %{note_slug}", note_slug: note.slug)} > <%= dgettext("actions", "delete") %> diff --git a/lib/memex_web/live/note_live/show.html.heex b/lib/memex_web/live/note_live/show.html.heex index ebce59e..b182a7c 100644 --- a/lib/memex_web/live/note_live/show.html.heex +++ b/lib/memex_web/live/note_live/show.html.heex @@ -36,7 +36,7 @@ class="btn btn-primary" phx-click="delete" data-confirm={dgettext("prompts", "are you sure?")} - data-qa={"delete-note-#{@note.id}"} + aria-label={gettext("delete %{note_slug}", note_slug: @note.slug)} > <%= dgettext("actions", "delete") %> diff --git a/lib/memex_web/live/pipeline_live/index.html.heex b/lib/memex_web/live/pipeline_live/index.html.heex index 5d91906..56f0b86 100644 --- a/lib/memex_web/live/pipeline_live/index.html.heex +++ b/lib/memex_web/live/pipeline_live/index.html.heex @@ -33,7 +33,7 @@ <.link :if={is_owner?(pipeline, @current_user)} patch={Routes.pipeline_index_path(@socket, :edit, pipeline.slug)} - data-qa={"pipeline-edit-#{pipeline.id}"} + aria-label={gettext("edit %{pipeline_slug}", pipeline_slug: pipeline.slug)} > <%= dgettext("actions", "edit") %> @@ -43,7 +43,7 @@ phx-click="delete" phx-value-id={pipeline.id} data-confirm={dgettext("prompts", "are you sure?")} - data-qa={"delete-pipeline-#{pipeline.id}"} + aria-label={gettext("delete %{pipeline_slug}", pipeline_slug: pipeline.slug)} > <%= dgettext("actions", "delete") %> diff --git a/lib/memex_web/live/pipeline_live/show.html.heex b/lib/memex_web/live/pipeline_live/show.html.heex index f6847df..d503f6e 100644 --- a/lib/memex_web/live/pipeline_live/show.html.heex +++ b/lib/memex_web/live/pipeline_live/show.html.heex @@ -44,7 +44,7 @@ class="btn btn-primary" phx-click="delete" data-confirm={dgettext("prompts", "are you sure?")} - data-qa={"delete-pipeline-#{@pipeline.id}"} + aria-label={gettext("delete %{pipeline_slug}", pipeline_slug: @pipeline.slug)} > <%= dgettext("actions", "delete") %> @@ -78,7 +78,7 @@ phx-click="reorder_step" phx-value-direction="up" phx-value-step-id={step_id} - data-qa={"move-step-up-#{step_id}"} + aria-label={gettext("move %{step_title} up", step_title: step.title)} > @@ -93,7 +93,7 @@ phx-click="reorder_step" phx-value-direction="down" phx-value-step-id={step_id} - data-qa={"move-step-down-#{step_id}"} + aria-label={gettext("move %{step_title} down", step_title: step.title)} > @@ -102,7 +102,7 @@ <.link class="self-end btn btn-primary" patch={Routes.pipeline_show_path(@socket, :edit_step, @pipeline.slug, step_id)} - data-qa={"edit-step-#{step_id}"} + aria-label={gettext("edit %{step_title}", step_title: step.title)} > <%= dgettext("actions", "edit") %> @@ -113,7 +113,7 @@ phx-click="delete_step" phx-value-step-id={step_id} data-confirm={dgettext("prompts", "are you sure?")} - data-qa={"delete-step-#{step_id}"} + aria-label={gettext("delete %{step_title}", step_title: step.title)} > <%= dgettext("actions", "delete") %> @@ -129,7 +129,6 @@ :if={is_owner?(@pipeline, @current_user)} class="self-end btn btn-primary" patch={Routes.pipeline_show_path(@socket, :add_step, @pipeline.slug)} - data-qa={"add-step-#{@pipeline.id}"} > <%= dgettext("actions", "add step") %> diff --git a/mix.exs b/mix.exs index 821ab14..3c6529e 100644 --- a/mix.exs +++ b/mix.exs @@ -4,7 +4,7 @@ defmodule Memex.MixProject do def project do [ app: :memex, - version: "0.1.9", + version: "0.1.10", elixir: "1.14.1", elixirc_paths: elixirc_paths(Mix.env()), compilers: Mix.compilers(), diff --git a/priv/gettext/actions.pot b/priv/gettext/actions.pot index b20e261..15f295c 100644 --- a/priv/gettext/actions.pot +++ b/priv/gettext/actions.pot @@ -45,7 +45,7 @@ msgstr "" msgid "change password" msgstr "" -#: lib/memex_web/live/invite_live/index.html.heex:82 +#: lib/memex_web/live/invite_live/index.html.heex:83 #, elixir-autogen, elixir-format msgid "create invite" msgstr "" @@ -134,7 +134,7 @@ msgstr "" msgid "back" msgstr "" -#: lib/memex_web/live/pipeline_live/show.html.heex:134 +#: lib/memex_web/live/pipeline_live/show.html.heex:133 #, elixir-autogen, elixir-format msgid "add step" msgstr "" @@ -156,7 +156,7 @@ msgstr "" msgid "export data as json" msgstr "" -#: lib/memex_web/live/invite_live/index.html.heex:25 +#: lib/memex_web/live/invite_live/index.html.heex:26 #, elixir-autogen, elixir-format msgid "copy" msgstr "" diff --git a/priv/gettext/de/LC_MESSAGES/actions.po b/priv/gettext/de/LC_MESSAGES/actions.po index ae90599..d6d710f 100644 --- a/priv/gettext/de/LC_MESSAGES/actions.po +++ b/priv/gettext/de/LC_MESSAGES/actions.po @@ -45,7 +45,7 @@ msgstr "" msgid "change password" msgstr "" -#: lib/memex_web/live/invite_live/index.html.heex:82 +#: lib/memex_web/live/invite_live/index.html.heex:83 #, elixir-autogen, elixir-format msgid "create invite" msgstr "" @@ -134,7 +134,7 @@ msgstr "" msgid "back" msgstr "" -#: lib/memex_web/live/pipeline_live/show.html.heex:134 +#: lib/memex_web/live/pipeline_live/show.html.heex:133 #, elixir-autogen, elixir-format msgid "add step" msgstr "" @@ -156,7 +156,7 @@ msgstr "" msgid "export data as json" msgstr "" -#: lib/memex_web/live/invite_live/index.html.heex:25 +#: lib/memex_web/live/invite_live/index.html.heex:26 #, elixir-autogen, elixir-format msgid "copy" msgstr "" diff --git a/priv/gettext/de/LC_MESSAGES/default.po b/priv/gettext/de/LC_MESSAGES/default.po index 0a5eaf1..826bc7b 100644 --- a/priv/gettext/de/LC_MESSAGES/default.po +++ b/priv/gettext/de/LC_MESSAGES/default.po @@ -84,7 +84,7 @@ msgstr "" msgid "current password" msgstr "" -#: lib/memex_web/live/invite_live/index.html.heex:58 +#: lib/memex_web/live/invite_live/index.html.heex:59 #, elixir-autogen, elixir-format msgid "disable" msgstr "" @@ -117,7 +117,7 @@ msgstr "" msgid "email unconfirmed" msgstr "" -#: lib/memex_web/live/invite_live/index.html.heex:58 +#: lib/memex_web/live/invite_live/index.html.heex:59 #, elixir-autogen, elixir-format msgid "enable" msgstr "" @@ -267,7 +267,7 @@ msgstr "" msgid "select privacy" msgstr "" -#: lib/memex_web/live/invite_live/index.html.heex:73 +#: lib/memex_web/live/invite_live/index.html.heex:74 #, elixir-autogen, elixir-format msgid "set unlimited" msgstr "" @@ -292,7 +292,7 @@ msgstr "" msgid "tags" msgstr "" -#: lib/memex_web/live/invite_live/index.html.heex:118 +#: lib/memex_web/live/invite_live/index.html.heex:119 #, elixir-autogen, elixir-format msgid "users" msgstr "" @@ -649,7 +649,7 @@ msgstr "" msgid "Leave \"Uses left\" blank to make invite unlimited" msgstr "" -#: lib/memex_web/live/invite_live/index.html.heex:90 +#: lib/memex_web/live/invite_live/index.html.heex:91 #, elixir-autogen, elixir-format, fuzzy msgid "admins" msgstr "" @@ -674,3 +674,71 @@ msgstr "" #, elixir-autogen, elixir-format, fuzzy msgid "uses left" msgstr "" + +#: lib/memex_web/live/invite_live/index.html.heex:24 +#, elixir-autogen, elixir-format +msgid "copy invite link for %{invite_name}" +msgstr "" + +#: lib/memex_web/live/context_live/index.html.heex:46 +#: lib/memex_web/live/context_live/show.html.heex:39 +#, elixir-autogen, elixir-format +msgid "delete %{context_slug}" +msgstr "" + +#: lib/memex_web/live/note_live/index.html.heex:46 +#: lib/memex_web/live/note_live/show.html.heex:39 +#, elixir-autogen, elixir-format +msgid "delete %{note_slug}" +msgstr "" + +#: lib/memex_web/live/pipeline_live/index.html.heex:46 +#: lib/memex_web/live/pipeline_live/show.html.heex:47 +#, elixir-autogen, elixir-format +msgid "delete %{pipeline_slug}" +msgstr "" + +#: lib/memex_web/live/pipeline_live/show.html.heex:116 +#, elixir-autogen, elixir-format +msgid "delete %{step_title}" +msgstr "" + +#: lib/memex_web/live/invite_live/index.html.heex:48 +#, elixir-autogen, elixir-format +msgid "delete invite for %{invite_name}" +msgstr "" + +#: lib/memex_web/live/context_live/index.html.heex:36 +#, elixir-autogen, elixir-format, fuzzy +msgid "edit %{context_slug}" +msgstr "" + +#: lib/memex_web/live/note_live/index.html.heex:36 +#, elixir-autogen, elixir-format, fuzzy +msgid "edit %{note_slug}" +msgstr "" + +#: lib/memex_web/live/pipeline_live/index.html.heex:36 +#, elixir-autogen, elixir-format, fuzzy +msgid "edit %{pipeline_slug}" +msgstr "" + +#: lib/memex_web/live/pipeline_live/show.html.heex:105 +#, elixir-autogen, elixir-format +msgid "edit %{step_title}" +msgstr "" + +#: lib/memex_web/live/invite_live/index.html.heex:33 +#, elixir-autogen, elixir-format +msgid "edit invite for %{invite_name}" +msgstr "" + +#: lib/memex_web/live/pipeline_live/show.html.heex:96 +#, elixir-autogen, elixir-format +msgid "move %{step_title} down" +msgstr "" + +#: lib/memex_web/live/pipeline_live/show.html.heex:81 +#, elixir-autogen, elixir-format +msgid "move %{step_title} up" +msgstr "" diff --git a/priv/gettext/de/LC_MESSAGES/prompts.po b/priv/gettext/de/LC_MESSAGES/prompts.po index 2b17d69..3013a15 100644 --- a/priv/gettext/de/LC_MESSAGES/prompts.po +++ b/priv/gettext/de/LC_MESSAGES/prompts.po @@ -65,7 +65,7 @@ msgstr "" msgid "are you sure you want to change your language?" msgstr "" -#: lib/memex_web/live/invite_live/index.html.heex:43 +#: lib/memex_web/live/invite_live/index.html.heex:44 #, elixir-autogen, elixir-format msgid "are you sure you want to delete the invite for %{invite_name}?" msgstr "" @@ -80,7 +80,7 @@ msgstr "" msgid "are you sure you want to log out?" msgstr "" -#: lib/memex_web/live/invite_live/index.html.heex:68 +#: lib/memex_web/live/invite_live/index.html.heex:69 #, elixir-autogen, elixir-format msgid "are you sure you want to make %{invite_name} unlimited?" msgstr "" @@ -151,8 +151,8 @@ msgstr "" msgid "your account has been deleted" msgstr "" -#: lib/memex_web/live/invite_live/index.html.heex:101 -#: lib/memex_web/live/invite_live/index.html.heex:129 +#: lib/memex_web/live/invite_live/index.html.heex:102 +#: lib/memex_web/live/invite_live/index.html.heex:130 #, elixir-autogen, elixir-format, fuzzy msgid "are you sure you want to delete %{email}? this action is permanent!" msgstr "" diff --git a/priv/gettext/default.pot b/priv/gettext/default.pot index 1c935ad..3429d9c 100644 --- a/priv/gettext/default.pot +++ b/priv/gettext/default.pot @@ -82,7 +82,7 @@ msgstr "" msgid "current password" msgstr "" -#: lib/memex_web/live/invite_live/index.html.heex:58 +#: lib/memex_web/live/invite_live/index.html.heex:59 #, elixir-autogen, elixir-format msgid "disable" msgstr "" @@ -115,7 +115,7 @@ msgstr "" msgid "email unconfirmed" msgstr "" -#: lib/memex_web/live/invite_live/index.html.heex:58 +#: lib/memex_web/live/invite_live/index.html.heex:59 #, elixir-autogen, elixir-format msgid "enable" msgstr "" @@ -265,7 +265,7 @@ msgstr "" msgid "select privacy" msgstr "" -#: lib/memex_web/live/invite_live/index.html.heex:73 +#: lib/memex_web/live/invite_live/index.html.heex:74 #, elixir-autogen, elixir-format msgid "set unlimited" msgstr "" @@ -290,7 +290,7 @@ msgstr "" msgid "tags" msgstr "" -#: lib/memex_web/live/invite_live/index.html.heex:118 +#: lib/memex_web/live/invite_live/index.html.heex:119 #, elixir-autogen, elixir-format msgid "users" msgstr "" @@ -647,7 +647,7 @@ msgstr "" msgid "Leave \"Uses left\" blank to make invite unlimited" msgstr "" -#: lib/memex_web/live/invite_live/index.html.heex:90 +#: lib/memex_web/live/invite_live/index.html.heex:91 #, elixir-autogen, elixir-format msgid "admins" msgstr "" @@ -672,3 +672,71 @@ msgstr "" #, elixir-autogen, elixir-format msgid "uses left" msgstr "" + +#: lib/memex_web/live/invite_live/index.html.heex:24 +#, elixir-autogen, elixir-format +msgid "copy invite link for %{invite_name}" +msgstr "" + +#: lib/memex_web/live/context_live/index.html.heex:46 +#: lib/memex_web/live/context_live/show.html.heex:39 +#, elixir-autogen, elixir-format +msgid "delete %{context_slug}" +msgstr "" + +#: lib/memex_web/live/note_live/index.html.heex:46 +#: lib/memex_web/live/note_live/show.html.heex:39 +#, elixir-autogen, elixir-format +msgid "delete %{note_slug}" +msgstr "" + +#: lib/memex_web/live/pipeline_live/index.html.heex:46 +#: lib/memex_web/live/pipeline_live/show.html.heex:47 +#, elixir-autogen, elixir-format +msgid "delete %{pipeline_slug}" +msgstr "" + +#: lib/memex_web/live/pipeline_live/show.html.heex:116 +#, elixir-autogen, elixir-format +msgid "delete %{step_title}" +msgstr "" + +#: lib/memex_web/live/invite_live/index.html.heex:48 +#, elixir-autogen, elixir-format +msgid "delete invite for %{invite_name}" +msgstr "" + +#: lib/memex_web/live/context_live/index.html.heex:36 +#, elixir-autogen, elixir-format +msgid "edit %{context_slug}" +msgstr "" + +#: lib/memex_web/live/note_live/index.html.heex:36 +#, elixir-autogen, elixir-format +msgid "edit %{note_slug}" +msgstr "" + +#: lib/memex_web/live/pipeline_live/index.html.heex:36 +#, elixir-autogen, elixir-format +msgid "edit %{pipeline_slug}" +msgstr "" + +#: lib/memex_web/live/pipeline_live/show.html.heex:105 +#, elixir-autogen, elixir-format +msgid "edit %{step_title}" +msgstr "" + +#: lib/memex_web/live/invite_live/index.html.heex:33 +#, elixir-autogen, elixir-format +msgid "edit invite for %{invite_name}" +msgstr "" + +#: lib/memex_web/live/pipeline_live/show.html.heex:96 +#, elixir-autogen, elixir-format +msgid "move %{step_title} down" +msgstr "" + +#: lib/memex_web/live/pipeline_live/show.html.heex:81 +#, elixir-autogen, elixir-format +msgid "move %{step_title} up" +msgstr "" diff --git a/priv/gettext/en/LC_MESSAGES/actions.po b/priv/gettext/en/LC_MESSAGES/actions.po index 8732fc0..60060b7 100644 --- a/priv/gettext/en/LC_MESSAGES/actions.po +++ b/priv/gettext/en/LC_MESSAGES/actions.po @@ -46,7 +46,7 @@ msgstr "" msgid "change password" msgstr "" -#: lib/memex_web/live/invite_live/index.html.heex:82 +#: lib/memex_web/live/invite_live/index.html.heex:83 #, elixir-autogen, elixir-format msgid "create invite" msgstr "" @@ -135,7 +135,7 @@ msgstr "" msgid "back" msgstr "" -#: lib/memex_web/live/pipeline_live/show.html.heex:134 +#: lib/memex_web/live/pipeline_live/show.html.heex:133 #, elixir-autogen, elixir-format msgid "add step" msgstr "" @@ -157,7 +157,7 @@ msgstr "" msgid "export data as json" msgstr "" -#: lib/memex_web/live/invite_live/index.html.heex:25 +#: lib/memex_web/live/invite_live/index.html.heex:26 #, elixir-autogen, elixir-format msgid "copy" msgstr "" diff --git a/priv/gettext/en/LC_MESSAGES/default.po b/priv/gettext/en/LC_MESSAGES/default.po index d734376..83809f8 100644 --- a/priv/gettext/en/LC_MESSAGES/default.po +++ b/priv/gettext/en/LC_MESSAGES/default.po @@ -83,7 +83,7 @@ msgstr "" msgid "current password" msgstr "" -#: lib/memex_web/live/invite_live/index.html.heex:58 +#: lib/memex_web/live/invite_live/index.html.heex:59 #, elixir-autogen, elixir-format msgid "disable" msgstr "" @@ -116,7 +116,7 @@ msgstr "" msgid "email unconfirmed" msgstr "" -#: lib/memex_web/live/invite_live/index.html.heex:58 +#: lib/memex_web/live/invite_live/index.html.heex:59 #, elixir-autogen, elixir-format msgid "enable" msgstr "" @@ -266,7 +266,7 @@ msgstr "" msgid "select privacy" msgstr "" -#: lib/memex_web/live/invite_live/index.html.heex:73 +#: lib/memex_web/live/invite_live/index.html.heex:74 #, elixir-autogen, elixir-format msgid "set unlimited" msgstr "" @@ -291,7 +291,7 @@ msgstr "" msgid "tags" msgstr "" -#: lib/memex_web/live/invite_live/index.html.heex:118 +#: lib/memex_web/live/invite_live/index.html.heex:119 #, elixir-autogen, elixir-format msgid "users" msgstr "" @@ -648,7 +648,7 @@ msgstr "" msgid "Leave \"Uses left\" blank to make invite unlimited" msgstr "" -#: lib/memex_web/live/invite_live/index.html.heex:90 +#: lib/memex_web/live/invite_live/index.html.heex:91 #, elixir-autogen, elixir-format msgid "admins" msgstr "" @@ -673,3 +673,71 @@ msgstr "" #, elixir-autogen, elixir-format msgid "uses left" msgstr "" + +#: lib/memex_web/live/invite_live/index.html.heex:24 +#, elixir-autogen, elixir-format +msgid "copy invite link for %{invite_name}" +msgstr "" + +#: lib/memex_web/live/context_live/index.html.heex:46 +#: lib/memex_web/live/context_live/show.html.heex:39 +#, elixir-autogen, elixir-format +msgid "delete %{context_slug}" +msgstr "" + +#: lib/memex_web/live/note_live/index.html.heex:46 +#: lib/memex_web/live/note_live/show.html.heex:39 +#, elixir-autogen, elixir-format +msgid "delete %{note_slug}" +msgstr "" + +#: lib/memex_web/live/pipeline_live/index.html.heex:46 +#: lib/memex_web/live/pipeline_live/show.html.heex:47 +#, elixir-autogen, elixir-format +msgid "delete %{pipeline_slug}" +msgstr "" + +#: lib/memex_web/live/pipeline_live/show.html.heex:116 +#, elixir-autogen, elixir-format +msgid "delete %{step_title}" +msgstr "" + +#: lib/memex_web/live/invite_live/index.html.heex:48 +#, elixir-autogen, elixir-format +msgid "delete invite for %{invite_name}" +msgstr "" + +#: lib/memex_web/live/context_live/index.html.heex:36 +#, elixir-autogen, elixir-format, fuzzy +msgid "edit %{context_slug}" +msgstr "" + +#: lib/memex_web/live/note_live/index.html.heex:36 +#, elixir-autogen, elixir-format, fuzzy +msgid "edit %{note_slug}" +msgstr "" + +#: lib/memex_web/live/pipeline_live/index.html.heex:36 +#, elixir-autogen, elixir-format, fuzzy +msgid "edit %{pipeline_slug}" +msgstr "" + +#: lib/memex_web/live/pipeline_live/show.html.heex:105 +#, elixir-autogen, elixir-format +msgid "edit %{step_title}" +msgstr "" + +#: lib/memex_web/live/invite_live/index.html.heex:33 +#, elixir-autogen, elixir-format +msgid "edit invite for %{invite_name}" +msgstr "" + +#: lib/memex_web/live/pipeline_live/show.html.heex:96 +#, elixir-autogen, elixir-format +msgid "move %{step_title} down" +msgstr "" + +#: lib/memex_web/live/pipeline_live/show.html.heex:81 +#, elixir-autogen, elixir-format +msgid "move %{step_title} up" +msgstr "" diff --git a/priv/gettext/en/LC_MESSAGES/prompts.po b/priv/gettext/en/LC_MESSAGES/prompts.po index 6bb9b5e..42fa82d 100644 --- a/priv/gettext/en/LC_MESSAGES/prompts.po +++ b/priv/gettext/en/LC_MESSAGES/prompts.po @@ -66,7 +66,7 @@ msgstr "" msgid "are you sure you want to change your language?" msgstr "" -#: lib/memex_web/live/invite_live/index.html.heex:43 +#: lib/memex_web/live/invite_live/index.html.heex:44 #, elixir-autogen, elixir-format msgid "are you sure you want to delete the invite for %{invite_name}?" msgstr "" @@ -81,7 +81,7 @@ msgstr "" msgid "are you sure you want to log out?" msgstr "" -#: lib/memex_web/live/invite_live/index.html.heex:68 +#: lib/memex_web/live/invite_live/index.html.heex:69 #, elixir-autogen, elixir-format msgid "are you sure you want to make %{invite_name} unlimited?" msgstr "" @@ -152,8 +152,8 @@ msgstr "" msgid "your account has been deleted" msgstr "" -#: lib/memex_web/live/invite_live/index.html.heex:101 -#: lib/memex_web/live/invite_live/index.html.heex:129 +#: lib/memex_web/live/invite_live/index.html.heex:102 +#: lib/memex_web/live/invite_live/index.html.heex:130 #, elixir-autogen, elixir-format msgid "are you sure you want to delete %{email}? this action is permanent!" msgstr "" diff --git a/priv/gettext/prompts.pot b/priv/gettext/prompts.pot index b0bb52c..c96ecff 100644 --- a/priv/gettext/prompts.pot +++ b/priv/gettext/prompts.pot @@ -65,7 +65,7 @@ msgstr "" msgid "are you sure you want to change your language?" msgstr "" -#: lib/memex_web/live/invite_live/index.html.heex:43 +#: lib/memex_web/live/invite_live/index.html.heex:44 #, elixir-autogen, elixir-format msgid "are you sure you want to delete the invite for %{invite_name}?" msgstr "" @@ -80,7 +80,7 @@ msgstr "" msgid "are you sure you want to log out?" msgstr "" -#: lib/memex_web/live/invite_live/index.html.heex:68 +#: lib/memex_web/live/invite_live/index.html.heex:69 #, elixir-autogen, elixir-format msgid "are you sure you want to make %{invite_name} unlimited?" msgstr "" @@ -151,8 +151,8 @@ msgstr "" msgid "your account has been deleted" msgstr "" -#: lib/memex_web/live/invite_live/index.html.heex:101 -#: lib/memex_web/live/invite_live/index.html.heex:129 +#: lib/memex_web/live/invite_live/index.html.heex:102 +#: lib/memex_web/live/invite_live/index.html.heex:130 #, elixir-autogen, elixir-format msgid "are you sure you want to delete %{email}? this action is permanent!" msgstr "" diff --git a/test/memex_web/live/context_live_test.exs b/test/memex_web/live/context_live_test.exs index 905e669..a1f8c4d 100644 --- a/test/memex_web/live/context_live_test.exs +++ b/test/memex_web/live/context_live_test.exs @@ -70,7 +70,7 @@ defmodule MemexWeb.ContextLiveTest do test "updates context in listing", %{conn: conn, context: context} do {:ok, index_live, _html} = live(conn, Routes.context_index_path(conn, :index)) - assert index_live |> element("[data-qa=\"context-edit-#{context.id}\"]") |> render_click() =~ + assert index_live |> element(~s/a[aria-label="edit #{context.slug}"]/) |> render_click() =~ "edit" assert_patch(index_live, Routes.context_index_path(conn, :edit, context.slug)) @@ -92,7 +92,7 @@ defmodule MemexWeb.ContextLiveTest do test "deletes context in listing", %{conn: conn, context: context} do {:ok, index_live, _html} = live(conn, Routes.context_index_path(conn, :index)) - assert index_live |> element("[data-qa=\"delete-context-#{context.id}\"]") |> render_click() + assert index_live |> element(~s/a[aria-label="delete #{context.slug}"]/) |> render_click() refute has_element?(index_live, "#context-#{context.id}") end end @@ -137,7 +137,7 @@ defmodule MemexWeb.ContextLiveTest do {:ok, index_live, _html} = show_live - |> element("[data-qa=\"delete-context-#{context.id}\"]") + |> element(~s/button[aria-label="delete #{context.slug}"]/) |> render_click() |> follow_redirect(conn, Routes.context_index_path(conn, :index)) @@ -174,7 +174,7 @@ defmodule MemexWeb.ContextLiveTest do assert html =~ "context" assert html =~ Routes.note_show_path(Endpoint, :show, note_slug) - assert has_element?(show_live, "[data-qa=\"context-note-#{note_slug}\"]") + assert has_element?(show_live, "a", note_slug) end end end diff --git a/test/memex_web/live/invite_live_test.exs b/test/memex_web/live/invite_live_test.exs index da2c526..5168a94 100644 --- a/test/memex_web/live/invite_live_test.exs +++ b/test/memex_web/live/invite_live_test.exs @@ -55,7 +55,9 @@ defmodule MemexWeb.InviteLiveTest do test "updates invite in listing", %{conn: conn, invite: invite} do {:ok, index_live, _html} = live(conn, Routes.invite_index_path(conn, :index)) - assert index_live |> element("[data-qa=\"edit-#{invite.id}\"]") |> render_click() =~ + assert index_live + |> element(~s/a[aria-label="edit invite for #{invite.name}"]/) + |> render_click() =~ gettext("edit invite") assert_patch(index_live, Routes.invite_index_path(conn, :edit, invite)) @@ -81,7 +83,10 @@ defmodule MemexWeb.InviteLiveTest do test "deletes invite in listing", %{conn: conn, invite: invite} do {:ok, index_live, _html} = live(conn, Routes.invite_index_path(conn, :index)) - assert index_live |> element("[data-qa=\"delete-#{invite.id}\"]") |> render_click() + assert index_live + |> element(~s/a[aria-label="delete invite for #{invite.name}"]/) + |> render_click() + refute has_element?(index_live, "#invite-#{invite.id}") end end diff --git a/test/memex_web/live/note_live_test.exs b/test/memex_web/live/note_live_test.exs index c3c9ee9..3144936 100644 --- a/test/memex_web/live/note_live_test.exs +++ b/test/memex_web/live/note_live_test.exs @@ -75,7 +75,7 @@ defmodule MemexWeb.NoteLiveTest do test "updates note in listing", %{conn: conn, note: note} do {:ok, index_live, _html} = live(conn, Routes.note_index_path(conn, :index)) - assert index_live |> element("[data-qa=\"note-edit-#{note.id}\"]") |> render_click() =~ + assert index_live |> element(~s/a[aria-label="edit #{note.slug}"]/) |> render_click() =~ "edit" assert_patch(index_live, Routes.note_index_path(conn, :edit, note.slug)) @@ -97,7 +97,7 @@ defmodule MemexWeb.NoteLiveTest do test "deletes note in listing", %{conn: conn, note: note} do {:ok, index_live, _html} = live(conn, Routes.note_index_path(conn, :index)) - assert index_live |> element("[data-qa=\"delete-note-#{note.id}\"]") |> render_click() + assert index_live |> element(~s/a[aria-label="delete #{note.slug}"]/) |> render_click() refute has_element?(index_live, "#note-#{note.id}") end end @@ -138,7 +138,7 @@ defmodule MemexWeb.NoteLiveTest do {:ok, index_live, _html} = show_live - |> element("[data-qa=\"delete-note-#{note.id}\"]") + |> element(~s/button[aria-label="delete #{note.slug}"]/) |> render_click() |> follow_redirect(conn, Routes.note_index_path(conn, :index)) @@ -177,7 +177,7 @@ defmodule MemexWeb.NoteLiveTest do assert html =~ "context" assert html =~ Routes.note_show_path(Endpoint, :show, note_slug) - assert has_element?(show_live, "[data-qa=\"note-link-#{note_slug}\"]") + assert has_element?(show_live, "a", note_slug) end end end diff --git a/test/memex_web/live/pipeline_live_test.exs b/test/memex_web/live/pipeline_live_test.exs index 6af87bb..b67a822 100644 --- a/test/memex_web/live/pipeline_live_test.exs +++ b/test/memex_web/live/pipeline_live_test.exs @@ -81,7 +81,7 @@ defmodule MemexWeb.PipelineLiveTest do test "updates pipeline in listing", %{conn: conn, pipeline: pipeline} do {:ok, index_live, _html} = live(conn, Routes.pipeline_index_path(conn, :index)) - assert index_live |> element("[data-qa=\"pipeline-edit-#{pipeline.id}\"]") |> render_click() =~ + assert index_live |> element(~s/a[aria-label="edit #{pipeline.slug}"]/) |> render_click() =~ "edit" assert_patch(index_live, Routes.pipeline_index_path(conn, :edit, pipeline.slug)) @@ -104,7 +104,7 @@ defmodule MemexWeb.PipelineLiveTest do {:ok, index_live, _html} = live(conn, Routes.pipeline_index_path(conn, :index)) assert index_live - |> element("[data-qa=\"delete-pipeline-#{pipeline.id}\"]") + |> element(~s/a[aria-label="delete #{pipeline.slug}"]/) |> render_click() refute has_element?(index_live, "#pipeline-#{pipeline.id}") @@ -151,7 +151,7 @@ defmodule MemexWeb.PipelineLiveTest do {:ok, index_live, _html} = show_live - |> element("[data-qa=\"delete-pipeline-#{pipeline.id}\"]") + |> element(~s/button[aria-label="delete #{pipeline.slug}"]/) |> render_click() |> follow_redirect(conn, Routes.pipeline_index_path(conn, :index)) @@ -161,9 +161,7 @@ defmodule MemexWeb.PipelineLiveTest do test "creates a step", %{conn: conn, pipeline: pipeline} do {:ok, show_live, _html} = live(conn, Routes.pipeline_show_path(conn, :show, pipeline.slug)) - show_live - |> element("[data-qa=\"add-step-#{pipeline.id}\"]") - |> render_click() + show_live |> element("a", "add step") |> render_click() assert_patch(show_live, Routes.pipeline_show_path(conn, :add_step, pipeline.slug)) @@ -199,7 +197,7 @@ defmodule MemexWeb.PipelineLiveTest do {:ok, show_live, _html} = live(conn, Routes.pipeline_show_path(conn, :show, pipeline.slug)) show_live - |> element("[data-qa=\"edit-step-#{step.id}\"]") + |> element(~s/a[aria-label="edit #{step.title}"]/) |> render_click() assert_patch(show_live, Routes.pipeline_show_path(conn, :edit_step, pipeline.slug, step.id)) @@ -223,7 +221,7 @@ defmodule MemexWeb.PipelineLiveTest do html = show_live - |> element("[data-qa=\"delete-step-#{step.id}\"]") + |> element(~s/button[aria-label="delete #{step.title}"]/) |> render_click() assert_patch(show_live, Routes.pipeline_show_path(conn, :show, pipeline.slug)) @@ -250,25 +248,25 @@ defmodule MemexWeb.PipelineLiveTest do html = show_live - |> element("[data-qa=\"move-step-up-#{second_step.id}\"]") + |> element(~s/button[aria-label="move #{second_step.title} up"]/) |> render_click() assert html =~ "1. second step" assert html =~ "2. first step" assert html =~ "3. third step" - refute has_element?(show_live, "[data-qa=\"move-step-up-#{second_step.id}\"]") + refute has_element?(show_live, ~s/button[aria-label="move #{second_step.title} up"]/) html = show_live - |> element("[data-qa=\"move-step-down-#{first_step.id}\"]") + |> element(~s/button[aria-label="move #{first_step.title} down"]/) |> render_click() assert html =~ "1. second step" assert html =~ "2. third step" assert html =~ "3. first step" - refute has_element?(show_live, "[data-qa=\"move-step-down-#{first_step.id}\"]") + refute has_element?(show_live, ~s/button[aria-label="move #{first_step.title} down"]/) end end end