-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ILM] New copy for rollover and small refactor for timeline (#89422)
* refactor timeline and relative ms calculation logic for easier use outside of edit_policy section * further refactor, move child component to own file in timeline, and clean up public API for relative timing calculation * added copy to call out variation in timing (slop) introduced by rollover * use separate copy for timeline * remove unused import * fix unresolved merge * implement copy feedback * added component integration for showing/hiding hot phase icon on timeline Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
- Loading branch information
1 parent
84d49f1
commit 61a51b5
Showing
13 changed files
with
288 additions
and
151 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
7 changes: 7 additions & 0 deletions
7
...anagement/public/application/sections/edit_policy/components/timeline/components/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,7 @@ | ||
/* | ||
* 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 { TimelinePhaseText } from './timeline_phase_text'; |
28 changes: 28 additions & 0 deletions
28
...c/application/sections/edit_policy/components/timeline/components/timeline_phase_text.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,28 @@ | ||
/* | ||
* 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, { FunctionComponent, ReactNode } from 'react'; | ||
import { EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; | ||
|
||
export const TimelinePhaseText: FunctionComponent<{ | ||
phaseName: ReactNode | string; | ||
durationInPhase?: ReactNode | string; | ||
}> = ({ phaseName, durationInPhase }) => ( | ||
<EuiFlexGroup justifyContent="spaceBetween" gutterSize="none"> | ||
<EuiFlexItem> | ||
<EuiText size="s"> | ||
<strong>{phaseName}</strong> | ||
</EuiText> | ||
</EuiFlexItem> | ||
<EuiFlexItem grow={false}> | ||
{typeof durationInPhase === 'string' ? ( | ||
<EuiText size="s">{durationInPhase}</EuiText> | ||
) : ( | ||
durationInPhase | ||
)} | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
); |
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
33 changes: 33 additions & 0 deletions
33
...gement/public/application/sections/edit_policy/components/timeline/timeline.container.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,33 @@ | ||
/* | ||
* 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, { FunctionComponent } from 'react'; | ||
|
||
import { useFormData } from '../../../../../shared_imports'; | ||
|
||
import { formDataToAbsoluteTimings } from '../../lib'; | ||
|
||
import { useConfigurationIssues } from '../../form'; | ||
|
||
import { FormInternal } from '../../types'; | ||
|
||
import { Timeline as ViewComponent } from './timeline'; | ||
|
||
export const Timeline: FunctionComponent = () => { | ||
const [formData] = useFormData<FormInternal>(); | ||
const timings = formDataToAbsoluteTimings(formData); | ||
const { isUsingRollover } = useConfigurationIssues(); | ||
return ( | ||
<ViewComponent | ||
hotPhaseMinAge={timings.hot.min_age} | ||
warmPhaseMinAge={timings.warm?.min_age} | ||
coldPhaseMinAge={timings.cold?.min_age} | ||
deletePhaseMinAge={timings.delete?.min_age} | ||
isUsingRollover={isUsingRollover} | ||
hasDeletePhase={Boolean(formData._meta?.delete?.enabled)} | ||
/> | ||
); | ||
}; |
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
Oops, something went wrong.