@@ -36,7 +36,12 @@ import { getAtlasPerformanceAdvisorLink } from '../utils';
36
36
import { useIsLastAppliedQueryOutdated } from '@mongodb-js/compass-query-bar' ;
37
37
import { useTelemetry } from '@mongodb-js/compass-telemetry/provider' ;
38
38
import type { RootState } from '../stores/store' ;
39
- import { startAnalysis , stopAnalysis } from '../stores/schema-analysis-reducer' ;
39
+ import {
40
+ analysisErrorDismissed ,
41
+ type SchemaAnalysisError ,
42
+ startAnalysis ,
43
+ stopAnalysis ,
44
+ } from '../stores/schema-analysis-reducer' ;
40
45
import { openExportSchema } from '../stores/schema-export-reducer' ;
41
46
import ExportSchemaModal from './export-schema-modal' ;
42
47
import ExportSchemaLegacyBanner from './export-schema-legacy-banner' ;
@@ -371,22 +376,24 @@ const PerformanceAdvisorBanner = () => {
371
376
372
377
const Schema : React . FunctionComponent < {
373
378
analysisState : AnalysisState ;
374
- errorMessage ?: string ;
379
+ error ?: SchemaAnalysisError ;
375
380
maxTimeMS ?: number ;
376
381
schema : MongodbSchema | null ;
377
382
count ?: number ;
378
383
resultId ?: string ;
379
384
onExportSchemaClicked : ( ) => void ;
380
385
onStartAnalysis : ( ) => Promise < void > ;
381
386
onStopAnalysis : ( ) => void ;
387
+ onDismissError : ( ) => void ;
382
388
} > = ( {
383
389
analysisState,
384
- errorMessage ,
390
+ error ,
385
391
schema,
386
392
resultId,
387
393
onExportSchemaClicked,
388
394
onStartAnalysis,
389
395
onStopAnalysis,
396
+ onDismissError,
390
397
} ) => {
391
398
const onApplyClicked = useCallback ( ( ) => {
392
399
void onStartAnalysis ( ) ;
@@ -410,7 +417,8 @@ const Schema: React.FunctionComponent<{
410
417
onExportSchemaClicked = { onExportSchemaClicked }
411
418
onResetClicked = { onApplyClicked }
412
419
analysisState = { analysisState }
413
- errorMessage = { errorMessage || '' }
420
+ error = { error }
421
+ onDismissError = { onDismissError }
414
422
isOutdated = { ! ! outdated }
415
423
sampleSize = { schema ? schema . count : 0 }
416
424
schemaResultId = { resultId || '' }
@@ -440,13 +448,14 @@ const Schema: React.FunctionComponent<{
440
448
export default connect (
441
449
( state : RootState ) => ( {
442
450
analysisState : state . schemaAnalysis . analysisState ,
443
- errorMessage : state . schemaAnalysis . errorMessage ,
451
+ error : state . schemaAnalysis . error ,
444
452
schema : state . schemaAnalysis . schema ,
445
453
resultId : state . schemaAnalysis . resultId ,
446
454
} ) ,
447
455
{
448
456
onStartAnalysis : startAnalysis ,
449
457
onStopAnalysis : ( ) => stopAnalysis ( ) ,
450
458
onExportSchemaClicked : openExportSchema ,
459
+ onDismissError : analysisErrorDismissed ,
451
460
}
452
461
) ( Schema ) ;
0 commit comments