@burdenoff/microfe-support 2026.530.1 → 2026.531.1
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/dist/support/SupportAdminRoot.js +42 -34
- package/dist/support/SupportAdminRoot.js.map +1 -1
- package/dist/support/SupportUserRoot.js +30 -22
- package/dist/support/SupportUserRoot.js.map +1 -1
- package/dist/support/hooks/useRegisterFooter.js +10 -5
- package/dist/support/hooks/useRegisterFooter.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,82 +5,90 @@ import { useRegisterFooter as r } from "./hooks/useRegisterFooter.js";
|
|
|
5
5
|
import { SupportAdminRoutes as i } from "./SupportAdminRoutes.js";
|
|
6
6
|
import { useEffect as a } from "react";
|
|
7
7
|
import { ErrorBoundary as o } from "@burdenoff/fe-libs/shared/components";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { useI18n as s } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
9
|
+
import { BarChart3 as c, BookOpen as l, Briefcase as u, Mail as d, Settings as f, Ticket as p } from "lucide-react";
|
|
10
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
10
11
|
//#region src/support/SupportAdminRoot.tsx
|
|
11
|
-
var
|
|
12
|
-
let { registerNavItems:
|
|
12
|
+
var h = (h) => {
|
|
13
|
+
let { registerNavItems: g, registerFooterItems: _, basePath: v = "/", currentUser: y, workspaceId: b, organizationId: x, productId: S } = h, C = n((e) => e.resetForContextChange), { t: w } = s(), T = (e, t) => {
|
|
14
|
+
let n = w(e);
|
|
15
|
+
return n === e ? t : n;
|
|
16
|
+
};
|
|
13
17
|
return a(() => {
|
|
14
|
-
|
|
18
|
+
C();
|
|
15
19
|
}, [
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
y,
|
|
20
|
+
C,
|
|
21
|
+
y?.id,
|
|
19
22
|
b,
|
|
20
|
-
x
|
|
23
|
+
x,
|
|
24
|
+
S
|
|
21
25
|
]), a(() => {
|
|
22
|
-
if (
|
|
26
|
+
if (g) return g([
|
|
23
27
|
{
|
|
24
28
|
id: "support-tickets",
|
|
25
|
-
label: "Tickets",
|
|
26
|
-
path: t(
|
|
27
|
-
icon: /* @__PURE__ */ p
|
|
29
|
+
label: T("support.nav.tickets", "Tickets"),
|
|
30
|
+
path: t(v, "tickets"),
|
|
31
|
+
icon: /* @__PURE__ */ m(p, { size: 20 }),
|
|
28
32
|
order: 10,
|
|
29
33
|
group: "support"
|
|
30
34
|
},
|
|
31
35
|
{
|
|
32
36
|
id: "support-inquiries",
|
|
33
|
-
label: "Contact Inquiries",
|
|
34
|
-
path: t(
|
|
35
|
-
icon: /* @__PURE__ */
|
|
37
|
+
label: T("support.nav.contactInquiries", "Contact Inquiries"),
|
|
38
|
+
path: t(v, "inquiries"),
|
|
39
|
+
icon: /* @__PURE__ */ m(d, { size: 20 }),
|
|
36
40
|
order: 15,
|
|
37
41
|
group: "support"
|
|
38
42
|
},
|
|
39
43
|
{
|
|
40
44
|
id: "support-applications",
|
|
41
|
-
label: "Job Applications",
|
|
42
|
-
path: t(
|
|
43
|
-
icon: /* @__PURE__ */
|
|
45
|
+
label: T("support.nav.jobApplications", "Job Applications"),
|
|
46
|
+
path: t(v, "applications"),
|
|
47
|
+
icon: /* @__PURE__ */ m(u, { size: 20 }),
|
|
44
48
|
order: 16,
|
|
45
49
|
group: "support"
|
|
46
50
|
},
|
|
47
51
|
{
|
|
48
52
|
id: "support-kb",
|
|
49
|
-
label: "Knowledge Base",
|
|
50
|
-
path: t(
|
|
51
|
-
icon: /* @__PURE__ */
|
|
53
|
+
label: T("support.nav.knowledgeBase", "Knowledge Base"),
|
|
54
|
+
path: t(v, "kb"),
|
|
55
|
+
icon: /* @__PURE__ */ m(l, { size: 20 }),
|
|
52
56
|
order: 20,
|
|
53
57
|
group: "support"
|
|
54
58
|
},
|
|
55
59
|
{
|
|
56
60
|
id: "support-analytics",
|
|
57
|
-
label: "Analytics",
|
|
58
|
-
path: t(
|
|
59
|
-
icon: /* @__PURE__ */
|
|
61
|
+
label: T("support.nav.analytics", "Analytics"),
|
|
62
|
+
path: t(v, "analytics"),
|
|
63
|
+
icon: /* @__PURE__ */ m(c, { size: 20 }),
|
|
60
64
|
order: 40,
|
|
61
65
|
group: "support"
|
|
62
66
|
},
|
|
63
67
|
{
|
|
64
68
|
id: "support-settings",
|
|
65
|
-
label: "Settings",
|
|
66
|
-
path: t(
|
|
67
|
-
icon: /* @__PURE__ */
|
|
69
|
+
label: T("support.nav.settings", "Settings"),
|
|
70
|
+
path: t(v, "settings"),
|
|
71
|
+
icon: /* @__PURE__ */ m(f, { size: 20 }),
|
|
68
72
|
order: 50,
|
|
69
73
|
group: "support"
|
|
70
74
|
}
|
|
71
75
|
]);
|
|
72
|
-
}, [
|
|
73
|
-
|
|
76
|
+
}, [
|
|
77
|
+
g,
|
|
78
|
+
v,
|
|
79
|
+
w
|
|
80
|
+
]), r(_), /* @__PURE__ */ m(o, {
|
|
81
|
+
fallback: /* @__PURE__ */ m("div", {
|
|
74
82
|
className: "p-6 text-center text-text-secondary",
|
|
75
83
|
children: "Something went wrong loading this module. Please refresh the page."
|
|
76
84
|
}),
|
|
77
|
-
children: /* @__PURE__ */
|
|
78
|
-
...
|
|
79
|
-
children: /* @__PURE__ */
|
|
85
|
+
children: /* @__PURE__ */ m(e, {
|
|
86
|
+
...h,
|
|
87
|
+
children: /* @__PURE__ */ m(i, {})
|
|
80
88
|
})
|
|
81
89
|
});
|
|
82
90
|
};
|
|
83
91
|
//#endregion
|
|
84
|
-
export {
|
|
92
|
+
export { h as SupportAdminRoot };
|
|
85
93
|
|
|
86
94
|
//# sourceMappingURL=SupportAdminRoot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SupportAdminRoot.js","names":[],"sources":["../../src/support/SupportAdminRoot.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useEffect } from 'react';\nimport { ErrorBoundary } from '@burdenoff/fe-libs/shared/components';\nimport { Ticket, BookOpen, BarChart3, Settings, Mail, Briefcase } from 'lucide-react';\nimport { SupportProvider } from './providers/SupportProvider';\nimport type { NavItem, SupportRootProps } from './types';\nimport { SupportAdminRoutes } from './SupportAdminRoutes';\nimport { joinPath } from './utils';\nimport { useRegisterFooter } from './hooks/useRegisterFooter';\nimport { useSupportStore } from './store/supportStore';\n\n/**\n * Admin-facing root component for the Support microfrontend.\n *\n * Renders admin support management routes (tickets with full controls,\n * contact inquiries, KB authoring, analytics, settings).\n *\n * Use this in admin-app where platform administrators manage support operations.\n *\n * Navigation registration is optional — admin-app uses shell-owned nav\n * (NavRegistration.tsx with contentMfeProps), so registerNavItems won't be provided.\n * Other shells that pass registerNavItems will get admin nav items registered.\n *\n * For user-facing support features, use SupportUserRoot instead.\n *\n * Note: This is a UI-layer route split, not a security boundary.\n * Access control is enforced at the API/server level.\n */\nexport const SupportAdminRoot: FC<SupportRootProps> = (props) => {\n const {\n registerNavItems,\n registerFooterItems,\n basePath = '/',\n currentUser,\n workspaceId,\n organizationId,\n productId,\n } = props;\n const resetForContextChange = useSupportStore((state) => state.resetForContextChange);\n\n useEffect(() => {\n resetForContextChange();\n }, [resetForContextChange, currentUser?.id, workspaceId, organizationId, productId]);\n\n // Register admin navigation items only if the shell provides registerNavItems.\n // admin-app uses contentMfeProps (no registerNavItems) so the shell's\n // NavRegistration.tsx owns the nav — this avoids duplicate entries.\n useEffect(() => {\n if (!registerNavItems) return;\n\n const navItems: NavItem[] = [\n {\n id: 'support-tickets',\n label: 'Tickets',\n path: joinPath(basePath, 'tickets'),\n icon: <Ticket size={20} />,\n order: 10,\n group: 'support',\n },\n {\n id: 'support-inquiries',\n label: 'Contact Inquiries',\n path: joinPath(basePath, 'inquiries'),\n icon: <Mail size={20} />,\n order: 15,\n group: 'support',\n },\n {\n id: 'support-applications',\n label: 'Job Applications',\n path: joinPath(basePath, 'applications'),\n icon: <Briefcase size={20} />,\n order: 16,\n group: 'support',\n },\n {\n id: 'support-kb',\n label: 'Knowledge Base',\n path: joinPath(basePath, 'kb'),\n icon: <BookOpen size={20} />,\n order: 20,\n group: 'support',\n },\n {\n id: 'support-analytics',\n label: 'Analytics',\n path: joinPath(basePath, 'analytics'),\n icon: <BarChart3 size={20} />,\n order: 40,\n group: 'support',\n },\n {\n id: 'support-settings',\n label: 'Settings',\n path: joinPath(basePath, 'settings'),\n icon: <Settings size={20} />,\n order: 50,\n group: 'support',\n },\n ];\n\n const cleanup = registerNavItems(navItems);\n return cleanup;\n }, [registerNavItems, basePath]);\n\n useRegisterFooter(registerFooterItems);\n\n return (\n <ErrorBoundary\n fallback={\n <div className=\"p-6 text-center text-text-secondary\">\n Something went wrong loading this module. Please refresh the page.\n </div>\n }\n >\n <SupportProvider {...props}>\n <SupportAdminRoutes />\n </SupportProvider>\n </ErrorBoundary>\n );\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SupportAdminRoot.js","names":[],"sources":["../../src/support/SupportAdminRoot.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useEffect } from 'react';\nimport { ErrorBoundary } from '@burdenoff/fe-libs/shared/components';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { Ticket, BookOpen, BarChart3, Settings, Mail, Briefcase } from 'lucide-react';\nimport { SupportProvider } from './providers/SupportProvider';\nimport type { NavItem, SupportRootProps } from './types';\nimport { SupportAdminRoutes } from './SupportAdminRoutes';\nimport { joinPath } from './utils';\nimport { useRegisterFooter } from './hooks/useRegisterFooter';\nimport { useSupportStore } from './store/supportStore';\n\n/**\n * Admin-facing root component for the Support microfrontend.\n *\n * Renders admin support management routes (tickets with full controls,\n * contact inquiries, KB authoring, analytics, settings).\n *\n * Use this in admin-app where platform administrators manage support operations.\n *\n * Navigation registration is optional — admin-app uses shell-owned nav\n * (NavRegistration.tsx with contentMfeProps), so registerNavItems won't be provided.\n * Other shells that pass registerNavItems will get admin nav items registered.\n *\n * For user-facing support features, use SupportUserRoot instead.\n *\n * Note: This is a UI-layer route split, not a security boundary.\n * Access control is enforced at the API/server level.\n */\nexport const SupportAdminRoot: FC<SupportRootProps> = (props) => {\n const {\n registerNavItems,\n registerFooterItems,\n basePath = '/',\n currentUser,\n workspaceId,\n organizationId,\n productId,\n } = props;\n const resetForContextChange = useSupportStore((state) => state.resetForContextChange);\n const { t } = useI18n();\n const tr = (key: string, fallback: string): string => {\n const translated = t(key);\n return translated === key ? fallback : translated;\n };\n\n useEffect(() => {\n resetForContextChange();\n }, [resetForContextChange, currentUser?.id, workspaceId, organizationId, productId]);\n\n // Register admin navigation items only if the shell provides registerNavItems.\n // admin-app uses contentMfeProps (no registerNavItems) so the shell's\n // NavRegistration.tsx owns the nav — this avoids duplicate entries.\n // `t` is in the deps so labels re-register when locale flips.\n useEffect(() => {\n if (!registerNavItems) return;\n\n const navItems: NavItem[] = [\n {\n id: 'support-tickets',\n label: tr('support.nav.tickets', 'Tickets'),\n path: joinPath(basePath, 'tickets'),\n icon: <Ticket size={20} />,\n order: 10,\n group: 'support',\n },\n {\n id: 'support-inquiries',\n label: tr('support.nav.contactInquiries', 'Contact Inquiries'),\n path: joinPath(basePath, 'inquiries'),\n icon: <Mail size={20} />,\n order: 15,\n group: 'support',\n },\n {\n id: 'support-applications',\n label: tr('support.nav.jobApplications', 'Job Applications'),\n path: joinPath(basePath, 'applications'),\n icon: <Briefcase size={20} />,\n order: 16,\n group: 'support',\n },\n {\n id: 'support-kb',\n label: tr('support.nav.knowledgeBase', 'Knowledge Base'),\n path: joinPath(basePath, 'kb'),\n icon: <BookOpen size={20} />,\n order: 20,\n group: 'support',\n },\n {\n id: 'support-analytics',\n label: tr('support.nav.analytics', 'Analytics'),\n path: joinPath(basePath, 'analytics'),\n icon: <BarChart3 size={20} />,\n order: 40,\n group: 'support',\n },\n {\n id: 'support-settings',\n label: tr('support.nav.settings', 'Settings'),\n path: joinPath(basePath, 'settings'),\n icon: <Settings size={20} />,\n order: 50,\n group: 'support',\n },\n ];\n\n const cleanup = registerNavItems(navItems);\n return cleanup;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [registerNavItems, basePath, t]);\n\n useRegisterFooter(registerFooterItems);\n\n return (\n <ErrorBoundary\n fallback={\n <div className=\"p-6 text-center text-text-secondary\">\n Something went wrong loading this module. Please refresh the page.\n </div>\n }\n >\n <SupportProvider {...props}>\n <SupportAdminRoutes />\n </SupportProvider>\n </ErrorBoundary>\n );\n};\n"],"mappings":";;;;;;;;;;;AA6BA,IAAa,KAA0C,MAAU;CAC/D,IAAM,EACJ,qBACA,wBACA,cAAW,KACX,gBACA,gBACA,mBACA,iBACE,GACE,IAAwB,GAAiB,MAAU,EAAM,sBAAsB,EAC/E,EAAE,SAAM,GAAS,EACjB,KAAM,GAAa,MAA6B;EACpD,IAAM,IAAa,EAAE,EAAI;AACzB,SAAO,MAAe,IAAM,IAAW;;AAwEzC,QArEA,QAAgB;AACd,KAAuB;IACtB;EAAC;EAAuB,GAAa;EAAI;EAAa;EAAgB;EAAU,CAAC,EAMpF,QAAgB;AACT,QAsDL,QADgB,EAnDY;GAC1B;IACE,IAAI;IACJ,OAAO,EAAG,uBAAuB,UAAU;IAC3C,MAAM,EAAS,GAAU,UAAU;IACnC,MAAM,kBAAC,GAAD,EAAQ,MAAM,IAAM,CAAA;IAC1B,OAAO;IACP,OAAO;IACR;GACD;IACE,IAAI;IACJ,OAAO,EAAG,gCAAgC,oBAAoB;IAC9D,MAAM,EAAS,GAAU,YAAY;IACrC,MAAM,kBAAC,GAAD,EAAM,MAAM,IAAM,CAAA;IACxB,OAAO;IACP,OAAO;IACR;GACD;IACE,IAAI;IACJ,OAAO,EAAG,+BAA+B,mBAAmB;IAC5D,MAAM,EAAS,GAAU,eAAe;IACxC,MAAM,kBAAC,GAAD,EAAW,MAAM,IAAM,CAAA;IAC7B,OAAO;IACP,OAAO;IACR;GACD;IACE,IAAI;IACJ,OAAO,EAAG,6BAA6B,iBAAiB;IACxD,MAAM,EAAS,GAAU,KAAK;IAC9B,MAAM,kBAAC,GAAD,EAAU,MAAM,IAAM,CAAA;IAC5B,OAAO;IACP,OAAO;IACR;GACD;IACE,IAAI;IACJ,OAAO,EAAG,yBAAyB,YAAY;IAC/C,MAAM,EAAS,GAAU,YAAY;IACrC,MAAM,kBAAC,GAAD,EAAW,MAAM,IAAM,CAAA;IAC7B,OAAO;IACP,OAAO;IACR;GACD;IACE,IAAI;IACJ,OAAO,EAAG,wBAAwB,WAAW;IAC7C,MAAM,EAAS,GAAU,WAAW;IACpC,MAAM,kBAAC,GAAD,EAAU,MAAM,IAAM,CAAA;IAC5B,OAAO;IACP,OAAO;IACR;GACF,CAEyC;IAGzC;EAAC;EAAkB;EAAU;EAAE,CAAC,EAEnC,EAAkB,EAAoB,EAGpC,kBAAC,GAAD;EACE,UACE,kBAAC,OAAD;GAAK,WAAU;aAAsC;GAE/C,CAAA;YAGR,kBAAC,GAAD;GAAiB,GAAI;aACnB,kBAAC,GAAD,EAAsB,CAAA;GACN,CAAA;EACJ,CAAA"}
|
|
@@ -5,47 +5,55 @@ import { SupportUserRoutes as r } from "./SupportUserRoutes.js";
|
|
|
5
5
|
import { useRegisterFooter as i } from "./hooks/useRegisterFooter.js";
|
|
6
6
|
import { useEffect as a } from "react";
|
|
7
7
|
import { ErrorBoundary as o } from "@burdenoff/fe-libs/shared/components";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { useI18n as s } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
9
|
+
import { BookOpen as c, Ticket as l } from "lucide-react";
|
|
10
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
10
11
|
//#region src/support/SupportUserRoot.tsx
|
|
11
|
-
var
|
|
12
|
-
let { registerNavItems:
|
|
12
|
+
var d = (d) => {
|
|
13
|
+
let { registerNavItems: f, registerFooterItems: p, basePath: m = "/", currentUser: h, workspaceId: g, organizationId: _, productId: v } = d, y = n((e) => e.resetForContextChange), { t: b } = s(), x = (e, t) => {
|
|
14
|
+
let n = b(e);
|
|
15
|
+
return n === e ? t : n;
|
|
16
|
+
};
|
|
13
17
|
return a(() => {
|
|
14
|
-
|
|
18
|
+
y();
|
|
15
19
|
}, [
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
h,
|
|
20
|
+
y,
|
|
21
|
+
h?.id,
|
|
19
22
|
g,
|
|
20
|
-
_
|
|
23
|
+
_,
|
|
24
|
+
v
|
|
21
25
|
]), a(() => {
|
|
22
|
-
if (
|
|
26
|
+
if (f) return f([{
|
|
23
27
|
id: "support-tickets",
|
|
24
|
-
label: "Tickets",
|
|
25
|
-
path: t(
|
|
26
|
-
icon: /* @__PURE__ */ l
|
|
28
|
+
label: x("support.nav.tickets", "Tickets"),
|
|
29
|
+
path: t(m, "tickets"),
|
|
30
|
+
icon: /* @__PURE__ */ u(l, { size: 20 }),
|
|
27
31
|
order: 10,
|
|
28
32
|
group: "support"
|
|
29
33
|
}, {
|
|
30
34
|
id: "support-kb",
|
|
31
|
-
label: "Knowledge Base",
|
|
32
|
-
path: t(
|
|
33
|
-
icon: /* @__PURE__ */
|
|
35
|
+
label: x("support.nav.knowledgeBase", "Knowledge Base"),
|
|
36
|
+
path: t(m, "kb"),
|
|
37
|
+
icon: /* @__PURE__ */ u(c, { size: 20 }),
|
|
34
38
|
order: 20,
|
|
35
39
|
group: "support"
|
|
36
40
|
}]);
|
|
37
|
-
}, [
|
|
38
|
-
|
|
41
|
+
}, [
|
|
42
|
+
f,
|
|
43
|
+
m,
|
|
44
|
+
b
|
|
45
|
+
]), i(p), /* @__PURE__ */ u(o, {
|
|
46
|
+
fallback: /* @__PURE__ */ u("div", {
|
|
39
47
|
className: "p-6 text-center text-text-secondary",
|
|
40
48
|
children: "Something went wrong loading this module. Please refresh the page."
|
|
41
49
|
}),
|
|
42
|
-
children: /* @__PURE__ */
|
|
43
|
-
...
|
|
44
|
-
children: /* @__PURE__ */
|
|
50
|
+
children: /* @__PURE__ */ u(e, {
|
|
51
|
+
...d,
|
|
52
|
+
children: /* @__PURE__ */ u(r, {})
|
|
45
53
|
})
|
|
46
54
|
});
|
|
47
55
|
};
|
|
48
56
|
//#endregion
|
|
49
|
-
export {
|
|
57
|
+
export { d as SupportUserRoot };
|
|
50
58
|
|
|
51
59
|
//# sourceMappingURL=SupportUserRoot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SupportUserRoot.js","names":[],"sources":["../../src/support/SupportUserRoot.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useEffect } from 'react';\nimport { ErrorBoundary } from '@burdenoff/fe-libs/shared/components';\nimport { Ticket, BookOpen } from 'lucide-react';\nimport { SupportProvider } from './providers/SupportProvider';\nimport type { NavItem, SupportRootProps } from './types';\nimport { SupportUserRoutes } from './SupportUserRoutes';\nimport { joinPath } from './utils';\nimport { useRegisterFooter } from './hooks/useRegisterFooter';\nimport { useSupportStore } from './store/supportStore';\n\n/**\n * User-facing root component for the Support microfrontend.\n *\n * Renders only user-relevant routes (tickets and KB browsing)\n * and registers user-only navigation items with the shell.\n *\n * Use this in product app shells (vibecontrols-app, bigconsole, etc.)\n * where end users interact with the support module.\n *\n * For admin-facing support features, use SupportAdminRoot instead.\n *\n * Note: This is a UI-layer route split, not a security boundary.\n * Access control is enforced at the API/server level.\n */\nexport const SupportUserRoot: FC<SupportRootProps> = (props) => {\n const {\n registerNavItems,\n registerFooterItems,\n basePath = '/',\n currentUser,\n workspaceId,\n organizationId,\n productId,\n } = props;\n const resetForContextChange = useSupportStore((state) => state.resetForContextChange);\n\n useEffect(() => {\n resetForContextChange();\n }, [resetForContextChange, currentUser?.id, workspaceId, organizationId, productId]);\n\n // Register user-only navigation items\n useEffect(() => {\n if (!registerNavItems) return;\n\n const navItems: NavItem[] = [\n {\n id: 'support-tickets',\n label: 'Tickets',\n path: joinPath(basePath, 'tickets'),\n icon: <Ticket size={20} />,\n order: 10,\n group: 'support',\n },\n {\n id: 'support-kb',\n label: 'Knowledge Base',\n path: joinPath(basePath, 'kb'),\n icon: <BookOpen size={20} />,\n order: 20,\n group: 'support',\n },\n ];\n\n const cleanup = registerNavItems(navItems);\n return cleanup;\n }, [registerNavItems, basePath]);\n\n useRegisterFooter(registerFooterItems);\n\n return (\n <ErrorBoundary\n fallback={\n <div className=\"p-6 text-center text-text-secondary\">\n Something went wrong loading this module. Please refresh the page.\n </div>\n }\n >\n <SupportProvider {...props}>\n <SupportUserRoutes />\n </SupportProvider>\n </ErrorBoundary>\n );\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SupportUserRoot.js","names":[],"sources":["../../src/support/SupportUserRoot.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useEffect } from 'react';\nimport { ErrorBoundary } from '@burdenoff/fe-libs/shared/components';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { Ticket, BookOpen } from 'lucide-react';\nimport { SupportProvider } from './providers/SupportProvider';\nimport type { NavItem, SupportRootProps } from './types';\nimport { SupportUserRoutes } from './SupportUserRoutes';\nimport { joinPath } from './utils';\nimport { useRegisterFooter } from './hooks/useRegisterFooter';\nimport { useSupportStore } from './store/supportStore';\n\n/**\n * User-facing root component for the Support microfrontend.\n *\n * Renders only user-relevant routes (tickets and KB browsing)\n * and registers user-only navigation items with the shell.\n *\n * Use this in product app shells (vibecontrols-app, bigconsole, etc.)\n * where end users interact with the support module.\n *\n * For admin-facing support features, use SupportAdminRoot instead.\n *\n * Note: This is a UI-layer route split, not a security boundary.\n * Access control is enforced at the API/server level.\n */\nexport const SupportUserRoot: FC<SupportRootProps> = (props) => {\n const {\n registerNavItems,\n registerFooterItems,\n basePath = '/',\n currentUser,\n workspaceId,\n organizationId,\n productId,\n } = props;\n const resetForContextChange = useSupportStore((state) => state.resetForContextChange);\n const { t } = useI18n();\n // Local tr helper: returns the translated value or `fallback` when the\n // key is missing (i18n returns the key itself on miss).\n const tr = (key: string, fallback: string): string => {\n const translated = t(key);\n return translated === key ? fallback : translated;\n };\n\n useEffect(() => {\n resetForContextChange();\n }, [resetForContextChange, currentUser?.id, workspaceId, organizationId, productId]);\n\n // Register user-only navigation items.\n // `t` is in the deps so labels re-register when locale changes — without\n // this, switching locale after mount leaves the old-language labels in the\n // shell's nav state.\n useEffect(() => {\n if (!registerNavItems) return;\n\n const navItems: NavItem[] = [\n {\n id: 'support-tickets',\n label: tr('support.nav.tickets', 'Tickets'),\n path: joinPath(basePath, 'tickets'),\n icon: <Ticket size={20} />,\n order: 10,\n group: 'support',\n },\n {\n id: 'support-kb',\n label: tr('support.nav.knowledgeBase', 'Knowledge Base'),\n path: joinPath(basePath, 'kb'),\n icon: <BookOpen size={20} />,\n order: 20,\n group: 'support',\n },\n ];\n\n const cleanup = registerNavItems(navItems);\n return cleanup;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [registerNavItems, basePath, t]);\n\n useRegisterFooter(registerFooterItems);\n\n return (\n <ErrorBoundary\n fallback={\n <div className=\"p-6 text-center text-text-secondary\">\n Something went wrong loading this module. Please refresh the page.\n </div>\n }\n >\n <SupportProvider {...props}>\n <SupportUserRoutes />\n </SupportProvider>\n </ErrorBoundary>\n );\n};\n"],"mappings":";;;;;;;;;;;AA0BA,IAAa,KAAyC,MAAU;CAC9D,IAAM,EACJ,qBACA,wBACA,cAAW,KACX,gBACA,gBACA,mBACA,iBACE,GACE,IAAwB,GAAiB,MAAU,EAAM,sBAAsB,EAC/E,EAAE,SAAM,GAAS,EAGjB,KAAM,GAAa,MAA6B;EACpD,IAAM,IAAa,EAAE,EAAI;AACzB,SAAO,MAAe,IAAM,IAAW;;AAwCzC,QArCA,QAAgB;AACd,KAAuB;IACtB;EAAC;EAAuB,GAAa;EAAI;EAAa;EAAgB;EAAU,CAAC,EAMpF,QAAgB;AACT,QAsBL,QADgB,EAnBY,CAC1B;GACE,IAAI;GACJ,OAAO,EAAG,uBAAuB,UAAU;GAC3C,MAAM,EAAS,GAAU,UAAU;GACnC,MAAM,kBAAC,GAAD,EAAQ,MAAM,IAAM,CAAA;GAC1B,OAAO;GACP,OAAO;GACR,EACD;GACE,IAAI;GACJ,OAAO,EAAG,6BAA6B,iBAAiB;GACxD,MAAM,EAAS,GAAU,KAAK;GAC9B,MAAM,kBAAC,GAAD,EAAU,MAAM,IAAM,CAAA;GAC5B,OAAO;GACP,OAAO;GACR,CACF,CAEyC;IAGzC;EAAC;EAAkB;EAAU;EAAE,CAAC,EAEnC,EAAkB,EAAoB,EAGpC,kBAAC,GAAD;EACE,UACE,kBAAC,OAAD;GAAK,WAAU;aAAsC;GAE/C,CAAA;YAGR,kBAAC,GAAD;GAAiB,GAAI;aACnB,kBAAC,GAAD,EAAqB,CAAA;GACL,CAAA;EACJ,CAAA"}
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import { useEffect as e } from "react";
|
|
2
|
+
import { useI18n as t } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
2
3
|
//#region src/support/hooks/useRegisterFooter.ts
|
|
3
|
-
function
|
|
4
|
+
function n(n) {
|
|
5
|
+
let { t: r } = t(), i = (e, t) => {
|
|
6
|
+
let n = r(e);
|
|
7
|
+
return n === e ? t : n;
|
|
8
|
+
};
|
|
4
9
|
e(() => {
|
|
5
|
-
if (
|
|
10
|
+
if (n) return n([{
|
|
6
11
|
id: "support-status",
|
|
7
|
-
label: "Support Ready",
|
|
12
|
+
label: i("support.footer.ready", "Support Ready"),
|
|
8
13
|
type: "status",
|
|
9
14
|
order: 10,
|
|
10
15
|
section: "left"
|
|
11
16
|
}]);
|
|
12
|
-
}, [
|
|
17
|
+
}, [n, r]);
|
|
13
18
|
}
|
|
14
19
|
//#endregion
|
|
15
|
-
export {
|
|
20
|
+
export { n as useRegisterFooter };
|
|
16
21
|
|
|
17
22
|
//# sourceMappingURL=useRegisterFooter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRegisterFooter.js","names":[],"sources":["../../../src/support/hooks/useRegisterFooter.ts"],"sourcesContent":["import { useEffect } from 'react';\nimport type { FooterItem } from '../types';\n\n/**\n * Shared hook for registering the support footer status indicator.\n * Used by SupportUserRoot, SupportAdminRoot, and SupportRoot.\n */\nexport function useRegisterFooter(\n registerFooterItems?: (items: FooterItem | FooterItem[]) => () => void\n) {\n useEffect(() => {\n if (!registerFooterItems) return;\n\n const footerItems = [\n {\n id: 'support-status',\n label: 'Support Ready',\n type: 'status' as const,\n order: 10,\n section: 'left' as const,\n },\n ];\n\n const cleanup = registerFooterItems(footerItems);\n return cleanup;\n }, [registerFooterItems]);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useRegisterFooter.js","names":[],"sources":["../../../src/support/hooks/useRegisterFooter.ts"],"sourcesContent":["import { useEffect } from 'react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport type { FooterItem } from '../types';\n\n/**\n * Shared hook for registering the support footer status indicator.\n * Used by SupportUserRoot, SupportAdminRoot, and SupportRoot.\n */\nexport function useRegisterFooter(\n registerFooterItems?: (items: FooterItem | FooterItem[]) => () => void\n) {\n const { t } = useI18n();\n const tr = (key: string, fallback: string): string => {\n const translated = t(key);\n return translated === key ? fallback : translated;\n };\n useEffect(() => {\n if (!registerFooterItems) return;\n\n const footerItems = [\n {\n id: 'support-status',\n label: tr('support.footer.ready', 'Support Ready'),\n type: 'status' as const,\n order: 10,\n section: 'left' as const,\n },\n ];\n\n const cleanup = registerFooterItems(footerItems);\n return cleanup;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [registerFooterItems, t]);\n}\n"],"mappings":";;;AAQA,SAAgB,EACd,GACA;CACA,IAAM,EAAE,SAAM,GAAS,EACjB,KAAM,GAAa,MAA6B;EACpD,IAAM,IAAa,EAAE,EAAI;AACzB,SAAO,MAAe,IAAM,IAAW;;AAEzC,SAAgB;AACT,QAaL,QADgB,EAVI,CAClB;GACE,IAAI;GACJ,OAAO,EAAG,wBAAwB,gBAAgB;GAClD,MAAM;GACN,OAAO;GACP,SAAS;GACV,CACF,CAE+C;IAG/C,CAAC,GAAqB,EAAE,CAAC"}
|