From 3299d7b4247cfa0e03ae102b22fa6730309870e4 Mon Sep 17 00:00:00 2001 From: Yulia Cech Date: Wed, 13 Oct 2021 18:22:57 +0200 Subject: [PATCH] [Upgrade Assistant] Removed "closed index" warning that reindexing might take longer than usual, which is not the case --- .../reindex/flyout/checklist_step.tsx | 4 +- .../reindex/flyout/container.tsx | 67 ++----------------- .../reindex/flyout/warnings_step.tsx | 4 -- 3 files changed, 5 insertions(+), 70 deletions(-) diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/checklist_step.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/checklist_step.tsx index 3ba0428f8bb33..19d61b3a8afa9 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/checklist_step.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/checklist_step.tsx @@ -61,12 +61,11 @@ const buttonLabel = (status?: ReindexStatus) => { * Displays a flyout that shows the current reindexing status for a given index. */ export const ChecklistFlyoutStep: React.FunctionComponent<{ - renderGlobalCallouts: () => React.ReactNode; closeFlyout: () => void; reindexState: ReindexState; startReindex: () => void; cancelReindex: () => void; -}> = ({ closeFlyout, reindexState, startReindex, cancelReindex, renderGlobalCallouts }) => { +}> = ({ closeFlyout, reindexState, startReindex, cancelReindex }) => { const { loadingState, status, hasRequiredPrivileges } = reindexState; const loading = loadingState === LoadingState.Loading || status === ReindexStatus.inProgress; const isCompleted = status === ReindexStatus.completed; @@ -116,7 +115,6 @@ export const ChecklistFlyoutStep: React.FunctionComponent<{ )} - {renderGlobalCallouts()} void; } -const getOpenAndCloseIndexDocLink = (docLinks: DocLinksStart) => ( - - {i18n.translate( - 'xpack.upgradeAssistant.checkupTab.reindexing.flyout.openAndCloseDocumentation', - { defaultMessage: 'documentation' } - )} - -); - -const getIndexClosedCallout = (docLinks: DocLinksStart) => ( - <> - -

- - {i18n.translate( - 'xpack.upgradeAssistant.checkupTab.reindexing.flyout.indexClosedCallout.calloutDetails.reindexingTakesLongerEmphasis', - { defaultMessage: 'Reindexing may take longer than usual' } - )} - - ), - }} - /> -

-
- - -); - export const ReindexFlyout: React.FunctionComponent = ({ reindexState, startReindex, @@ -82,12 +34,8 @@ export const ReindexFlyout: React.FunctionComponent = ({ deprecation, }) => { const { status, reindexWarnings } = reindexState; - const { index, correctiveAction } = deprecation; - const { - services: { - core: { docLinks }, - }, - } = useAppContext(); + const { index } = deprecation; + // If there are any warnings and we haven't started reindexing, show the warnings step first. const [currentFlyoutStep, setCurrentFlyoutStep] = useState( reindexWarnings && reindexWarnings.length > 0 && status === undefined @@ -97,16 +45,10 @@ export const ReindexFlyout: React.FunctionComponent = ({ let flyoutContents: React.ReactNode; - const globalCallout = - (correctiveAction as ReindexAction).blockerForReindexing === 'index-closed' && - reindexState.status !== ReindexStatus.completed - ? getIndexClosedCallout(docLinks) - : undefined; switch (currentFlyoutStep) { case ReindexFlyoutStep.reindexWarnings: flyoutContents = ( globalCallout} closeFlyout={closeFlyout} warnings={reindexState.reindexWarnings!} advanceNextStep={() => setCurrentFlyoutStep(ReindexFlyoutStep.checklist)} @@ -116,7 +58,6 @@ export const ReindexFlyout: React.FunctionComponent = ({ case ReindexFlyoutStep.checklist: flyoutContents = ( globalCallout} closeFlyout={closeFlyout} reindexState={reindexState} startReindex={startReindex} diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/warnings_step.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/warnings_step.tsx index 8078d495c4009..0596c692a9f38 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/warnings_step.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/warnings_step.tsx @@ -41,7 +41,6 @@ const warningToComponentMap: { export const idForWarning = (id: number) => `reindexWarning-${id}`; interface WarningsConfirmationFlyoutProps { - renderGlobalCallouts: () => React.ReactNode; closeFlyout: () => void; warnings: ReindexWarning[]; advanceNextStep: () => void; @@ -53,7 +52,6 @@ interface WarningsConfirmationFlyoutProps { */ export const WarningsFlyoutStep: React.FunctionComponent = ({ warnings, - renderGlobalCallouts, closeFlyout, advanceNextStep, }) => { @@ -88,8 +86,6 @@ export const WarningsFlyoutStep: React.FunctionComponent - {renderGlobalCallouts()} -