Skip to content
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

[Uptime] Donut chart loader position centered vertically #50219

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,22 @@ interface SnapshotQueryResult {
snapshot?: SnapshotType;
}

interface SnapshotProps {
/**
* Height is needed, since by default charts takes height of 100%
*/
height?: string;
}

export type SnapshotComponentProps = SnapshotProps & UptimeGraphQLQueryProps<SnapshotQueryResult>;

/**
* This component visualizes a KPI and histogram chart to help users quickly
* glean the status of their uptime environment.
* @param props the props required by the component
*/
export const SnapshotComponent = ({
data,
loading,
}: UptimeGraphQLQueryProps<SnapshotQueryResult>) => (
<ChartWrapper loading={loading}>
export const SnapshotComponent = ({ data, loading, height }: SnapshotComponentProps) => (
<ChartWrapper loading={loading} height={height}>
<SnapshotHeading
down={get<number>(data, 'snapshot.counts.down', 0)}
total={get<number>(data, 'snapshot.counts.total', 0)}
Expand All @@ -49,4 +55,7 @@ export const SnapshotComponent = ({
* This component visualizes a KPI and histogram chart to help users quickly
* glean the status of their uptime environment.
*/
export const Snapshot = withUptimeGraphQL<SnapshotQueryResult>(SnapshotComponent, snapshotQuery);
export const Snapshot = withUptimeGraphQL<SnapshotQueryResult, SnapshotProps>(
SnapshotComponent,
snapshotQuery
);
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const StatusPanel = ({
<EuiPanel>
<EuiFlexGroup gutterSize="l">
<EuiFlexItem grow={2}>
<Snapshot variables={sharedProps} />
<Snapshot variables={sharedProps} height="160px" />
shahzad31 marked this conversation as resolved.
Show resolved Hide resolved
</EuiFlexItem>
<EuiFlexItem grow={10}>
<SnapshotHistogram
Expand Down