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.
[Uptime]Fix/issue 40584 section headline should be inside panel (elas…
…tic#43468) * move title inside panel * fix monitor list title * update title in each panel and paddings * update unit tests snapshots * make section titles symmeteric * update snapshots * Add chart wrapper to improve UX experience and padding arounds charts * removed ping list count * removed unnecessary spacer * update test snaps
- Loading branch information
Showing
13 changed files
with
275 additions
and
216 deletions.
There are no files selected for viewing
10 changes: 3 additions & 7 deletions
10
.../uptime/public/components/functional/__tests__/__snapshots__/monitor_charts.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
46 changes: 15 additions & 31 deletions
46
...ugins/uptime/public/components/functional/__tests__/__snapshots__/ping_list.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
27 changes: 14 additions & 13 deletions
27
...lugins/uptime/public/components/functional/__tests__/__snapshots__/snapshot.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
42 changes: 42 additions & 0 deletions
42
...legacy/plugins/uptime/public/components/functional/charts/chart_wrapper/chart_wrapper.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,42 @@ | ||
/* | ||
* 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, { FC, Fragment } from 'react'; | ||
import { EuiFlexGroup, EuiFlexItem, EuiLoadingChart } from '@elastic/eui'; | ||
|
||
interface Props { | ||
height?: string; | ||
loading?: boolean; | ||
} | ||
|
||
export const ChartWrapper: FC<Props> = ({ loading = false, height = '100%', children }) => { | ||
const opacity = loading === true ? 0.3 : 1; | ||
|
||
return ( | ||
<Fragment> | ||
<div | ||
style={{ | ||
height, | ||
opacity, | ||
transition: 'opacity 0.2s', | ||
}} | ||
> | ||
{children} | ||
</div> | ||
{loading === true && ( | ||
<EuiFlexGroup | ||
justifyContent="spaceAround" | ||
alignItems="center" | ||
style={{ height, marginTop: `-${height}` }} | ||
> | ||
<EuiFlexItem grow={false}> | ||
<EuiLoadingChart size="xl" /> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
)} | ||
</Fragment> | ||
); | ||
}; |
6 changes: 6 additions & 0 deletions
6
x-pack/legacy/plugins/uptime/public/components/functional/charts/chart_wrapper/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,6 @@ | ||
/* | ||
* 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 { ChartWrapper } from './chart_wrapper'; |
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.