From 6a7388173b1284fe0937516e04a8bc0b34f3f084 Mon Sep 17 00:00:00 2001 From: Ritesh Kumar Date: Tue, 24 Sep 2024 01:39:16 +0800 Subject: [PATCH] Hide dev dump when not in dev env (#108) --- lib/vyasa_web/components/contexts/read.ex | 37 ++++++++++++++--------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/lib/vyasa_web/components/contexts/read.ex b/lib/vyasa_web/components/contexts/read.ex index e503edba..c4f09ea0 100644 --- a/lib/vyasa_web/components/contexts/read.ex +++ b/lib/vyasa_web/components/contexts/read.ex @@ -417,21 +417,7 @@ defmodule VyasaWeb.Context.Read do def render(assigns) do ~H"""
- Hello world, i'm the ReadContext
- Session: <%= @session && @session.name %> Sangh: <%= @session && @session.sangh && - @session.sangh.id %>
- <%= @user_mode.mode_context_component %> - <%= @user_mode.mode_context_component_selector %> - <.button phx-click="foo" phx-target={@myself}> - FOO - -
- <%= @user_mode.mode %> mode
-
-
-
-
-
+ <.debug_dump session={@session} user_mode={@user_mode} />
<%= if @content_action == :show_sources do %> @@ -534,4 +520,25 @@ defmodule VyasaWeb.Context.Read do defp sync_draft_reflector(%{assigns: %{session: _}} = socket) do socket end + + def debug_dump(assigns) do + ~H""" +
+

Developer Dump

+
+ Session: <%= @session && @session.name %>
+ Sangh ID: <%= @session && @session.sangh && + @session.sangh.id %>
+ User Mode: <%= @user_mode.mode_context_component %> | <%= @user_mode.mode_context_component_selector %> | <%= @user_mode.mode %> mode +
+
+

Parameters:

+
<%= inspect(Map.drop(assigns, [:session, :user_mode]), pretty: true) %>
+
+
+ """ + end end