File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed
packages/compass-aggregations/src/components/pipeline-toolbar Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ export const PipelineToolbar: React.FunctionComponent<PipelineToolbarProps> = ({
101
101
< PipelineOptions />
102
102
</ div >
103
103
) }
104
- { enableAIExperience && (
104
+ { enableAIExperience && isBuilderView && (
105
105
< PipelineAI
106
106
onClose = { ( ) => {
107
107
onHideAIInputClick ?.( ) ;
@@ -127,8 +127,8 @@ export const PipelineToolbar: React.FunctionComponent<PipelineToolbarProps> = ({
127
127
} ;
128
128
129
129
const mapState = ( state : RootState ) => ( {
130
- isBuilderView : state . workspace === 'builder' ,
131
130
isAIInputVisible : state . pipelineBuilder . aiPipeline . isInputVisible ,
131
+ isBuilderView : state . workspace === 'builder' ,
132
132
} ) ;
133
133
export default connect ( mapState , {
134
134
onHideAIInputClick : hideAIInput ,
Original file line number Diff line number Diff line change @@ -166,14 +166,16 @@ const mapState = (state: RootState) => {
166
166
const lastStage = resultPipeline [ resultPipeline . length - 1 ] ;
167
167
const isMergeOrOutPipeline = isOutputStage ( lastStage ) ;
168
168
const hasSyntaxErrors = getIsPipelineInvalidFromBuilderState ( state , false ) ;
169
+ const isBuilderView = state . workspace === 'builder' ;
169
170
170
171
return {
171
172
isRunButtonDisabled : hasSyntaxErrors ,
172
173
isExplainButtonDisabled : hasSyntaxErrors ,
173
174
isExportButtonDisabled : isMergeOrOutPipeline || hasSyntaxErrors ,
174
175
showAIEntry :
175
176
! state . pipelineBuilder . aiPipeline . isInputVisible &&
176
- resultPipeline . length > 0 ,
177
+ resultPipeline . length > 0 &&
178
+ isBuilderView ,
177
179
showUpdateViewButton : Boolean ( state . editViewName ) ,
178
180
isUpdateViewButtonDisabled : ! state . isModified || hasSyntaxErrors ,
179
181
isAtlasDeployed : state . isAtlasDeployed ,
Original file line number Diff line number Diff line change @@ -122,7 +122,8 @@ const mapState = (state: RootState) => {
122
122
const isResultsMode = state . workspace === 'results' ;
123
123
const isStageMode = state . pipelineBuilder . pipelineMode === 'builder-ui' ;
124
124
return {
125
- showAIEntry : ! state . pipelineBuilder . aiPipeline . isInputVisible ,
125
+ showAIEntry :
126
+ ! state . pipelineBuilder . aiPipeline . isInputVisible && ! isResultsMode ,
126
127
stages : stages . filter ( Boolean ) as string [ ] ,
127
128
showAddNewStage :
128
129
! state . pipelineBuilder . aiPipeline . isInputVisible &&
You can’t perform that action at this time.
0 commit comments