choo121600 commented on code in PR #67366:
URL: https://github.com/apache/airflow/pull/67366#discussion_r3294004250
##########
airflow-core/src/airflow/ui/src/pages/Dashboard/HistoricalMetrics/MetricSection.tsx:
##########
@@ -42,13 +43,15 @@ export const MetricSection = ({
endDate,
kind,
runs,
+ showPercentages = true,
startDate,
state,
total,
}: MetricSectionProps) => {
const stateWidth = capped ? BAR_WIDTH : total === 0 ? 0 : (runs / total) *
BAR_WIDTH;
const remainingWidth = BAR_WIDTH - stateWidth;
- const statePercent = capped ? undefined : total === 0 ? 0 : ((runs / total)
* 100).toFixed(2);
+ const statePercent =
+ showPercentages && !capped && total !== 0 ? ((runs / total) *
100).toFixed(2) : undefined;
Review Comment:
With the previous behavior, each row displayed 0% when all counts were 0,
but after this changes it seems nothing will be shown instead.
Not blocking, but personally I think showing 0% is clearer than rendering
nothing (`undefined`). WDYT?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]