Enhance ReportPreviewOverlay to display DOC weight and improve KPI row styling. Update dashboard report payload to include docWeight, and adjust report summary to incorporate it. Add tests for docWeight functionality.
This commit is contained in:
1 parent
75eb218558
commit
3ba6fed189
7 files changed
+123
-18
No files matched your search
@@ -9,6 +9,7 @@ import { formatNumber, formatRatio } from './format.ts';
|
||||
|
||||
export type ReportSummaryMetricKey =
|
||||
| 'umur'
|
||||
| 'docWeight'
|
||||
| 'populasi'
|
||||
| 'mortalitas'
|
||||
| 'panen'
|
||||
@@ -68,6 +69,12 @@ export function buildReportSummary(payload: DashboardReportPayload): ReportSumma
|
||||
|
||||
const metrics: ReportSummaryMetric[] = [
|
||||
{ key: 'umur', label: 'Umur', value: payload.upToDay, unit: 'hari' },
|
||||
{
|
||||
key: 'docWeight',
|
||||
label: 'Berat DOC',
|
||||
value: isPresent(payload.docWeight) ? payload.docWeight : null,
|
||||
unit: 'gram',
|
||||
},
|
||||
{
|
||||
key: 'populasi',
|
||||
label: 'Populasi',
|
||||
@@ -150,7 +157,8 @@ export function formatSummaryValue(metric: ReportSummaryMetric): string {
|
||||
metric.key === 'uniformity' ||
|
||||
metric.key === 'beratAvg' ||
|
||||
metric.key === 'beratPanen' ||
|
||||
metric.key === 'beratPakan'
|
||||
metric.key === 'beratPakan' ||
|
||||
metric.key === 'docWeight'
|
||||
) {
|
||||
return formatNumber(metric.value, 1, 0, true);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user