forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ILM] Delete phase redesign (rework) (elastic#90291)
* Phases redesign * Fixed scss file * Fixed errors * Added changes for phase blocks * Added styles adjustments Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
- Loading branch information
1 parent
735d9a9
commit 5badc31
Showing
34 changed files
with
672 additions
and
321 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
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
18 changes: 0 additions & 18 deletions
18
..._lifecycle_management/public/application/sections/edit_policy/components/active_badge.tsx
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
...public/application/sections/edit_policy/components/active_highlight/active_highlight.scss
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -5,4 +5,4 @@ | |
* 2.0. | ||
*/ | ||
|
||
export { ActiveHighlight } from './active_highlight'; | ||
export { InfinityIcon } from './infinity_icon'; |
File renamed without changes.
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
8 changes: 8 additions & 0 deletions
8
...cycle_management/public/application/sections/edit_policy/components/phase_footer/index.ts
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 | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
export { PhaseFooter } from './phase_footer'; |
94 changes: 94 additions & 0 deletions
94
...nagement/public/application/sections/edit_policy/components/phase_footer/phase_footer.tsx
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,94 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import React, { FunctionComponent } from 'react'; | ||
|
||
import { i18n } from '@kbn/i18n'; | ||
|
||
import { EuiText, EuiButtonGroup, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; | ||
|
||
import { PhasesExceptDelete } from '../../../../../../common/types'; | ||
|
||
import { usePhaseTimings } from '../../form'; | ||
|
||
import { InfinityIconSvg } from '../infinity_icon/infinity_icon.svg'; | ||
|
||
interface Props { | ||
phase: PhasesExceptDelete; | ||
} | ||
|
||
export const PhaseFooter: FunctionComponent<Props> = ({ phase }) => { | ||
const { | ||
isDeletePhaseEnabled, | ||
setDeletePhaseEnabled: setValue, | ||
[phase]: phaseConfiguration, | ||
} = usePhaseTimings(); | ||
|
||
if (!phaseConfiguration.isFinalDataPhase) { | ||
return null; | ||
} | ||
|
||
const phaseDescription = isDeletePhaseEnabled | ||
? i18n.translate('xpack.indexLifecycleMgmt.editPolicy.phaseTiming.beforeDeleteDescription', { | ||
defaultMessage: 'Data will be deleted after this phase', | ||
}) | ||
: i18n.translate('xpack.indexLifecycleMgmt.editPolicy.phaseTiming.foreverTimingDescription', { | ||
defaultMessage: 'Data will remain in this phase forever', | ||
}); | ||
|
||
const selectedButton = isDeletePhaseEnabled | ||
? 'ilmEnableDeletePhaseButton' | ||
: 'ilmDisableDeletePhaseButton'; | ||
|
||
const buttons = [ | ||
{ | ||
id: `ilmDisableDeletePhaseButton`, | ||
label: i18n.translate( | ||
'xpack.indexLifecycleMgmt.editPolicy.deletePhase.disablePhaseButtonLabel', | ||
{ | ||
defaultMessage: 'Keep data in this phase forever', | ||
} | ||
), | ||
iconType: InfinityIconSvg, | ||
}, | ||
{ | ||
id: `ilmEnableDeletePhaseButton`, | ||
label: i18n.translate( | ||
'xpack.indexLifecycleMgmt.editPolicy.deletePhase.enablePhaseButtonLabel', | ||
{ | ||
defaultMessage: 'Delete data after this phase', | ||
} | ||
), | ||
iconType: 'trash', | ||
'data-test-subj': 'enableDeletePhaseButton', | ||
}, | ||
]; | ||
|
||
return ( | ||
<EuiFlexGroup alignItems="center" gutterSize="s" wrap> | ||
<EuiFlexItem grow={false}> | ||
<EuiText size="s" color="subdued"> | ||
{phaseDescription} | ||
</EuiText> | ||
</EuiFlexItem> | ||
<EuiFlexItem grow={false}> | ||
<EuiButtonGroup | ||
legend={i18n.translate( | ||
'xpack.indexLifecycleMgmt.editPolicy.deletePhase.buttonGroupLegend', | ||
{ defaultMessage: 'Enable or disable delete phase' } | ||
)} | ||
options={buttons} | ||
idSelected={selectedButton} | ||
onChange={(id) => { | ||
setValue(id === 'ilmEnableDeletePhaseButton'); | ||
}} | ||
isIconOnly={true} | ||
/> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
); | ||
}; |
8 changes: 8 additions & 0 deletions
8
...fecycle_management/public/application/sections/edit_policy/components/phase_icon/index.ts
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 | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
export { PhaseIcon } from './phase_icon'; |
33 changes: 33 additions & 0 deletions
33
..._management/public/application/sections/edit_policy/components/phase_icon/phase_icon.scss
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,33 @@ | ||
.ilmPhaseIcon { | ||
width: $euiSizeXL; | ||
height: $euiSizeXL; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
border-radius: 50%; | ||
background-color: $euiColorLightestShade; | ||
&--disabled { | ||
margin-top: $euiSizeS; | ||
width: $euiSize; | ||
height: $euiSize; | ||
} | ||
&--delete { | ||
background-color: $euiColorLightShade; | ||
} | ||
&__inner--hot { | ||
fill: $euiColorVis9_behindText; | ||
} | ||
&__inner--warm { | ||
fill: $euiColorVis5_behindText; | ||
} | ||
&__inner--cold { | ||
fill: $euiColorVis1_behindText; | ||
} | ||
&__inner--delete { | ||
fill: $euiColorDarkShade; | ||
} | ||
|
||
&__inner--disabled { | ||
fill: $euiColorMediumShade; | ||
} | ||
} |
Oops, something went wrong.