simply assigns
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
shibao 2023-04-14 20:32:47 -04:00
parent 026bf22f60
commit 994aa96a20
2 changed files with 5 additions and 15 deletions

View File

@ -88,9 +88,7 @@ defmodule MemexWeb.Components.NotesTableComponent do
@spec get_value_for_key(atom(), Note.t(), additional_data :: map()) ::
any() | {any(), Rendered.t()}
defp get_value_for_key(:slug, %{slug: slug}, _additional_data) do
assigns = %{slug: slug}
defp get_value_for_key(:slug, %{slug: slug} = assigns, _additional_data) do
slug_block = ~H"""
<.link navigate={~p"/note/#{@slug}"} class="link">
<%= @slug %>
@ -100,9 +98,7 @@ defmodule MemexWeb.Components.NotesTableComponent do
{slug, slug_block}
end
defp get_value_for_key(:tags, %{tags: tags}, _additional_data) do
assigns = %{tags: tags}
defp get_value_for_key(:tags, assigns, _additional_data) do
~H"""
<div class="flex flex-wrap justify-center space-x-1">
<.link :for={tag <- @tags} patch={~p"/notes/#{tag}"} class="link">

View File

@ -89,9 +89,7 @@ defmodule MemexWeb.Components.PipelinesTableComponent do
@spec get_value_for_key(atom(), Pipeline.t(), additional_data :: map()) ::
any() | {any(), Rendered.t()}
defp get_value_for_key(:slug, %{slug: slug}, _additional_data) do
assigns = %{slug: slug}
defp get_value_for_key(:slug, %{slug: slug} = assigns, _additional_data) do
slug_block = ~H"""
<.link navigate={~p"/pipeline/#{@slug}"} class="link">
<%= @slug %>
@ -101,9 +99,7 @@ defmodule MemexWeb.Components.PipelinesTableComponent do
{slug, slug_block}
end
defp get_value_for_key(:description, %{description: description}, _additional_data) do
assigns = %{description: description}
defp get_value_for_key(:description, %{description: description} = assigns, _additional_data) do
description_block = ~H"""
<div class="truncate max-w-sm">
<%= @description %>
@ -113,9 +109,7 @@ defmodule MemexWeb.Components.PipelinesTableComponent do
{description, description_block}
end
defp get_value_for_key(:tags, %{tags: tags}, _additional_data) do
assigns = %{tags: tags}
defp get_value_for_key(:tags, assigns, _additional_data) do
~H"""
<div class="flex flex-wrap justify-center space-x-1">
<.link :for={tag <- @tags} patch={~p"/pipelines/#{tag}"} class="link">