3 Commits

  1. 11
      CHANGELOG.md
  2. 2
      lib/mirage_web/live/home_live.ex
  3. 0
      lib/mirage_web/live/home_live.html.leex
  4. 4
      lib/mirage_web/live/show_note_live.html.leex
  5. 2
      lib/mirage_web/router.ex
  6. 2
      mix.exs
  7. 8
      test/mirage_web/live/page_live_test.exs
  8. 6
      test/mirage_web/live/show_note_live_test.exs

11
CHANGELOG.md

@ -5,6 +5,17 @@ See [Conventional Commits](Https://conventionalcommits.org) for commit guideline
<!-- changelog -->
## [v0.47.0](https://git.inhji.de/inhji/mirage/compare/v0.46.1...v0.47.0) (2021-02-20)
### Features:
* rename page live to home live
* add GotoAnything to show note
## [v0.46.1](https://git.inhji.de/inhji/mirage/compare/v0.46.0...v0.46.1) (2021-02-20)

2
lib/mirage_web/live/page_live.ex → lib/mirage_web/live/home_live.ex

@ -1,4 +1,4 @@
defmodule MirageWeb.PageLive do
defmodule MirageWeb.HomeLive do
use MirageWeb, :live_view
@impl true

0
lib/mirage_web/live/page_live.html.leex → lib/mirage_web/live/home_live.html.leex

4
lib/mirage_web/live/show_note_live.html.leex

@ -1,3 +1,7 @@
<%= if @current_user do %>
<%= live_render @socket, MirageWeb.GotoAnythingLive, id: "goto-anything-wrapper" %>
<% end %>
<header class="hero">
<h1><span class="id"><%= "##{@note.id}" %></span> <%= @note.title %></h1>
<p><time datetime="<%= @note.inserted_at %>"><%= Timex.from_now(@note.inserted_at) %></time> / <time datetime="<%= @note.updated_at %>"><%= Timex.from_now(@note.updated_at) %></time></p>

2
lib/mirage_web/router.ex

@ -26,7 +26,7 @@ defmodule MirageWeb.Router do
scope "/", MirageWeb do
pipe_through :browser
live "/", PageLive, :index
live "/", HomeLive, :index
resources "/notes", NoteController, except: [:show]
resources "/topics", TopicController

2
mix.exs

@ -1,7 +1,7 @@
defmodule Mirage.MixProject do
use Mix.Project
@version "0.46.1"
@version "0.47.0"
def project do
[

8
test/mirage_web/live/page_live_test.exs

@ -1,13 +1,13 @@
defmodule MirageWeb.PageLiveTest do
defmodule MirageWeb.HomeLiveTest do
use MirageWeb.ConnCase
import Phoenix.LiveViewTest
test "disconnected and connected render", %{conn: conn} do
{:ok, page_live, disconnected_html} = live(conn, "/")
{:ok, home_live, disconnected_html} = live(conn, "/")
assert disconnected_html =~ "Hi"
assert disconnected_html =~ "some tagline"
assert render(page_live) =~ "Hi"
assert render(page_live) =~ "some tagline"
assert render(home_live) =~ "Hi"
assert render(home_live) =~ "some tagline"
end
end

6
test/mirage_web/live/show_note_live_test.exs

@ -8,11 +8,11 @@ defmodule MirageWeb.ShowNoteLiveTest do
setup [:create_note]
test "disconnected and connected render", %{conn: conn, note: note} do
{:ok, page_live, disconnected_html} = live(conn, "/notes/#{note.id}")
{:ok, show_note_live, disconnected_html} = live(conn, "/notes/#{note.id}")
assert disconnected_html =~ note.title
assert disconnected_html =~ note.content
assert render(page_live) =~ note.title
assert render(page_live) =~ note.content
assert render(show_note_live) =~ note.title
assert render(show_note_live) =~ note.content
end
end
end
Loading…
Cancel
Save