Skip to content

Commit

Permalink
styling
Browse files Browse the repository at this point in the history
  • Loading branch information
angorayc committed Jan 5, 2023
1 parent 4d4a5cf commit 075ef5f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ export interface DonutChartWrapperProps {

/* Make this position absolute in order to overlap the text onto the donut */
export const DonutTextWrapper = styled(EuiFlexGroup)<
EuiFlexGroupProps & { $isChartEmbeddablesEnabled?: boolean }
EuiFlexGroupProps & { $isChartEmbeddablesEnabled?: boolean; $dataExists?: boolean }
>`
top: ${({ $isChartEmbeddablesEnabled }) => ($isChartEmbeddablesEnabled ? `66%` : `34%;`)};
top: ${({ $isChartEmbeddablesEnabled, $dataExists }) =>
$isChartEmbeddablesEnabled && !$dataExists ? `66%` : `34%;`};
width: 100%;
max-width: 77px;
position: absolute;
Expand Down Expand Up @@ -101,6 +102,7 @@ const DonutChartWrapperComponent: React.FC<DonutChartWrapperProps> = ({
>
<StyledEuiFlexItem grow={isChartEmbeddablesEnabled}>
<DonutTextWrapper
$dataExists={dataExists}
$isChartEmbeddablesEnabled={isChartEmbeddablesEnabled}
alignItems="center"
direction="column"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import type { GetLensAttributes, LensAttributes } from '../../../types';

export const getAlertsBySeverityAttributes: GetLensAttributes = (
export const getAlertsByStatusAttributes: GetLensAttributes = (
stackByField = 'kibana.alert.workflow_status',
extraOptions
) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import React, { useCallback, useEffect, useMemo } from 'react';
import { DonutChartWrapper } from '../../../../common/components/charts/donutchart';
import { useRefetchByRestartingSession } from '../../../../common/components/page/use_refetch_by_session';
import { getAlertsBySeverityAttributes } from '../../../../common/components/visualization_actions/lens_attributes/common/alerts/alerts_by_severity_donut';
import { getAlertsByStatusAttributes } from '../../../../common/components/visualization_actions/lens_attributes/common/alerts/alerts_by_status_donut';
import { LensEmbeddable } from '../../../../common/components/visualization_actions/lens_embeddable';
import type { EmbeddableData } from '../../../../common/components/visualization_actions/types';
import { parseVisualizationData } from '../../../../common/components/visualization_actions/utils';
Expand Down Expand Up @@ -78,7 +78,7 @@ const AlertDonutEmbeddableComponent: React.FC<AlertDonutEmbeddableProps> = ({
height={ChartSize}
width={ChartSize}
onLoad={onEmbeddableLoad}
getLensAttributes={getAlertsBySeverityAttributes}
getLensAttributes={getAlertsByStatusAttributes}
stackByField="kibana.alert.workflow_status"
scopeId={SourcererScopeName.detections}
id={`alertsStatus${status}`}
Expand Down

0 comments on commit 075ef5f

Please sign in to comment.