From 5914dfde1246e2334c80b4257543780a303c8612 Mon Sep 17 00:00:00 2001 From: Basit Date: Thu, 12 May 2022 12:40:25 +0200 Subject: [PATCH 1/4] feat(explain-aggregation): add explain button in toolbar --- .../pipeline-header/pipeline-actions.tsx | 23 ++++++++++++++++++- packages/compass/src/index.d.ts | 1 + 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/packages/compass-aggregations/src/components/pipeline-toolbar/pipeline-header/pipeline-actions.tsx b/packages/compass-aggregations/src/components/pipeline-toolbar/pipeline-header/pipeline-actions.tsx index c6fabbbefe5..be5ec4483b6 100644 --- a/packages/compass-aggregations/src/components/pipeline-toolbar/pipeline-header/pipeline-actions.tsx +++ b/packages/compass-aggregations/src/components/pipeline-toolbar/pipeline-header/pipeline-actions.tsx @@ -51,6 +51,9 @@ type PipelineActionsProps = { isUpdateViewButtonDisabled?: boolean; onUpdateView: () => void; + isExplainButtonDisabled?: boolean; + onExplainAggregation: () => void; + isOptionsVisible?: boolean; onToggleOptions: () => void; }; @@ -63,22 +66,26 @@ export const PipelineActions: React.FunctionComponent = ({ isExportButtonDisabled, showUpdateViewButton, isUpdateViewButtonDisabled, + isExplainButtonDisabled, onUpdateView, onRunAggregation, onToggleOptions, onExportAggregationResults, + onExplainAggregation, }) => { const optionsIcon = isOptionsVisible ? 'CaretDown' : 'CaretRight'; const showExportButton = process?.env?.COMPASS_ENABLE_AGGREGATION_EXPORT === 'true' && _showExportButton; + const showExplainButton = + process?.env?.COMPASS_ENABLE_AGGREGATION_EXPLAIN === 'true'; const optionsLabel = isOptionsVisible ? 'Less Options' : 'More Options'; return (
{showUpdateViewButton && ( )} + {showExplainButton && ( + + )} {!showUpdateViewButton && showExportButton && (