Skip to content

Commit

Permalink
[#10776] Make "ALL" bold & Remove total if stack is false
Browse files Browse the repository at this point in the history
  • Loading branch information
jihea-park committed Oct 8, 2024
1 parent 34527c4 commit f2e2496
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 15 deletions.
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

0 comments on commit f2e2496

Please sign in to comment.