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

[#10776] Make "ALL" bold & Remove total if stack is false #11558

Merged
merged 1 commit into from
Oct 8, 2024
Merged
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 @@ -53,7 +53,7 @@ export const OpenTelemetryChartCommon = ({
}
{...restTooltipConfig}
/>
<ChartLegend className="block overflow-hidden" content={<ChartLegendContent />} />
<ChartLegend content={<ChartLegendContent />} />
</>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const OpenTelemetryMetricFetcher = ({
});
}, [metricDefinition]);

const { stack, showTotal = true } = metricDefinition;
const { stack, showTotal = false } = metricDefinition;

const dataSets =
data?.metricValues.reduce(
Expand Down Expand Up @@ -101,7 +101,7 @@ export const OpenTelemetryMetricFetcher = ({
},
}}
tooltipConfig={{
showTotal,
showTotal: showTotal || stack,
}}
/>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ export const MetricDefinitionFormFetcher = ({
}}
/>
<FormLabel className="text-sm font-normal" htmlFor="all">
ALL{' '}
<span className="font-bold">ALL</span>
<span className="text-muted-foreground">{`(Select all ${primaryForFieldAndTagRelation === 'tag' ? 'field' : 'tag'})`}</span>
</FormLabel>
</FormItem>
Expand Down
15 changes: 4 additions & 11 deletions web-frontend/src/main/v3/packages/ui/src/components/ui/chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,7 @@ const ChartLegendContent = React.forwardRef<
<div
ref={ref}
className={cn(
'flex items-center justify-center gap-4',
verticalAlign === 'top' ? 'pb-3' : 'pt-3',
`flex justify-center gap-1 flex-wrap ${verticalAlign === 'top' ? 'pb-3' : 'pt-3'}`,
className,
)}
>
Expand All @@ -273,13 +272,7 @@ const ChartLegendContent = React.forwardRef<
return (
<React.Fragment key={item.value}>
<TooltipTrigger asChild>
<div
key={item.value}
className={cn(
'flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground',
'justify-center',
)}
>
<div key={item.value} className={cn('inline-flex max-w-full items-center gap-1')}>
<>
{itemConfig?.icon && !hideIcon ? (
<itemConfig.icon />
Expand All @@ -291,9 +284,9 @@ const ChartLegendContent = React.forwardRef<
}}
/>
)}
<span className="text-ellipsis overflow-hidden whitespace-nowrap">
<div className="text-ellipsis overflow-hidden whitespace-nowrap">
{itemConfig?.label}
</span>
</div>
</>
</div>
</TooltipTrigger>
Expand Down