Skip to content

Commit

Permalink
fix(insights): Support "Save as" for query node-based insights (#19295)
Browse files Browse the repository at this point in the history
  • Loading branch information
Twixes authored Dec 13, 2023
1 parent b5fb79c commit 371c2e5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
14 changes: 6 additions & 8 deletions frontend/src/lib/logic/promptLogic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ import { createRoot } from 'react-dom/client'

import type { promptLogicType } from './promptLogicType'

// This logic creates a modal to ask for an input. It's unique in that when the logic is unmounted,
// for example when changing the URL, the modal is also closed. That would normally happen with the antd prompt.
//
// props:
// - key - unique key for this logic
//
// actions:
// - prompt({ title, placeholder, value, error, success, failure })
/**
* This logic creates a modal to ask for an input. It's unique in that when the logic is unmounted,
* for example when changing the URL, the modal is also closed. That would normally happen with the antd prompt.
*
* @deprecated Use LemonDialog or, more broadly, LemonModal instead.
*/
export const promptLogic = kea<promptLogicType>([
path((key) => ['lib', 'logic', 'prompt', key]),
props({} as { key: string }),
Expand Down
1 change: 1 addition & 0 deletions frontend/src/scenes/insights/insightLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,7 @@ export const insightLogic = kea<insightLogicType>([
const insight: InsightModel = await api.create(`api/projects/${teamLogic.values.currentTeamId}/insights/`, {
name,
filters: values.filters,
query: values.insight.query,
saved: true,
})
lemonToast.info(`You're now working on a copy of ${values.insight.name ?? values.insight.derived_name}`)
Expand Down

0 comments on commit 371c2e5

Please sign in to comment.