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): add sellers search and navigation shortcuts for sellers and payouts

vholik01eba3a2c5cb
diff --git a/packages/admin/src/components/search/constants.ts b/packages/admin/src/components/search/constants.ts
index aa6a974b2..910890766 100644
--- a/packages/admin/src/components/search/constants.ts
+++ b/packages/admin/src/components/search/constants.ts
@@ -6,6 +6,7 @@ export const SEARCH_AREAS = [
"category",
"inventory",
"customer",
+ "seller",
"promotion",
"campaign",
"priceList",
diff --git a/packages/admin/src/components/search/use-search-results.tsx b/packages/admin/src/components/search/use-search-results.tsx
index 1dab82e85..0550d3161 100644
--- a/packages/admin/src/components/search/use-search-results.tsx
+++ b/packages/admin/src/components/search/use-search-results.tsx
@@ -15,6 +15,7 @@ import {
useProductTags,
useProductTypes,
usePromotions,
+ useSellers,
useStockLocations,
} from "../../hooks/api"
import { Shortcut, ShortcutType } from "../../providers/keybind-provider"
@@ -155,6 +156,18 @@ const useDynamicSearchResults = (
}
)
+ const sellerResponse = useSellers(
+ {
+ q: debouncedSearch,
+ limit,
+ fields: "id,name",
+ },
+ {
+ enabled: isAreaEnabled(currentArea, "seller"),
+ placeholderData: keepPreviousData,
+ }
+ )
+
const inventoryResponse = useInventoryItems(
{
q: debouncedSearch,
@@ -247,6 +260,7 @@ const useDynamicSearchResults = (
category: categoryResponse,
inventory: inventoryResponse,
customer: customerResponse,
+ seller: sellerResponse,
promotion: promotionResponse,
campaign: campaignResponse,
priceList: priceListResponse,
@@ -261,6 +275,7 @@ const useDynamicSearchResults = (
categoryResponse,
collectionResponse,
customerResponse,
+ sellerResponse,
promotionResponse,
campaignResponse,
priceListResponse,
@@ -411,6 +426,15 @@ const transformMap: TransformMap = {
}
},
},
+ seller: {
+ dataKey: "sellers",
+ transform: (seller: { id: string; name: string }) => ({
+ id: seller.id,
+ title: seller.name,
+ to: `/sellers/${seller.id}`,
+ value: `seller:${seller.id}`,
+ }),
+ },
collection: {
dataKey: "collections",
transform: (collection: HttpTypes.AdminCollection) => ({
diff --git a/packages/admin/src/i18n/translations/en.json b/packages/admin/src/i18n/translations/en.json
index 9262ed02c..6245b03ed 100644
--- a/packages/admin/src/i18n/translations/en.json
+++ b/packages/admin/src/i18n/translations/en.json
@@ -162,6 +162,7 @@
"groups": {
"all": "All areas",
"customer": "Customers",
+ "seller": "Sellers",
"customerGroup": "Customer Groups",
"product": "Products",
"productVariant": "Product Variants",
@@ -204,7 +205,9 @@
"goToReservations": "Reservations",
"goToPriceLists": "Price Lists",
"goToPromotions": "Promotions",
- "goToCampaigns": "Campaigns"
+ "goToCampaigns": "Campaigns",
+ "goToSellers": "Sellers",
+ "goToPayouts": "Payouts"
},
"settings": {
"goToSettings": "Settings",
diff --git a/packages/admin/src/providers/keybind-provider/hooks.tsx b/packages/admin/src/providers/keybind-provider/hooks.tsx
index 75ef13c11..988d33c56 100644
--- a/packages/admin/src/providers/keybind-provider/hooks.tsx
+++ b/packages/admin/src/providers/keybind-provider/hooks.tsx
@@ -183,22 +183,30 @@ export const useGlobalShortcuts = () => {
type: "pageShortcut",
to: "/campaigns",
},
- // Settings
{
keys: {
- Mac: ["G", ","],
+ Mac: ["G", "S"],
},
- label: t("app.keyboardShortcuts.settings.goToSettings"),
- type: "settingShortcut",
- to: "/settings",
+ label: t("app.keyboardShortcuts.navigation.goToSellers"),
+ type: "pageShortcut",
+ to: "/sellers",
},
{
keys: {
- Mac: ["G", ",", "S"],
+ Mac: ["G", "Y"],
},
- label: t("app.keyboardShortcuts.settings.goToSeller"),
+ label: t("app.keyboardShortcuts.navigation.goToPayouts"),
+ type: "pageShortcut",
+ to: "/payouts",
+ },
+ // Settings
+ {
+ keys: {
+ Mac: ["G", ","],
+ },
+ label: t("app.keyboardShortcuts.settings.goToSettings"),
type: "settingShortcut",
- to: "/settings/seller",
+ to: "/settings",
},
{
keys: {