Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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 @@ -7,8 +7,8 @@ import {
CardTitle,
Content,
ContentVariants,
Flex,
FlexItem,
Grid,
GridItem,
Spinner,
Stack,
StackItem,
Expand Down Expand Up @@ -52,25 +52,25 @@ const StatusCard = () => {
</Content>
</StackItem>
<StackItem>
<Flex justifyContent={{ default: 'justifyContentSpaceAround' }}>
<FlexItem>
<Grid hasGutter>
<GridItem md={4}>
<ApplicationStatusChart
applicationStatus={devicesSummary?.applicationStatus || {}}
labels={labels}
fleets={fleets}
/>
</FlexItem>
<FlexItem>
</GridItem>
<GridItem md={4}>
<DeviceStatusChart deviceStatus={devicesSummary?.summaryStatus || {}} labels={labels} fleets={fleets} />
</FlexItem>
<FlexItem>
</GridItem>
<GridItem md={4}>
<SystemUpdateStatusChart
updatedStatus={devicesSummary?.updateStatus || {}}
labels={labels}
fleets={fleets}
/>
</FlexItem>
</Flex>
</GridItem>
</Grid>
</StackItem>
</Stack>
);
Expand Down
4 changes: 4 additions & 0 deletions libs/ui-components/src/components/charts/DonutChart.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@
color: var(--pf-t--global--text--color--subtle);
font-size: 0.85rem;
}

.fctl-charts__title .fctl-label-withhelpertext {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't seem like this is fixing the issue when there is at least one device in the system.
In that case, the legend for each of the Donut charts is different, and the widths are proportional to each Donut's legend width.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, Thanks.

image

gap: var(--pf-t--global--spacer--sm);
}
2 changes: 1 addition & 1 deletion libs/ui-components/src/components/charts/DonutChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const DonutChart = ({ data, title, helperText }: { data: Data[]; title: string;
alignContent={{ default: 'alignContentCenter' }}
className="fctl-charts__title"
>
{helperText ? <LabelWithHelperText label={title} content={helperText} /> : title}
{helperText ? <LabelWithHelperText label={title} content={helperText} hasNoPadding /> : title}
</Flex>
</foreignObject>
<ChartDonut
Expand Down
11 changes: 9 additions & 2 deletions libs/ui-components/src/components/common/WithHelperText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import './WithHelperText.css';
type HelperTextPopoverProps = {
label: string;
isInline?: boolean;
hasNoPadding?: boolean;
Comment thread
asmasarw marked this conversation as resolved.
Resolved
triggerAction?: 'click' | 'hover';
content: React.ReactNode;
};
Expand All @@ -19,13 +20,15 @@ const HelperTextPopover = ({
ariaLabel,
content,
triggerAction,
hasNoPadding,
}: Omit<HelperTextPopoverProps, 'label'> & { ariaLabel: string }) => (
<Popover aria-label={ariaLabel} bodyContent={content} withFocusTrap triggerAction={triggerAction}>
<Button
icon={<OutlinedQuestionCircleIcon />}
component="a"
isInline
variant="plain"
hasNoPadding={hasNoPadding}
onClick={(ev) => {
ev.preventDefault();
ev.stopPropagation();
Expand All @@ -41,22 +44,26 @@ const LabelWithHelperText = ({
isInline,
content,
triggerAction,
hasNoPadding,
}: HelperTextPopoverProps & { hideLabel?: boolean }) => (
<span className={`fctl-label-withhelpertext${isInline ? ' fctl-label-withhelpertext--inline' : ''}`}>
{!hideLabel && label}
<HelperTextPopover ariaLabel={label} content={content} triggerAction={triggerAction} />
<HelperTextPopover ariaLabel={label} content={content} triggerAction={triggerAction} hasNoPadding={hasNoPadding} />
</span>
);

export const FormGroupWithHelperText = ({
label,
isRequired,
content,
hasNoPadding,
children,
}: React.PropsWithChildren<FormGroupWithHelperTextProps>) => (
<FormGroup
label={label}
labelHelp={content ? <HelperTextPopover ariaLabel={label} content={content} /> : undefined}
labelHelp={
content ? <HelperTextPopover ariaLabel={label} content={content} hasNoPadding={hasNoPadding} /> : undefined
}
isRequired={isRequired}
>
{children}
Expand Down
Loading