fix: never show raw English status keys to user — fall back to 'Неизвестно (key)'
This commit is contained in:
parent
f1e2b47396
commit
d28e00782b
|
|
@ -140,7 +140,7 @@ export const AdminDashboard = () => {
|
||||||
const econ = economics || {};
|
const econ = economics || {};
|
||||||
|
|
||||||
const statusPieData = (statusDist || []).map(s => ({
|
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,
|
value: s.count,
|
||||||
status: s.delivery_status,
|
status: s.delivery_status,
|
||||||
})).filter(d => d.value > 0);
|
})).filter(d => d.value > 0);
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,7 @@ export const isOrderGroupAgreedForDelivery = (group) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getOrderGroupDeliveryStatusLabel = (status) =>
|
export const getOrderGroupDeliveryStatusLabel = (status) =>
|
||||||
DELIVERY_GROUP_STATUS_LABELS[status] || status || "Неизвестно";
|
DELIVERY_GROUP_STATUS_LABELS[status] || (status ? `Неизвестно (${status})` : "Неизвестно");
|
||||||
|
|
||||||
export const getOrderGroupDisplayStatusLabel = (group) => {
|
export const getOrderGroupDisplayStatusLabel = (group) => {
|
||||||
const deliveryStatus = group?.deliveryStatus || group?.delivery_status;
|
const deliveryStatus = group?.deliveryStatus || group?.delivery_status;
|
||||||
|
|
@ -339,7 +339,7 @@ export const ORDER_GROUP_DISPLAY_STATUS_OPTIONS = [
|
||||||
];
|
];
|
||||||
|
|
||||||
export const getOrderGroupStatusLabel = (status) =>
|
export const getOrderGroupStatusLabel = (status) =>
|
||||||
ORDER_GROUP_STATUS_LABELS[status] || status || "Неизвестно";
|
ORDER_GROUP_STATUS_LABELS[status] || (status ? `Неизвестно (${status})` : "Неизвестно");
|
||||||
|
|
||||||
export const getOrderGroupDeliveryStatusTone = (status) => {
|
export const getOrderGroupDeliveryStatusTone = (status) => {
|
||||||
switch (status) {
|
switch (status) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue