refactor(usage): address PR review — null-safe mark, hook renames, lazy intl

This commit is contained in:
jialin
2026-07-09 15:17:53 +08:00
committed by jialin
parent d91fbec9d7
commit 794ac724ca
4 changed files with 19 additions and 9 deletions
+8 -2
View File
@@ -287,9 +287,15 @@ function flattenItem(
// The chart series legend can't render a tag, so it carries the deleted
// marker as text ("<name> [Deleted.<id>]"); the tables render a DeletedTag off
// ``flat.deleted`` + the id and so keep the clean name.
const deletedWord = getIntl().formatMessage({ id: 'usage.table.deleted' });
const key =
rawKey != null ? withDeletedMark(rawKey, deleted, deletedWord, id) : rawKey;
rawKey != null
? withDeletedMark(
rawKey,
deleted,
deleted ? getIntl().formatMessage({ id: 'usage.table.deleted' }) : '',
id
)
: rawKey;
// Generic group label — for a compound (date + dim) trend row the key is the
// sub-group value (the switch below targets single-dimension table rows).
if (rawKey != null) flat.group = key;