-
Notifications
You must be signed in to change notification settings - Fork 8.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ILM] Delete phase redesign (rework) #90291
Changes from 3 commits
9342150
47edd7b
0b4035c
73ed835
ad70c1b
9851d48
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
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'; |
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'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.euiPanel.ilmPhaseFooter { | ||
padding-top: $euiSizeS; | ||
padding-bottom: $euiSizeS; | ||
border: none; | ||
border-top-left-radius: 0; | ||
border-top-right-radius: 0; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/* | ||
* 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 { FormattedMessage } from '@kbn/i18n/react'; | ||
|
||
import { EuiIcon, EuiText, EuiLink, EuiPanel } from '@elastic/eui'; | ||
|
||
import { PhasesExceptDelete } from '../../../../../../common/types'; | ||
|
||
import { usePhaseTimings } from '../../form'; | ||
|
||
import { InfinityIcon } from '../infinity_icon'; | ||
import './phase_footer.scss'; | ||
|
||
interface Props { | ||
phase: PhasesExceptDelete; | ||
} | ||
|
||
export const PhaseFooter: FunctionComponent<Props> = ({ phase }) => { | ||
const phaseTimings = usePhaseTimings(); | ||
const phaseConfiguration = phaseTimings[phase]; | ||
const setValue = phaseTimings.setDeletePhaseEnabled; | ||
|
||
if (phaseConfiguration === 'disabled' || phaseConfiguration === 'enabled') { | ||
return ( | ||
<EuiPanel className={'ilmPhaseFooter'} hasShadow={false}> | ||
<EuiText size={'s'}> </EuiText> | ||
</EuiPanel> | ||
); | ||
} | ||
|
||
if (phaseConfiguration === 'forever') { | ||
return ( | ||
<EuiPanel color={'subdued'} className={'ilmPhaseFooter'} hasShadow={false}> | ||
<InfinityIcon size={'s'} />{' '} | ||
<EuiText size={'s'} grow={false} className={'eui-displayInlineBlock'}> | ||
<FormattedMessage | ||
id="xpack.indexLifecycleMgmt.editPolicy.phaseTiming.foreverTimingDescription" | ||
defaultMessage="Data will remain in this phase forever." | ||
/>{' '} | ||
<EuiLink onClick={() => setValue(true)} data-test-subj={'enableDeletePhaseLink'}> | ||
<FormattedMessage | ||
id="xpack.indexLifecycleMgmt.editPolicy.deletePhase.enablePhaseButtonLabel" | ||
defaultMessage="Set delete age" | ||
/> | ||
</EuiLink> | ||
</EuiText> | ||
</EuiPanel> | ||
); | ||
} | ||
|
||
return ( | ||
<EuiPanel color={'subdued'} className={'ilmPhaseFooter'} hasShadow={false}> | ||
<EuiIcon type={'storage'} size={'s'} />{' '} | ||
<EuiText size={'s'} grow={false} className={'eui-displayInlineBlock'}> | ||
<FormattedMessage | ||
id="xpack.indexLifecycleMgmt.editPolicy.phaseTiming.beforeDeleteDescription" | ||
defaultMessage="Data will be deleted after this phase." | ||
/>{' '} | ||
<EuiLink onClick={() => setValue(false)} data-test-subj={'disableDeletePhaseLink'}> | ||
<FormattedMessage | ||
id="xpack.indexLifecycleMgmt.editPolicy.deletePhase.disablePhaseButtonLabel" | ||
defaultMessage="Keep data" | ||
/> | ||
</EuiLink> | ||
</EuiText> | ||
</EuiPanel> | ||
); | ||
}; |
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'; |
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,28 @@ | ||||||||||
.ilmPhaseIcon { | ||||||||||
width: 32px; | ||||||||||
height: 32px; | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
display: flex; | ||||||||||
justify-content: center; | ||||||||||
align-items: center; | ||||||||||
border-radius: 50%; | ||||||||||
background-color: $euiColorLightestShade; | ||||||||||
&--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; | ||||||||||
} | ||||||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* 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 { EuiIcon } from '@elastic/eui'; | ||
import { Phases } from '../../../../../../common/types'; | ||
import './phase_icon.scss'; | ||
interface Props { | ||
enabled: boolean; | ||
phase: string & keyof Phases; | ||
} | ||
export const PhaseIcon: FunctionComponent<Props> = ({ enabled, phase }) => { | ||
return ( | ||
<div | ||
className={`ilmPhaseIcon ilmPhaseIcon--${phase} ${enabled ? '' : 'ilmPhaseIcon--disabled'}`} | ||
> | ||
{enabled ? ( | ||
<EuiIcon | ||
className={`ilmPhaseIcon__inner--${phase}`} | ||
type={phase === 'delete' ? 'trash' : 'checkInCircleFilled'} | ||
size={phase === 'delete' ? 'm' : 'l'} | ||
/> | ||
) : ( | ||
<EuiIcon className="ilmPhaseIcon__inner--disabled" type={'dot'} size={'l'} /> | ||
)} | ||
</div> | ||
); | ||
}; |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,15 @@ | ||||||
.ilmDeletePhase { | ||||||
.euiCommentEvent { | ||||||
&__header { | ||||||
padding: $euiSize; | ||||||
background-color: $euiColorEmptyShade; | ||||||
|
||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
} | ||||||
&__body { | ||||||
padding: $euiSize; | ||||||
background-color: $euiColorLightestShade; | ||||||
|
||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
} | ||||||
|
||||||
} | ||||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit; here and elsewhere. the convention for fixed string-literal props is:
I think this is perhaps webstorm specific behaviour as I recall running into it there. If you're using webstorm I managed to disable auto-bracket insertion for JSX by following this issue: https://youtrack.jetbrains.com/issue/WEB-31288?_ga=2.14889842.555971730.1612525382-1881428346.1584373905