From b3fdb8c3ae5dbc934a472a3e9e8aa23fa46b5e27 Mon Sep 17 00:00:00 2001 From: Raquel Smith Date: Thu, 12 Sep 2024 12:26:22 -0700 Subject: [PATCH] feat(onboarding-templates): allow someone to select pageview as variable (#24899) Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> --- .../authorizedUrlListLogic.ts | 2 +- .../IframedToolbarBrowser.tsx | 4 +- .../iframedToolbarBrowserLogic.ts | 28 ++- .../components/IframedToolbarBrowser/utils.ts | 1 + .../LemonInputSelect/LemonInputSelect.tsx | 11 +- .../scenes/dashboard/Dashboards.stories.tsx | 14 +- .../dashboardTemplateVariablesLogic.ts | 27 +- .../src/scenes/dashboard/newDashboardLogic.ts | 2 +- .../DashboardTemplateConfigureStep.tsx | 238 ++++++++++++------ .../DashboardTemplateVariables.tsx | 32 ++- .../src/scenes/onboarding/sdks/sdksLogic.tsx | 13 +- frontend/src/toolbar/bar/toolbarLogic.ts | 28 +++ frontend/src/types.ts | 14 +- 13 files changed, 299 insertions(+), 115 deletions(-) diff --git a/frontend/src/lib/components/AuthorizedUrlList/authorizedUrlListLogic.ts b/frontend/src/lib/components/AuthorizedUrlList/authorizedUrlListLogic.ts index 20d0811578258..8cc977e20f2ae 100644 --- a/frontend/src/lib/components/AuthorizedUrlList/authorizedUrlListLogic.ts +++ b/frontend/src/lib/components/AuthorizedUrlList/authorizedUrlListLogic.ts @@ -241,7 +241,7 @@ export const authorizedUrlListLogic = kea([ [] as string[], { setAuthorizedUrls: (_, { authorizedUrls }) => authorizedUrls, - addUrl: (state, { url }) => state.concat([url]), + addUrl: (state, { url }) => (!state.includes(url) ? state.concat([url]) : state), updateUrl: (state, { index, url }) => Object.assign([...state], { [index]: url }), removeUrl: (state, { index }) => { const newUrls = [...state] diff --git a/frontend/src/lib/components/IframedToolbarBrowser/IframedToolbarBrowser.tsx b/frontend/src/lib/components/IframedToolbarBrowser/IframedToolbarBrowser.tsx index aa32b83e36ee7..2013b1a5e32c0 100644 --- a/frontend/src/lib/components/IframedToolbarBrowser/IframedToolbarBrowser.tsx +++ b/frontend/src/lib/components/IframedToolbarBrowser/IframedToolbarBrowser.tsx @@ -40,7 +40,7 @@ export function IframedToolbarBrowser({ }): JSX.Element | null { const logic = iframedToolbarBrowserLogic({ iframeRef, userIntent: userIntent }) - const { browserUrl } = useValues(logic) + const { browserUrl, initialPath } = useValues(logic) const { onIframeLoad, setIframeWidth } = useActions(logic) const { width: iframeWidth } = useResizeObserver({ ref: iframeRef }) @@ -55,7 +55,7 @@ export function IframedToolbarBrowser({