defmodule PlausibleWeb.Live.GoalSettings.List do @moduledoc """ Phoenix LiveComponent module that renders a list of goals """ use Phoenix.LiveComponent use Phoenix.HTML use Plausible.Funnel attr(:goals, :list, required: true) attr(:domain, :string, required: true) attr(:filter_text, :string) def render(assigns) do ~H"""
<%= if Enum.count(@goals) > 0 do %>
<%= for goal <- @goals do %>
<%= goal %>
Pageview Custom Event Revenue Goal - belongs to funnel(s)
<% end %>
<% else %>

No goals found for this site. Please refine or reset your search. No goals configured for this site.

<% end %>
""" end defp delete_confirmation_text(goal) do if Enum.empty?(goal.funnels) do """ Are you sure you want to remove the following goal: #{goal} This will just affect the UI, all of your analytics data will stay intact. """ else """ The goal: #{goal} is part of some funnel(s). If you are going to delete it, the associated funnels will be either reduced or deleted completely. Are you sure you want to remove the goal? """ end end end