-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* [ML] Adding index migration warnings * small refactor * correctlng comment * adding upgrade service to manage upgradeInProgress state * removing missing function
- Loading branch information
1 parent
64f26ab
commit 389290e
Showing
6 changed files
with
205 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
|
||
export { UpgradeWarning } from './upgrade_warning'; |
48 changes: 48 additions & 0 deletions
48
x-pack/plugins/ml/public/components/upgrade/upgrade_warning.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
|
||
import React from 'react'; | ||
|
||
import { | ||
EuiCallOut, | ||
EuiSpacer, | ||
} from '@elastic/eui'; | ||
import { FormattedMessage } from '@kbn/i18n/react'; | ||
|
||
import { isUpgradeInProgress } from '../../services/upgrade_service'; | ||
|
||
export function UpgradeWarning() { | ||
if (isUpgradeInProgress() === true) { | ||
return ( | ||
<React.Fragment> | ||
<EuiCallOut | ||
title={(<FormattedMessage | ||
id="xpack.ml.upgrade.upgradeWarning.upgradeInProgressWarningTitle" | ||
defaultMessage="Index migration in progress" | ||
/>)} | ||
color="warning" | ||
iconType="alert" | ||
> | ||
<p> | ||
<FormattedMessage | ||
id="xpack.ml.upgrade.upgradeWarning.upgradeInProgressWarningDescription" | ||
defaultMessage="Indices related to Machine Learning are currently being upgraded." | ||
/> | ||
<br /> | ||
<FormattedMessage | ||
id="xpack.ml.upgrade.upgradeWarning.upgradeInProgressWarningDescriptionExtra" | ||
defaultMessage="Some actions will not be available during this time." | ||
/> | ||
</p> | ||
</EuiCallOut> | ||
<EuiSpacer size="m" /> | ||
</React.Fragment> | ||
); | ||
} | ||
|
||
return null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
|
||
let upgradeInProgress = false; | ||
|
||
export function setUpgradeInProgress(show) { | ||
upgradeInProgress = show; | ||
} | ||
|
||
export function isUpgradeInProgress() { | ||
return upgradeInProgress; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters