11import React , { useMemo } from 'react' ;
22import {
3+ Banner ,
4+ BannerVariant ,
35 Body ,
46 Button ,
57 ErrorSummary ,
@@ -45,10 +47,6 @@ const schemaToolbarActionBarRightStyles = css({
4547} ) ;
4648
4749const ERROR_WARNING = 'An error occurred during schema analysis' ;
48- const COMPLEXITY_ABORT_MESSAGE = `
49- Analysis was aborted due to: Fields count above 1000.
50- Consider breaking up your data into more collections with smaller documents, and using references to consolidate the data you need.
51- ` ;
5250const INCREASE_MAX_TIME_MS_HINT_MESSAGE =
5351 'Operation exceeded time limit. Please try increasing the maxTimeMS for the query in the filter options.' ;
5452const OUTDATED_WARNING_MESSAGE =
@@ -61,7 +59,7 @@ const SCHEMA_ANALYSIS_DOCS_LINK =
6159
6260type SchemaToolbarProps = {
6361 analysisState : AnalysisState ;
64- error : SchemaAnalysisError ;
62+ error ? : SchemaAnalysisError ;
6563 isOutdated : boolean ;
6664 onAnalyzeSchemaClicked : ( ) => void ;
6765 onExportSchemaClicked : ( ) => void ;
@@ -141,10 +139,18 @@ const SchemaToolbar: React.FunctionComponent<SchemaToolbarProps> = ({
141139 < WarningSummary warnings = { [ INCREASE_MAX_TIME_MS_HINT_MESSAGE ] } />
142140 ) }
143141 { error ?. errorType === 'HIGH_COMPLEXITY' && (
144- < ErrorSummary
142+ < Banner
143+ variant = { BannerVariant . Danger }
145144 data-testid = "schema-toolbar-complexity-abort-message"
146- errors = { [ COMPLEXITY_ABORT_MESSAGE ] }
147- />
145+ dismissible = { true }
146+ >
147+ Analysis was aborted due to: Fields count above 1000. Consider
148+ breaking up your data into more collections with smaller documents,
149+ and using references to consolidate the data you need.
150+ < Link href = "https://www.mongodb.com/cloud/atlas/lp/search-1" >
151+ Learn more
152+ </ Link >
153+ </ Banner >
148154 ) }
149155 { analysisState === ANALYSIS_STATE_COMPLETE && isOutdated && (
150156 < WarningSummary warnings = { [ OUTDATED_WARNING_MESSAGE ] } />
0 commit comments