Skip to content

Commit 8b492a0

Browse files
committed
modify the panel count to vis only and fix the ft
Signed-off-by: Jialiang Liang <[email protected]>
1 parent f6682de commit 8b492a0

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.tsx

+8-4
Original file line numberDiff line numberDiff line change
@@ -198,16 +198,20 @@ export class DashboardViewport extends React.Component<DashboardViewportProps, S
198198
useMargins,
199199
} = this.state;
200200

201-
const shouldRenderSyncUI = this.syncService.shouldRenderSyncUI();
202-
const syncUIProps = this.syncService.getSyncUIProps();
201+
// Count only panels that are likely to render visualizations
202+
const renderablePanels = Object.values(panels).filter((p) => p.type === 'visualization');
203+
204+
const shouldRenderSyncUI =
205+
this.props.isDirectQuerySyncEnabled && this.syncService?.shouldRenderSyncUI();
206+
const syncUIProps = this.syncService?.getSyncUIProps();
203207

204208
return (
205209
<div>
206-
{shouldRenderSyncUI && (
210+
{shouldRenderSyncUI && syncUIProps && (
207211
<DashboardDirectQuerySync loadStatus={this.props.loadStatus} {...syncUIProps} />
208212
)}
209213
<div
210-
data-shared-items-count={Object.values(panels).length}
214+
data-shared-items-count={renderablePanels.length}
211215
data-shared-items-container
212216
data-title={title}
213217
data-description={description}

0 commit comments

Comments
 (0)