Skip to content

Commit

Permalink
fix: remove redundant controls from InsightCard for Data Table (#23560)
Browse files Browse the repository at this point in the history
  • Loading branch information
skoob13 authored Jul 9, 2024
1 parent 31155c4 commit f4f20f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions frontend/src/queries/Query/Query.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export function Query<Q extends Node>(props: QueryProps<Q>): JSX.Element | null
cachedResults={props.cachedResults}
uniqueKey={uniqueKey}
context={queryContext}
readOnly={readOnly}
/>
)
} else if (isSavedInsightNode(query)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ interface DataTableVisualizationProps {
/* Cached Results are provided when shared or exported,
the data node logic becomes read only implicitly */
cachedResults?: AnyResponseType
readOnly?: boolean
}

let uniqueNode = 0
Expand Down Expand Up @@ -70,6 +71,7 @@ export function DataTableVisualization(props: DataTableVisualizationProps): JSX.
}

function InternalDataTableVisualization(props: DataTableVisualizationProps): JSX.Element {
const { readOnly } = props
const { query, visualizationType, showEditingUI, showResultControls, sourceFeatures, response, responseLoading } =
useValues(dataVisualizationLogic)

Expand Down Expand Up @@ -112,7 +114,7 @@ function InternalDataTableVisualization(props: DataTableVisualizationProps): JSX
return (
<div className="DataVisualization flex flex-1">
<div className="relative w-full flex flex-col gap-4 flex-1 overflow-hidden">
{showEditingUI && (
{!readOnly && showEditingUI && (
<>
<HogQLQueryEditor query={query.source} setQuery={setQuerySource} embedded />
{sourceFeatures.has(QueryFeature.dateRangePicker) && (
Expand All @@ -130,7 +132,7 @@ function InternalDataTableVisualization(props: DataTableVisualizationProps): JSX
)}
</>
)}
{showResultControls && (
{!readOnly && showResultControls && (
<>
<LemonDivider className="my-0" />
<div className="flex gap-4 justify-between flex-wrap">
Expand Down

0 comments on commit f4f20f1

Please sign in to comment.