Skip to content

Commit

Permalink
logic: slight update to when the index closed callout is shown
Browse files Browse the repository at this point in the history
We only show the index closed callout in the flyout when the
reindex operation is not considered "completed"
  • Loading branch information
jloleysens committed Mar 6, 2020
1 parent 83e18d8 commit a0e0ad4
Showing 1 changed file with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ import { DocLinksStart } from 'kibana/public';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import {
EuiCallOut,
EuiFlyout,
EuiFlyoutHeader,
EuiPortal,
EuiTitle,
EuiCallOut,
EuiLink,
EuiPortal,
EuiSpacer,
EuiTitle,
} from '@elastic/eui';

import { EnrichedDeprecationInfo } from '../../../../../../../../common/types';
import { EnrichedDeprecationInfo, ReindexStatus } from '../../../../../../../../common/types';

import { ReindexState } from '../polling_service';
import { ChecklistFlyoutStep } from './checklist_step';
Expand Down Expand Up @@ -117,13 +117,16 @@ export class ReindexFlyout extends React.Component<ReindexFlyoutProps, ReindexFl
const { currentFlyoutStep } = this.state;

let flyoutContents: React.ReactNode;

const globalCallout =
reindexBlocker === 'index-closed' && reindexState.status !== ReindexStatus.completed
? getIndexClosedCallout(docLinks)
: undefined;
switch (currentFlyoutStep) {
case ReindexFlyoutStep.reindexWarnings:
flyoutContents = (
<WarningsFlyoutStep
renderGlobalCallouts={() =>
reindexBlocker === 'index-closed' ? getIndexClosedCallout(docLinks) : undefined
}
renderGlobalCallouts={() => globalCallout}
closeFlyout={closeFlyout}
warnings={reindexState.reindexWarnings!}
advanceNextStep={this.advanceNextStep}
Expand All @@ -133,9 +136,7 @@ export class ReindexFlyout extends React.Component<ReindexFlyoutProps, ReindexFl
case ReindexFlyoutStep.checklist:
flyoutContents = (
<ChecklistFlyoutStep
renderGlobalCallouts={() =>
reindexBlocker === 'index-closed' ? getIndexClosedCallout(docLinks) : undefined
}
renderGlobalCallouts={() => globalCallout}
closeFlyout={closeFlyout}
reindexState={reindexState}
startReindex={startReindex}
Expand Down

0 comments on commit a0e0ad4

Please sign in to comment.