From eeca63ff4c66500cc0e666d4cedfcaf48cd35c9c Mon Sep 17 00:00:00 2001 From: RobertJoonas <56999674+RobertJoonas@users.noreply.github.com> Date: Mon, 7 Aug 2023 18:11:14 +0100 Subject: [PATCH] Some fixes to the Custom Props feature (#3241) * rename Properties to Custom Properties in Site Settings * fix docs link for custom props * add back the external links for special goal URLs and 404 paths * grandfathering note --- assets/js/dashboard/stats/behaviours/goal-conversions.js | 9 +++++++++ .../templates/site/settings_props.html.heex | 9 +++++---- lib/plausible_web/views/layout_view.ex | 2 +- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/assets/js/dashboard/stats/behaviours/goal-conversions.js b/assets/js/dashboard/stats/behaviours/goal-conversions.js index 6d18821c2..bf613ab91 100644 --- a/assets/js/dashboard/stats/behaviours/goal-conversions.js +++ b/assets/js/dashboard/stats/behaviours/goal-conversions.js @@ -24,6 +24,14 @@ function SpecialPropBreakdown(props) { return api.get(url.apiPath(site, `/custom-prop-values/${prop}`), query) } + function externalLinkDest() { + if (prop === 'path') { + return (listItem) => url.externalLinkForPage(site.domain, listItem.name) + } else { + return (listItem) => listItem.name + } + } + const getFilterFor = (listItem) => { return {'props': JSON.stringify({[prop]: listItem['name']})} } return ( @@ -37,6 +45,7 @@ function SpecialPropBreakdown(props) { CR_METRIC ]} detailsLink={url.sitePath(site, `/custom-prop-values/${prop}`)} + externalLinkDest={externalLinkDest()} maybeHideDetails={true} query={query} color="bg-red-50" diff --git a/lib/plausible_web/templates/site/settings_props.html.heex b/lib/plausible_web/templates/site/settings_props.html.heex index 16b90f275..7b3f7b941 100644 --- a/lib/plausible_web/templates/site/settings_props.html.heex +++ b/lib/plausible_web/templates/site/settings_props.html.heex @@ -1,8 +1,9 @@
Properties is an upcoming premium feature that's free-to-use during the - private preview. Pricing will be announced soon. See examples and learn - more in <.link + private preview. Pricing will be announced soon. Existing subscribers will + be grandfathered and will keep having access to custom properties without + any change to their plan. See examples and learn more in <.link class="font-medium text-yellow underline hover:text-yellow-600" href="https://plausible.io/docs/custom-pageview-props" target="_blank" @@ -14,7 +15,7 @@

- Properties + Custom Properties

@@ -24,7 +25,7 @@ <.link - href="https://plausible.io/docs/custom-pageview-props" + href="https://plausible.io/docs/custom-props/introduction" target="_blank" rel="noreferrer" > diff --git a/lib/plausible_web/views/layout_view.ex b/lib/plausible_web/views/layout_view.ex index dd4eca761..ca73d49e9 100644 --- a/lib/plausible_web/views/layout_view.ex +++ b/lib/plausible_web/views/layout_view.ex @@ -31,7 +31,7 @@ defmodule PlausibleWeb.LayoutView do [key: "Funnels", value: "funnels"] end, if Plausible.Props.enabled_for?(conn.assigns[:current_user]) do - [key: "Properties", value: "properties"] + [key: "Custom Properties", value: "properties"] end, [key: "Search Console", value: "search-console"], [key: "Email reports", value: "email-reports"],