From b2abacfe7472c7ab64fc7b60a85a6b0d0eccd7c9 Mon Sep 17 00:00:00 2001 From: GabrielBarros Date: Mon, 22 Aug 2022 18:10:49 -0300 Subject: [PATCH 1/2] Not Mapped status tag added --- messages/en.json | 1 + messages/pt.json | 1 + .../admin/dashboard/AffiliateOrdersTable.tsx | 2 +- .../store/ProfileStatusTag/ProfileStatusTag.tsx | 2 +- react/utils/messages.ts | 1 + react/utils/shared.ts | 14 +++++++++++--- 6 files changed, 16 insertions(+), 5 deletions(-) diff --git a/messages/en.json b/messages/en.json index 3175df5..a479dd5 100644 --- a/messages/en.json +++ b/messages/en.json @@ -107,6 +107,7 @@ "admin/order.status.paid.label": "Payment approved", "admin/order.status.cancel.label": "Canceled", "admin/order.status.invoiced.label": "Invoiced", + "admin/order.status.notmapped.label": "Not Mapped", "admin/total.orders.label": "Total orders", "admin/edit.affiliate.approve.title": "Change affiliate approved status", "admin/total.order.value.disclaimer.text": "The total value is based only on the value of the items in the order. Shipping price is not considered.", diff --git a/messages/pt.json b/messages/pt.json index d03e50f..57c91e5 100644 --- a/messages/pt.json +++ b/messages/pt.json @@ -107,6 +107,7 @@ "admin/order.status.paid.label": "Pagamento aprovado", "admin/order.status.cancel.label": "Cancelado", "admin/order.status.invoiced.label": "Faturado", + "admin/order.status.notmapped.label": "Não Mapeado", "admin/total.orders.label": "Total de pedidos", "admin/edit.affiliate.approve.title": "Modificar o status do afiliado", "admin/total.order.value.disclaimer.text": "O valor total considera apenas o valor dos itens do pedido. O valor do frete não é considerado.", diff --git a/react/components/admin/dashboard/AffiliateOrdersTable.tsx b/react/components/admin/dashboard/AffiliateOrdersTable.tsx index 337a9b4..7710022 100644 --- a/react/components/admin/dashboard/AffiliateOrdersTable.tsx +++ b/react/components/admin/dashboard/AffiliateOrdersTable.tsx @@ -237,7 +237,7 @@ const AffiliateOrdersTable: FC = () => { header: intl.formatMessage( messages.affiliatesOrdersTableStatusColumnLabel ), - width: 140, + width: 200, resolver: { type: 'root', render: StatusTableCell, diff --git a/react/components/store/ProfileStatusTag/ProfileStatusTag.tsx b/react/components/store/ProfileStatusTag/ProfileStatusTag.tsx index 1675d3a..ab5f536 100644 --- a/react/components/store/ProfileStatusTag/ProfileStatusTag.tsx +++ b/react/components/store/ProfileStatusTag/ProfileStatusTag.tsx @@ -20,7 +20,7 @@ function ProfileStatusTag(props: StatusProp) { ) } - if (status === 'invoiced') { + if (status === 'invoiced' || status === 'invoice') { return ( {intl.formatMessage(storeMessages.invoicedTitle)} diff --git a/react/utils/messages.ts b/react/utils/messages.ts index 2346291..1e2f2b5 100644 --- a/react/utils/messages.ts +++ b/react/utils/messages.ts @@ -151,6 +151,7 @@ export const messages = defineMessages({ orderStatusPaidLabel: { id: 'admin/order.status.paid.label' }, orderStatusCancelLabel: { id: 'admin/order.status.cancel.label' }, orderStatusInvoicedLabel: { id: 'admin/order.status.invoiced.label' }, + orderStatusNotMapped: { id: 'admin/order.status.notmapped.label' }, totalOrdersLabel: { id: 'admin/total.orders.label' }, totalOrderValueDisclaimerText: { id: 'admin/total.order.value.disclaimer.text', diff --git a/react/utils/shared.ts b/react/utils/shared.ts index 0030565..9f0cf82 100644 --- a/react/utils/shared.ts +++ b/react/utils/shared.ts @@ -51,7 +51,7 @@ export const statusTagControl = ( } } - if (status === 'invoiced') { + if (status === 'invoiced' || status === 'invoice') { return { label: intl.formatMessage(messages.orderStatusInvoicedLabel), palette: 'green', @@ -59,9 +59,17 @@ export const statusTagControl = ( } } + if (status === 'cancel' || status === 'canceled') { + return { + label: intl.formatMessage(messages.orderStatusCancelLabel), + palette: 'red', + size: 'large', + } + } + return { - label: intl.formatMessage(messages.orderStatusCancelLabel), - palette: 'red', + label: intl.formatMessage(messages.orderStatusNotMapped), + palette: 'gray', size: 'large', } } From 62a6d1678a8bcbeb957f404ffef386d4ebdcc260 Mon Sep 17 00:00:00 2001 From: GabrielBarros Date: Mon, 22 Aug 2022 18:21:01 -0300 Subject: [PATCH 2/2] CHANGELOG adjustments --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c95623f..934b0eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Added + +- Added the "Not Mapped" status to the affiliate orders table ### Changed - Added the `Combobox` component to the affiliate orders page