Skip to content

The complete open source platform to run your entire marketplace. Storefront, vendor panel, admin console, and integrations in one enterprise-grade platform you own.

feat(admin): simplify commission rate table columns and update login hint

vholik19897aabeb03
diff --git a/packages/admin/src/i18n/translations/en.json b/packages/admin/src/i18n/translations/en.json
index 6245b03ed..e11ee3877 100644
--- a/packages/admin/src/i18n/translations/en.json
+++ b/packages/admin/src/i18n/translations/en.json
@@ -2820,7 +2820,7 @@
"login": {
"forgotPassword": "Forgot password? - <0>Reset</0>",
"title": "Welcome to Mercur Admin Panel",
- "hint": "Sign in to access the account area"
+ "hint": "Sign in to access the admin hub"
},
"invite": {
"title": "Welcome to Mercur Admin Panel",
@@ -3270,4 +3270,4 @@
"commissionLines": {
"domain": "Commission Lines"
}
-}
+}
\ No newline at end of file
diff --git a/packages/admin/src/pages/commission-rates/commission-rate-list/components/commission-rate-list-table/commission-rate-list-table.tsx b/packages/admin/src/pages/commission-rates/commission-rate-list/components/commission-rate-list-table/commission-rate-list-table.tsx
index c0454b46e..b8c822c48 100644
--- a/packages/admin/src/pages/commission-rates/commission-rate-list/components/commission-rate-list-table/commission-rate-list-table.tsx
+++ b/packages/admin/src/pages/commission-rates/commission-rate-list/components/commission-rate-list-table/commission-rate-list-table.tsx
@@ -16,6 +16,10 @@ import { useTranslation } from "react-i18next"
import { Link } from "react-router-dom"
import { ActionMenu } from "../../../../../components/common/action-menu"
+import {
+ TextCell,
+ TextHeader,
+} from "../../../../../components/table/table-cells/common/text-cell"
import { _DataTable } from "../../../../../components/table/data-table"
import {
useCommissionRates,
@@ -152,10 +156,6 @@ const columnHelper = createColumnHelper<CommissionRateDTO>()
const useColumns = () => {
return useMemo(
() => [
- columnHelper.accessor("name", {
- header: "Name",
- cell: ({ getValue }) => getValue(),
- }),
columnHelper.accessor("code", {
header: "Code",
cell: ({ getValue }) => (
@@ -165,33 +165,10 @@ const useColumns = () => {
),
}),
columnHelper.accessor("type", {
- header: "Type",
+ header: () => <TextHeader text="Type" />,
cell: ({ getValue }) => {
const type = getValue()
- return (
- <Badge size="2xsmall" color={type === "percentage" ? "blue" : "grey"}>
- {type === "percentage" ? "Percentage" : "Fixed"}
- </Badge>
- )
- },
- }),
- columnHelper.accessor("value", {
- header: "Value",
- cell: ({ row }) => {
- const { value, type, currency_code } = row.original
- if (type === "percentage") {
- return `${value}%`
- }
- return currency_code
- ? `${value} ${currency_code.toUpperCase()}`
- : `${value}`
- },
- }),
- columnHelper.accessor("target", {
- header: "Target",
- cell: ({ getValue }) => {
- const target = getValue()
- return target === "item" ? "Item" : "Shipping"
+ return <TextCell text={type === "percentage" ? "Percentage" : "Fixed"} />
},
}),
columnHelper.accessor("is_enabled", {
@@ -205,13 +182,6 @@ const useColumns = () => {
)
},
}),
- columnHelper.accessor("rules", {
- header: "Rules",
- cell: ({ getValue }) => {
- const rules = getValue()
- return rules?.length ?? 0
- },
- }),
columnHelper.display({
id: "actions",
cell: ({ row }) => (
diff --git a/packages/admin/src/pages/orders/order-list/components/order-list-table/order-list-table.tsx b/packages/admin/src/pages/orders/order-list/components/order-list-table/order-list-table.tsx
index 895932513..5a573af8b 100644
--- a/packages/admin/src/pages/orders/order-list/components/order-list-table/order-list-table.tsx
+++ b/packages/admin/src/pages/orders/order-list/components/order-list-table/order-list-table.tsx
@@ -8,6 +8,7 @@ import { keepPreviousData } from "@tanstack/react-query";
import { useTranslation } from "react-i18next";
import { useOrderLegacyTableFilters } from "./use-order-legacy-table-filters";
+import { DEFAULT_FIELDS } from "../../const";
const PAGE_SIZE = 20;
@@ -21,6 +22,7 @@ export const OrderListTable = () => {
const { orders, count, isError, error, isLoading } = useOrders(
{
...searchParams,
+ fields: DEFAULT_FIELDS,
},
{
placeholderData: keepPreviousData,