@open-mercato/core 0.6.8-develop.7101.1.bd9356828a → 0.7.1-develop.7102.1.b41f7e3e51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +1 -1
- package/dist/modules/auth/api/login.js +19 -0
- package/dist/modules/auth/api/login.js.map +2 -2
- package/dist/modules/auth/api/routeError.js +11 -0
- package/dist/modules/auth/api/routeError.js.map +7 -0
- package/dist/modules/auth/api/users/acl/route.js +23 -7
- package/dist/modules/auth/api/users/acl/route.js.map +2 -2
- package/dist/modules/business_rules/backend/rules/[id]/page.meta.js +6 -1
- package/dist/modules/business_rules/backend/rules/[id]/page.meta.js.map +2 -2
- package/dist/modules/business_rules/backend/rules/create/page.meta.js +5 -1
- package/dist/modules/business_rules/backend/rules/create/page.meta.js.map +2 -2
- package/dist/modules/business_rules/backend/sets/[id]/page.meta.js +6 -1
- package/dist/modules/business_rules/backend/sets/[id]/page.meta.js.map +2 -2
- package/dist/modules/business_rules/backend/sets/create/page.meta.js +5 -1
- package/dist/modules/business_rules/backend/sets/create/page.meta.js.map +2 -2
- package/dist/modules/customer_accounts/backend/customer_accounts/settings/CustomerAccountsSettingsPageClient.js +84 -0
- package/dist/modules/customer_accounts/backend/customer_accounts/settings/CustomerAccountsSettingsPageClient.js.map +7 -0
- package/dist/modules/customer_accounts/backend/customer_accounts/settings/page.js +7 -81
- package/dist/modules/customer_accounts/backend/customer_accounts/settings/page.js.map +2 -2
- package/dist/modules/customer_accounts/backend/customer_accounts/users/PortalUsersPageClient.js +525 -0
- package/dist/modules/customer_accounts/backend/customer_accounts/users/PortalUsersPageClient.js.map +7 -0
- package/dist/modules/customer_accounts/backend/customer_accounts/users/[id]/PortalUserDetailPageClient.js +731 -0
- package/dist/modules/customer_accounts/backend/customer_accounts/users/[id]/PortalUserDetailPageClient.js.map +7 -0
- package/dist/modules/customer_accounts/backend/customer_accounts/users/[id]/page.js +7 -727
- package/dist/modules/customer_accounts/backend/customer_accounts/users/[id]/page.js.map +2 -2
- package/dist/modules/customer_accounts/backend/customer_accounts/users/page.js +7 -521
- package/dist/modules/customer_accounts/backend/customer_accounts/users/page.js.map +2 -2
- package/dist/modules/customer_accounts/extension-points.js +1 -1
- package/dist/modules/customer_accounts/extension-points.js.map +2 -2
- package/dist/modules/customer_accounts/lib/portalUrl.js +69 -0
- package/dist/modules/customer_accounts/lib/portalUrl.js.map +7 -0
- package/dist/modules/customers/backend/customers/companies/page.js +2 -2
- package/dist/modules/customers/backend/customers/companies/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/page.js +2 -2
- package/dist/modules/customers/backend/customers/deals/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/people/page.js +2 -2
- package/dist/modules/customers/backend/customers/people/page.js.map +2 -2
- package/dist/modules/customers/components/detail/AssignRoleDialog.js +33 -28
- package/dist/modules/customers/components/detail/AssignRoleDialog.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/evidence-submissions/[id]/page.meta.js +3 -1
- package/dist/modules/eudr/backend/eudr/evidence-submissions/[id]/page.meta.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/evidence-submissions/create/page.meta.js +1 -0
- package/dist/modules/eudr/backend/eudr/evidence-submissions/create/page.meta.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/evidence-submissions/page.meta.js +4 -1
- package/dist/modules/eudr/backend/eudr/evidence-submissions/page.meta.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/page.meta.js +2 -2
- package/dist/modules/eudr/backend/eudr/page.meta.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/plots/[id]/page.js +8 -2
- package/dist/modules/eudr/backend/eudr/plots/[id]/page.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/plots/[id]/page.meta.js +3 -1
- package/dist/modules/eudr/backend/eudr/plots/[id]/page.meta.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/plots/create/page.js +8 -2
- package/dist/modules/eudr/backend/eudr/plots/create/page.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/plots/create/page.meta.js +1 -0
- package/dist/modules/eudr/backend/eudr/plots/create/page.meta.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/plots/page.meta.js +4 -1
- package/dist/modules/eudr/backend/eudr/plots/page.meta.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/product-mappings/[id]/page.meta.js +3 -1
- package/dist/modules/eudr/backend/eudr/product-mappings/[id]/page.meta.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/product-mappings/create/page.meta.js +1 -0
- package/dist/modules/eudr/backend/eudr/product-mappings/create/page.meta.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/product-mappings/page.meta.js +4 -1
- package/dist/modules/eudr/backend/eudr/product-mappings/page.meta.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/risk-assessments/[id]/page.meta.js +3 -1
- package/dist/modules/eudr/backend/eudr/risk-assessments/[id]/page.meta.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/risk-assessments/create/page.meta.js +1 -0
- package/dist/modules/eudr/backend/eudr/risk-assessments/create/page.meta.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/risk-assessments/page.meta.js +4 -1
- package/dist/modules/eudr/backend/eudr/risk-assessments/page.meta.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/statements/[id]/page.js +2 -0
- package/dist/modules/eudr/backend/eudr/statements/[id]/page.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/statements/[id]/page.meta.js +3 -1
- package/dist/modules/eudr/backend/eudr/statements/[id]/page.meta.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/statements/create/page.meta.js +1 -0
- package/dist/modules/eudr/backend/eudr/statements/create/page.meta.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/statements/page.js +30 -25
- package/dist/modules/eudr/backend/eudr/statements/page.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/statements/page.meta.js +4 -1
- package/dist/modules/eudr/backend/eudr/statements/page.meta.js.map +2 -2
- package/dist/modules/eudr/commands/statements.js +5 -3
- package/dist/modules/eudr/commands/statements.js.map +2 -2
- package/dist/modules/eudr/components/crudErrorI18n.js +21 -1
- package/dist/modules/eudr/components/crudErrorI18n.js.map +2 -2
- package/dist/modules/eudr/components/formConfig.js +6 -2
- package/dist/modules/eudr/components/formConfig.js.map +2 -2
- package/dist/modules/eudr/lib/statement-lifecycle.js +9 -1
- package/dist/modules/eudr/lib/statement-lifecycle.js.map +2 -2
- package/dist/modules/sales/components/documents/LineItemDialog.js +1 -1
- package/dist/modules/sales/components/documents/LineItemDialog.js.map +1 -1
- package/dist/modules/sales/widgets/injection/document-history/widget.client.js +44 -2
- package/dist/modules/sales/widgets/injection/document-history/widget.client.js.map +2 -2
- package/dist/modules/wms/components/backend/WmsLocationDetailPage.js +20 -16
- package/dist/modules/wms/components/backend/WmsLocationDetailPage.js.map +2 -2
- package/dist/modules/wms/components/backend/WmsLotDetailPage.js +10 -6
- package/dist/modules/wms/components/backend/WmsLotDetailPage.js.map +2 -2
- package/dist/modules/wms/components/backend/WmsOperationalDashboardPage.js +11 -7
- package/dist/modules/wms/components/backend/WmsOperationalDashboardPage.js.map +2 -2
- package/dist/modules/wms/components/backend/WmsSkuDetailPage.js +10 -6
- package/dist/modules/wms/components/backend/WmsSkuDetailPage.js.map +2 -2
- package/package.json +8 -8
- package/src/modules/auth/api/login.ts +23 -0
- package/src/modules/auth/api/routeError.ts +30 -0
- package/src/modules/auth/api/users/acl/route.ts +49 -9
- package/src/modules/business_rules/backend/rules/[id]/page.meta.ts +5 -0
- package/src/modules/business_rules/backend/rules/create/page.meta.ts +5 -1
- package/src/modules/business_rules/backend/sets/[id]/page.meta.ts +5 -0
- package/src/modules/business_rules/backend/sets/create/page.meta.ts +5 -1
- package/src/modules/customer_accounts/backend/customer_accounts/settings/CustomerAccountsSettingsPageClient.tsx +138 -0
- package/src/modules/customer_accounts/backend/customer_accounts/settings/page.tsx +8 -132
- package/src/modules/customer_accounts/backend/customer_accounts/users/PortalUsersPageClient.tsx +601 -0
- package/src/modules/customer_accounts/backend/customer_accounts/users/[id]/PortalUserDetailPageClient.tsx +838 -0
- package/src/modules/customer_accounts/backend/customer_accounts/users/[id]/page.tsx +6 -838
- package/src/modules/customer_accounts/backend/customer_accounts/users/page.tsx +6 -590
- package/src/modules/customer_accounts/extension-points.ts +1 -1
- package/src/modules/customer_accounts/lib/portalUrl.ts +112 -0
- package/src/modules/customers/backend/customers/companies/page.tsx +2 -2
- package/src/modules/customers/backend/customers/deals/page.tsx +2 -2
- package/src/modules/customers/backend/customers/people/page.tsx +2 -2
- package/src/modules/customers/components/detail/AssignRoleDialog.tsx +12 -7
- package/src/modules/eudr/backend/eudr/evidence-submissions/[id]/page.meta.ts +2 -0
- package/src/modules/eudr/backend/eudr/evidence-submissions/create/page.meta.ts +1 -0
- package/src/modules/eudr/backend/eudr/evidence-submissions/page.meta.ts +4 -1
- package/src/modules/eudr/backend/eudr/page.meta.ts +2 -2
- package/src/modules/eudr/backend/eudr/plots/[id]/page.meta.ts +2 -0
- package/src/modules/eudr/backend/eudr/plots/[id]/page.tsx +8 -2
- package/src/modules/eudr/backend/eudr/plots/create/page.meta.ts +1 -0
- package/src/modules/eudr/backend/eudr/plots/create/page.tsx +8 -2
- package/src/modules/eudr/backend/eudr/plots/page.meta.ts +4 -1
- package/src/modules/eudr/backend/eudr/product-mappings/[id]/page.meta.ts +2 -0
- package/src/modules/eudr/backend/eudr/product-mappings/create/page.meta.ts +1 -0
- package/src/modules/eudr/backend/eudr/product-mappings/page.meta.ts +4 -1
- package/src/modules/eudr/backend/eudr/risk-assessments/[id]/page.meta.ts +2 -0
- package/src/modules/eudr/backend/eudr/risk-assessments/create/page.meta.ts +1 -0
- package/src/modules/eudr/backend/eudr/risk-assessments/page.meta.ts +4 -1
- package/src/modules/eudr/backend/eudr/statements/[id]/page.meta.ts +2 -0
- package/src/modules/eudr/backend/eudr/statements/[id]/page.tsx +2 -0
- package/src/modules/eudr/backend/eudr/statements/create/page.meta.ts +1 -0
- package/src/modules/eudr/backend/eudr/statements/page.meta.ts +4 -1
- package/src/modules/eudr/backend/eudr/statements/page.tsx +32 -26
- package/src/modules/eudr/commands/statements.ts +4 -2
- package/src/modules/eudr/components/crudErrorI18n.ts +31 -0
- package/src/modules/eudr/components/formConfig.tsx +9 -1
- package/src/modules/eudr/i18n/de.json +3 -2
- package/src/modules/eudr/i18n/en.json +3 -2
- package/src/modules/eudr/i18n/es.json +3 -2
- package/src/modules/eudr/i18n/ko.json +3 -2
- package/src/modules/eudr/i18n/pl.json +3 -2
- package/src/modules/eudr/lib/statement-lifecycle.ts +8 -0
- package/src/modules/sales/components/documents/LineItemDialog.tsx +1 -1
- package/src/modules/sales/i18n/de.json +37 -0
- package/src/modules/sales/i18n/en.json +37 -0
- package/src/modules/sales/i18n/es.json +37 -0
- package/src/modules/sales/i18n/ko.json +37 -0
- package/src/modules/sales/i18n/pl.json +37 -0
- package/src/modules/sales/widgets/injection/document-history/widget.client.tsx +42 -2
- package/src/modules/wms/components/backend/WmsLocationDetailPage.tsx +30 -26
- package/src/modules/wms/components/backend/WmsLotDetailPage.tsx +21 -17
- package/src/modules/wms/components/backend/WmsOperationalDashboardPage.tsx +17 -13
- package/src/modules/wms/components/backend/WmsSkuDetailPage.tsx +16 -12
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import Link from "next/link";
|
|
5
|
+
import { FormHeader } from "@open-mercato/ui/backend/forms";
|
|
6
|
+
import { Button } from "@open-mercato/ui/primitives/button";
|
|
7
|
+
import { useT } from "@open-mercato/shared/lib/i18n/context";
|
|
8
|
+
import { buildPortalRootUrl, buildPortalUrlPattern } from "../../../lib/portalUrl.js";
|
|
9
|
+
const DEMO_CREDENTIALS = [
|
|
10
|
+
{ email: "alice.johnson@example.com", password: "Password123!", role: "Portal Admin" },
|
|
11
|
+
{ email: "bob.smith@example.com", password: "Password123!", role: "Buyer" },
|
|
12
|
+
{ email: "carol.white@example.com", password: "Password123!", role: "Viewer" }
|
|
13
|
+
];
|
|
14
|
+
function CustomerAccountsSettingsPageClient({ portalOrigin }) {
|
|
15
|
+
const t = useT();
|
|
16
|
+
const portalUrl = useMemo(() => buildPortalUrlPattern(portalOrigin), [portalOrigin]);
|
|
17
|
+
const portalRootUrl = useMemo(() => buildPortalRootUrl(portalOrigin), [portalOrigin]);
|
|
18
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
19
|
+
/* @__PURE__ */ jsx("div", { className: "px-3 py-3 md:px-6 md:py-4", children: /* @__PURE__ */ jsx(
|
|
20
|
+
FormHeader,
|
|
21
|
+
{
|
|
22
|
+
mode: "detail",
|
|
23
|
+
title: t("customer_accounts.settings.title", "Portal Settings"),
|
|
24
|
+
backHref: "/backend/customer_accounts/users",
|
|
25
|
+
backLabel: t("customer_accounts.settings.back", "Customer Users")
|
|
26
|
+
}
|
|
27
|
+
) }),
|
|
28
|
+
/* @__PURE__ */ jsxs("div", { className: "max-w-2xl space-y-6", children: [
|
|
29
|
+
/* @__PURE__ */ jsxs("div", { className: "rounded-lg border p-4 space-y-3", children: [
|
|
30
|
+
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold", children: t("customer_accounts.settings.portal_access.title", "Portal Access") }),
|
|
31
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
32
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: t("customer_accounts.settings.portal_access.url_label", "Portal URL pattern:") }),
|
|
33
|
+
/* @__PURE__ */ jsx("code", { className: "mt-1 block rounded bg-muted px-3 py-2 text-sm font-mono", children: portalUrl })
|
|
34
|
+
] }),
|
|
35
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", size: "sm", asChild: true, children: /* @__PURE__ */ jsx("a", { href: portalRootUrl, target: "_blank", rel: "noopener noreferrer", children: t("customer_accounts.settings.portal_access.open_portal", "Open Portal") }) }) }),
|
|
36
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t(
|
|
37
|
+
"customer_accounts.settings.portal_access.slug_note",
|
|
38
|
+
"The organization slug is auto-generated from the organization name. You can view and manage organizations in Directory \u2192 Organizations."
|
|
39
|
+
) }),
|
|
40
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: /* @__PURE__ */ jsx(Link, { href: "/backend/directory/organizations", className: "text-primary underline underline-offset-4 hover:text-primary/80", children: t("customer_accounts.settings.portal_access.manage_orgs", "Manage Organizations") }) })
|
|
41
|
+
] }),
|
|
42
|
+
/* @__PURE__ */ jsxs("div", { className: "rounded-lg border p-4 space-y-3", children: [
|
|
43
|
+
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold", children: t("customer_accounts.settings.demo_credentials.title", "Demo Credentials") }),
|
|
44
|
+
/* @__PURE__ */ jsx("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs("table", { className: "w-full text-sm", children: [
|
|
45
|
+
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { className: "border-b text-left", children: [
|
|
46
|
+
/* @__PURE__ */ jsx("th", { className: "pb-2 pr-4 font-medium text-muted-foreground", children: t("customer_accounts.settings.demo_credentials.email", "Email") }),
|
|
47
|
+
/* @__PURE__ */ jsx("th", { className: "pb-2 pr-4 font-medium text-muted-foreground", children: t("customer_accounts.settings.demo_credentials.password", "Password") }),
|
|
48
|
+
/* @__PURE__ */ jsx("th", { className: "pb-2 font-medium text-muted-foreground", children: t("customer_accounts.settings.demo_credentials.role", "Role") })
|
|
49
|
+
] }) }),
|
|
50
|
+
/* @__PURE__ */ jsx("tbody", { children: DEMO_CREDENTIALS.map((cred) => /* @__PURE__ */ jsxs("tr", { className: "border-b last:border-0", children: [
|
|
51
|
+
/* @__PURE__ */ jsx("td", { className: "py-2 pr-4 font-mono text-xs", children: cred.email }),
|
|
52
|
+
/* @__PURE__ */ jsx("td", { className: "py-2 pr-4 font-mono text-xs", children: cred.password }),
|
|
53
|
+
/* @__PURE__ */ jsx("td", { className: "py-2 text-xs", children: cred.role })
|
|
54
|
+
] }, cred.email)) })
|
|
55
|
+
] }) }),
|
|
56
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t(
|
|
57
|
+
"customer_accounts.settings.demo_credentials.note",
|
|
58
|
+
"These credentials are only available if example data was seeded during setup."
|
|
59
|
+
) })
|
|
60
|
+
] }),
|
|
61
|
+
/* @__PURE__ */ jsxs("div", { className: "rounded-lg border p-4 space-y-3", children: [
|
|
62
|
+
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold", children: t("customer_accounts.settings.quick_links.title", "Quick Links") }),
|
|
63
|
+
/* @__PURE__ */ jsxs("ul", { className: "space-y-2", children: [
|
|
64
|
+
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { href: "/backend/customer_accounts/users", className: "text-sm text-primary underline underline-offset-4 hover:text-primary/80", children: t("customer_accounts.settings.quick_links.manage_users", "Manage customer users") }) }),
|
|
65
|
+
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { href: "/backend/customer_accounts/roles", className: "text-sm text-primary underline underline-offset-4 hover:text-primary/80", children: t("customer_accounts.settings.quick_links.manage_roles", "Manage customer roles") }) }),
|
|
66
|
+
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
|
67
|
+
"a",
|
|
68
|
+
{
|
|
69
|
+
href: "https://docs.open-mercato.com/framework/modules/customer-portal",
|
|
70
|
+
target: "_blank",
|
|
71
|
+
rel: "noopener noreferrer",
|
|
72
|
+
className: "text-sm text-primary underline underline-offset-4 hover:text-primary/80",
|
|
73
|
+
children: t("customer_accounts.settings.quick_links.portal_docs", "Portal documentation")
|
|
74
|
+
}
|
|
75
|
+
) })
|
|
76
|
+
] })
|
|
77
|
+
] })
|
|
78
|
+
] })
|
|
79
|
+
] });
|
|
80
|
+
}
|
|
81
|
+
export {
|
|
82
|
+
CustomerAccountsSettingsPageClient
|
|
83
|
+
};
|
|
84
|
+
//# sourceMappingURL=CustomerAccountsSettingsPageClient.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/modules/customer_accounts/backend/customer_accounts/settings/CustomerAccountsSettingsPageClient.tsx"],
|
|
4
|
+
"sourcesContent": ["\"use client\"\n\nimport { useMemo } from 'react'\nimport Link from 'next/link'\nimport { FormHeader } from '@open-mercato/ui/backend/forms'\nimport { Button } from '@open-mercato/ui/primitives/button'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { buildPortalRootUrl, buildPortalUrlPattern } from '../../../lib/portalUrl'\n\nconst DEMO_CREDENTIALS = [\n { email: 'alice.johnson@example.com', password: 'Password123!', role: 'Portal Admin' },\n { email: 'bob.smith@example.com', password: 'Password123!', role: 'Buyer' },\n { email: 'carol.white@example.com', password: 'Password123!', role: 'Viewer' },\n] as const\n\nexport type CustomerAccountsSettingsPageClientProps = {\n portalOrigin: string\n}\n\nexport function CustomerAccountsSettingsPageClient({ portalOrigin }: CustomerAccountsSettingsPageClientProps) {\n const t = useT()\n\n const portalUrl = useMemo(() => buildPortalUrlPattern(portalOrigin), [portalOrigin])\n const portalRootUrl = useMemo(() => buildPortalRootUrl(portalOrigin), [portalOrigin])\n\n return (\n <>\n <div className=\"px-3 py-3 md:px-6 md:py-4\">\n <FormHeader\n mode=\"detail\"\n title={t('customer_accounts.settings.title', 'Portal Settings')}\n backHref=\"/backend/customer_accounts/users\"\n backLabel={t('customer_accounts.settings.back', 'Customer Users')}\n />\n </div>\n\n <div className=\"max-w-2xl space-y-6\">\n <div className=\"rounded-lg border p-4 space-y-3\">\n <h3 className=\"text-sm font-semibold\">\n {t('customer_accounts.settings.portal_access.title', 'Portal Access')}\n </h3>\n <div>\n <p className=\"text-sm text-muted-foreground\">\n {t('customer_accounts.settings.portal_access.url_label', 'Portal URL pattern:')}\n </p>\n <code className=\"mt-1 block rounded bg-muted px-3 py-2 text-sm font-mono\">\n {portalUrl}\n </code>\n </div>\n <div>\n <Button type=\"button\" variant=\"outline\" size=\"sm\" asChild>\n <a href={portalRootUrl} target=\"_blank\" rel=\"noopener noreferrer\">\n {t('customer_accounts.settings.portal_access.open_portal', 'Open Portal')}\n </a>\n </Button>\n </div>\n <p className=\"text-xs text-muted-foreground\">\n {t(\n 'customer_accounts.settings.portal_access.slug_note',\n 'The organization slug is auto-generated from the organization name. You can view and manage organizations in Directory \\u2192 Organizations.',\n )}\n </p>\n <p className=\"text-xs text-muted-foreground\">\n <Link href=\"/backend/directory/organizations\" className=\"text-primary underline underline-offset-4 hover:text-primary/80\">\n {t('customer_accounts.settings.portal_access.manage_orgs', 'Manage Organizations')}\n </Link>\n </p>\n </div>\n\n <div className=\"rounded-lg border p-4 space-y-3\">\n <h3 className=\"text-sm font-semibold\">\n {t('customer_accounts.settings.demo_credentials.title', 'Demo Credentials')}\n </h3>\n <div className=\"overflow-x-auto\">\n <table className=\"w-full text-sm\">\n <thead>\n <tr className=\"border-b text-left\">\n <th className=\"pb-2 pr-4 font-medium text-muted-foreground\">\n {t('customer_accounts.settings.demo_credentials.email', 'Email')}\n </th>\n <th className=\"pb-2 pr-4 font-medium text-muted-foreground\">\n {t('customer_accounts.settings.demo_credentials.password', 'Password')}\n </th>\n <th className=\"pb-2 font-medium text-muted-foreground\">\n {t('customer_accounts.settings.demo_credentials.role', 'Role')}\n </th>\n </tr>\n </thead>\n <tbody>\n {DEMO_CREDENTIALS.map((cred) => (\n <tr key={cred.email} className=\"border-b last:border-0\">\n <td className=\"py-2 pr-4 font-mono text-xs\">{cred.email}</td>\n <td className=\"py-2 pr-4 font-mono text-xs\">{cred.password}</td>\n <td className=\"py-2 text-xs\">{cred.role}</td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n <p className=\"text-xs text-muted-foreground\">\n {t(\n 'customer_accounts.settings.demo_credentials.note',\n 'These credentials are only available if example data was seeded during setup.',\n )}\n </p>\n </div>\n\n <div className=\"rounded-lg border p-4 space-y-3\">\n <h3 className=\"text-sm font-semibold\">\n {t('customer_accounts.settings.quick_links.title', 'Quick Links')}\n </h3>\n <ul className=\"space-y-2\">\n <li>\n <Link href=\"/backend/customer_accounts/users\" className=\"text-sm text-primary underline underline-offset-4 hover:text-primary/80\">\n {t('customer_accounts.settings.quick_links.manage_users', 'Manage customer users')}\n </Link>\n </li>\n <li>\n <Link href=\"/backend/customer_accounts/roles\" className=\"text-sm text-primary underline underline-offset-4 hover:text-primary/80\">\n {t('customer_accounts.settings.quick_links.manage_roles', 'Manage customer roles')}\n </Link>\n </li>\n <li>\n <a\n href=\"https://docs.open-mercato.com/framework/modules/customer-portal\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"text-sm text-primary underline underline-offset-4 hover:text-primary/80\"\n >\n {t('customer_accounts.settings.quick_links.portal_docs', 'Portal documentation')}\n </a>\n </li>\n </ul>\n </div>\n </div>\n </>\n )\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,85 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import { useMemo } from "react";
|
|
4
|
-
import Link from "next/link";
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { headers } from "next/headers";
|
|
5
3
|
import { Page, PageBody } from "@open-mercato/ui/backend/Page";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return
|
|
11
|
-
}
|
|
12
|
-
const DEMO_CREDENTIALS = [
|
|
13
|
-
{ email: "alice.johnson@example.com", password: "Password123!", role: "Portal Admin" },
|
|
14
|
-
{ email: "bob.smith@example.com", password: "Password123!", role: "Buyer" },
|
|
15
|
-
{ email: "carol.white@example.com", password: "Password123!", role: "Viewer" }
|
|
16
|
-
];
|
|
17
|
-
function CustomerAccountsSettingsPage() {
|
|
18
|
-
const t = useT();
|
|
19
|
-
const origin = useOrigin();
|
|
20
|
-
const portalUrl = useMemo(() => `${origin}/[org-slug]/portal`, [origin]);
|
|
21
|
-
return /* @__PURE__ */ jsxs(Page, { children: [
|
|
22
|
-
/* @__PURE__ */ jsx("div", { className: "px-3 py-3 md:px-6 md:py-4", children: /* @__PURE__ */ jsx(
|
|
23
|
-
FormHeader,
|
|
24
|
-
{
|
|
25
|
-
mode: "detail",
|
|
26
|
-
title: t("customer_accounts.settings.title", "Portal Settings"),
|
|
27
|
-
backHref: "/backend/customer_accounts/users",
|
|
28
|
-
backLabel: t("customer_accounts.settings.back", "Customer Users")
|
|
29
|
-
}
|
|
30
|
-
) }),
|
|
31
|
-
/* @__PURE__ */ jsx(PageBody, { children: /* @__PURE__ */ jsxs("div", { className: "max-w-2xl space-y-6", children: [
|
|
32
|
-
/* @__PURE__ */ jsxs("div", { className: "rounded-lg border p-4 space-y-3", children: [
|
|
33
|
-
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold", children: t("customer_accounts.settings.portal_access.title", "Portal Access") }),
|
|
34
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
35
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: t("customer_accounts.settings.portal_access.url_label", "Portal URL pattern:") }),
|
|
36
|
-
/* @__PURE__ */ jsx("code", { className: "mt-1 block rounded bg-muted px-3 py-2 text-sm font-mono", children: portalUrl })
|
|
37
|
-
] }),
|
|
38
|
-
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", size: "sm", asChild: true, children: /* @__PURE__ */ jsx("a", { href: `${origin}/portal`, target: "_blank", rel: "noopener noreferrer", children: t("customer_accounts.settings.portal_access.open_portal", "Open Portal") }) }) }),
|
|
39
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t(
|
|
40
|
-
"customer_accounts.settings.portal_access.slug_note",
|
|
41
|
-
"The organization slug is auto-generated from the organization name. You can view and manage organizations in Directory \u2192 Organizations."
|
|
42
|
-
) }),
|
|
43
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: /* @__PURE__ */ jsx(Link, { href: "/backend/directory/organizations", className: "text-primary underline underline-offset-4 hover:text-primary/80", children: t("customer_accounts.settings.portal_access.manage_orgs", "Manage Organizations") }) })
|
|
44
|
-
] }),
|
|
45
|
-
/* @__PURE__ */ jsxs("div", { className: "rounded-lg border p-4 space-y-3", children: [
|
|
46
|
-
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold", children: t("customer_accounts.settings.demo_credentials.title", "Demo Credentials") }),
|
|
47
|
-
/* @__PURE__ */ jsx("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs("table", { className: "w-full text-sm", children: [
|
|
48
|
-
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { className: "border-b text-left", children: [
|
|
49
|
-
/* @__PURE__ */ jsx("th", { className: "pb-2 pr-4 font-medium text-muted-foreground", children: t("customer_accounts.settings.demo_credentials.email", "Email") }),
|
|
50
|
-
/* @__PURE__ */ jsx("th", { className: "pb-2 pr-4 font-medium text-muted-foreground", children: t("customer_accounts.settings.demo_credentials.password", "Password") }),
|
|
51
|
-
/* @__PURE__ */ jsx("th", { className: "pb-2 font-medium text-muted-foreground", children: t("customer_accounts.settings.demo_credentials.role", "Role") })
|
|
52
|
-
] }) }),
|
|
53
|
-
/* @__PURE__ */ jsx("tbody", { children: DEMO_CREDENTIALS.map((cred) => /* @__PURE__ */ jsxs("tr", { className: "border-b last:border-0", children: [
|
|
54
|
-
/* @__PURE__ */ jsx("td", { className: "py-2 pr-4 font-mono text-xs", children: cred.email }),
|
|
55
|
-
/* @__PURE__ */ jsx("td", { className: "py-2 pr-4 font-mono text-xs", children: cred.password }),
|
|
56
|
-
/* @__PURE__ */ jsx("td", { className: "py-2 text-xs", children: cred.role })
|
|
57
|
-
] }, cred.email)) })
|
|
58
|
-
] }) }),
|
|
59
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t(
|
|
60
|
-
"customer_accounts.settings.demo_credentials.note",
|
|
61
|
-
"These credentials are only available if example data was seeded during setup."
|
|
62
|
-
) })
|
|
63
|
-
] }),
|
|
64
|
-
/* @__PURE__ */ jsxs("div", { className: "rounded-lg border p-4 space-y-3", children: [
|
|
65
|
-
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold", children: t("customer_accounts.settings.quick_links.title", "Quick Links") }),
|
|
66
|
-
/* @__PURE__ */ jsxs("ul", { className: "space-y-2", children: [
|
|
67
|
-
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { href: "/backend/customer_accounts/users", className: "text-sm text-primary underline underline-offset-4 hover:text-primary/80", children: t("customer_accounts.settings.quick_links.manage_users", "Manage customer users") }) }),
|
|
68
|
-
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { href: "/backend/customer_accounts/roles", className: "text-sm text-primary underline underline-offset-4 hover:text-primary/80", children: t("customer_accounts.settings.quick_links.manage_roles", "Manage customer roles") }) }),
|
|
69
|
-
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
|
70
|
-
"a",
|
|
71
|
-
{
|
|
72
|
-
href: "https://docs.open-mercato.com/framework/modules/customer-portal",
|
|
73
|
-
target: "_blank",
|
|
74
|
-
rel: "noopener noreferrer",
|
|
75
|
-
className: "text-sm text-primary underline underline-offset-4 hover:text-primary/80",
|
|
76
|
-
children: t("customer_accounts.settings.quick_links.portal_docs", "Portal documentation")
|
|
77
|
-
}
|
|
78
|
-
) })
|
|
79
|
-
] })
|
|
80
|
-
] })
|
|
81
|
-
] }) })
|
|
82
|
-
] });
|
|
4
|
+
import { resolvePortalRequestOrigin } from "../../../lib/portalUrl.js";
|
|
5
|
+
import { CustomerAccountsSettingsPageClient } from "./CustomerAccountsSettingsPageClient.js";
|
|
6
|
+
async function CustomerAccountsSettingsPage() {
|
|
7
|
+
const portalOrigin = resolvePortalRequestOrigin(await headers());
|
|
8
|
+
return /* @__PURE__ */ jsx(Page, { children: /* @__PURE__ */ jsx(PageBody, { className: "space-y-6", children: /* @__PURE__ */ jsx(CustomerAccountsSettingsPageClient, { portalOrigin }) }) });
|
|
83
9
|
}
|
|
84
10
|
export {
|
|
85
11
|
CustomerAccountsSettingsPage as default
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/modules/customer_accounts/backend/customer_accounts/settings/page.tsx"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["import { headers } from 'next/headers'\nimport { Page, PageBody } from '@open-mercato/ui/backend/Page'\nimport { resolvePortalRequestOrigin } from '../../../lib/portalUrl'\nimport { CustomerAccountsSettingsPageClient } from './CustomerAccountsSettingsPageClient'\n\nexport default async function CustomerAccountsSettingsPage() {\n const portalOrigin = resolvePortalRequestOrigin(await headers())\n return (\n <Page>\n {/* space-y-6 preserves the gap the page header previously got as a direct <Page> child. */}\n <PageBody className=\"space-y-6\">\n <CustomerAccountsSettingsPageClient portalOrigin={portalOrigin} />\n </PageBody>\n </Page>\n )\n}\n"],
|
|
5
|
+
"mappings": "AAWQ;AAXR,SAAS,eAAe;AACxB,SAAS,MAAM,gBAAgB;AAC/B,SAAS,kCAAkC;AAC3C,SAAS,0CAA0C;AAEnD,eAAO,+BAAsD;AAC3D,QAAM,eAAe,2BAA2B,MAAM,QAAQ,CAAC;AAC/D,SACE,oBAAC,QAEC,8BAAC,YAAS,WAAU,aAClB,8BAAC,sCAAmC,cAA4B,GAClE,GACF;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|