Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
634891ee73 | |||
571f6fffdb | |||
926805ba9b | |||
220122dec6 | |||
de399b4819 | |||
c3ceb877b2 | |||
0b4449c8a8 |
10
changelog.md
10
changelog.md
@ -1,3 +1,13 @@
|
||||
# v0.1.4
|
||||
- fix docker-compose
|
||||
- fix newlines in notes/context/step contents
|
||||
- fix user invite page
|
||||
- improve tagging logic
|
||||
|
||||
# v0.1.3
|
||||
- backlink to other notes in notes
|
||||
- search tags on click
|
||||
|
||||
# v0.1.2
|
||||
- fix more typos
|
||||
- add to faq
|
||||
|
10
de.tbx
Normal file
10
de.tbx
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE martif PUBLIC "ISO 12200:1999A//DTD MARTIF core (DXFcdV04)//EN" "TBXcdv04.dtd">
|
||||
<martif type="TBX">
|
||||
<martifHeader>
|
||||
<fileDesc>
|
||||
<sourceDesc><p>Translate Toolkit</p></sourceDesc>
|
||||
</fileDesc>
|
||||
</martifHeader>
|
||||
<text><body></body></text>
|
||||
</martif>
|
@ -2,8 +2,7 @@ version: '3'
|
||||
|
||||
services:
|
||||
memex:
|
||||
build:
|
||||
context: .
|
||||
image: shibaobun/memex
|
||||
container_name: memex
|
||||
restart: always
|
||||
environment:
|
||||
|
@ -4,7 +4,6 @@ defmodule Memex.Contexts do
|
||||
"""
|
||||
|
||||
import Ecto.Query, warn: false
|
||||
alias Ecto.Changeset
|
||||
alias Memex.{Accounts.User, Contexts.Context, Repo}
|
||||
|
||||
@doc """
|
||||
@ -229,18 +228,4 @@ defmodule Memex.Contexts do
|
||||
def change_context(%Context{} = context, attrs \\ %{}, user) do
|
||||
context |> Context.update_changeset(attrs, user)
|
||||
end
|
||||
|
||||
@doc """
|
||||
Gets a canonical string representation of the `:tags` field for a Note
|
||||
"""
|
||||
@spec get_tags_string(Context.t() | Context.changeset() | [String.t()] | nil) :: String.t()
|
||||
def get_tags_string(nil), do: ""
|
||||
def get_tags_string(tags) when tags |> is_list(), do: tags |> Enum.join(",")
|
||||
def get_tags_string(%Context{tags: tags}), do: tags |> get_tags_string()
|
||||
|
||||
def get_tags_string(%Changeset{} = changeset) do
|
||||
changeset
|
||||
|> Changeset.get_field(:tags)
|
||||
|> get_tags_string()
|
||||
end
|
||||
end
|
||||
|
@ -27,7 +27,7 @@ defmodule Memex.Contexts.Context do
|
||||
slug: slug(),
|
||||
content: String.t(),
|
||||
tags: [String.t()] | nil,
|
||||
tags_string: String.t(),
|
||||
tags_string: String.t() | nil,
|
||||
visibility: :public | :private | :unlisted,
|
||||
user: User.t() | Ecto.Association.NotLoaded.t(),
|
||||
user_id: User.id(),
|
||||
@ -66,16 +66,38 @@ defmodule Memex.Contexts.Context do
|
||||
|> unsafe_validate_unique(:slug, Repo)
|
||||
end
|
||||
|
||||
defp cast_tags_string(changeset, %{"tags_string" => tags_string})
|
||||
when tags_string |> is_binary() do
|
||||
tags =
|
||||
tags_string
|
||||
|> String.split(",", trim: true)
|
||||
|> Enum.map(fn str -> str |> String.trim() end)
|
||||
|> Enum.sort()
|
||||
|
||||
changeset |> change(tags: tags)
|
||||
defp cast_tags_string(changeset, attrs) do
|
||||
changeset
|
||||
|> put_change(:tags_string, changeset |> get_field(:tags) |> get_tags_string())
|
||||
|> cast(attrs, [:tags_string])
|
||||
|> validate_format(:tags_string, ~r/^[\p{L}\p{N}\-\,]+$/,
|
||||
message:
|
||||
dgettext(
|
||||
"errors",
|
||||
"invalid format: only numbers, letters and hyphen are accepted. tags must be comma-delimited"
|
||||
)
|
||||
)
|
||||
|> cast_tags()
|
||||
end
|
||||
|
||||
defp cast_tags_string(changeset, _attrs), do: changeset
|
||||
defp cast_tags(%{valid?: false} = changeset), do: changeset
|
||||
|
||||
defp cast_tags(%{valid?: true} = changeset) do
|
||||
tags = changeset |> get_field(:tags_string) |> process_tags()
|
||||
changeset |> put_change(:tags, tags)
|
||||
end
|
||||
|
||||
defp process_tags(tags_string) when tags_string |> is_binary() do
|
||||
tags_string
|
||||
|> String.split(",", trim: true)
|
||||
|> Enum.map(fn str -> str |> String.trim() end)
|
||||
|> Enum.reject(fn str -> str |> is_nil() end)
|
||||
|> Enum.sort()
|
||||
end
|
||||
|
||||
defp process_tags(_other_tags_string), do: []
|
||||
|
||||
@spec get_tags_string([String.t()] | nil) :: String.t()
|
||||
def get_tags_string(nil), do: ""
|
||||
def get_tags_string(tags) when tags |> is_list(), do: tags |> Enum.join(",")
|
||||
end
|
||||
|
@ -4,7 +4,6 @@ defmodule Memex.Notes do
|
||||
"""
|
||||
|
||||
import Ecto.Query, warn: false
|
||||
alias Ecto.Changeset
|
||||
alias Memex.{Accounts.User, Notes.Note, Repo}
|
||||
|
||||
@doc """
|
||||
@ -229,18 +228,4 @@ defmodule Memex.Notes do
|
||||
def change_note(%Note{} = note, attrs \\ %{}, user) do
|
||||
note |> Note.update_changeset(attrs, user)
|
||||
end
|
||||
|
||||
@doc """
|
||||
Gets a canonical string representation of the `:tags` field for a Note
|
||||
"""
|
||||
@spec get_tags_string(Note.t() | Note.changeset() | [String.t()] | nil) :: String.t()
|
||||
def get_tags_string(nil), do: ""
|
||||
def get_tags_string(tags) when tags |> is_list(), do: tags |> Enum.join(",")
|
||||
def get_tags_string(%Note{tags: tags}), do: tags |> get_tags_string()
|
||||
|
||||
def get_tags_string(%Changeset{} = changeset) do
|
||||
changeset
|
||||
|> Changeset.get_field(:tags)
|
||||
|> get_tags_string()
|
||||
end
|
||||
end
|
||||
|
@ -26,7 +26,7 @@ defmodule Memex.Notes.Note do
|
||||
slug: slug(),
|
||||
content: String.t(),
|
||||
tags: [String.t()] | nil,
|
||||
tags_string: String.t(),
|
||||
tags_string: String.t() | nil,
|
||||
visibility: :public | :private | :unlisted,
|
||||
user: User.t() | Ecto.Association.NotLoaded.t(),
|
||||
user_id: User.id(),
|
||||
@ -65,16 +65,38 @@ defmodule Memex.Notes.Note do
|
||||
|> unsafe_validate_unique(:slug, Repo)
|
||||
end
|
||||
|
||||
defp cast_tags_string(changeset, %{"tags_string" => tags_string})
|
||||
when tags_string |> is_binary() do
|
||||
tags =
|
||||
tags_string
|
||||
|> String.split(",", trim: true)
|
||||
|> Enum.map(fn str -> str |> String.trim() end)
|
||||
|> Enum.sort()
|
||||
|
||||
changeset |> change(tags: tags)
|
||||
defp cast_tags_string(changeset, attrs) do
|
||||
changeset
|
||||
|> put_change(:tags_string, changeset |> get_field(:tags) |> get_tags_string())
|
||||
|> cast(attrs, [:tags_string])
|
||||
|> validate_format(:tags_string, ~r/^[\p{L}\p{N}\-\,]+$/,
|
||||
message:
|
||||
dgettext(
|
||||
"errors",
|
||||
"invalid format: only numbers, letters and hyphen are accepted. tags must be comma-delimited"
|
||||
)
|
||||
)
|
||||
|> cast_tags()
|
||||
end
|
||||
|
||||
defp cast_tags_string(changeset, _attrs), do: changeset
|
||||
defp cast_tags(%{valid?: false} = changeset), do: changeset
|
||||
|
||||
defp cast_tags(%{valid?: true} = changeset) do
|
||||
tags = changeset |> get_field(:tags_string) |> process_tags()
|
||||
changeset |> put_change(:tags, tags)
|
||||
end
|
||||
|
||||
defp process_tags(tags_string) when tags_string |> is_binary() do
|
||||
tags_string
|
||||
|> String.split(",", trim: true)
|
||||
|> Enum.map(fn str -> str |> String.trim() end)
|
||||
|> Enum.reject(fn str -> str |> is_nil() end)
|
||||
|> Enum.sort()
|
||||
end
|
||||
|
||||
defp process_tags(_other_tags_string), do: []
|
||||
|
||||
@spec get_tags_string([String.t()] | nil) :: String.t()
|
||||
def get_tags_string(nil), do: ""
|
||||
def get_tags_string(tags) when tags |> is_list(), do: tags |> Enum.join(",")
|
||||
end
|
||||
|
@ -4,7 +4,6 @@ defmodule Memex.Pipelines do
|
||||
"""
|
||||
|
||||
import Ecto.Query, warn: false
|
||||
alias Ecto.Changeset
|
||||
alias Memex.{Accounts.User, Pipelines.Pipeline, Repo}
|
||||
|
||||
@doc """
|
||||
@ -231,18 +230,4 @@ defmodule Memex.Pipelines do
|
||||
def change_pipeline(%Pipeline{} = pipeline, attrs \\ %{}, user) do
|
||||
pipeline |> Pipeline.update_changeset(attrs, user)
|
||||
end
|
||||
|
||||
@doc """
|
||||
Gets a canonical string representation of the `:tags` field for a Pipeline
|
||||
"""
|
||||
@spec get_tags_string(Pipeline.t() | Pipeline.changeset() | [String.t()] | nil) :: String.t()
|
||||
def get_tags_string(nil), do: ""
|
||||
def get_tags_string(tags) when tags |> is_list(), do: tags |> Enum.join(",")
|
||||
def get_tags_string(%Pipeline{tags: tags}), do: tags |> get_tags_string()
|
||||
|
||||
def get_tags_string(%Changeset{} = changeset) do
|
||||
changeset
|
||||
|> Changeset.get_field(:tags)
|
||||
|> get_tags_string()
|
||||
end
|
||||
end
|
||||
|
@ -28,7 +28,7 @@ defmodule Memex.Pipelines.Pipeline do
|
||||
slug: slug(),
|
||||
description: String.t(),
|
||||
tags: [String.t()] | nil,
|
||||
tags_string: String.t(),
|
||||
tags_string: String.t() | nil,
|
||||
visibility: :public | :private | :unlisted,
|
||||
user: User.t() | Ecto.Association.NotLoaded.t(),
|
||||
user_id: User.id(),
|
||||
@ -67,16 +67,38 @@ defmodule Memex.Pipelines.Pipeline do
|
||||
|> unsafe_validate_unique(:slug, Repo)
|
||||
end
|
||||
|
||||
defp cast_tags_string(changeset, %{"tags_string" => tags_string})
|
||||
when tags_string |> is_binary() do
|
||||
tags =
|
||||
tags_string
|
||||
|> String.split(",", trim: true)
|
||||
|> Enum.map(fn str -> str |> String.trim() end)
|
||||
|> Enum.sort()
|
||||
|
||||
changeset |> change(tags: tags)
|
||||
defp cast_tags_string(changeset, attrs) do
|
||||
changeset
|
||||
|> put_change(:tags_string, changeset |> get_field(:tags) |> get_tags_string())
|
||||
|> cast(attrs, [:tags_string])
|
||||
|> validate_format(:tags_string, ~r/^[\p{L}\p{N}\-\,]+$/,
|
||||
message:
|
||||
dgettext(
|
||||
"errors",
|
||||
"invalid format: only numbers, letters and hyphen are accepted. tags must be comma-delimited"
|
||||
)
|
||||
)
|
||||
|> cast_tags()
|
||||
end
|
||||
|
||||
defp cast_tags_string(changeset, _attrs), do: changeset
|
||||
defp cast_tags(%{valid?: false} = changeset), do: changeset
|
||||
|
||||
defp cast_tags(%{valid?: true} = changeset) do
|
||||
tags = changeset |> get_field(:tags_string) |> process_tags()
|
||||
changeset |> put_change(:tags, tags)
|
||||
end
|
||||
|
||||
defp process_tags(tags_string) when tags_string |> is_binary() do
|
||||
tags_string
|
||||
|> String.split(",", trim: true)
|
||||
|> Enum.map(fn str -> str |> String.trim() end)
|
||||
|> Enum.reject(fn str -> str |> is_nil() end)
|
||||
|> Enum.sort()
|
||||
end
|
||||
|
||||
defp process_tags(_other_tags_string), do: []
|
||||
|
||||
@spec get_tags_string([String.t()] | nil) :: String.t()
|
||||
def get_tags_string(nil), do: ""
|
||||
def get_tags_string(tags) when tags |> is_list(), do: tags |> Enum.join(",")
|
||||
end
|
||||
|
@ -39,6 +39,7 @@ defmodule MemexWeb.Components.ContextContent do
|
||||
"</p>#{link}<p class=\"inline\">"
|
||||
end
|
||||
)
|
||||
|> String.replace("\n", "<br>")
|
||||
|> HTML.raw()
|
||||
end
|
||||
end
|
||||
|
@ -105,7 +105,17 @@ defmodule MemexWeb.Components.ContextsTableComponent do
|
||||
end
|
||||
|
||||
defp get_value_for_key(:tags, %{tags: tags}, _additional_data) do
|
||||
tags |> Enum.join(", ")
|
||||
assigns = %{tags: tags}
|
||||
|
||||
~H"""
|
||||
<div class="flex flex-wrap justify-center space-x-1">
|
||||
<%= for tag <- @tags do %>
|
||||
<.link patch={Routes.context_index_path(Endpoint, :search, tag)} class="link">
|
||||
<%= tag %>
|
||||
</.link>
|
||||
<% end %>
|
||||
</div>
|
||||
"""
|
||||
end
|
||||
|
||||
defp get_value_for_key(:actions, context, %{actions: actions}) do
|
||||
|
45
lib/memex_web/components/note_content.ex
Normal file
45
lib/memex_web/components/note_content.ex
Normal file
@ -0,0 +1,45 @@
|
||||
defmodule MemexWeb.Components.NoteContent do
|
||||
@moduledoc """
|
||||
Display the content for a note
|
||||
"""
|
||||
use MemexWeb, :component
|
||||
alias Memex.Notes.Note
|
||||
alias Phoenix.HTML
|
||||
|
||||
attr :note, Note, required: true
|
||||
|
||||
def note_content(assigns) do
|
||||
~H"""
|
||||
<div
|
||||
id={"show-note-content-#{@note.id}"}
|
||||
class="input input-primary h-128 min-h-128 inline-block"
|
||||
phx-hook="MaintainAttrs"
|
||||
phx-update="ignore"
|
||||
readonly
|
||||
phx-no-format
|
||||
><p class="inline"><%= add_links_to_content(@note.content) %></p></div>
|
||||
"""
|
||||
end
|
||||
|
||||
defp add_links_to_content(content) do
|
||||
Regex.replace(
|
||||
~r/\[\[([\p{L}\p{N}\-]+)\]\]/,
|
||||
content,
|
||||
fn _whole_match, slug ->
|
||||
link =
|
||||
HTML.Link.link(
|
||||
"[[#{slug}]]",
|
||||
to: Routes.note_show_path(Endpoint, :show, slug),
|
||||
class: "link inline",
|
||||
data: [qa: "note-link-#{slug}"]
|
||||
)
|
||||
|> HTML.Safe.to_iodata()
|
||||
|> IO.iodata_to_binary()
|
||||
|
||||
"</p>#{link}<p class=\"inline\">"
|
||||
end
|
||||
)
|
||||
|> String.replace("\n", "<br>")
|
||||
|> HTML.raw()
|
||||
end
|
||||
end
|
@ -105,7 +105,17 @@ defmodule MemexWeb.Components.NotesTableComponent do
|
||||
end
|
||||
|
||||
defp get_value_for_key(:tags, %{tags: tags}, _additional_data) do
|
||||
tags |> Enum.join(", ")
|
||||
assigns = %{tags: tags}
|
||||
|
||||
~H"""
|
||||
<div class="flex flex-wrap justify-center space-x-1">
|
||||
<%= for tag <- @tags do %>
|
||||
<.link patch={Routes.note_index_path(Endpoint, :search, tag)} class="link">
|
||||
<%= tag %>
|
||||
</.link>
|
||||
<% end %>
|
||||
</div>
|
||||
"""
|
||||
end
|
||||
|
||||
defp get_value_for_key(:actions, note, %{actions: actions}) do
|
||||
|
@ -118,7 +118,17 @@ defmodule MemexWeb.Components.PipelinesTableComponent do
|
||||
end
|
||||
|
||||
defp get_value_for_key(:tags, %{tags: tags}, _additional_data) do
|
||||
tags |> Enum.join(", ")
|
||||
assigns = %{tags: tags}
|
||||
|
||||
~H"""
|
||||
<div class="flex flex-wrap justify-center space-x-1">
|
||||
<%= for tag <- @tags do %>
|
||||
<.link patch={Routes.pipeline_index_path(Endpoint, :search, tag)} class="link">
|
||||
<%= tag %>
|
||||
</.link>
|
||||
<% end %>
|
||||
</div>
|
||||
"""
|
||||
end
|
||||
|
||||
defp get_value_for_key(:actions, pipeline, %{actions: actions}) do
|
||||
|
@ -39,6 +39,7 @@ defmodule MemexWeb.Components.StepContent do
|
||||
"</p>#{link}<p class=\"inline\">"
|
||||
end
|
||||
)
|
||||
|> String.replace("\n", "<br>")
|
||||
|> HTML.raw()
|
||||
end
|
||||
end
|
||||
|
@ -22,15 +22,15 @@ defmodule MemexWeb.Components.UserCard do
|
||||
<%= if @user.confirmed_at |> is_nil() do %>
|
||||
<%= gettext("email unconfirmed") %>
|
||||
<% else %>
|
||||
<%= gettext(
|
||||
"user was confirmed at %{relative_datetime}",
|
||||
relative_datetime: @user.confirmed_at |> display_datetime()
|
||||
) %>
|
||||
<p>
|
||||
<%= gettext("user confirmed on") %>
|
||||
<%= @user.confirmed_at |> display_datetime() %>
|
||||
</p>
|
||||
<% end %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%= gettext("User registered on") %>
|
||||
<%= gettext("user registered on") %>
|
||||
<%= @user.inserted_at |> display_datetime() %>
|
||||
</p>
|
||||
</h3>
|
||||
|
@ -27,9 +27,7 @@
|
||||
<%= text_input(f, :tags_string,
|
||||
id: "tags-input",
|
||||
class: "input input-primary",
|
||||
placeholder: gettext("tag1,tag2"),
|
||||
phx_update: "ignore",
|
||||
value: Contexts.get_tags_string(@changeset)
|
||||
placeholder: gettext("tag1,tag2")
|
||||
) %>
|
||||
<%= error_tag(f, :tags_string) %>
|
||||
|
||||
|
@ -3,7 +3,13 @@
|
||||
<%= @context.slug %>
|
||||
</h1>
|
||||
|
||||
<p><%= if @context.tags, do: @context.tags |> Enum.join(", ") %></p>
|
||||
<div class="flex flex-wrap space-x-1">
|
||||
<%= for tag <- @context.tags do %>
|
||||
<.link navigate={Routes.context_index_path(Endpoint, :search, tag)} class="link">
|
||||
<%= tag %>
|
||||
</.link>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<.context_content context={@context} />
|
||||
|
||||
|
@ -27,9 +27,7 @@
|
||||
<%= text_input(f, :tags_string,
|
||||
id: "tags-input",
|
||||
class: "input input-primary",
|
||||
placeholder: gettext("tag1,tag2"),
|
||||
phx_update: "ignore",
|
||||
value: Notes.get_tags_string(@changeset)
|
||||
placeholder: gettext("tag1,tag2")
|
||||
) %>
|
||||
<%= error_tag(f, :tags_string) %>
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
defmodule MemexWeb.NoteLive.Show do
|
||||
use MemexWeb, :live_view
|
||||
|
||||
import MemexWeb.Components.NoteContent
|
||||
alias Memex.{Accounts.User, Notes, Notes.Note}
|
||||
|
||||
@impl true
|
||||
|
@ -3,16 +3,15 @@
|
||||
<%= @note.slug %>
|
||||
</h1>
|
||||
|
||||
<p><%= if @note.tags, do: @note.tags |> Enum.join(", ") %></p>
|
||||
<div class="flex flex-wrap space-x-1">
|
||||
<%= for tag <- @note.tags do %>
|
||||
<.link navigate={Routes.note_index_path(Endpoint, :search, tag)} class="link">
|
||||
<%= tag %>
|
||||
</.link>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<textarea
|
||||
id="show-note-content"
|
||||
class="input input-primary h-128 min-h-128"
|
||||
phx-hook="MaintainAttrs"
|
||||
phx-update="ignore"
|
||||
readonly
|
||||
phx-no-format
|
||||
><%= @note.content %></textarea>
|
||||
<.note_content note={@note} />
|
||||
|
||||
<p class="self-end">
|
||||
<%= gettext("Visibility: %{visibility}", visibility: @note.visibility) %>
|
||||
|
@ -27,9 +27,7 @@
|
||||
<%= text_input(f, :tags_string,
|
||||
id: "tags-input",
|
||||
class: "input input-primary",
|
||||
placeholder: gettext("tag1,tag2"),
|
||||
phx_update: "ignore",
|
||||
value: Pipelines.get_tags_string(@changeset)
|
||||
placeholder: gettext("tag1,tag2")
|
||||
) %>
|
||||
<%= error_tag(f, :tags_string) %>
|
||||
|
||||
|
@ -3,7 +3,13 @@
|
||||
<%= @pipeline.slug %>
|
||||
</h1>
|
||||
|
||||
<p><%= if @pipeline.tags, do: @pipeline.tags |> Enum.join(", ") %></p>
|
||||
<div class="flex flex-wrap space-x-1">
|
||||
<%= for tag <- @pipeline.tags do %>
|
||||
<.link navigate={Routes.pipeline_index_path(Endpoint, :search, tag)} class="link">
|
||||
<%= tag %>
|
||||
</.link>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= if @pipeline.description do %>
|
||||
<textarea
|
||||
|
@ -5,7 +5,7 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>
|
||||
<%= dgettext("errors", "Error") %>| memEx
|
||||
<%= dgettext("errors", "Error") %> | memEx
|
||||
</title>
|
||||
<link rel="stylesheet" href="/css/app.css" />
|
||||
<script defer type="text/javascript" src="/js/app.js">
|
||||
|
2
mix.exs
2
mix.exs
@ -4,7 +4,7 @@ defmodule Memex.MixProject do
|
||||
def project do
|
||||
[
|
||||
app: :memex,
|
||||
version: "0.1.2",
|
||||
version: "0.1.4",
|
||||
elixir: "~> 1.14",
|
||||
elixirc_paths: elixirc_paths(Mix.env()),
|
||||
compilers: Mix.compilers(),
|
||||
|
@ -56,12 +56,12 @@ msgid "create invite"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex_web/live/context_live/index.html.heex:49
|
||||
#: lib/memex_web/live/context_live/show.html.heex:34
|
||||
#: lib/memex_web/live/context_live/show.html.heex:40
|
||||
#: lib/memex_web/live/note_live/index.html.heex:49
|
||||
#: lib/memex_web/live/note_live/show.html.heex:38
|
||||
#: lib/memex_web/live/note_live/show.html.heex:37
|
||||
#: lib/memex_web/live/pipeline_live/index.html.heex:49
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:43
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:113
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:49
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:119
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "delete"
|
||||
msgstr ""
|
||||
@ -72,12 +72,12 @@ msgid "delete user"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex_web/live/context_live/index.html.heex:38
|
||||
#: lib/memex_web/live/context_live/show.html.heex:23
|
||||
#: lib/memex_web/live/context_live/show.html.heex:29
|
||||
#: lib/memex_web/live/note_live/index.html.heex:38
|
||||
#: lib/memex_web/live/note_live/show.html.heex:27
|
||||
#: lib/memex_web/live/note_live/show.html.heex:26
|
||||
#: lib/memex_web/live/pipeline_live/index.html.heex:38
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:32
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:102
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:38
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:108
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "edit"
|
||||
msgstr ""
|
||||
@ -124,22 +124,22 @@ msgstr ""
|
||||
msgid "register"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex_web/live/context_live/form_component.html.heex:42
|
||||
#: lib/memex_web/live/note_live/form_component.html.heex:42
|
||||
#: lib/memex_web/live/pipeline_live/form_component.html.heex:42
|
||||
#: lib/memex_web/live/context_live/form_component.html.heex:40
|
||||
#: lib/memex_web/live/note_live/form_component.html.heex:40
|
||||
#: lib/memex_web/live/pipeline_live/form_component.html.heex:40
|
||||
#: lib/memex_web/live/step_live/form_component.html.heex:28
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "save"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex_web/live/context_live/show.html.heex:16
|
||||
#: lib/memex_web/live/note_live/show.html.heex:23
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:25
|
||||
#: lib/memex_web/live/context_live/show.html.heex:22
|
||||
#: lib/memex_web/live/note_live/show.html.heex:22
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:31
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "back"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:129
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:135
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "add step"
|
||||
msgstr ""
|
||||
|
@ -57,12 +57,12 @@ msgid "create invite"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex_web/live/context_live/index.html.heex:49
|
||||
#: lib/memex_web/live/context_live/show.html.heex:34
|
||||
#: lib/memex_web/live/context_live/show.html.heex:40
|
||||
#: lib/memex_web/live/note_live/index.html.heex:49
|
||||
#: lib/memex_web/live/note_live/show.html.heex:38
|
||||
#: lib/memex_web/live/note_live/show.html.heex:37
|
||||
#: lib/memex_web/live/pipeline_live/index.html.heex:49
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:43
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:113
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:49
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:119
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "delete"
|
||||
msgstr ""
|
||||
@ -73,12 +73,12 @@ msgid "delete user"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex_web/live/context_live/index.html.heex:38
|
||||
#: lib/memex_web/live/context_live/show.html.heex:23
|
||||
#: lib/memex_web/live/context_live/show.html.heex:29
|
||||
#: lib/memex_web/live/note_live/index.html.heex:38
|
||||
#: lib/memex_web/live/note_live/show.html.heex:27
|
||||
#: lib/memex_web/live/note_live/show.html.heex:26
|
||||
#: lib/memex_web/live/pipeline_live/index.html.heex:38
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:32
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:102
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:38
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:108
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "edit"
|
||||
msgstr ""
|
||||
@ -125,22 +125,22 @@ msgstr ""
|
||||
msgid "register"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex_web/live/context_live/form_component.html.heex:42
|
||||
#: lib/memex_web/live/note_live/form_component.html.heex:42
|
||||
#: lib/memex_web/live/pipeline_live/form_component.html.heex:42
|
||||
#: lib/memex_web/live/context_live/form_component.html.heex:40
|
||||
#: lib/memex_web/live/note_live/form_component.html.heex:40
|
||||
#: lib/memex_web/live/pipeline_live/form_component.html.heex:40
|
||||
#: lib/memex_web/live/step_live/form_component.html.heex:28
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "save"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex_web/live/context_live/show.html.heex:16
|
||||
#: lib/memex_web/live/note_live/show.html.heex:23
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:25
|
||||
#: lib/memex_web/live/context_live/show.html.heex:22
|
||||
#: lib/memex_web/live/note_live/show.html.heex:22
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:31
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "back"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:129
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:135
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "add step"
|
||||
msgstr ""
|
||||
|
@ -66,11 +66,6 @@ msgstr ""
|
||||
msgid "Settings"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex_web/components/user_card.ex:33
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "User registered on"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex_web/components/invite_card.ex:19
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "Uses Left:"
|
||||
@ -81,9 +76,9 @@ msgstr ""
|
||||
msgid "Uses left"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex_web/live/context_live/show.html.heex:11
|
||||
#: lib/memex_web/live/note_live/show.html.heex:18
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:20
|
||||
#: lib/memex_web/live/context_live/show.html.heex:17
|
||||
#: lib/memex_web/live/note_live/show.html.heex:17
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:26
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "Visibility: %{visibility}"
|
||||
msgstr ""
|
||||
@ -306,17 +301,17 @@ msgstr ""
|
||||
msgid "report bugs or request features"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex_web/live/context_live/form_component.html.heex:43
|
||||
#: lib/memex_web/live/note_live/form_component.html.heex:43
|
||||
#: lib/memex_web/live/pipeline_live/form_component.html.heex:43
|
||||
#: lib/memex_web/live/context_live/form_component.html.heex:41
|
||||
#: lib/memex_web/live/note_live/form_component.html.heex:41
|
||||
#: lib/memex_web/live/pipeline_live/form_component.html.heex:41
|
||||
#: lib/memex_web/live/step_live/form_component.html.heex:29
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "saving..."
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex_web/live/context_live/form_component.html.heex:39
|
||||
#: lib/memex_web/live/note_live/form_component.html.heex:39
|
||||
#: lib/memex_web/live/pipeline_live/form_component.html.heex:39
|
||||
#: lib/memex_web/live/context_live/form_component.html.heex:37
|
||||
#: lib/memex_web/live/note_live/form_component.html.heex:37
|
||||
#: lib/memex_web/live/pipeline_live/form_component.html.heex:37
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "select privacy"
|
||||
msgstr ""
|
||||
@ -350,11 +345,6 @@ msgstr ""
|
||||
msgid "unlimited"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex_web/components/user_card.ex:25
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "user was confirmed at %{relative_datetime}"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex_web/live/invite_live/index.html.heex:120
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "users"
|
||||
@ -501,7 +491,7 @@ msgstr ""
|
||||
msgid "what is this?"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:62
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:68
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "%{position}. %{title}"
|
||||
msgstr ""
|
||||
@ -526,12 +516,12 @@ msgstr ""
|
||||
msgid "add step to %{slug}"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:56
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:62
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "no steps"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:51
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:57
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "steps:"
|
||||
msgstr ""
|
||||
@ -665,3 +655,13 @@ msgstr ""
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "while memEx fully supports multiple users, each memEx instance should be treated as a single cohesive and collaborative document."
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex_web/components/user_card.ex:26
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "user confirmed on"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex_web/components/user_card.ex:33
|
||||
#, elixir-autogen, elixir-format, fuzzy
|
||||
msgid "user registered on"
|
||||
msgstr ""
|
||||
|
@ -131,3 +131,10 @@ msgstr ""
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "unauthorized"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex/contexts/context.ex:75
|
||||
#: lib/memex/notes/note.ex:74
|
||||
#: lib/memex/pipelines/pipeline.ex:76
|
||||
#, elixir-autogen, elixir-format, fuzzy
|
||||
msgid "invalid format: only numbers, letters and hyphen are accepted. tags must be comma-delimited"
|
||||
msgstr ""
|
||||
|
@ -138,12 +138,12 @@ msgid "are you sure you want to make %{invite_name} unlimited?"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex_web/live/context_live/index.html.heex:46
|
||||
#: lib/memex_web/live/context_live/show.html.heex:31
|
||||
#: lib/memex_web/live/context_live/show.html.heex:37
|
||||
#: lib/memex_web/live/note_live/index.html.heex:46
|
||||
#: lib/memex_web/live/note_live/show.html.heex:35
|
||||
#: lib/memex_web/live/note_live/show.html.heex:34
|
||||
#: lib/memex_web/live/pipeline_live/index.html.heex:46
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:40
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:110
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:46
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:116
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "are you sure?"
|
||||
msgstr ""
|
||||
|
@ -55,11 +55,6 @@ msgstr ""
|
||||
msgid "Settings"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex_web/components/user_card.ex:33
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "User registered on"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex_web/components/invite_card.ex:19
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "Uses Left:"
|
||||
@ -70,9 +65,9 @@ msgstr ""
|
||||
msgid "Uses left"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex_web/live/context_live/show.html.heex:11
|
||||
#: lib/memex_web/live/note_live/show.html.heex:18
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:20
|
||||
#: lib/memex_web/live/context_live/show.html.heex:17
|
||||
#: lib/memex_web/live/note_live/show.html.heex:17
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:26
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "Visibility: %{visibility}"
|
||||
msgstr ""
|
||||
@ -295,17 +290,17 @@ msgstr ""
|
||||
msgid "report bugs or request features"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex_web/live/context_live/form_component.html.heex:43
|
||||
#: lib/memex_web/live/note_live/form_component.html.heex:43
|
||||
#: lib/memex_web/live/pipeline_live/form_component.html.heex:43
|
||||
#: lib/memex_web/live/context_live/form_component.html.heex:41
|
||||
#: lib/memex_web/live/note_live/form_component.html.heex:41
|
||||
#: lib/memex_web/live/pipeline_live/form_component.html.heex:41
|
||||
#: lib/memex_web/live/step_live/form_component.html.heex:29
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "saving..."
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex_web/live/context_live/form_component.html.heex:39
|
||||
#: lib/memex_web/live/note_live/form_component.html.heex:39
|
||||
#: lib/memex_web/live/pipeline_live/form_component.html.heex:39
|
||||
#: lib/memex_web/live/context_live/form_component.html.heex:37
|
||||
#: lib/memex_web/live/note_live/form_component.html.heex:37
|
||||
#: lib/memex_web/live/pipeline_live/form_component.html.heex:37
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "select privacy"
|
||||
msgstr ""
|
||||
@ -339,11 +334,6 @@ msgstr ""
|
||||
msgid "unlimited"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex_web/components/user_card.ex:25
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "user was confirmed at %{relative_datetime}"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex_web/live/invite_live/index.html.heex:120
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "users"
|
||||
@ -490,7 +480,7 @@ msgstr ""
|
||||
msgid "what is this?"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:62
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:68
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "%{position}. %{title}"
|
||||
msgstr ""
|
||||
@ -515,12 +505,12 @@ msgstr ""
|
||||
msgid "add step to %{slug}"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:56
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:62
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "no steps"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:51
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:57
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "steps:"
|
||||
msgstr ""
|
||||
@ -654,3 +644,13 @@ msgstr ""
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "while memEx fully supports multiple users, each memEx instance should be treated as a single cohesive and collaborative document."
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex_web/components/user_card.ex:26
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "user confirmed on"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex_web/components/user_card.ex:33
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "user registered on"
|
||||
msgstr ""
|
||||
|
@ -130,3 +130,10 @@ msgstr ""
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "unauthorized"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex/contexts/context.ex:75
|
||||
#: lib/memex/notes/note.ex:74
|
||||
#: lib/memex/pipelines/pipeline.ex:76
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "invalid format: only numbers, letters and hyphen are accepted. tags must be comma-delimited"
|
||||
msgstr ""
|
||||
|
@ -137,12 +137,12 @@ msgid "are you sure you want to make %{invite_name} unlimited?"
|
||||
msgstr ""
|
||||
|
||||
#: lib/memex_web/live/context_live/index.html.heex:46
|
||||
#: lib/memex_web/live/context_live/show.html.heex:31
|
||||
#: lib/memex_web/live/context_live/show.html.heex:37
|
||||
#: lib/memex_web/live/note_live/index.html.heex:46
|
||||
#: lib/memex_web/live/note_live/show.html.heex:35
|
||||
#: lib/memex_web/live/note_live/show.html.heex:34
|
||||
#: lib/memex_web/live/pipeline_live/index.html.heex:46
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:40
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:110
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:46
|
||||
#: lib/memex_web/live/pipeline_live/show.html.heex:116
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "are you sure?"
|
||||
msgstr ""
|
||||
|
@ -18,7 +18,7 @@ defmodule MemexWeb.ContextLiveTest do
|
||||
}
|
||||
@invalid_attrs %{
|
||||
"content" => nil,
|
||||
"tags_string" => "",
|
||||
"tags_string" => " ",
|
||||
"slug" => nil,
|
||||
"visibility" => nil
|
||||
}
|
||||
@ -37,6 +37,14 @@ defmodule MemexWeb.ContextLiveTest do
|
||||
assert html =~ context.slug
|
||||
end
|
||||
|
||||
test "searches by tag", %{conn: conn} do
|
||||
{:ok, index_live, html} = live(conn, Routes.context_index_path(conn, :index))
|
||||
|
||||
assert html =~ "example-tag"
|
||||
assert index_live |> element("a", "example-tag") |> render_click()
|
||||
assert_patch(index_live, Routes.context_index_path(conn, :search, "example-tag"))
|
||||
end
|
||||
|
||||
test "saves new context", %{conn: conn} do
|
||||
{:ok, index_live, _html} = live(conn, Routes.context_index_path(conn, :index))
|
||||
|
||||
@ -106,9 +114,13 @@ defmodule MemexWeb.ContextLiveTest do
|
||||
|
||||
assert_patch(show_live, Routes.context_show_path(conn, :edit, context.slug))
|
||||
|
||||
assert show_live
|
||||
|> form("#context-form", context: @invalid_attrs)
|
||||
|> render_change() =~ "can't be blank"
|
||||
html =
|
||||
show_live
|
||||
|> form("#context-form", context: @invalid_attrs)
|
||||
|> render_change()
|
||||
|
||||
assert html =~ "can't be blank"
|
||||
assert html =~ "tags must be comma-delimited"
|
||||
|
||||
{:ok, _, html} =
|
||||
show_live
|
||||
@ -146,6 +158,14 @@ defmodule MemexWeb.ContextLiveTest do
|
||||
]
|
||||
end
|
||||
|
||||
test "searches by tag", %{conn: conn, context: context} do
|
||||
{:ok, show_live, html} = live(conn, Routes.context_show_path(conn, :show, context.slug))
|
||||
|
||||
assert html =~ "example-tag"
|
||||
assert show_live |> element("a", "example-tag") |> render_click()
|
||||
assert_redirect(show_live, Routes.context_index_path(conn, :search, "example-tag"))
|
||||
end
|
||||
|
||||
test "displays context", %{conn: conn, context: context, note: %{slug: note_slug}} do
|
||||
{:ok, show_live, html} = live(conn, Routes.context_show_path(conn, :show, context.slug))
|
||||
|
||||
|
@ -3,6 +3,7 @@ defmodule MemexWeb.NoteLiveTest do
|
||||
|
||||
import Phoenix.LiveViewTest
|
||||
import Memex.NotesFixtures
|
||||
alias MemexWeb.Endpoint
|
||||
|
||||
@create_attrs %{
|
||||
"content" => "some content",
|
||||
@ -18,7 +19,7 @@ defmodule MemexWeb.NoteLiveTest do
|
||||
}
|
||||
@invalid_attrs %{
|
||||
"content" => nil,
|
||||
"tags_string" => "",
|
||||
"tags_string" => " ",
|
||||
"slug" => nil,
|
||||
"visibility" => nil
|
||||
}
|
||||
@ -37,6 +38,14 @@ defmodule MemexWeb.NoteLiveTest do
|
||||
assert html =~ note.slug
|
||||
end
|
||||
|
||||
test "searches by tag", %{conn: conn} do
|
||||
{:ok, index_live, html} = live(conn, Routes.note_index_path(conn, :index))
|
||||
|
||||
assert html =~ "example-tag"
|
||||
assert index_live |> element("a", "example-tag") |> render_click()
|
||||
assert_patch(index_live, Routes.note_index_path(conn, :search, "example-tag"))
|
||||
end
|
||||
|
||||
test "saves new note", %{conn: conn} do
|
||||
{:ok, index_live, _html} = live(conn, Routes.note_index_path(conn, :index))
|
||||
|
||||
@ -45,9 +54,13 @@ defmodule MemexWeb.NoteLiveTest do
|
||||
|
||||
assert_patch(index_live, Routes.note_index_path(conn, :new))
|
||||
|
||||
assert index_live
|
||||
|> form("#note-form", note: @invalid_attrs)
|
||||
|> render_change() =~ "can't be blank"
|
||||
html =
|
||||
index_live
|
||||
|> form("#note-form", note: @invalid_attrs)
|
||||
|> render_change()
|
||||
|
||||
assert html =~ "can't be blank"
|
||||
assert html =~ "tags must be comma-delimited"
|
||||
|
||||
{:ok, _, html} =
|
||||
index_live
|
||||
@ -132,4 +145,39 @@ defmodule MemexWeb.NoteLiveTest do
|
||||
refute has_element?(index_live, "#note-#{note.id}")
|
||||
end
|
||||
end
|
||||
|
||||
describe "show with note" do
|
||||
setup [:register_and_log_in_user]
|
||||
|
||||
setup %{user: user} do
|
||||
%{slug: note_slug} = note = note_fixture(user)
|
||||
|
||||
[
|
||||
note: note,
|
||||
backlinked_note:
|
||||
note_fixture(%{content: "example with backlink to [[#{note_slug}]] note"}, user)
|
||||
]
|
||||
end
|
||||
|
||||
test "searches by tag", %{conn: conn, note: note} do
|
||||
{:ok, show_live, html} = live(conn, Routes.note_show_path(conn, :show, note.slug))
|
||||
|
||||
assert html =~ "example-tag"
|
||||
assert show_live |> element("a", "example-tag") |> render_click()
|
||||
assert_redirect(show_live, Routes.note_index_path(conn, :search, "example-tag"))
|
||||
end
|
||||
|
||||
test "displays context", %{
|
||||
conn: conn,
|
||||
backlinked_note: %{slug: backlinked_note_slug},
|
||||
note: %{slug: note_slug}
|
||||
} do
|
||||
{:ok, show_live, html} =
|
||||
live(conn, Routes.note_show_path(conn, :show, backlinked_note_slug))
|
||||
|
||||
assert html =~ "context"
|
||||
assert html =~ Routes.note_show_path(Endpoint, :show, note_slug)
|
||||
assert has_element?(show_live, "[data-qa=\"note-link-#{note_slug}\"]")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -17,7 +17,7 @@ defmodule MemexWeb.PipelineLiveTest do
|
||||
}
|
||||
@invalid_attrs %{
|
||||
"description" => nil,
|
||||
"tags_string" => "",
|
||||
"tags_string" => " ",
|
||||
"slug" => nil,
|
||||
"visibility" => nil
|
||||
}
|
||||
@ -48,6 +48,14 @@ defmodule MemexWeb.PipelineLiveTest do
|
||||
assert html =~ pipeline.description
|
||||
end
|
||||
|
||||
test "searches by tag", %{conn: conn} do
|
||||
{:ok, index_live, html} = live(conn, Routes.pipeline_index_path(conn, :index))
|
||||
|
||||
assert html =~ "example-tag"
|
||||
assert index_live |> element("a", "example-tag") |> render_click()
|
||||
assert_patch(index_live, Routes.pipeline_index_path(conn, :search, "example-tag"))
|
||||
end
|
||||
|
||||
test "saves new pipeline", %{conn: conn} do
|
||||
{:ok, index_live, _html} = live(conn, Routes.pipeline_index_path(conn, :index))
|
||||
|
||||
@ -120,9 +128,13 @@ defmodule MemexWeb.PipelineLiveTest do
|
||||
|
||||
assert_patch(show_live, Routes.pipeline_show_path(conn, :edit, pipeline.slug))
|
||||
|
||||
assert show_live
|
||||
|> form("#pipeline-form", pipeline: @invalid_attrs)
|
||||
|> render_change() =~ "can't be blank"
|
||||
html =
|
||||
show_live
|
||||
|> form("#pipeline-form", pipeline: @invalid_attrs)
|
||||
|> render_change()
|
||||
|
||||
assert html =~ "can't be blank"
|
||||
assert html =~ "tags must be comma-delimited"
|
||||
|
||||
{:ok, _, html} =
|
||||
show_live
|
||||
@ -175,6 +187,14 @@ defmodule MemexWeb.PipelineLiveTest do
|
||||
]
|
||||
end
|
||||
|
||||
test "searches by tag", %{conn: conn, pipeline: pipeline} do
|
||||
{:ok, show_live, html} = live(conn, Routes.pipeline_show_path(conn, :show, pipeline.slug))
|
||||
|
||||
assert html =~ "example-tag"
|
||||
assert show_live |> element("a", "example-tag") |> render_click()
|
||||
assert_redirect(show_live, Routes.pipeline_index_path(conn, :search, "example-tag"))
|
||||
end
|
||||
|
||||
test "updates a step", %{conn: conn, pipeline: pipeline, step: step} do
|
||||
{:ok, show_live, _html} = live(conn, Routes.pipeline_show_path(conn, :show, pipeline.slug))
|
||||
|
||||
|
@ -16,12 +16,12 @@ defmodule Memex.ContextsFixtures do
|
||||
attrs
|
||||
|> Enum.into(%{
|
||||
content: "some content",
|
||||
tags: [],
|
||||
tags: ["example-tag"],
|
||||
slug: random_slug(),
|
||||
visibility: :private
|
||||
})
|
||||
|> Contexts.create_context(user)
|
||||
|
||||
context
|
||||
%{context | tags_string: nil}
|
||||
end
|
||||
end
|
||||
|
@ -16,12 +16,12 @@ defmodule Memex.NotesFixtures do
|
||||
attrs
|
||||
|> Enum.into(%{
|
||||
content: "some content",
|
||||
tags: [],
|
||||
tags: ["example-tag"],
|
||||
slug: random_slug(),
|
||||
visibility: :private
|
||||
})
|
||||
|> Notes.create_note(user)
|
||||
|
||||
note
|
||||
%{note | tags_string: nil}
|
||||
end
|
||||
end
|
||||
|
@ -16,12 +16,12 @@ defmodule Memex.PipelinesFixtures do
|
||||
attrs
|
||||
|> Enum.into(%{
|
||||
description: "some description",
|
||||
tags: [],
|
||||
tags: ["example-tag"],
|
||||
slug: random_slug(),
|
||||
visibility: :private
|
||||
})
|
||||
|> Pipelines.create_pipeline(user)
|
||||
|
||||
pipeline
|
||||
%{pipeline | tags_string: nil}
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user