fix: never show raw English status keys to user — fall back to 'Неизвестно (key)'

This commit is contained in:
root 2026-06-16 13:29:38 +00:00
parent f1e2b47396
commit d28e00782b
2 changed files with 3 additions and 3 deletions

View File

@ -140,7 +140,7 @@ export const AdminDashboard = () => {
const econ = economics || {};
const statusPieData = (statusDist || []).map(s => ({
name: STATUS_LABELS[s.delivery_status] || s.delivery_status,
name: STATUS_LABELS[s.delivery_status] || (s.delivery_status ? `Неизвестно (${s.delivery_status})` : 'Неизвестно'),
value: s.count,
status: s.delivery_status,
})).filter(d => d.value > 0);

View File

@ -141,7 +141,7 @@ export const isOrderGroupAgreedForDelivery = (group) => {
};
export const getOrderGroupDeliveryStatusLabel = (status) =>
DELIVERY_GROUP_STATUS_LABELS[status] || status || "Неизвестно";
DELIVERY_GROUP_STATUS_LABELS[status] || (status ? `Неизвестно (${status})` : "Неизвестно");
export const getOrderGroupDisplayStatusLabel = (group) => {
const deliveryStatus = group?.deliveryStatus || group?.delivery_status;
@ -339,7 +339,7 @@ export const ORDER_GROUP_DISPLAY_STATUS_OPTIONS = [
];
export const getOrderGroupStatusLabel = (status) =>
ORDER_GROUP_STATUS_LABELS[status] || status || "Неизвестно";
ORDER_GROUP_STATUS_LABELS[status] || (status ? `Неизвестно (${status})` : "Неизвестно");
export const getOrderGroupDeliveryStatusTone = (status) => {
switch (status) {