Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Give the seller panel a Settings launcher and move Team into it

Damian Legawiecb6a72bcd4f2d
diff --git a/packages/dashboard-core/src/locales/ar.json b/packages/dashboard-core/src/locales/ar.json
index d9aaa320f1..4b24f248a7 100644
--- a/packages/dashboard-core/src/locales/ar.json
+++ b/packages/dashboard-core/src/locales/ar.json
@@ -755,7 +755,8 @@
},
"settings_nav": {
"groups": {
- "fulfillment": "التنفيذ"
+ "fulfillment": "التنفيذ",
+ "team": "الفريق والوصول"
},
"items": {
"stock_locations": "مواقع المخزون"
diff --git a/packages/dashboard-core/src/locales/de.json b/packages/dashboard-core/src/locales/de.json
index 5638256a50..bb83a84a37 100644
--- a/packages/dashboard-core/src/locales/de.json
+++ b/packages/dashboard-core/src/locales/de.json
@@ -755,7 +755,8 @@
},
"settings_nav": {
"groups": {
- "fulfillment": "Fulfillment"
+ "fulfillment": "Fulfillment",
+ "team": "Team & Zugriff"
},
"items": {
"stock_locations": "Lagerstandorte"
diff --git a/packages/dashboard-core/src/locales/en.json b/packages/dashboard-core/src/locales/en.json
index e2d417acee..df62de8f05 100644
--- a/packages/dashboard-core/src/locales/en.json
+++ b/packages/dashboard-core/src/locales/en.json
@@ -757,7 +757,8 @@
},
"settings_nav": {
"groups": {
- "fulfillment": "Fulfillment"
+ "fulfillment": "Fulfillment",
+ "team": "Team & access"
},
"items": {
"stock_locations": "Stock locations"
diff --git a/packages/dashboard-core/src/locales/fr.json b/packages/dashboard-core/src/locales/fr.json
index 9400bea9e4..61ecd170ee 100644
--- a/packages/dashboard-core/src/locales/fr.json
+++ b/packages/dashboard-core/src/locales/fr.json
@@ -755,7 +755,8 @@
},
"settings_nav": {
"groups": {
- "fulfillment": "Traitement des commandes"
+ "fulfillment": "Traitement des commandes",
+ "team": "Équipe et accès"
},
"items": {
"stock_locations": "Emplacements de stock"
diff --git a/packages/dashboard-core/src/locales/pl.json b/packages/dashboard-core/src/locales/pl.json
index 2e126d4c5a..1531aa5f6e 100644
--- a/packages/dashboard-core/src/locales/pl.json
+++ b/packages/dashboard-core/src/locales/pl.json
@@ -755,7 +755,8 @@
},
"settings_nav": {
"groups": {
- "fulfillment": "Realizacja zamówień"
+ "fulfillment": "Realizacja zamówień",
+ "team": "Zespół i dostęp"
},
"items": {
"stock_locations": "Lokalizacje magazynowe"
diff --git a/packages/dashboard-core/src/locales/zh-CN.json b/packages/dashboard-core/src/locales/zh-CN.json
index adcafb72f5..c64e28f6ac 100644
--- a/packages/dashboard-core/src/locales/zh-CN.json
+++ b/packages/dashboard-core/src/locales/zh-CN.json
@@ -755,7 +755,8 @@
},
"settings_nav": {
"groups": {
- "fulfillment": "履约"
+ "fulfillment": "履约",
+ "team": "团队与权限"
},
"items": {
"stock_locations": "库存地点"
diff --git a/packages/seller-dashboard-starter/src/routeTree.gen.ts b/packages/seller-dashboard-starter/src/routeTree.gen.ts
index db88cb3b60..0d5d10ed92 100644
--- a/packages/seller-dashboard-starter/src/routeTree.gen.ts
+++ b/packages/seller-dashboard-starter/src/routeTree.gen.ts
@@ -15,9 +15,12 @@ import { Route as authenticatedIndexRouteImport } from './../../seller-dashboard
import { Route as acceptInvitationDotinvitationIdRouteImport } from './../../seller-dashboard/src/routes/accept-invitation.$invitationId'
import { Route as authenticatedSellerIdRouteImport } from './../../seller-dashboard/src/routes/_authenticated/$sellerId'
import { Route as IndexRouteImport } from './../../seller-dashboard/src/routes/_authenticated/$sellerId/index'
-import { Route as TeamRouteImport } from './../../seller-dashboard/src/routes/_authenticated/$sellerId/team'
+import { Route as SettingsRouteImport } from './../../seller-dashboard/src/routes/_authenticated/$sellerId/settings'
import { Route as ProfileRouteImport } from './../../seller-dashboard/src/routes/_authenticated/$sellerId/profile'
import { Route as OnboardingRouteImport } from './../../seller-dashboard/src/routes/_authenticated/$sellerId/onboarding'
+import { Route as SettingsIndexRouteImport } from './../../seller-dashboard/src/routes/_authenticated/$sellerId/settings/index'
+import { Route as SettingsTeamRouteImport } from './../../seller-dashboard/src/routes/_authenticated/$sellerId/settings/team'
+import { Route as SettingsStockLocationsRouteImport } from './../../seller-dashboard/src/routes/_authenticated/$sellerId/settings/stock-locations'
const loginRoute = loginRouteImport.update({
id: '/login',
@@ -49,9 +52,9 @@ const IndexRoute = IndexRouteImport.update({
path: '/',
getParentRoute: () => authenticatedSellerIdRoute,
} as any)
-const TeamRoute = TeamRouteImport.update({
- id: '/team',
- path: '/team',
+const SettingsRoute = SettingsRouteImport.update({
+ id: '/settings',
+ path: '/settings',
getParentRoute: () => authenticatedSellerIdRoute,
} as any)
const ProfileRoute = ProfileRouteImport.update({
@@ -64,6 +67,21 @@ const OnboardingRoute = OnboardingRouteImport.update({
path: '/onboarding',
getParentRoute: () => authenticatedSellerIdRoute,
} as any)
+const SettingsIndexRoute = SettingsIndexRouteImport.update({
+ id: '/',
+ path: '/',
+ getParentRoute: () => SettingsRoute,
+} as any)
+const SettingsTeamRoute = SettingsTeamRouteImport.update({
+ id: '/team',
+ path: '/team',
+ getParentRoute: () => SettingsRoute,
+} as any)
+const SettingsStockLocationsRoute = SettingsStockLocationsRouteImport.update({
+ id: '/stock-locations',
+ path: '/stock-locations',
+ getParentRoute: () => SettingsRoute,
+} as any)
export interface FileRoutesByFullPath {
'/': typeof authenticatedIndexRoute
@@ -72,8 +90,11 @@ export interface FileRoutesByFullPath {
'/accept-invitation/$invitationId': typeof acceptInvitationDotinvitationIdRoute
'/$sellerId/onboarding': typeof OnboardingRoute
'/$sellerId/profile': typeof ProfileRoute
- '/$sellerId/team': typeof TeamRoute
+ '/$sellerId/settings': typeof SettingsRouteWithChildren
'/$sellerId/': typeof IndexRoute
+ '/$sellerId/settings/stock-locations': typeof SettingsStockLocationsRoute
+ '/$sellerId/settings/team': typeof SettingsTeamRoute
+ '/$sellerId/settings/': typeof SettingsIndexRoute
}
export interface FileRoutesByTo {
'/login': typeof loginRoute
@@ -81,8 +102,10 @@ export interface FileRoutesByTo {
'/': typeof authenticatedIndexRoute
'/$sellerId/onboarding': typeof OnboardingRoute
'/$sellerId/profile': typeof ProfileRoute
- '/$sellerId/team': typeof TeamRoute
'/$sellerId': typeof IndexRoute
+ '/$sellerId/settings/stock-locations': typeof SettingsStockLocationsRoute
+ '/$sellerId/settings/team': typeof SettingsTeamRoute
+ '/$sellerId/settings': typeof SettingsIndexRoute
}
export interface FileRoutesById {
__root__: typeof rootRouteImport
@@ -93,8 +116,11 @@ export interface FileRoutesById {
'/_authenticated/': typeof authenticatedIndexRoute
'/_authenticated/$sellerId/onboarding': typeof OnboardingRoute
'/_authenticated/$sellerId/profile': typeof ProfileRoute
- '/_authenticated/$sellerId/team': typeof TeamRoute
+ '/_authenticated/$sellerId/settings': typeof SettingsRouteWithChildren
'/_authenticated/$sellerId/': typeof IndexRoute
+ '/_authenticated/$sellerId/settings/stock-locations': typeof SettingsStockLocationsRoute
+ '/_authenticated/$sellerId/settings/team': typeof SettingsTeamRoute
+ '/_authenticated/$sellerId/settings/': typeof SettingsIndexRoute
}
export interface FileRouteTypes {
fileRoutesByFullPath: FileRoutesByFullPath
@@ -105,8 +131,11 @@ export interface FileRouteTypes {
| '/accept-invitation/$invitationId'
| '/$sellerId/onboarding'
| '/$sellerId/profile'
- | '/$sellerId/team'
+ | '/$sellerId/settings'
| '/$sellerId/'
+ | '/$sellerId/settings/stock-locations'
+ | '/$sellerId/settings/team'
+ | '/$sellerId/settings/'
fileRoutesByTo: FileRoutesByTo
to:
| '/login'
@@ -114,8 +143,10 @@ export interface FileRouteTypes {
| '/'
| '/$sellerId/onboarding'
| '/$sellerId/profile'
- | '/$sellerId/team'
| '/$sellerId'
+ | '/$sellerId/settings/stock-locations'
+ | '/$sellerId/settings/team'
+ | '/$sellerId/settings'
id:
| '__root__'
| '/_authenticated'
@@ -125,8 +156,11 @@ export interface FileRouteTypes {
| '/_authenticated/'
| '/_authenticated/$sellerId/onboarding'
| '/_authenticated/$sellerId/profile'
- | '/_authenticated/$sellerId/team'
+ | '/_authenticated/$sellerId/settings'
| '/_authenticated/$sellerId/'
+ | '/_authenticated/$sellerId/settings/stock-locations'
+ | '/_authenticated/$sellerId/settings/team'
+ | '/_authenticated/$sellerId/settings/'
fileRoutesById: FileRoutesById
}
export interface RootRouteChildren {
@@ -179,11 +213,11 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof IndexRouteImport
parentRoute: typeof authenticatedSellerIdRoute
}
- '/_authenticated/$sellerId/team': {
- id: '/_authenticated/$sellerId/team'
- path: '/team'
- fullPath: '/$sellerId/team'
- preLoaderRoute: typeof TeamRouteImport
+ '/_authenticated/$sellerId/settings': {
+ id: '/_authenticated/$sellerId/settings'
+ path: '/settings'
+ fullPath: '/$sellerId/settings'
+ preLoaderRoute: typeof SettingsRouteImport
parentRoute: typeof authenticatedSellerIdRoute
}
'/_authenticated/$sellerId/profile': {
@@ -200,20 +234,57 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof OnboardingRouteImport
parentRoute: typeof authenticatedSellerIdRoute
}
+ '/_authenticated/$sellerId/settings/': {
+ id: '/_authenticated/$sellerId/settings/'
+ path: '/'
+ fullPath: '/$sellerId/settings/'
+ preLoaderRoute: typeof SettingsIndexRouteImport
+ parentRoute: typeof SettingsRoute
+ }
+ '/_authenticated/$sellerId/settings/team': {
+ id: '/_authenticated/$sellerId/settings/team'
+ path: '/team'
+ fullPath: '/$sellerId/settings/team'
+ preLoaderRoute: typeof SettingsTeamRouteImport
+ parentRoute: typeof SettingsRoute
+ }
+ '/_authenticated/$sellerId/settings/stock-locations': {
+ id: '/_authenticated/$sellerId/settings/stock-locations'
+ path: '/stock-locations'
+ fullPath: '/$sellerId/settings/stock-locations'
+ preLoaderRoute: typeof SettingsStockLocationsRouteImport
+ parentRoute: typeof SettingsRoute
+ }
}
}
+interface SettingsRouteChildren {
+ SettingsStockLocationsRoute: typeof SettingsStockLocationsRoute
+ SettingsTeamRoute: typeof SettingsTeamRoute
+ SettingsIndexRoute: typeof SettingsIndexRoute
+}
+
+const SettingsRouteChildren: SettingsRouteChildren = {
+ SettingsStockLocationsRoute: SettingsStockLocationsRoute,
+ SettingsTeamRoute: SettingsTeamRoute,
+ SettingsIndexRoute: SettingsIndexRoute,
+}
+
+const SettingsRouteWithChildren = SettingsRoute._addFileChildren(
+ SettingsRouteChildren,
+)
+
interface authenticatedSellerIdRouteChildren {
OnboardingRoute: typeof OnboardingRoute
ProfileRoute: typeof ProfileRoute
- TeamRoute: typeof TeamRoute
+ SettingsRoute: typeof SettingsRouteWithChildren
IndexRoute: typeof IndexRoute
}
const authenticatedSellerIdRouteChildren: authenticatedSellerIdRouteChildren = {
OnboardingRoute: OnboardingRoute,
ProfileRoute: ProfileRoute,
- TeamRoute: TeamRoute,
+ SettingsRoute: SettingsRouteWithChildren,
IndexRoute: IndexRoute,
}
diff --git a/packages/seller-dashboard/src/locales/en.json b/packages/seller-dashboard/src/locales/en.json
index 74c005d63d..76075f8f27 100644
--- a/packages/seller-dashboard/src/locales/en.json
+++ b/packages/seller-dashboard/src/locales/en.json
@@ -1,171 +1,172 @@
{
- "app": {
- "name": "Seller panel"
- },
- "login": {
- "title": "Sign in to your seller panel",
- "subtitle": "Manage your storefront, team and payouts.",
- "email": "Email",
- "password": "Password",
- "submit": "Sign in",
- "submitting": "Signing in…",
- "failed": "That email and password did not match a seller account.",
- "no_seller": "This account does not run a seller on this marketplace."
- },
"accept_invitation": {
- "title": "Join the team",
- "subtitle": "You were invited as {{email}}. Set a password to finish.",
+ "failed": "That invitation could not be accepted. It may have expired, or the password was wrong.",
"first_name": "First name",
+ "invalid_link": "This link is missing its token. Open the link from your invitation email.",
"last_name": "Last name",
+ "not_found": "This invitation is no longer valid. Ask whoever invited you to send a new one.",
"password": "Password",
"password_confirmation": "Confirm password",
"submit": "Accept invitation",
"submitting": "Accepting…",
- "failed": "That invitation could not be accepted. It may have expired, or the password was wrong.",
- "not_found": "This invitation is no longer valid. Ask whoever invited you to send a new one.",
- "invalid_link": "This link is missing its token. Open the link from your invitation email."
- },
- "seller_picker": {
- "title": "Choose a seller",
- "subtitle": "You run more than one. Pick which to manage.",
- "status": "Status"
+ "subtitle": "You were invited as {{email}}. Set a password to finish.",
+ "title": "Join the team"
},
- "seller_switcher": {
- "label": "Switch seller"
+ "app": {
+ "name": "Seller panel"
},
- "nav": {
- "home": "Home",
- "profile": "Profile",
- "team": "Team",
- "sign_out": "Sign out",
- "onboarding": "Setup"
+ "common": {
+ "cancel": "Cancel",
+ "error": "Something went wrong.",
+ "loading": "Loading…",
+ "retry": "Try again"
},
"home": {
- "title": "Hello, {{name}}",
- "subtitle": "How you stand with this marketplace.",
- "setup_title": "Finish setting up",
- "setup_description": "{{done}} of {{total}} done — complete these to start selling.",
- "setup_cta": "Continue setup",
- "status": "Status",
"products": "Products",
- "team": "Team members",
+ "selling_no": "Your products are not on sale yet.",
"selling_title": "Selling",
"selling_yes": "Your products are on sale.",
- "selling_no": "Your products are not on sale yet."
+ "setup_cta": "Continue setup",
+ "setup_description": "{{done}} of {{total}} done — complete these to start selling.",
+ "setup_title": "Finish setting up",
+ "status": "Status",
+ "subtitle": "How you stand with this marketplace.",
+ "team": "Team members",
+ "title": "Hello, {{name}}"
+ },
+ "login": {
+ "email": "Email",
+ "failed": "That email and password did not match a seller account.",
+ "no_seller": "This account does not run a seller on this marketplace.",
+ "password": "Password",
+ "submit": "Sign in",
+ "submitting": "Signing in…",
+ "subtitle": "Manage your storefront, team and payouts.",
+ "title": "Sign in to your seller panel"
+ },
+ "nav": {
+ "home": "Home",
+ "onboarding": "Setup",
+ "profile": "Profile",
+ "settings": "Settings",
+ "sign_out": "Sign out",
+ "team": "Team"
},
"onboarding": {
- "title": "Setup",
- "subtitle": "What this marketplace asks for before you can start selling.",
- "progress_title": "Your progress",
- "progress_count": "{{done}} of {{total}} done",
- "remaining_one": "{{count}} thing still to do before you can submit",
- "remaining_other": "{{count}} things still to do before you can submit",
- "ready": "Everything required is done.",
- "submit": "Submit for review",
- "submitting": "Submitting…",
- "submitted": "Sent for review",
- "under_review": "The marketplace is reviewing your application. We will email you when there is news.",
- "optional": "Optional",
- "done": "This one is done.",
- "awaiting_review": "Waiting for the marketplace to review this.",
"accept_terms": "Accept the terms",
- "terms_accepted": "Terms accepted",
+ "awaiting_review": "Waiting for the marketplace to review this.",
"confirm": "Confirm",
- "note_placeholder": "Anything the marketplace should know (optional)",
- "submitted_requirement": "Sent",
+ "done": "This one is done.",
"go": "Go there",
+ "note_placeholder": "Anything the marketplace should know (optional)",
+ "optional": "Optional",
+ "progress_count": "{{done}} of {{total}} done",
+ "progress_title": "Your progress",
+ "read_terms": "Read the terms",
+ "ready": "Everything required is done.",
+ "remaining_one": "{{count}} thing still to do before you can submit",
+ "remaining_other": "{{count}} things still to do before you can submit",
"status": {
"complete": "Done",
"pending": "In review",
"rejected": "Needs another look"
},
- "read_terms": "Read the terms"
+ "submit": "Submit for review",
+ "submitted": "Sent for review",
+ "submitted_requirement": "Sent",
+ "submitting": "Submitting…",
+ "subtitle": "What this marketplace asks for before you can start selling.",
+ "terms_accepted": "Terms accepted",
+ "title": "Setup",
+ "under_review": "The marketplace is reviewing your application. We will email you when there is news."
},
"profile": {
- "subtitle": "How your storefront presents you, and how the marketplace reaches you.",
- "section_contact": "Contact",
- "section_standing": "Standing",
- "section_settlement": "Payouts and tax",
- "name": "Name",
"about": "About",
- "contact_email": "Contact email",
+ "add_address": "Add address",
+ "address_filled": "Added",
+ "address_missing": "Not added",
+ "address_not_provided": "No address yet.",
+ "at_a_glance": "At a glance",
+ "billing_address": "Billing address",
"billing_email": "Billing email",
- "products_count": "Products",
- "tax_remittance": "Tax remitted by",
- "payout_schedule": "Payout schedule",
- "minimum_payout": "Minimum payout",
- "operator_managed": "Set by the marketplace",
- "save": "Save changes",
- "saving": "Saving…",
- "saved": "Profile saved",
- "not_provided": "Not provided",
+ "contact_email": "Contact email",
"edit": "Edit",
"edit_title": "Edit your profile",
- "no_about": "You have not written a description yet.",
- "at_a_glance": "At a glance",
- "team_count": "Team members",
"joined": "Joined",
+ "minimum_payout": "Minimum payout",
+ "name": "Name",
+ "no_about": "You have not written a description yet.",
+ "not_provided": "Not provided",
"on_holiday_notice": "Holiday mode is on, so your products are visible but cannot be bought.",
+ "operator_managed": "Set by the marketplace",
+ "payout_schedule": "Payout schedule",
+ "products_count": "Products",
+ "returns_address": "Returns address",
+ "save": "Save changes",
+ "saved": "Profile saved",
+ "saving": "Saving…",
+ "section_contact": "Contact",
+ "section_settlement": "Payouts and tax",
+ "section_standing": "Standing",
"status_help": {
- "pending": "The marketplace has not started your application yet.",
+ "approved": "You are approved and can sell on this marketplace.",
+ "canceled": "This seller account is closed.",
"invited": "You have been invited. Finish getting set up to apply.",
"onboarding": "Work through your checklist, then submit for review.",
+ "pending": "The marketplace has not started your application yet.",
"ready_for_review": "The marketplace is reviewing your application.",
- "approved": "You are approved and can sell on this marketplace.",
- "suspended": "Selling is paused. Contact the marketplace to find out more.",
"rejected": "Your application was not accepted. Contact the marketplace to find out more.",
- "canceled": "This seller account is closed."
+ "suspended": "Selling is paused. Contact the marketplace to find out more."
},
- "billing_address": "Billing address",
- "returns_address": "Returns address",
- "address_filled": "Added",
- "address_missing": "Not added",
- "address_not_provided": "No address yet.",
- "add_address": "Add address"
+ "subtitle": "How your storefront presents you, and how the marketplace reaches you.",
+ "tax_remittance": "Tax remitted by",
+ "team_count": "Team members"
+ },
+ "seller_picker": {
+ "status": "Status",
+ "subtitle": "You run more than one. Pick which to manage.",
+ "title": "Choose a seller"
+ },
+ "seller_switcher": {
+ "label": "Switch seller"
},
"team": {
- "title": "Your team",
- "subtitle": "The people who can sign in and manage this seller.",
- "members_section": "Members",
- "invitations_section": "Pending invitations",
- "invite_cta": "Invite member",
- "invite_title": "Invite a colleague",
- "invite_description": "They will get an email with a link to join this seller.",
- "invite_email": "Email",
- "invite_email_placeholder": "[email protected]",
- "invite_submit": "Send invitation",
- "invite_sending": "Sending…",
- "empty": "Nobody on the team yet",
- "empty_description": "Invite a colleague and they will appear here once they accept.",
- "table": {
- "member": "Member",
- "email": "Email",
- "expires": "Expires"
- },
"actions": {
+ "copy_link": "Copy invitation link",
"remove": "Remove",
"resend": "Resend invitation",
- "copy_link": "Copy invitation link",
"revoke": "Revoke"
},
"confirm": {
- "remove_title": "Remove member",
"remove_message": "{{name}} will lose access to this seller immediately.",
- "revoke_title": "Revoke invitation",
- "revoke_message": "The invitation to {{email}} will stop working."
+ "remove_title": "Remove member",
+ "revoke_message": "The invitation to {{email}} will stop working.",
+ "revoke_title": "Revoke invitation"
},
+ "empty": "Nobody on the team yet",
+ "empty_description": "Invite a colleague and they will appear here once they accept.",
+ "invitations_section": "Pending invitations",
+ "invite_cta": "Invite member",
+ "invite_description": "They will get an email with a link to join this seller.",
+ "invite_email": "Email",
+ "invite_email_placeholder": "[email protected]",
+ "invite_sending": "Sending…",
+ "invite_submit": "Send invitation",
+ "invite_title": "Invite a colleague",
+ "members_section": "Members",
"messages": {
"invited": "Invitation sent",
+ "link_copied": "Invitation link copied",
"removed": "Member removed",
"resent": "Invitation sent again",
- "revoked": "Invitation revoked",
- "link_copied": "Invitation link copied"
- }
- },
- "common": {
- "loading": "Loading…",
- "error": "Something went wrong.",
- "retry": "Try again",
- "cancel": "Cancel"
+ "revoked": "Invitation revoked"
+ },
+ "subtitle": "The people who can sign in and manage this seller.",
+ "table": {
+ "email": "Email",
+ "expires": "Expires",
+ "member": "Member"
+ },
+ "title": "Your team"
}
}
diff --git a/packages/seller-dashboard/src/nav/default.ts b/packages/seller-dashboard/src/nav/default.ts
index fe124eb7e7..68fe36bf31 100644
--- a/packages/seller-dashboard/src/nav/default.ts
+++ b/packages/seller-dashboard/src/nav/default.ts
@@ -1,5 +1,5 @@
-import { i18n, nav } from '@spree/dashboard-core'
-import { ClipboardCheckIcon, HomeIcon, StoreIcon, UsersIcon } from 'lucide-react'
+import { hasVisibleSettingsEntries, i18n, nav } from '@spree/dashboard-core'
+import { ClipboardCheckIcon, HomeIcon, SettingsIcon, StoreIcon } from 'lucide-react'
import { OnboardingNavBadge } from '../components/onboarding-nav-badge'
// The panel's built-in sidebar. Registered into the same registry a plugin
@@ -22,34 +22,38 @@ nav.add({
subject: 'seller_profile',
})
-nav.add({
- key: 'profile',
- label: i18n.t('nav.profile'),
- path: '/profile',
- icon: StoreIcon,
- position: 100,
- subject: 'seller_profile',
-})
-
-// First in the rail while a seller is still being admitted: it is the only
-// thing that matters until they are approved. A marketplace that admits
+// High in the rail while a seller is still being admitted: until they are
+// approved it is the only thing that matters. A marketplace that admits
// sellers some other way removes it like any other entry.
nav.add({
key: 'onboarding',
label: i18n.t('nav.onboarding'),
path: '/onboarding',
icon: ClipboardCheckIcon,
- position: 150,
+ position: 100,
subject: 'seller_profile',
badge: OnboardingNavBadge,
})
nav.add({
- key: 'team',
- label: i18n.t('nav.team'),
- path: '/team',
- icon: UsersIcon,
- position: 200,
+ key: 'profile',
+ label: i18n.t('nav.profile'),
+ path: '/profile',
+ icon: StoreIcon,
+ position: 150,
subject: 'seller_profile',
- action: 'update',
+})
+
+// Settings is a launcher for the secondary rail, not a page: the entries
+// inside it live in `nav/settings.ts`. Bottom section and gated on there
+// being something to see, exactly as the operator's dashboard does it — a
+// member with no settings authority never opens an empty shell.
+nav.add({
+ key: 'settings',
+ label: i18n.t('nav.settings'),
+ path: '/settings',
+ icon: SettingsIcon,
+ if: ({ permissions }) => hasVisibleSettingsEntries(permissions),
+ section: 'bottom',
+ position: 100,
})
diff --git a/packages/seller-dashboard/src/nav/settings.ts b/packages/seller-dashboard/src/nav/settings.ts
index 452f5069cf..e7776b2005 100644
--- a/packages/seller-dashboard/src/nav/settings.ts
+++ b/packages/seller-dashboard/src/nav/settings.ts
@@ -1,5 +1,5 @@
-import { settingsNav } from '@spree/dashboard-core'
-import { WarehouseIcon } from 'lucide-react'
+import { i18n, settingsNav } from '@spree/dashboard-core'
+import { UsersRoundIcon, WarehouseIcon } from 'lucide-react'
// The panel's settings rail, registered into the same registry the operator's
// dashboard writes to — so a marketplace adds, removes or reorders entries
@@ -15,6 +15,12 @@ settingsNav.addGroup({
position: 200,
})
+settingsNav.addGroup({
+ key: 'team',
+ labelKey: 'admin.settings_nav.groups.team',
+ position: 300,
+})
+
settingsNav.add({
key: 'settings.stock-locations',
labelKey: 'admin.settings_nav.items.stock_locations',
@@ -26,3 +32,17 @@ settingsNav.add({
// stock permission never sees the entry.
subject: 'Spree::StockLocation',
})
+
+// Who runs this seller. Under settings rather than in the main rail, matching
+// where the operator's dashboard puts its own staff page: managing people is
+// configuration, not day-to-day selling.
+settingsNav.add({
+ key: 'settings.team',
+ label: i18n.t('nav.team'),
+ path: '/team',
+ icon: UsersRoundIcon,
+ group: 'team',
+ position: 100,
+ subject: 'seller_profile',
+ action: 'update',
+})
diff --git a/packages/seller-dashboard/src/routeTree.gen.ts b/packages/seller-dashboard/src/routeTree.gen.ts
index 905b0b3d88..511fc8b23c 100644
--- a/packages/seller-dashboard/src/routeTree.gen.ts
+++ b/packages/seller-dashboard/src/routeTree.gen.ts
@@ -15,10 +15,11 @@ import { Route as authenticatedIndexRouteImport } from './routes/_authenticated/
import { Route as acceptInvitationDotinvitationIdRouteImport } from './routes/accept-invitation.$invitationId'
import { Route as authenticatedSellerIdRouteImport } from './routes/_authenticated/$sellerId'
import { Route as IndexRouteImport } from './routes/_authenticated/$sellerId/index'
-import { Route as TeamRouteImport } from './routes/_authenticated/$sellerId/team'
import { Route as SettingsRouteImport } from './routes/_authenticated/$sellerId/settings'
import { Route as ProfileRouteImport } from './routes/_authenticated/$sellerId/profile'
import { Route as OnboardingRouteImport } from './routes/_authenticated/$sellerId/onboarding'
+import { Route as SettingsIndexRouteImport } from './routes/_authenticated/$sellerId/settings/index'
+import { Route as SettingsTeamRouteImport } from './routes/_authenticated/$sellerId/settings/team'
import { Route as SettingsStockLocationsRouteImport } from './routes/_authenticated/$sellerId/settings/stock-locations'
const loginRoute = loginRouteImport.update({
@@ -51,11 +52,6 @@ const IndexRoute = IndexRouteImport.update({
path: '/',
getParentRoute: () => authenticatedSellerIdRoute,
} as any)
-const TeamRoute = TeamRouteImport.update({
- id: '/team',
- path: '/team',
- getParentRoute: () => authenticatedSellerIdRoute,
-} as any)
const SettingsRoute = SettingsRouteImport.update({
id: '/settings',
path: '/settings',
@@ -71,6 +67,16 @@ const OnboardingRoute = OnboardingRouteImport.update({
path: '/onboarding',
getParentRoute: () => authenticatedSellerIdRoute,
} as any)
+const SettingsIndexRoute = SettingsIndexRouteImport.update({
+ id: '/',
+ path: '/',
+ getParentRoute: () => SettingsRoute,
+} as any)
+const SettingsTeamRoute = SettingsTeamRouteImport.update({
+ id: '/team',
+ path: '/team',
+ getParentRoute: () => SettingsRoute,
+} as any)
const SettingsStockLocationsRoute = SettingsStockLocationsRouteImport.update({
id: '/stock-locations',
path: '/stock-locations',
@@ -85,9 +91,10 @@ export interface FileRoutesByFullPath {
'/$sellerId/onboarding': typeof OnboardingRoute
'/$sellerId/profile': typeof ProfileRoute
'/$sellerId/settings': typeof SettingsRouteWithChildren
- '/$sellerId/team': typeof TeamRoute
'/$sellerId/': typeof IndexRoute
'/$sellerId/settings/stock-locations': typeof SettingsStockLocationsRoute
+ '/$sellerId/settings/team': typeof SettingsTeamRoute
+ '/$sellerId/settings/': typeof SettingsIndexRoute
}
export interface FileRoutesByTo {
'/login': typeof loginRoute
@@ -95,10 +102,10 @@ export interface FileRoutesByTo {
'/': typeof authenticatedIndexRoute
'/$sellerId/onboarding': typeof OnboardingRoute
'/$sellerId/profile': typeof ProfileRoute
- '/$sellerId/settings': typeof SettingsRouteWithChildren
- '/$sellerId/team': typeof TeamRoute
'/$sellerId': typeof IndexRoute
'/$sellerId/settings/stock-locations': typeof SettingsStockLocationsRoute
+ '/$sellerId/settings/team': typeof SettingsTeamRoute
+ '/$sellerId/settings': typeof SettingsIndexRoute
}
export interface FileRoutesById {
__root__: typeof rootRouteImport
@@ -110,9 +117,10 @@ export interface FileRoutesById {
'/_authenticated/$sellerId/onboarding': typeof OnboardingRoute
'/_authenticated/$sellerId/profile': typeof ProfileRoute
'/_authenticated/$sellerId/settings': typeof SettingsRouteWithChildren
- '/_authenticated/$sellerId/team': typeof TeamRoute
'/_authenticated/$sellerId/': typeof IndexRoute
'/_authenticated/$sellerId/settings/stock-locations': typeof SettingsStockLocationsRoute
+ '/_authenticated/$sellerId/settings/team': typeof SettingsTeamRoute
+ '/_authenticated/$sellerId/settings/': typeof SettingsIndexRoute
}
export interface FileRouteTypes {
fileRoutesByFullPath: FileRoutesByFullPath
@@ -124,9 +132,10 @@ export interface FileRouteTypes {
| '/$sellerId/onboarding'
| '/$sellerId/profile'
| '/$sellerId/settings'
- | '/$sellerId/team'
| '/$sellerId/'
| '/$sellerId/settings/stock-locations'
+ | '/$sellerId/settings/team'
+ | '/$sellerId/settings/'
fileRoutesByTo: FileRoutesByTo
to:
| '/login'
@@ -134,10 +143,10 @@ export interface FileRouteTypes {
| '/'
| '/$sellerId/onboarding'
| '/$sellerId/profile'
- | '/$sellerId/settings'
- | '/$sellerId/team'
| '/$sellerId'
| '/$sellerId/settings/stock-locations'
+ | '/$sellerId/settings/team'
+ | '/$sellerId/settings'
id:
| '__root__'
| '/_authenticated'
@@ -148,9 +157,10 @@ export interface FileRouteTypes {
| '/_authenticated/$sellerId/onboarding'
| '/_authenticated/$sellerId/profile'
| '/_authenticated/$sellerId/settings'
- | '/_authenticated/$sellerId/team'
| '/_authenticated/$sellerId/'
| '/_authenticated/$sellerId/settings/stock-locations'
+ | '/_authenticated/$sellerId/settings/team'
+ | '/_authenticated/$sellerId/settings/'
fileRoutesById: FileRoutesById
}
export interface RootRouteChildren {
@@ -203,13 +213,6 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof IndexRouteImport
parentRoute: typeof authenticatedSellerIdRoute
}
- '/_authenticated/$sellerId/team': {
- id: '/_authenticated/$sellerId/team'
- path: '/team'
- fullPath: '/$sellerId/team'
- preLoaderRoute: typeof TeamRouteImport
- parentRoute: typeof authenticatedSellerIdRoute
- }
'/_authenticated/$sellerId/settings': {
id: '/_authenticated/$sellerId/settings'
path: '/settings'
@@ -231,6 +234,20 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof OnboardingRouteImport
parentRoute: typeof authenticatedSellerIdRoute
}
+ '/_authenticated/$sellerId/settings/': {
+ id: '/_authenticated/$sellerId/settings/'
+ path: '/'
+ fullPath: '/$sellerId/settings/'
+ preLoaderRoute: typeof SettingsIndexRouteImport
+ parentRoute: typeof SettingsRoute
+ }
+ '/_authenticated/$sellerId/settings/team': {
+ id: '/_authenticated/$sellerId/settings/team'
+ path: '/team'
+ fullPath: '/$sellerId/settings/team'
+ preLoaderRoute: typeof SettingsTeamRouteImport
+ parentRoute: typeof SettingsRoute
+ }
'/_authenticated/$sellerId/settings/stock-locations': {
id: '/_authenticated/$sellerId/settings/stock-locations'
path: '/stock-locations'
@@ -243,10 +260,14 @@ declare module '@tanstack/react-router' {
interface SettingsRouteChildren {
SettingsStockLocationsRoute: typeof SettingsStockLocationsRoute
+ SettingsTeamRoute: typeof SettingsTeamRoute
+ SettingsIndexRoute: typeof SettingsIndexRoute
}
const SettingsRouteChildren: SettingsRouteChildren = {
SettingsStockLocationsRoute: SettingsStockLocationsRoute,
+ SettingsTeamRoute: SettingsTeamRoute,
+ SettingsIndexRoute: SettingsIndexRoute,
}
const SettingsRouteWithChildren = SettingsRoute._addFileChildren(
@@ -257,7 +278,6 @@ interface authenticatedSellerIdRouteChildren {
OnboardingRoute: typeof OnboardingRoute
ProfileRoute: typeof ProfileRoute
SettingsRoute: typeof SettingsRouteWithChildren
- TeamRoute: typeof TeamRoute
IndexRoute: typeof IndexRoute
}
@@ -265,7 +285,6 @@ const authenticatedSellerIdRouteChildren: authenticatedSellerIdRouteChildren = {
OnboardingRoute: OnboardingRoute,
ProfileRoute: ProfileRoute,
SettingsRoute: SettingsRouteWithChildren,
- TeamRoute: TeamRoute,
IndexRoute: IndexRoute,
}
diff --git a/packages/seller-dashboard/src/routes/_authenticated/$sellerId/settings/index.tsx b/packages/seller-dashboard/src/routes/_authenticated/$sellerId/settings/index.tsx
new file mode 100644
index 0000000000..98abb7d8de
--- /dev/null
+++ b/packages/seller-dashboard/src/routes/_authenticated/$sellerId/settings/index.tsx
@@ -0,0 +1,16 @@
+import { createFileRoute, redirect } from '@tanstack/react-router'
+
+/**
+ * Settings is a launcher, not a page — landing on it bare would show the rail
+ * beside an empty pane, so it opens the first entry, as the operator's
+ * dashboard does.
+ */
+export const Route = createFileRoute('/_authenticated/$sellerId/settings/')({
+ beforeLoad: ({ params }) => {
+ throw redirect({
+ to: '/$sellerId/settings/stock-locations',
+ params: { sellerId: params.sellerId },
+ replace: true,
+ })
+ },
+})
diff --git a/packages/seller-dashboard/src/routes/_authenticated/$sellerId/team.tsx b/packages/seller-dashboard/src/routes/_authenticated/$sellerId/settings/team.tsx
similarity index 68%
rename from packages/seller-dashboard/src/routes/_authenticated/$sellerId/team.tsx
rename to packages/seller-dashboard/src/routes/_authenticated/$sellerId/settings/team.tsx
index cc9d3be007..b7fb5efeb2 100644
--- a/packages/seller-dashboard/src/routes/_authenticated/$sellerId/team.tsx
+++ b/packages/seller-dashboard/src/routes/_authenticated/$sellerId/settings/team.tsx
@@ -1,6 +1,6 @@
import { createFileRoute } from '@tanstack/react-router'
-import { TeamPage } from '../../../pages/team'
+import { TeamPage } from '../../../../pages/team'
-export const Route = createFileRoute('/_authenticated/$sellerId/team')({
+export const Route = createFileRoute('/_authenticated/$sellerId/settings/team')({
component: TeamPage,
})