diff --git a/frontend/__snapshots__/components-sharing--insight-sharing--dark.png b/frontend/__snapshots__/components-sharing--insight-sharing--dark.png index 6e40bcdb70577a..e3db2e56700969 100644 Binary files a/frontend/__snapshots__/components-sharing--insight-sharing--dark.png and b/frontend/__snapshots__/components-sharing--insight-sharing--dark.png differ diff --git a/frontend/__snapshots__/components-sharing--insight-sharing--light.png b/frontend/__snapshots__/components-sharing--insight-sharing--light.png index 47af2592fb8f17..d352a9d91d9afe 100644 Binary files a/frontend/__snapshots__/components-sharing--insight-sharing--light.png and b/frontend/__snapshots__/components-sharing--insight-sharing--light.png differ diff --git a/frontend/__snapshots__/components-sharing--insight-sharing-licensed--dark.png b/frontend/__snapshots__/components-sharing--insight-sharing-licensed--dark.png index 425db32962ae73..ae571f58239554 100644 Binary files a/frontend/__snapshots__/components-sharing--insight-sharing-licensed--dark.png and b/frontend/__snapshots__/components-sharing--insight-sharing-licensed--dark.png differ diff --git a/frontend/__snapshots__/components-sharing--insight-sharing-licensed--light.png b/frontend/__snapshots__/components-sharing--insight-sharing-licensed--light.png index d160f8e9f75814..8a8d5000bbba0e 100644 Binary files a/frontend/__snapshots__/components-sharing--insight-sharing-licensed--light.png and b/frontend/__snapshots__/components-sharing--insight-sharing-licensed--light.png differ diff --git a/frontend/__snapshots__/components-sharing--recording-sharing-licensed--dark.png b/frontend/__snapshots__/components-sharing--recording-sharing-licensed--dark.png index 3511f7ab3b8f1e..38969eb8b989eb 100644 Binary files a/frontend/__snapshots__/components-sharing--recording-sharing-licensed--dark.png and b/frontend/__snapshots__/components-sharing--recording-sharing-licensed--dark.png differ diff --git a/frontend/__snapshots__/components-sharing--recording-sharing-licensed--light.png b/frontend/__snapshots__/components-sharing--recording-sharing-licensed--light.png index f7626677c9e8c5..08eb57f6203939 100644 Binary files a/frontend/__snapshots__/components-sharing--recording-sharing-licensed--light.png and b/frontend/__snapshots__/components-sharing--recording-sharing-licensed--light.png differ diff --git a/frontend/__snapshots__/exporter-exporter--dashboard--dark.png b/frontend/__snapshots__/exporter-exporter--dashboard--dark.png index e3b04bf5f786d6..bc2be663dbc2e8 100644 Binary files a/frontend/__snapshots__/exporter-exporter--dashboard--dark.png and b/frontend/__snapshots__/exporter-exporter--dashboard--dark.png differ diff --git a/frontend/__snapshots__/exporter-exporter--dashboard--light.png b/frontend/__snapshots__/exporter-exporter--dashboard--light.png index 60710037e09066..1cac3b9e6f2fb8 100644 Binary files a/frontend/__snapshots__/exporter-exporter--dashboard--light.png and b/frontend/__snapshots__/exporter-exporter--dashboard--light.png differ diff --git a/frontend/__snapshots__/exporter-exporter--event-table-insight--dark.png b/frontend/__snapshots__/exporter-exporter--event-table-insight--dark.png index 0096045ebeaffb..cf6449f3311d3d 100644 Binary files a/frontend/__snapshots__/exporter-exporter--event-table-insight--dark.png and b/frontend/__snapshots__/exporter-exporter--event-table-insight--dark.png differ diff --git a/frontend/__snapshots__/exporter-exporter--event-table-insight--light.png b/frontend/__snapshots__/exporter-exporter--event-table-insight--light.png index d886b6d24e19d8..a103d51e267718 100644 Binary files a/frontend/__snapshots__/exporter-exporter--event-table-insight--light.png and b/frontend/__snapshots__/exporter-exporter--event-table-insight--light.png differ diff --git a/frontend/__snapshots__/exporter-exporter--event-table-insight-no-results--dark.png b/frontend/__snapshots__/exporter-exporter--event-table-insight-no-results--dark.png index 3ecaa93e050752..969a1c84054fbc 100644 Binary files a/frontend/__snapshots__/exporter-exporter--event-table-insight-no-results--dark.png and b/frontend/__snapshots__/exporter-exporter--event-table-insight-no-results--dark.png differ diff --git a/frontend/__snapshots__/exporter-exporter--event-table-insight-no-results--light.png b/frontend/__snapshots__/exporter-exporter--event-table-insight-no-results--light.png index 8035deac1cecd1..5b85d05b621507 100644 Binary files a/frontend/__snapshots__/exporter-exporter--event-table-insight-no-results--light.png and b/frontend/__snapshots__/exporter-exporter--event-table-insight-no-results--light.png differ diff --git a/frontend/__snapshots__/exporter-exporter--funnel-left-to-right-breakdown-insight--dark.png b/frontend/__snapshots__/exporter-exporter--funnel-left-to-right-breakdown-insight--dark.png index 9323df38683e67..b61f4150fe31c3 100644 Binary files a/frontend/__snapshots__/exporter-exporter--funnel-left-to-right-breakdown-insight--dark.png and b/frontend/__snapshots__/exporter-exporter--funnel-left-to-right-breakdown-insight--dark.png differ diff --git a/frontend/__snapshots__/exporter-exporter--funnel-left-to-right-breakdown-insight--light.png b/frontend/__snapshots__/exporter-exporter--funnel-left-to-right-breakdown-insight--light.png index 6df79162154666..6a0bbe06200675 100644 Binary files a/frontend/__snapshots__/exporter-exporter--funnel-left-to-right-breakdown-insight--light.png and b/frontend/__snapshots__/exporter-exporter--funnel-left-to-right-breakdown-insight--light.png differ diff --git a/frontend/__snapshots__/exporter-exporter--funnel-left-to-right-insight--dark.png b/frontend/__snapshots__/exporter-exporter--funnel-left-to-right-insight--dark.png index 5671c43f6319d8..fbbabb7aa3ae3a 100644 Binary files a/frontend/__snapshots__/exporter-exporter--funnel-left-to-right-insight--dark.png and b/frontend/__snapshots__/exporter-exporter--funnel-left-to-right-insight--dark.png differ diff --git a/frontend/__snapshots__/exporter-exporter--funnel-left-to-right-insight--light.png b/frontend/__snapshots__/exporter-exporter--funnel-left-to-right-insight--light.png index 73946932b9c9c5..294040d29dc0a1 100644 Binary files a/frontend/__snapshots__/exporter-exporter--funnel-left-to-right-insight--light.png and b/frontend/__snapshots__/exporter-exporter--funnel-left-to-right-insight--light.png differ diff --git a/frontend/__snapshots__/exporter-exporter--funnel-left-to-right-insight-no-results--dark.png b/frontend/__snapshots__/exporter-exporter--funnel-left-to-right-insight-no-results--dark.png index 9872a14bab989f..e5c5026550b6f0 100644 Binary files a/frontend/__snapshots__/exporter-exporter--funnel-left-to-right-insight-no-results--dark.png and b/frontend/__snapshots__/exporter-exporter--funnel-left-to-right-insight-no-results--dark.png differ diff --git a/frontend/__snapshots__/exporter-exporter--funnel-left-to-right-insight-no-results--light.png b/frontend/__snapshots__/exporter-exporter--funnel-left-to-right-insight-no-results--light.png index c813f409dfc45b..3eaa6eac4272f5 100644 Binary files a/frontend/__snapshots__/exporter-exporter--funnel-left-to-right-insight-no-results--light.png and b/frontend/__snapshots__/exporter-exporter--funnel-left-to-right-insight-no-results--light.png differ diff --git a/frontend/__snapshots__/exporter-exporter--sql-insight--dark.png b/frontend/__snapshots__/exporter-exporter--sql-insight--dark.png index 87a31852af9e0c..1c9d664416a489 100644 Binary files a/frontend/__snapshots__/exporter-exporter--sql-insight--dark.png and b/frontend/__snapshots__/exporter-exporter--sql-insight--dark.png differ diff --git a/frontend/__snapshots__/exporter-exporter--sql-insight--light.png b/frontend/__snapshots__/exporter-exporter--sql-insight--light.png index 52ef48e3c5b921..b059c8b1fcb850 100644 Binary files a/frontend/__snapshots__/exporter-exporter--sql-insight--light.png and b/frontend/__snapshots__/exporter-exporter--sql-insight--light.png differ diff --git a/frontend/__snapshots__/exporter-exporter--sql-insight-no-results--dark.png b/frontend/__snapshots__/exporter-exporter--sql-insight-no-results--dark.png index 5599e3268f7c69..116e773e02c4ee 100644 Binary files a/frontend/__snapshots__/exporter-exporter--sql-insight-no-results--dark.png and b/frontend/__snapshots__/exporter-exporter--sql-insight-no-results--dark.png differ diff --git a/frontend/__snapshots__/exporter-exporter--sql-insight-no-results--light.png b/frontend/__snapshots__/exporter-exporter--sql-insight-no-results--light.png index 30bf75a3cefc42..50bbf12ca4b16c 100644 Binary files a/frontend/__snapshots__/exporter-exporter--sql-insight-no-results--light.png and b/frontend/__snapshots__/exporter-exporter--sql-insight-no-results--light.png differ diff --git a/frontend/__snapshots__/exporter-exporter--trends-line-insight-detailed--dark.png b/frontend/__snapshots__/exporter-exporter--trends-line-insight-detailed--dark.png new file mode 100644 index 00000000000000..0ab5e4ed6406ed Binary files /dev/null and b/frontend/__snapshots__/exporter-exporter--trends-line-insight-detailed--dark.png differ diff --git a/frontend/__snapshots__/exporter-exporter--trends-line-insight-detailed--light.png b/frontend/__snapshots__/exporter-exporter--trends-line-insight-detailed--light.png new file mode 100644 index 00000000000000..58585281416a59 Binary files /dev/null and b/frontend/__snapshots__/exporter-exporter--trends-line-insight-detailed--light.png differ diff --git a/frontend/__snapshots__/exporter-exporter--trends-line-insight-legend--dark.png b/frontend/__snapshots__/exporter-exporter--trends-line-insight-legend--dark.png new file mode 100644 index 00000000000000..c2c9bf4b33166d Binary files /dev/null and b/frontend/__snapshots__/exporter-exporter--trends-line-insight-legend--dark.png differ diff --git a/frontend/__snapshots__/exporter-exporter--trends-line-insight-legend--light.png b/frontend/__snapshots__/exporter-exporter--trends-line-insight-legend--light.png new file mode 100644 index 00000000000000..74ac1c339682ad Binary files /dev/null and b/frontend/__snapshots__/exporter-exporter--trends-line-insight-legend--light.png differ diff --git a/frontend/__snapshots__/exporter-exporter--trends-pie-insight-detailed--dark.png b/frontend/__snapshots__/exporter-exporter--trends-pie-insight-detailed--dark.png new file mode 100644 index 00000000000000..f6cc3c69c4af0f Binary files /dev/null and b/frontend/__snapshots__/exporter-exporter--trends-pie-insight-detailed--dark.png differ diff --git a/frontend/__snapshots__/exporter-exporter--trends-pie-insight-detailed--light.png b/frontend/__snapshots__/exporter-exporter--trends-pie-insight-detailed--light.png new file mode 100644 index 00000000000000..a69561f6afa1fd Binary files /dev/null and b/frontend/__snapshots__/exporter-exporter--trends-pie-insight-detailed--light.png differ diff --git a/frontend/__snapshots__/exporter-exporter--trends-pie-insight-legend--dark.png b/frontend/__snapshots__/exporter-exporter--trends-pie-insight-legend--dark.png new file mode 100644 index 00000000000000..8f19fbc0dc13c7 Binary files /dev/null and b/frontend/__snapshots__/exporter-exporter--trends-pie-insight-legend--dark.png differ diff --git a/frontend/__snapshots__/exporter-exporter--trends-pie-insight-legend--light.png b/frontend/__snapshots__/exporter-exporter--trends-pie-insight-legend--light.png new file mode 100644 index 00000000000000..01862074e2177b Binary files /dev/null and b/frontend/__snapshots__/exporter-exporter--trends-pie-insight-legend--light.png differ diff --git a/frontend/__snapshots__/exporter-exporter--trends-world-map-insight--dark.png b/frontend/__snapshots__/exporter-exporter--trends-world-map-insight--dark.png index 36d666d2659d5a..130f66dc712d2f 100644 Binary files a/frontend/__snapshots__/exporter-exporter--trends-world-map-insight--dark.png and b/frontend/__snapshots__/exporter-exporter--trends-world-map-insight--dark.png differ diff --git a/frontend/__snapshots__/exporter-exporter--trends-world-map-insight--light.png b/frontend/__snapshots__/exporter-exporter--trends-world-map-insight--light.png index 75f83a573a5f7b..3ffe1ef20a513f 100644 Binary files a/frontend/__snapshots__/exporter-exporter--trends-world-map-insight--light.png and b/frontend/__snapshots__/exporter-exporter--trends-world-map-insight--light.png differ diff --git a/frontend/__snapshots__/exporter-exporter--user-paths-insight--dark.png b/frontend/__snapshots__/exporter-exporter--user-paths-insight--dark.png index feb1b1b35f9c91..7cff26c475c50b 100644 Binary files a/frontend/__snapshots__/exporter-exporter--user-paths-insight--dark.png and b/frontend/__snapshots__/exporter-exporter--user-paths-insight--dark.png differ diff --git a/frontend/__snapshots__/exporter-exporter--user-paths-insight--light.png b/frontend/__snapshots__/exporter-exporter--user-paths-insight--light.png index 6dfb50641913e2..25984c46d95022 100644 Binary files a/frontend/__snapshots__/exporter-exporter--user-paths-insight--light.png and b/frontend/__snapshots__/exporter-exporter--user-paths-insight--light.png differ diff --git a/frontend/src/exporter/ExportedInsight/ExportedInsight.scss b/frontend/src/exporter/ExportedInsight/ExportedInsight.scss index 41ef2640523478..440bb0273387ec 100644 --- a/frontend/src/exporter/ExportedInsight/ExportedInsight.scss +++ b/frontend/src/exporter/ExportedInsight/ExportedInsight.scss @@ -29,12 +29,7 @@ display: flex; flex: 1; flex-direction: column; - - .LemonTable { - background: none; - border: none; - border-radius: 0; - } + border-radius: 0 0 var(--radius) var(--radius); html.export-type-image & .InsightCard__viz { // We can't use the viewport height, as the screenshotter will resize the height of the window to capture the full content @@ -43,6 +38,10 @@ } } + .LemonTable { + --lemon-table-background-color: var(--bg-light); + } + .ExportedInsight__watermark { position: absolute; top: 0; diff --git a/frontend/src/exporter/ExportedInsight/ExportedInsight.tsx b/frontend/src/exporter/ExportedInsight/ExportedInsight.tsx index be002a1958f793..5135c8c2bba813 100644 --- a/frontend/src/exporter/ExportedInsight/ExportedInsight.tsx +++ b/frontend/src/exporter/ExportedInsight/ExportedInsight.tsx @@ -5,10 +5,15 @@ import { BindLogic } from 'kea' import { FilterBasedCardContent } from 'lib/components/Cards/InsightCard/InsightCard' import { TopHeading } from 'lib/components/Cards/InsightCard/TopHeading' import { InsightLegend } from 'lib/components/InsightLegend/InsightLegend' +import { + DISPLAY_TYPES_WITHOUT_DETAILED_RESULTS, + DISPLAY_TYPES_WITHOUT_LEGEND, +} from 'lib/components/InsightLegend/utils' import { SINGLE_SERIES_DISPLAY_TYPES } from 'lib/constants' import { insightLogic } from 'scenes/insights/insightLogic' +import { InsightsTable } from 'scenes/insights/views/InsightsTable/InsightsTable' -import { ExportOptions, ExportType } from '~/exporter/types' +import { ExportOptions } from '~/exporter/types' import { getQueryBasedInsightModel } from '~/queries/nodes/InsightViz/utils' import { Query } from '~/queries/Query/Query' import { isDataTableNode, isInsightVizNode, isTrendsQuery } from '~/queries/utils' @@ -17,12 +22,10 @@ import { ChartDisplayType, InsightLogicProps, InsightModel } from '~/types' export function ExportedInsight({ insight: legacyInsight, - exportOptions: { whitelabel, noHeader, legend }, - type, + exportOptions: { whitelabel, noHeader, legend, detailed: detailedResults }, }: { insight: InsightModel exportOptions: ExportOptions - type: ExportType }): JSX.Element { const insight = getQueryBasedInsightModel(legacyInsight) @@ -49,25 +52,25 @@ export function ExportedInsight({ doNotLoad: true, } - const { query, name, derived_name, description } = insight + const { short_id, query, name, derived_name, description } = insight const showWatermark = noHeader && !whitelabel const showLegend = legend && isInsightVizNode(query) && isTrendsQuery(query.source) && - (!query.source.trendsFilter || - !query.source.trendsFilter.display || - (!SINGLE_SERIES_DISPLAY_TYPES.includes(query.source.trendsFilter.display) && - query.source.trendsFilter.display !== ChartDisplayType.ActionsTable)) + !SINGLE_SERIES_DISPLAY_TYPES.includes(query.source.trendsFilter?.display as ChartDisplayType) && + !DISPLAY_TYPES_WITHOUT_LEGEND.includes(query.source.trendsFilter?.display as ChartDisplayType) + + const showDetailedResultsTable = + detailedResults && + isInsightVizNode(query) && + isTrendsQuery(query.source) && + !DISPLAY_TYPES_WITHOUT_DETAILED_RESULTS.includes(query.source.trendsFilter?.display as ChartDisplayType) return ( -
+
{!noHeader && (
@@ -104,6 +107,11 @@ export function ExportedInsight({
)} + {showDetailedResultsTable && ( +
+ +
+ )}
diff --git a/frontend/src/exporter/Exporter.scss b/frontend/src/exporter/Exporter.scss index f63f936dc78fdd..5cec57584187d9 100644 --- a/frontend/src/exporter/Exporter.scss +++ b/frontend/src/exporter/Exporter.scss @@ -56,7 +56,6 @@ html.export-type-embed { overflow-y: auto; .Exporter { - height: 100vh; padding: 0; } } diff --git a/frontend/src/exporter/Exporter.stories.tsx b/frontend/src/exporter/Exporter.stories.tsx index b2be152974a2b0..01d43ede8f2121 100644 --- a/frontend/src/exporter/Exporter.stories.tsx +++ b/frontend/src/exporter/Exporter.stories.tsx @@ -15,6 +15,7 @@ const meta: Meta = { whitelabel: false, noHeader: false, legend: false, + detailed: false, }, parameters: { testOptions: { @@ -42,6 +43,18 @@ const Template: StoryFn = (props) => { export const TrendsLineInsight: Story = Template.bind({}) TrendsLineInsight.args = { insight: require('../mocks/fixtures/api/projects/team_id/insights/trendsLine.json') } +export const TrendsLineInsightLegend: Story = Template.bind({}) +TrendsLineInsightLegend.args = { + insight: require('../mocks/fixtures/api/projects/team_id/insights/trendsLine.json'), + legend: true, +} + +export const TrendsLineInsightDetailed: Story = Template.bind({}) +TrendsLineInsightDetailed.args = { + insight: require('../mocks/fixtures/api/projects/team_id/insights/trendsLine.json'), + detailed: true, +} + /** This should not happen in the exporter, but if it does, it shouldn't error out - we want a clear message. */ export const TrendsLineInsightNoResults: Story = Template.bind({}) // @ts-expect-error @@ -98,6 +111,18 @@ TrendsTableBreakdownInsight.args = { export const TrendsPieInsight: Story = Template.bind({}) TrendsPieInsight.args = { insight: require('../mocks/fixtures/api/projects/team_id/insights/trendsPie.json') } +export const TrendsPieInsightLegend: Story = Template.bind({}) +TrendsPieInsightLegend.args = { + insight: require('../mocks/fixtures/api/projects/team_id/insights/trendsPie.json'), + legend: true, +} + +export const TrendsPieInsightDetailed: Story = Template.bind({}) +TrendsPieInsightDetailed.args = { + insight: require('../mocks/fixtures/api/projects/team_id/insights/trendsPie.json'), + detailed: true, +} + export const TrendsPieBreakdownInsight: Story = Template.bind({}) TrendsPieBreakdownInsight.args = { insight: require('../mocks/fixtures/api/projects/team_id/insights/trendsPieBreakdown.json'), diff --git a/frontend/src/exporter/Exporter.tsx b/frontend/src/exporter/Exporter.tsx index 4c50137babefa4..24b8dd85a81e28 100644 --- a/frontend/src/exporter/Exporter.tsx +++ b/frontend/src/exporter/Exporter.tsx @@ -74,7 +74,7 @@ export function Exporter(props: ExportedData): JSX.Element { ) : null ) : null} {insight ? ( - + ) : dashboard ? ( { @@ -143,69 +143,67 @@ export function SharingModalContent({ formKey="embedConfig" className="space-y-2" > - - {({ value, onChange }) => ( - - Show PostHog branding - {!whitelabelAvailable && ( - - - - )} -
- } - onChange={() => - guardAvailableFeature(AvailableFeature.WHITE_LABELLING, () => - onChange(!value) - ) - } - checked={!value} - /> +
+ {insight && ( + + {({ value, onChange }) => ( + Show title and description
} + onChange={() => onChange(!value)} + checked={!value} + /> + )} + )} - - {insight && ( - + {({ value, onChange }) => ( Show title and description} - onChange={() => onChange(!value)} + label={ +
+ Show PostHog branding + {!whitelabelAvailable && ( + + + + )} +
+ } + onChange={() => + guardAvailableFeature(AvailableFeature.WHITE_LABELLING, () => + onChange(!value) + ) + } checked={!value} /> )}
- )} - {showLegendCheckbox && ( - - {({ value, onChange }) => ( - Show legend} - onChange={() => onChange(!value)} - checked={value} - /> - )} - - )} - {recordingId && ( - - {({ value, onChange }) => ( - Show inspector panel} - onChange={onChange} - checked={value} - /> - )} - - )} + + {isInsightVizNode(insight?.query) && insightShortId && ( + // These options are only valid for `InsightVizNode`s, and they rely on `insightVizDataLogic` + <> + + + + )} + + {recordingId && ( + + {({ value, onChange }) => ( + Show inspector panel} + onChange={onChange} + checked={value} + /> + )} + + )} + {previewIframe && (
@@ -238,6 +236,44 @@ export function SharingModalContent({ ) } +function DetailedResultsCheckbox({ insightShortId }: { insightShortId: InsightShortId }): JSX.Element | null { + const { hasDetailedResultsTable } = useValues(insightVizDataLogic({ dashboardItemId: insightShortId })) + + if (!hasDetailedResultsTable) { + return null // No detailed results toggle + } + + return ( + + {({ value, onChange }) => ( + onChange(!value)} + checked={value} + /> + )} + + ) +} + +function LegendCheckbox({ insightShortId }: { insightShortId: InsightShortId }): JSX.Element | null { + const { hasLegend } = useValues(insightVizDataLogic({ dashboardItemId: insightShortId })) + + if (!hasLegend) { + return null // No legend to toggle + } + + return ( + + {({ value, onChange }) => ( + onChange(!value)} checked={value} /> + )} + + ) +} + export function SharingModal({ closeModal, isOpen, inline, title, ...props }: SharingModalProps): JSX.Element { return ( {exportContext && ( diff --git a/frontend/src/scenes/insights/insightVizDataLogic.ts b/frontend/src/scenes/insights/insightVizDataLogic.ts index b3038bbe2f25ab..cd8e315e753504 100644 --- a/frontend/src/scenes/insights/insightVizDataLogic.ts +++ b/frontend/src/scenes/insights/insightVizDataLogic.ts @@ -1,6 +1,9 @@ import { lemonToast } from '@posthog/lemon-ui' import { actions, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea' -import { DISPLAY_TYPES_WITHOUT_LEGEND } from 'lib/components/InsightLegend/utils' +import { + DISPLAY_TYPES_WITHOUT_DETAILED_RESULTS, + DISPLAY_TYPES_WITHOUT_LEGEND, +} from 'lib/components/InsightLegend/utils' import { Intervals, intervals } from 'lib/components/IntervalFilter/intervals' import { parseProperties } from 'lib/components/PropertyFilters/utils' import { NON_TIME_SERIES_DISPLAY_TYPES, NON_VALUES_ON_SERIES_DISPLAY_TYPES } from 'lib/constants' @@ -275,6 +278,11 @@ export const insightVizDataLogic = kea([ !(display && DISPLAY_TYPES_WITHOUT_LEGEND.includes(display)), ], + hasDetailedResultsTable: [ + (s) => [s.isTrends, s.display], + (isTrends, display) => isTrends && !(display && DISPLAY_TYPES_WITHOUT_DETAILED_RESULTS.includes(display)), + ], + hasFormula: [(s) => [s.formula], (formula) => formula !== undefined], activeUsersMath: [ diff --git a/frontend/src/scenes/insights/views/InsightsTable/InsightsTable.tsx b/frontend/src/scenes/insights/views/InsightsTable/InsightsTable.tsx index 730ad17b66cdab..bf6a1c8f67a94d 100644 --- a/frontend/src/scenes/insights/views/InsightsTable/InsightsTable.tsx +++ b/frontend/src/scenes/insights/views/InsightsTable/InsightsTable.tsx @@ -27,16 +27,29 @@ import { AggregationType, insightsTableDataLogic } from './insightsTableDataLogi export type CalcColumnState = 'total' | 'average' | 'median' export interface InsightsTableProps { - /** Whether this is just a legend instead of standalone insight viz. Default: false. */ - isLegend?: boolean - /** Whether this is table is embedded in another card or whether it should be a card of its own. Default: false. */ - embedded?: boolean /** Key for the entityFilterLogic */ filterKey: string + /** + * Whether this is just a legend instead of standalone insight viz. + * @default false + */ + isLegend?: boolean + /** + * Whether this is table is embedded in another card or whether it should be a card of its own. + * @default false + */ + embedded?: boolean + /** @default false */ canEditSeriesNameInline?: boolean - /** (Un)checking series updates the insight via the API, so it should be disabled if updates aren't desired. */ + /** + * (Un)checking series updates the insight via the API, so it should be disabled if updates aren't desired. + * @default true + */ canCheckUncheckSeries?: boolean - /* whether this table is below another insight or the insight is in table view */ + /** + * Whether this table is below another insight or the insight is in table view. + * @default false + */ isMainInsightView?: boolean } diff --git a/posthog/api/sharing.py b/posthog/api/sharing.py index 9044084898d51d..951a0216ed115e 100644 --- a/posthog/api/sharing.py +++ b/posthog/api/sharing.py @@ -296,6 +296,8 @@ def retrieve(self, request: Request, *args: Any, **kwargs: Any) -> Any: exported_data.update({"showInspector": True}) if "legend" in request.GET: exported_data.update({"legend": True}) + if "detailed" in request.GET: + exported_data.update({"detailed": True}) if request.path.endswith(f".json"): return response.Response(exported_data)