diff --git a/changelog.md b/changelog.md
index c4976dd..e22db5a 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,5 +1,6 @@
# v0.1.1
- improve search a whole lot
+- improve table information for notes and contexts
# v0.1.0
initial release >:3c
diff --git a/lib/memex_web/components/contexts_table_component.ex b/lib/memex_web/components/contexts_table_component.ex
index 1443366..cc2456c 100644
--- a/lib/memex_web/components/contexts_table_component.ex
+++ b/lib/memex_web/components/contexts_table_component.ex
@@ -4,7 +4,7 @@ defmodule MemexWeb.Components.ContextsTableComponent do
"""
use MemexWeb, :live_component
alias Ecto.UUID
- alias Memex.{Accounts.User, Contexts, Contexts.Context}
+ alias Memex.{Accounts.User, Contexts.Context}
alias Phoenix.LiveView.{Rendered, Socket}
@impl true
@@ -45,7 +45,6 @@ defmodule MemexWeb.Components.ContextsTableComponent do
columns = [
%{label: gettext("slug"), key: :slug},
- %{label: gettext("content"), key: :content},
%{label: gettext("tags"), key: :tags},
%{label: gettext("visibility"), key: :visibility}
| columns
@@ -105,20 +104,8 @@ defmodule MemexWeb.Components.ContextsTableComponent do
{slug, slug_block}
end
- defp get_value_for_key(:content, %{content: content}, _additional_data) do
- assigns = %{content: content}
-
- content_block = ~H"""
-
- <%= @content %>
-
- """
-
- {content, content_block}
- end
-
defp get_value_for_key(:tags, %{tags: tags}, _additional_data) do
- tags |> Contexts.get_tags_string()
+ tags |> Enum.join(", ")
end
defp get_value_for_key(:actions, context, %{actions: actions}) do
diff --git a/lib/memex_web/components/notes_table_component.ex b/lib/memex_web/components/notes_table_component.ex
index 081f981..94f8b7c 100644
--- a/lib/memex_web/components/notes_table_component.ex
+++ b/lib/memex_web/components/notes_table_component.ex
@@ -4,7 +4,7 @@ defmodule MemexWeb.Components.NotesTableComponent do
"""
use MemexWeb, :live_component
alias Ecto.UUID
- alias Memex.{Accounts.User, Notes, Notes.Note}
+ alias Memex.{Accounts.User, Notes.Note}
alias Phoenix.LiveView.{Rendered, Socket}
@impl true
@@ -45,7 +45,6 @@ defmodule MemexWeb.Components.NotesTableComponent do
columns = [
%{label: gettext("slug"), key: :slug},
- %{label: gettext("content"), key: :content},
%{label: gettext("tags"), key: :tags},
%{label: gettext("visibility"), key: :visibility}
| columns
@@ -105,20 +104,8 @@ defmodule MemexWeb.Components.NotesTableComponent do
{slug, slug_block}
end
- defp get_value_for_key(:content, %{content: content}, _additional_data) do
- assigns = %{content: content}
-
- content_block = ~H"""
-
- <%= @content %>
-
- """
-
- {content, content_block}
- end
-
defp get_value_for_key(:tags, %{tags: tags}, _additional_data) do
- tags |> Notes.get_tags_string()
+ tags |> Enum.join(", ")
end
defp get_value_for_key(:actions, note, %{actions: actions}) do
diff --git a/lib/memex_web/components/pipelines_table_component.ex b/lib/memex_web/components/pipelines_table_component.ex
index f3a9afd..542d5c5 100644
--- a/lib/memex_web/components/pipelines_table_component.ex
+++ b/lib/memex_web/components/pipelines_table_component.ex
@@ -4,7 +4,7 @@ defmodule MemexWeb.Components.PipelinesTableComponent do
"""
use MemexWeb, :live_component
alias Ecto.UUID
- alias Memex.{Accounts.User, Pipelines, Pipelines.Pipeline}
+ alias Memex.{Accounts.User, Pipelines.Pipeline}
alias Phoenix.LiveView.{Rendered, Socket}
@impl true
@@ -118,7 +118,7 @@ defmodule MemexWeb.Components.PipelinesTableComponent do
end
defp get_value_for_key(:tags, %{tags: tags}, _additional_data) do
- tags |> Pipelines.get_tags_string()
+ tags |> Enum.join(", ")
end
defp get_value_for_key(:actions, pipeline, %{actions: actions}) do
diff --git a/priv/gettext/de/LC_MESSAGES/default.po b/priv/gettext/de/LC_MESSAGES/default.po
index f462372..b6420bf 100644
--- a/priv/gettext/de/LC_MESSAGES/default.po
+++ b/priv/gettext/de/LC_MESSAGES/default.po
@@ -118,8 +118,6 @@ msgstr ""
msgid "confirm new password"
msgstr ""
-#: lib/memex_web/components/contexts_table_component.ex:48
-#: lib/memex_web/components/notes_table_component.ex:48
#: lib/memex_web/live/note_live/form_component.html.heex:23
#, elixir-autogen, elixir-format
msgid "content"
@@ -349,8 +347,8 @@ msgstr ""
msgid "tag1,tag2"
msgstr ""
-#: lib/memex_web/components/contexts_table_component.ex:49
-#: lib/memex_web/components/notes_table_component.ex:49
+#: lib/memex_web/components/contexts_table_component.ex:48
+#: lib/memex_web/components/notes_table_component.ex:48
#: lib/memex_web/components/pipelines_table_component.ex:49
#, elixir-autogen, elixir-format
msgid "tags"
@@ -381,8 +379,8 @@ msgstr ""
msgid "view the source code"
msgstr ""
-#: lib/memex_web/components/contexts_table_component.ex:50
-#: lib/memex_web/components/notes_table_component.ex:50
+#: lib/memex_web/components/contexts_table_component.ex:49
+#: lib/memex_web/components/notes_table_component.ex:49
#: lib/memex_web/components/pipelines_table_component.ex:50
#, elixir-autogen, elixir-format
msgid "visibility"
diff --git a/priv/gettext/default.pot b/priv/gettext/default.pot
index fb5cbe6..1dfc62a 100644
--- a/priv/gettext/default.pot
+++ b/priv/gettext/default.pot
@@ -107,8 +107,6 @@ msgstr ""
msgid "confirm new password"
msgstr ""
-#: lib/memex_web/components/contexts_table_component.ex:48
-#: lib/memex_web/components/notes_table_component.ex:48
#: lib/memex_web/live/note_live/form_component.html.heex:23
#, elixir-autogen, elixir-format
msgid "content"
@@ -338,8 +336,8 @@ msgstr ""
msgid "tag1,tag2"
msgstr ""
-#: lib/memex_web/components/contexts_table_component.ex:49
-#: lib/memex_web/components/notes_table_component.ex:49
+#: lib/memex_web/components/contexts_table_component.ex:48
+#: lib/memex_web/components/notes_table_component.ex:48
#: lib/memex_web/components/pipelines_table_component.ex:49
#, elixir-autogen, elixir-format
msgid "tags"
@@ -370,8 +368,8 @@ msgstr ""
msgid "view the source code"
msgstr ""
-#: lib/memex_web/components/contexts_table_component.ex:50
-#: lib/memex_web/components/notes_table_component.ex:50
+#: lib/memex_web/components/contexts_table_component.ex:49
+#: lib/memex_web/components/notes_table_component.ex:49
#: lib/memex_web/components/pipelines_table_component.ex:50
#, elixir-autogen, elixir-format
msgid "visibility"
diff --git a/test/memex_web/live/context_live_test.exs b/test/memex_web/live/context_live_test.exs
index 782b714..a97bcc1 100644
--- a/test/memex_web/live/context_live_test.exs
+++ b/test/memex_web/live/context_live_test.exs
@@ -34,7 +34,7 @@ defmodule MemexWeb.ContextLiveTest do
{:ok, _index_live, html} = live(conn, Routes.context_index_path(conn, :index))
assert html =~ "contexts"
- assert html =~ context.content
+ assert html =~ context.slug
end
test "saves new context", %{conn: conn} do
@@ -56,7 +56,7 @@ defmodule MemexWeb.ContextLiveTest do
|> follow_redirect(conn, Routes.context_index_path(conn, :index))
assert html =~ "#{@create_attrs |> Map.get("slug")} created"
- assert html =~ "some content"
+ assert html =~ "some-slug"
end
test "updates context in listing", %{conn: conn, context: context} do
@@ -78,7 +78,7 @@ defmodule MemexWeb.ContextLiveTest do
|> follow_redirect(conn, Routes.context_index_path(conn, :index))
assert html =~ "#{@update_attrs |> Map.get("slug")} saved"
- assert html =~ "some updated content"
+ assert html =~ "some-updated-slug"
end
test "deletes context in listing", %{conn: conn, context: context} do
@@ -96,7 +96,7 @@ defmodule MemexWeb.ContextLiveTest do
{:ok, _show_live, html} = live(conn, Routes.context_show_path(conn, :show, context.slug))
assert html =~ "context"
- assert html =~ context.content
+ assert html =~ context.slug
end
test "updates context within modal", %{conn: conn, context: context} do
@@ -117,7 +117,7 @@ defmodule MemexWeb.ContextLiveTest do
|> follow_redirect(conn, Routes.context_show_path(conn, :show, context.slug))
assert html =~ "#{context.slug} saved"
- assert html =~ "some updated content"
+ assert html =~ "tag2"
end
test "deletes context", %{conn: conn, context: context} do
diff --git a/test/memex_web/live/note_live_test.exs b/test/memex_web/live/note_live_test.exs
index d93aebc..b4ea767 100644
--- a/test/memex_web/live/note_live_test.exs
+++ b/test/memex_web/live/note_live_test.exs
@@ -34,7 +34,7 @@ defmodule MemexWeb.NoteLiveTest do
{:ok, _index_live, html} = live(conn, Routes.note_index_path(conn, :index))
assert html =~ "notes"
- assert html =~ note.content
+ assert html =~ note.slug
end
test "saves new note", %{conn: conn} do
@@ -56,7 +56,7 @@ defmodule MemexWeb.NoteLiveTest do
|> follow_redirect(conn, Routes.note_index_path(conn, :index))
assert html =~ "#{@create_attrs |> Map.get("slug")} created"
- assert html =~ "some content"
+ assert html =~ "some-slug"
end
test "updates note in listing", %{conn: conn, note: note} do
@@ -78,7 +78,7 @@ defmodule MemexWeb.NoteLiveTest do
|> follow_redirect(conn, Routes.note_index_path(conn, :index))
assert html =~ "#{@update_attrs |> Map.get("slug")} saved"
- assert html =~ "some updated content"
+ assert html =~ "some-updated-slug"
end
test "deletes note in listing", %{conn: conn, note: note} do
@@ -96,7 +96,7 @@ defmodule MemexWeb.NoteLiveTest do
{:ok, _show_live, html} = live(conn, Routes.note_show_path(conn, :show, note.slug))
assert html =~ "note"
- assert html =~ note.content
+ assert html =~ note.slug
end
test "updates note within modal", %{conn: conn, note: note} do
@@ -117,7 +117,7 @@ defmodule MemexWeb.NoteLiveTest do
|> follow_redirect(conn, Routes.note_show_path(conn, :show, note.slug))
assert html =~ "#{note.slug} saved"
- assert html =~ "some updated content"
+ assert html =~ "tag2"
end
test "deletes note", %{conn: conn, note: note} do