Skip to content

Commit 779dd92

Browse files
committed
Fix funnels and props functionality not hiding when toggled off
- Add show_content? attribute to generic tile component - Ensure content is hidden when toggled off - Avoid rendering border and empty space when toggled off - Fix formatting
1 parent 9ccce04 commit 779dd92

File tree

15 files changed

+126
-77
lines changed

15 files changed

+126
-77
lines changed

extra/lib/plausible_web/live/funnel_settings.ex

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,17 @@ defmodule PlausibleWeb.Live.FunnelSettings do
7070
/>
7171
</div>
7272
73-
<div :if={@goal_count < Funnel.min_steps()} class="flex flex-col items-center justify-center pt-5 pb-6 max-w-md mx-auto">
73+
<div
74+
:if={@goal_count < Funnel.min_steps()}
75+
class="flex flex-col items-center justify-center pt-5 pb-6 max-w-md mx-auto"
76+
>
7477
<h3 class="text-center text-base font-medium text-gray-900 dark:text-gray-100 leading-7">
7578
Ready to dig into user flows?
7679
</h3>
7780
<p class="text-center text-sm mt-1 text-gray-500 dark:text-gray-400 leading-5 text-pretty">
78-
Set up a few goals like <span class="font-medium text-indigo-600 dark:text-gray-100">Signup</span>, <span class="font-medium text-indigo-600 dark:text-gray-100">Visit /</span>, or <span class="font-medium text-indigo-600 dark:text-gray-100">Scroll 50% on /blog/*</span> first, then return here to build your first funnel.
81+
Set up a few goals like <span class="font-medium text-indigo-600 dark:text-gray-100">Signup</span>, <span class="font-medium text-indigo-600 dark:text-gray-100">Visit /</span>, or
82+
<span class="font-medium text-indigo-600 dark:text-gray-100">Scroll 50% on /blog/*</span>
83+
first, then return here to build your first funnel.
7984
</p>
8085
<.button_link
8186
class="mt-4"

extra/lib/plausible_web/live/funnel_settings/list.ex

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ defmodule PlausibleWeb.Live.FunnelSettings.List do
5757
Create your first funnel
5858
</h3>
5959
<p class="text-center text-sm mt-1 text-gray-500 dark:text-gray-400 leading-5 text-pretty">
60-
Compose goals into funnels to track user flows and conversion rates. <.styled_link href="https://plausible.io/docs/funnel-analysis" target="_blank">Learn more</.styled_link>
60+
Compose goals into funnels to track user flows and conversion rates.
61+
<.styled_link href="https://plausible.io/docs/funnel-analysis" target="_blank">
62+
Learn more
63+
</.styled_link>
6164
</p>
6265
<.button
6366
id="add-funnel-button"

lib/plausible_web/components/generic.ex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,7 @@ defmodule PlausibleWeb.Components.Generic do
487487
attr :current_team, :any, default: nil
488488
attr :site, :any
489489
attr :conn, :any
490+
attr :show_content?, :boolean, default: true
490491

491492
def tile(assigns) do
492493
~H"""
@@ -507,8 +508,8 @@ defmodule PlausibleWeb.Components.Generic do
507508
conn={@conn}
508509
/>
509510
</header>
510-
<div class="border-b dark:border-gray-700 mx-6"></div>
511-
<div class="relative">
511+
<div :if={@show_content?} class="border-b dark:border-gray-700 mx-6"></div>
512+
<div :if={@show_content?} class="relative">
512513
<%= if @feature_mod do %>
513514
<PlausibleWeb.Components.Billing.feature_gate
514515
locked?={@feature_mod.check_availability(@current_team) != :ok}

lib/plausible_web/live/goal_settings/list.ex

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ defmodule PlausibleWeb.Live.GoalSettings.List do
104104
Create your first goal
105105
</h3>
106106
<p class="text-center text-sm mt-1 text-gray-500 dark:text-gray-400 leading-5 text-pretty">
107-
Define actions that you want your users to take, like visiting a certain page, submitting a form, etc. <.styled_link href="https://plausible.io/docs/goal-conversions" target="_blank">Learn more</.styled_link>
107+
Define actions that you want your users to take, like visiting a certain page, submitting a form, etc.
108+
<.styled_link href="https://plausible.io/docs/goal-conversions" target="_blank">
109+
Learn more
110+
</.styled_link>
108111
</p>
109112
<.button
110113
id="add-goal-button"

lib/plausible_web/live/imports_exports_settings.ex

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -131,67 +131,67 @@ defmodule PlausibleWeb.Live.ImportsExportsSettings do
131131
132132
<div class="mt-6">
133133
<.table rows={@site_imports}>
134-
<:thead>
135-
<.th>Import</.th>
136-
<.th hide_on_mobile>Date Range</.th>
137-
<.th hide_on_mobile>
138-
<div class="text-right">Pageviews</div>
139-
</.th>
140-
<.th invisible>Actions</.th>
141-
</:thead>
134+
<:thead>
135+
<.th>Import</.th>
136+
<.th hide_on_mobile>Date Range</.th>
137+
<.th hide_on_mobile>
138+
<div class="text-right">Pageviews</div>
139+
</.th>
140+
<.th invisible>Actions</.th>
141+
</:thead>
142142
143-
<:tbody :let={entry}>
144-
<.td max_width="max-w-40">
145-
<div class="flex items-center gap-x-2 truncate">
146-
<div class="w-5" title={notice_message(entry.tooltip)}>
147-
<Heroicons.clock
148-
:if={entry.live_status == SiteImport.pending()}
149-
class="block size-5 text-indigo-600 dark:text-green-600"
150-
/>
151-
<.spinner
152-
:if={entry.live_status == SiteImport.importing()}
153-
class="block size-5 text-indigo-600 dark:text-green-600"
154-
/>
155-
<Heroicons.check
156-
:if={entry.live_status == SiteImport.completed()}
157-
class="block size-5 text-indigo-600 dark:text-green-600"
158-
/>
159-
<Heroicons.exclamation_triangle
160-
:if={entry.live_status == SiteImport.failed()}
161-
class="block size-5 text-red-700 dark:text-red-500"
162-
/>
143+
<:tbody :let={entry}>
144+
<.td max_width="max-w-40">
145+
<div class="flex items-center gap-x-2 truncate">
146+
<div class="w-5" title={notice_message(entry.tooltip)}>
147+
<Heroicons.clock
148+
:if={entry.live_status == SiteImport.pending()}
149+
class="block size-5 text-indigo-600 dark:text-green-600"
150+
/>
151+
<.spinner
152+
:if={entry.live_status == SiteImport.importing()}
153+
class="block size-5 text-indigo-600 dark:text-green-600"
154+
/>
155+
<Heroicons.check
156+
:if={entry.live_status == SiteImport.completed()}
157+
class="block size-5 text-indigo-600 dark:text-green-600"
158+
/>
159+
<Heroicons.exclamation_triangle
160+
:if={entry.live_status == SiteImport.failed()}
161+
class="block size-5 text-red-700 dark:text-red-500"
162+
/>
163+
</div>
164+
<div
165+
class="max-w-sm"
166+
title={"#{Plausible.Imported.SiteImport.label(entry.site_import)} created at #{format_date(entry.site_import.inserted_at)}"}
167+
>
168+
{Plausible.Imported.SiteImport.label(entry.site_import)}
169+
</div>
163170
</div>
164-
<div
165-
class="max-w-sm"
166-
title={"#{Plausible.Imported.SiteImport.label(entry.site_import)} created at #{format_date(entry.site_import.inserted_at)}"}
167-
>
168-
{Plausible.Imported.SiteImport.label(entry.site_import)}
169-
</div>
170-
</div>
171-
</.td>
171+
</.td>
172172
173-
<.td hide_on_mobile>
174-
{format_date(entry.site_import.start_date)} - {format_date(entry.site_import.end_date)}
175-
</.td>
173+
<.td hide_on_mobile>
174+
{format_date(entry.site_import.start_date)} - {format_date(entry.site_import.end_date)}
175+
</.td>
176176
177-
<.td>
178-
<div class="text-right">
179-
{if entry.live_status == SiteImport.completed(),
180-
do:
181-
PlausibleWeb.StatsView.large_number_format(
182-
pageview_count(entry.site_import, @pageview_counts)
183-
)}
184-
</div>
185-
</.td>
186-
<.td actions>
187-
<.delete_button
188-
href={"/#{URI.encode_www_form(@site.domain)}/settings/forget-import/#{entry.site_import.id}"}
189-
method="delete"
190-
data-confirm="Are you sure you want to delete this import?"
191-
/>
192-
</.td>
193-
</:tbody>
194-
</.table>
177+
<.td>
178+
<div class="text-right">
179+
{if entry.live_status == SiteImport.completed(),
180+
do:
181+
PlausibleWeb.StatsView.large_number_format(
182+
pageview_count(entry.site_import, @pageview_counts)
183+
)}
184+
</div>
185+
</.td>
186+
<.td actions>
187+
<.delete_button
188+
href={"/#{URI.encode_www_form(@site.domain)}/settings/forget-import/#{entry.site_import.id}"}
189+
method="delete"
190+
data-confirm="Are you sure you want to delete this import?"
191+
/>
192+
</.td>
193+
</:tbody>
194+
</.table>
195195
</div>
196196
<% end %>
197197
"""

lib/plausible_web/live/props_settings/list.ex

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ defmodule PlausibleWeb.Live.PropsSettings.List do
4848
Create a custom property
4949
</h3>
5050
<p class="text-center text-sm mt-1 text-gray-500 dark:text-gray-400 leading-5 text-pretty">
51-
Attach custom properties when sending a pageview or an event to create custom metrics. <.styled_link href="https://plausible.io/docs/custom-props/introduction" target="_blank">Learn more</.styled_link>
51+
Attach custom properties when sending a pageview or an event to create custom metrics.
52+
<.styled_link href="https://plausible.io/docs/custom-props/introduction" target="_blank">
53+
Learn more
54+
</.styled_link>
5255
</p>
5356
<.button
5457
id="add-property-button"

lib/plausible_web/live/shared_link_settings.ex

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ defmodule PlausibleWeb.Live.SharedLinkSettings do
6868
Create your first shared link
6969
</h3>
7070
<p class="text-center text-sm mt-1 text-gray-500 dark:text-gray-400 leading-5 text-pretty">
71-
Share your stats privately with anyone. Links are unique, secure, and can be password-protected. <.styled_link href="https://plausible.io/docs/shared-links" target="_blank">Learn more</.styled_link>
71+
Share your stats privately with anyone. Links are unique, secure, and can be password-protected.
72+
<.styled_link href="https://plausible.io/docs/shared-links" target="_blank">
73+
Learn more
74+
</.styled_link>
7275
</p>
7376
<.button
7477
id="add-shared-link-button"

lib/plausible_web/live/shields/country_rules.ex

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,13 @@ defmodule PlausibleWeb.Live.Shields.CountryRules do
4141
Block a country
4242
</h3>
4343
<p class="text-center text-sm mt-1 text-gray-500 dark:text-gray-400 leading-5 text-pretty">
44-
Reject incoming traffic from specific countries. <.styled_link href="https://plausible.io/docs/excluding#exclude-visits-by-country" target="_blank">Learn more</.styled_link>
44+
Reject incoming traffic from specific countries.
45+
<.styled_link
46+
href="https://plausible.io/docs/excluding#exclude-visits-by-country"
47+
target="_blank"
48+
>
49+
Learn more
50+
</.styled_link>
4551
</p>
4652
<.button
4753
:if={@country_rules_count < Shields.maximum_country_rules()}

lib/plausible_web/live/shields/hostname_rules.ex

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,13 @@ defmodule PlausibleWeb.Live.Shields.HostnameRules do
4444
Allow a hostname
4545
</h3>
4646
<p class="text-center text-sm mt-1 text-gray-500 dark:text-gray-400 leading-5 text-pretty">
47-
Accept incoming traffic only from familiar hostnames. Traffic from all hostnames is recorded until you add your first rule. <.styled_link href="https://plausible.io/docs/excluding#exclude-visits-by-hostname" target="_blank">Learn more</.styled_link>
47+
Accept incoming traffic only from familiar hostnames. Traffic from all hostnames is recorded until you add your first rule.
48+
<.styled_link
49+
href="https://plausible.io/docs/excluding#exclude-visits-by-hostname"
50+
target="_blank"
51+
>
52+
Learn more
53+
</.styled_link>
4854
</p>
4955
<.button
5056
:if={@hostname_rules_count < Shields.maximum_hostname_rules()}

lib/plausible_web/live/shields/ip_rules.ex

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ defmodule PlausibleWeb.Live.Shields.IPRules do
4242
Block an IP address
4343
</h3>
4444
<p class="text-center text-sm mt-1 text-gray-500 dark:text-gray-400 leading-5 text-pretty">
45-
Reject incoming traffic from specific IP addresses. <.styled_link href="https://plausible.io/docs/excluding" target="_blank">Learn more</.styled_link>
45+
Reject incoming traffic from specific IP addresses.
46+
<.styled_link href="https://plausible.io/docs/excluding" target="_blank">
47+
Learn more
48+
</.styled_link>
4649
</p>
4750
<.button
4851
:if={@ip_rules_count < Shields.maximum_ip_rules()}

0 commit comments

Comments
 (0)