@burdenoff/microfe-support 2026.1109.1 → 2026.1115.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/generated/global-operations.d.ts +62 -0
- package/dist/generated/global-operations.js +104 -69
- package/dist/generated/global-operations.js.map +1 -1
- package/dist/generated/global-types.js +17 -15
- package/dist/generated/global-types.js.map +1 -1
- package/dist/support/SupportUserRoot.js +32 -28
- package/dist/support/SupportUserRoot.js.map +1 -1
- package/dist/support/SupportUserRoutes.d.ts +1 -0
- package/dist/support/SupportUserRoutes.js +31 -28
- package/dist/support/SupportUserRoutes.js.map +1 -1
- package/dist/support/components/PageLayout.js +35 -35
- package/dist/support/components/RouteHelpers.d.ts +2 -1
- package/dist/support/components/RouteHelpers.js +3 -3
- package/dist/support/components/RouteHelpers.js.map +1 -1
- package/dist/support/components/help/RelatedArticles.d.ts +12 -0
- package/dist/support/components/help/RelatedArticles.js +55 -0
- package/dist/support/components/help/RelatedArticles.js.map +1 -0
- package/dist/support/components/help/RequestDetailHeader.d.ts +18 -0
- package/dist/support/components/help/RequestDetailHeader.js +129 -0
- package/dist/support/components/help/RequestDetailHeader.js.map +1 -0
- package/dist/support/components/help/SatisfactionReview.d.ts +18 -0
- package/dist/support/components/help/SatisfactionReview.js +103 -0
- package/dist/support/components/help/SatisfactionReview.js.map +1 -0
- package/dist/support/components/help/StarRating.d.ts +16 -0
- package/dist/support/components/help/StarRating.js +63 -0
- package/dist/support/components/help/StarRating.js.map +1 -0
- package/dist/support/components/help/StatusGroupPill.d.ts +11 -0
- package/dist/support/components/help/StatusGroupPill.js +19 -0
- package/dist/support/components/help/StatusGroupPill.js.map +1 -0
- package/dist/support/components/settings/TicketCategoriesSettings.js +69 -69
- package/dist/support/components/settings/TicketCategoriesSettings.js.map +1 -1
- package/dist/support/components/tickets/MessageComposer.js +7 -7
- package/dist/support/components/tickets/MessageComposer.js.map +1 -1
- package/dist/support/components/tickets/TicketDetailHeader.js +54 -60
- package/dist/support/components/tickets/TicketDetailHeader.js.map +1 -1
- package/dist/support/components/ui.js +1 -1
- package/dist/support/constants.d.ts +23 -0
- package/dist/support/constants.js +2 -2
- package/dist/support/constants.js.map +1 -1
- package/dist/support/hooks/useDebouncedValue.d.ts +6 -0
- package/dist/support/hooks/useDebouncedValue.js +12 -0
- package/dist/support/hooks/useDebouncedValue.js.map +1 -0
- package/dist/support/hooks/useKnowledgeBaseOperations.d.ts +8 -1
- package/dist/support/hooks/useKnowledgeBaseOperations.js +86 -81
- package/dist/support/hooks/useKnowledgeBaseOperations.js.map +1 -1
- package/dist/support/hooks/useSupportVariant.d.ts +11 -0
- package/dist/support/hooks/useSupportVariant.js +11 -0
- package/dist/support/hooks/useSupportVariant.js.map +1 -0
- package/dist/support/hooks/useTicketCreatedToast.d.ts +16 -0
- package/dist/support/hooks/useTicketCreatedToast.js +25 -0
- package/dist/support/hooks/useTicketCreatedToast.js.map +1 -0
- package/dist/support/hooks/useTicketLabels.d.ts +22 -0
- package/dist/support/hooks/useTicketLabels.js +40 -0
- package/dist/support/hooks/useTicketLabels.js.map +1 -0
- package/dist/support/index.d.ts +1 -1
- package/dist/support/pages/ArticleDetailAdminPage.js +84 -84
- package/dist/support/pages/ArticleDetailAdminPage.js.map +1 -1
- package/dist/support/pages/ArticleDetailUserPage.d.ts +5 -0
- package/dist/support/pages/ArticleDetailUserPage.js +133 -69
- package/dist/support/pages/ArticleDetailUserPage.js.map +1 -1
- package/dist/support/pages/AskForHelpPage.d.ts +11 -0
- package/dist/support/pages/AskForHelpPage.js +396 -0
- package/dist/support/pages/AskForHelpPage.js.map +1 -0
- package/dist/support/pages/ContactInquiriesPage.js +73 -73
- package/dist/support/pages/ContactInquiryDetailPage.js +47 -47
- package/dist/support/pages/ContactInquiryDetailPage.js.map +1 -1
- package/dist/support/pages/CreateTicketPage.d.ts +4 -0
- package/dist/support/pages/CreateTicketPage.js +121 -117
- package/dist/support/pages/CreateTicketPage.js.map +1 -1
- package/dist/support/pages/HelpHubPage.d.ts +9 -0
- package/dist/support/pages/HelpHubPage.js +272 -0
- package/dist/support/pages/HelpHubPage.js.map +1 -0
- package/dist/support/pages/JobApplicationDetailPage.js +388 -388
- package/dist/support/pages/JobApplicationDetailPage.js.map +1 -1
- package/dist/support/pages/JobApplicationsPage.js +35 -35
- package/dist/support/pages/JobPostingDetailPage.js +236 -236
- package/dist/support/pages/JobPostingDetailPage.js.map +1 -1
- package/dist/support/pages/KnowledgeBaseUserPage.d.ts +6 -1
- package/dist/support/pages/KnowledgeBaseUserPage.js +188 -137
- package/dist/support/pages/KnowledgeBaseUserPage.js.map +1 -1
- package/dist/support/pages/MyRequestsPage.d.ts +16 -0
- package/dist/support/pages/MyRequestsPage.js +389 -0
- package/dist/support/pages/MyRequestsPage.js.map +1 -0
- package/dist/support/pages/TicketDetailUserPage.d.ts +5 -0
- package/dist/support/pages/TicketDetailUserPage.js +285 -192
- package/dist/support/pages/TicketDetailUserPage.js.map +1 -1
- package/dist/support/pages/TicketListPage.d.ts +7 -0
- package/dist/support/pages/TicketListPage.js +150 -153
- package/dist/support/pages/TicketListPage.js.map +1 -1
- package/dist/support/providers/SupportProvider.js +8 -7
- package/dist/support/providers/SupportProvider.js.map +1 -1
- package/dist/support/store/supportStore.d.ts +5 -0
- package/dist/support/store/supportStore.js +1 -0
- package/dist/support/store/supportStore.js.map +1 -1
- package/dist/support/translations/en.d.ts +279 -0
- package/dist/support/translations/en.js +270 -1
- package/dist/support/translations/en.js.map +1 -1
- package/dist/support/types/index.d.ts +13 -0
- package/dist/support/utils/cameFrom.d.ts +16 -0
- package/dist/support/utils/cameFrom.js +22 -0
- package/dist/support/utils/cameFrom.js.map +1 -0
- package/dist/support/utils/dates.d.ts +15 -0
- package/dist/support/utils/dates.js +35 -0
- package/dist/support/utils/dates.js.map +1 -0
- package/dist/support/utils/reopen.d.ts +27 -0
- package/dist/support/utils/reopen.js +27 -0
- package/dist/support/utils/reopen.js.map +1 -0
- package/dist/support/utils/requestTechnicalDetails.d.ts +13 -0
- package/dist/support/utils/requestTechnicalDetails.js +38 -0
- package/dist/support/utils/requestTechnicalDetails.js.map +1 -0
- package/dist/support/utils/ticketFilters.d.ts +16 -0
- package/dist/support/utils/ticketFilters.js +24 -12
- package/dist/support/utils/ticketFilters.js.map +1 -1
- package/dist/support/utils/ticketStatusGroups.d.ts +20 -0
- package/dist/support/utils/ticketStatusGroups.js +39 -0
- package/dist/support/utils/ticketStatusGroups.js.map +1 -0
- package/package.json +2 -2
|
@@ -6,52 +6,56 @@ import { useRegisterFooter as i } from "./hooks/useRegisterFooter.js";
|
|
|
6
6
|
import { useSupportStore as a } from "./store/supportStore.js";
|
|
7
7
|
import { useEffect as o } from "react";
|
|
8
8
|
import { ErrorBoundary as s } from "@burdenoff/fe-libs/shared/components";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { useHeadingDocumentTitle as c } from "@burdenoff/fe-libs/ui";
|
|
10
|
+
import { BookOpen as l, Ticket as u } from "lucide-react";
|
|
11
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
11
12
|
// src/support/SupportUserRoot.tsx
|
|
12
|
-
var
|
|
13
|
-
let { registerNavItems:
|
|
14
|
-
return
|
|
15
|
-
|
|
13
|
+
var f = (f) => {
|
|
14
|
+
let { registerNavItems: p, registerFooterItems: m, basePath: h = "/", currentUser: g, workspaceId: _, organizationId: v, productId: y, variant: b } = f, x = a((e) => e.resetForContextChange), S = e();
|
|
15
|
+
return c({
|
|
16
|
+
enabled: b === "fluidgrids",
|
|
17
|
+
suffix: "FluidGrids"
|
|
18
|
+
}), o(() => {
|
|
19
|
+
x();
|
|
16
20
|
}, [
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
g,
|
|
21
|
+
x,
|
|
22
|
+
g?.id,
|
|
20
23
|
_,
|
|
21
|
-
v
|
|
24
|
+
v,
|
|
25
|
+
y
|
|
22
26
|
]), o(() => {
|
|
23
|
-
if (!
|
|
27
|
+
if (!p) return;
|
|
24
28
|
let e = [{
|
|
25
29
|
id: "support-tickets",
|
|
26
|
-
label:
|
|
27
|
-
path: r(
|
|
28
|
-
icon: /* @__PURE__ */ u
|
|
30
|
+
label: S("support.nav.tickets", "Tickets"),
|
|
31
|
+
path: r(h, "tickets"),
|
|
32
|
+
icon: /* @__PURE__ */ d(u, { size: 20 }),
|
|
29
33
|
order: 10,
|
|
30
34
|
group: "support"
|
|
31
35
|
}, {
|
|
32
36
|
id: "support-kb",
|
|
33
|
-
label:
|
|
34
|
-
path: r(
|
|
35
|
-
icon: /* @__PURE__ */
|
|
37
|
+
label: S("support.nav.knowledgeBase", "Knowledge Base"),
|
|
38
|
+
path: r(h, "kb"),
|
|
39
|
+
icon: /* @__PURE__ */ d(l, { size: 20 }),
|
|
36
40
|
order: 20,
|
|
37
41
|
group: "support"
|
|
38
42
|
}];
|
|
39
|
-
return
|
|
43
|
+
return p(e);
|
|
40
44
|
}, [
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
]), i(
|
|
45
|
-
fallback: /* @__PURE__ */
|
|
45
|
+
p,
|
|
46
|
+
h,
|
|
47
|
+
S
|
|
48
|
+
]), i(m), /* @__PURE__ */ d(s, {
|
|
49
|
+
fallback: /* @__PURE__ */ d("div", {
|
|
46
50
|
className: "p-6 text-center text-text-secondary",
|
|
47
|
-
children:
|
|
51
|
+
children: S("support.root.errorFallback", "Something went wrong loading this module. Please refresh the page.")
|
|
48
52
|
}),
|
|
49
|
-
children: /* @__PURE__ */
|
|
50
|
-
...
|
|
51
|
-
children: /* @__PURE__ */
|
|
53
|
+
children: /* @__PURE__ */ d(t, {
|
|
54
|
+
...f,
|
|
55
|
+
children: /* @__PURE__ */ d(n, {})
|
|
52
56
|
})
|
|
53
57
|
});
|
|
54
58
|
};
|
|
55
|
-
export {
|
|
59
|
+
export { f as SupportUserRoot };
|
|
56
60
|
|
|
57
61
|
//# sourceMappingURL=SupportUserRoot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SupportUserRoot.js","names":["SupportUserRoot","props","resetForContextChange","useSupportStore","state","tr","useTr","useEffect","currentUser","workspaceId","organizationId","productId","registerNavItems","navItems","joinPath","basePath","Ticket","BookOpen","useRegisterFooter","registerFooterItems","ErrorBoundary","SupportProvider","SupportUserRoutes"],"sources":["../../src/support/SupportUserRoot.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useEffect } from 'react';\nimport { ErrorBoundary } from '@burdenoff/fe-libs/shared/components';\nimport { useTr } from './hooks/useTr';\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 tr = useTr();\n\n useEffect(() => {\n resetForContextChange();\n }, [resetForContextChange, currentUser?.id, workspaceId, organizationId, productId]);\n\n // Register user-only navigation items.\n // `tr` 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 }, [registerNavItems, basePath, tr]);\n\n useRegisterFooter(registerFooterItems);\n\n return (\n <ErrorBoundary\n fallback={\n <div className=\"p-6 text-center text-text-secondary\">\n {tr(\n 'support.root.errorFallback',\n 'Something went wrong loading this module. Please refresh the page.'\n )}\n </div>\n }\n >\n <SupportProvider {...props}>\n <SupportUserRoutes />\n </SupportProvider>\n </ErrorBoundary>\n );\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SupportUserRoot.js","names":["SupportUserRoot","props","resetForContextChange","useSupportStore","state","tr","useTr","useHeadingDocumentTitle","variant","useEffect","currentUser","workspaceId","organizationId","productId","registerNavItems","navItems","joinPath","basePath","Ticket","BookOpen","useRegisterFooter","registerFooterItems","ErrorBoundary","SupportProvider","SupportUserRoutes"],"sources":["../../src/support/SupportUserRoot.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useEffect } from 'react';\nimport { ErrorBoundary } from '@burdenoff/fe-libs/shared/components';\nimport { useHeadingDocumentTitle } from '@burdenoff/fe-libs/ui';\nimport { useTr } from './hooks/useTr';\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 variant,\n } = props;\n const resetForContextChange = useSupportStore((state) => state.resetForContextChange);\n const tr = useTr();\n\n // FluidGrids opt-in: each page's <h1> becomes the browser tab title\n // (\"Help articles · FluidGrids\"). Other apps keep their own titles.\n useHeadingDocumentTitle({ enabled: variant === 'fluidgrids', suffix: 'FluidGrids' });\n\n useEffect(() => {\n resetForContextChange();\n }, [resetForContextChange, currentUser?.id, workspaceId, organizationId, productId]);\n\n // Register user-only navigation items.\n // `tr` 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 }, [registerNavItems, basePath, tr]);\n\n useRegisterFooter(registerFooterItems);\n\n return (\n <ErrorBoundary\n fallback={\n <div className=\"p-6 text-center text-text-secondary\">\n {tr(\n 'support.root.errorFallback',\n 'Something went wrong loading this module. Please refresh the page.'\n )}\n </div>\n }\n >\n <SupportProvider {...props}>\n <SupportUserRoutes />\n </SupportProvider>\n </ErrorBoundary>\n );\n};\n"],"mappings":";;;;;;;;;;;;AA2BA,IAAaA,KAAyC,MAAU;CAC9D,IAAM,EACJ,qBACA,wBACA,cAAW,KACX,gBACA,gBACA,mBACA,cACA,eACEC,GACEC,IAAwBC,GAAiB,MAAUC,EAAM,qBAAqB,GAC9EC,IAAKC,EAAM;CA0CjB,OAtCAC,EAAwB;EAAE,SAASC,MAAY;EAAc,QAAQ;CAAa,CAAC,GAEnFC,QAAgB;EACd,EAAsB;CACxB,GAAG;EAACP;EAAuBQ,GAAa;EAAIC;EAAaC;EAAgBC;CAAS,CAAC,GAMnFJ,QAAgB;EACd,IAAI,CAACK,GAAkB;EAEvB,IAAMC,IAAsB,CAC1B;GACE,IAAI;GACJ,OAAOV,EAAG,uBAAuB,SAAS;GAC1C,MAAMW,EAASC,GAAU,SAAS;GAClC,MAAM,kBAACC,GAAD,EAAQ,MAAM,GAAK,CAAA;GACzB,OAAO;GACP,OAAO;EACT,GACA;GACE,IAAI;GACJ,OAAOb,EAAG,6BAA6B,gBAAgB;GACvD,MAAMW,EAASC,GAAU,IAAI;GAC7B,MAAM,kBAACE,GAAD,EAAU,MAAM,GAAK,CAAA;GAC3B,OAAO;GACP,OAAO;EACT,CACF;EAGA,OADgBL,EAAiBC,CAC1B;CACT,GAAG;EAACD;EAAkBG;EAAUZ;CAAE,CAAC,GAEnCe,EAAkBC,CAAmB,GAGnC,kBAACC,GAAD;EACE,UACE,kBAAC,OAAD;GAAK,WAAU;GACZ,UAAAjB,EACC,8BACA,oEACF;EACG,CAAA;EAGP,UAAA,kBAACkB,GAAD;GAAiB,GAAItB;GACnB,UAAA,kBAACuB,GAAD,CAAoB,CAAA;EACL,CAAA;CACJ,CAAA;AAEnB"}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Only includes routes relevant to end users:
|
|
5
5
|
* - Ticket management (list, create, view)
|
|
6
6
|
* - Knowledge base browsing (read-only, published articles)
|
|
7
|
+
* - With `variant="fluidgrids"`, a help hub at the index route
|
|
7
8
|
*
|
|
8
9
|
* Admin-only features (inquiries, analytics, settings, KB authoring)
|
|
9
10
|
* are excluded — see SupportAdminRoutes for those.
|
|
@@ -1,59 +1,62 @@
|
|
|
1
1
|
import { CatchAllRedirect as e, PageLoader as t } from "./components/RouteHelpers.js";
|
|
2
2
|
import { TicketListPage as n } from "./pages/TicketListPage.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { HelpHubPage as r } from "./pages/HelpHubPage.js";
|
|
4
|
+
import { useIsFluidgridsVariant as i } from "./hooks/useSupportVariant.js";
|
|
5
|
+
import { Suspense as a, lazy as o } from "react";
|
|
6
|
+
import { Navigate as s, Route as c, Routes as l, useLocation as u } from "react-router";
|
|
7
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
6
8
|
// src/support/SupportUserRoutes.tsx
|
|
7
|
-
var
|
|
8
|
-
function
|
|
9
|
-
let e =
|
|
10
|
-
return /* @__PURE__ */
|
|
9
|
+
var p = o(() => import("./pages/TicketDetailUserPage.js").then((e) => ({ default: e.TicketDetailUserPage }))), m = o(() => import("./pages/CreateTicketPage.js").then((e) => ({ default: e.CreateTicketPage }))), h = o(() => import("./pages/KnowledgeBaseUserPage.js").then((e) => ({ default: e.KnowledgeBaseUserPage }))), g = o(() => import("./pages/ArticleDetailUserPage.js").then((e) => ({ default: e.ArticleDetailUserPage })));
|
|
10
|
+
function _() {
|
|
11
|
+
let e = u(), t = e.pathname.replace("/knowledge-base", "/kb");
|
|
12
|
+
return /* @__PURE__ */ d(s, {
|
|
11
13
|
to: `${t}${e.search}${e.hash}`,
|
|
12
14
|
replace: !0
|
|
13
15
|
});
|
|
14
16
|
}
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
function v() {
|
|
18
|
+
let o = i();
|
|
19
|
+
return /* @__PURE__ */ d(a, {
|
|
20
|
+
fallback: /* @__PURE__ */ d(t, {}),
|
|
21
|
+
children: /* @__PURE__ */ f(l, { children: [
|
|
22
|
+
/* @__PURE__ */ d(c, {
|
|
20
23
|
index: !0,
|
|
21
|
-
element: /* @__PURE__ */
|
|
24
|
+
element: o ? /* @__PURE__ */ d(r, {}) : /* @__PURE__ */ d(s, {
|
|
22
25
|
to: "tickets",
|
|
23
26
|
replace: !0
|
|
24
27
|
})
|
|
25
28
|
}),
|
|
26
|
-
/* @__PURE__ */
|
|
29
|
+
/* @__PURE__ */ d(c, {
|
|
27
30
|
path: "tickets",
|
|
28
|
-
element: /* @__PURE__ */
|
|
31
|
+
element: /* @__PURE__ */ d(n, {})
|
|
29
32
|
}),
|
|
30
|
-
/* @__PURE__ */
|
|
33
|
+
/* @__PURE__ */ d(c, {
|
|
31
34
|
path: "tickets/new",
|
|
32
|
-
element: /* @__PURE__ */
|
|
35
|
+
element: /* @__PURE__ */ d(m, {})
|
|
33
36
|
}),
|
|
34
|
-
/* @__PURE__ */
|
|
37
|
+
/* @__PURE__ */ d(c, {
|
|
35
38
|
path: "tickets/:ticketId",
|
|
36
|
-
element: /* @__PURE__ */
|
|
39
|
+
element: /* @__PURE__ */ d(p, {})
|
|
37
40
|
}),
|
|
38
|
-
/* @__PURE__ */
|
|
41
|
+
/* @__PURE__ */ d(c, {
|
|
39
42
|
path: "kb",
|
|
40
|
-
element: /* @__PURE__ */
|
|
43
|
+
element: /* @__PURE__ */ d(h, {})
|
|
41
44
|
}),
|
|
42
|
-
/* @__PURE__ */
|
|
45
|
+
/* @__PURE__ */ d(c, {
|
|
43
46
|
path: "kb/articles/:slug",
|
|
44
|
-
element: /* @__PURE__ */
|
|
47
|
+
element: /* @__PURE__ */ d(g, {})
|
|
45
48
|
}),
|
|
46
|
-
/* @__PURE__ */
|
|
49
|
+
/* @__PURE__ */ d(c, {
|
|
47
50
|
path: "knowledge-base/*",
|
|
48
|
-
element: /* @__PURE__ */
|
|
51
|
+
element: /* @__PURE__ */ d(_, {})
|
|
49
52
|
}),
|
|
50
|
-
/* @__PURE__ */
|
|
53
|
+
/* @__PURE__ */ d(c, {
|
|
51
54
|
path: "*",
|
|
52
|
-
element: /* @__PURE__ */
|
|
55
|
+
element: /* @__PURE__ */ d(e, {})
|
|
53
56
|
})
|
|
54
57
|
] })
|
|
55
58
|
});
|
|
56
59
|
}
|
|
57
|
-
export {
|
|
60
|
+
export { v as SupportUserRoutes };
|
|
58
61
|
|
|
59
62
|
//# sourceMappingURL=SupportUserRoutes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SupportUserRoutes.js","names":["TicketDetailUserPage","lazy","m","CreateTicketPage","KnowledgeBaseUserPage","ArticleDetailUserPage","KnowledgeBaseAliasRedirect","location","useLocation","targetPath","Navigate","SupportUserRoutes","Suspense","PageLoader","Routes","Route","TicketListPage","CatchAllRedirect"],"sources":["../../src/support/SupportUserRoutes.tsx"],"sourcesContent":["import { lazy, Suspense } from 'react';\nimport { Routes, Route, Navigate, useLocation } from 'react-router';\nimport { PageLoader, CatchAllRedirect } from './components/RouteHelpers';\n\n// TicketListPage is eagerly imported — it's the default landing page after redirect,\n// so lazy-loading would cause a visible loading flash on every initial navigation.\nimport { TicketListPage } from './pages/TicketListPage';\n\n// Lazy loaded pages — user-specific variants for mixed pages\nconst TicketDetailUserPage = lazy(() =>\n import('./pages/TicketDetailUserPage').then((m) => ({ default: m.TicketDetailUserPage }))\n);\nconst CreateTicketPage = lazy(() =>\n import('./pages/CreateTicketPage').then((m) => ({ default: m.CreateTicketPage }))\n);\nconst KnowledgeBaseUserPage = lazy(() =>\n import('./pages/KnowledgeBaseUserPage').then((m) => ({ default: m.KnowledgeBaseUserPage }))\n);\nconst ArticleDetailUserPage = lazy(() =>\n import('./pages/ArticleDetailUserPage').then((m) => ({ default: m.ArticleDetailUserPage }))\n);\n\n// /knowledge-base/* deep links land here and immediately redirect to the canonical\n// /kb/* path so the URL stays consistent with the page-level navigation (which\n// hardcodes /kb paths). One wildcard route covers every sub-path so adding new\n// kb/* routes does not require maintaining a parallel knowledge-base/* mirror.\nfunction KnowledgeBaseAliasRedirect() {\n const location = useLocation();\n const targetPath = location.pathname.replace('/knowledge-base', '/kb');\n return <Navigate to={`${targetPath}${location.search}${location.hash}`} replace />;\n}\n\n/**\n * User-facing routes for the Support microfrontend.\n *\n * Only includes routes relevant to end users:\n * - Ticket management (list, create, view)\n * - Knowledge base browsing (read-only, published articles)\n *\n * Admin-only features (inquiries, analytics, settings, KB authoring)\n * are excluded — see SupportAdminRoutes for those.\n */\nexport function SupportUserRoutes() {\n return (\n <Suspense fallback={<PageLoader />}>\n <Routes>\n {/* Default redirect */}\n <Route index element={<Navigate to=\"tickets\" replace />} />\n\n {/* Tickets */}\n <Route path=\"tickets\" element={<TicketListPage />} />\n <Route path=\"tickets/new\" element={<CreateTicketPage />} />\n <Route path=\"tickets/:ticketId\" element={<TicketDetailUserPage />} />\n\n {/* Knowledge Base — canonical /kb paths */}\n <Route path=\"kb\" element={<KnowledgeBaseUserPage />} />\n <Route path=\"kb/articles/:slug\" element={<ArticleDetailUserPage />} />\n\n {/* /knowledge-base/* alias — redirects to the canonical /kb/* path */}\n <Route path=\"knowledge-base/*\" element={<KnowledgeBaseAliasRedirect />} />\n\n {/* Catch-all redirect */}\n <Route path=\"*\" element={<CatchAllRedirect />} />\n </Routes>\n </Suspense>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SupportUserRoutes.js","names":["TicketDetailUserPage","lazy","m","CreateTicketPage","KnowledgeBaseUserPage","ArticleDetailUserPage","KnowledgeBaseAliasRedirect","location","useLocation","targetPath","Navigate","SupportUserRoutes","isFluidgrids","useIsFluidgridsVariant","Suspense","PageLoader","Routes","Route","HelpHubPage","TicketListPage","CatchAllRedirect"],"sources":["../../src/support/SupportUserRoutes.tsx"],"sourcesContent":["import { lazy, Suspense } from 'react';\nimport { Routes, Route, Navigate, useLocation } from 'react-router';\nimport { PageLoader, CatchAllRedirect } from './components/RouteHelpers';\n\n// TicketListPage is eagerly imported — it's the default landing page after redirect,\n// so lazy-loading would cause a visible loading flash on every initial navigation.\nimport { TicketListPage } from './pages/TicketListPage';\n// The FluidGrids help hub is that variant's landing page, so it is eager too.\nimport { HelpHubPage } from './pages/HelpHubPage';\nimport { useIsFluidgridsVariant } from './hooks/useSupportVariant';\n\n// Lazy loaded pages — user-specific variants for mixed pages\nconst TicketDetailUserPage = lazy(() =>\n import('./pages/TicketDetailUserPage').then((m) => ({ default: m.TicketDetailUserPage }))\n);\nconst CreateTicketPage = lazy(() =>\n import('./pages/CreateTicketPage').then((m) => ({ default: m.CreateTicketPage }))\n);\nconst KnowledgeBaseUserPage = lazy(() =>\n import('./pages/KnowledgeBaseUserPage').then((m) => ({ default: m.KnowledgeBaseUserPage }))\n);\nconst ArticleDetailUserPage = lazy(() =>\n import('./pages/ArticleDetailUserPage').then((m) => ({ default: m.ArticleDetailUserPage }))\n);\n\n// /knowledge-base/* deep links land here and immediately redirect to the canonical\n// /kb/* path so the URL stays consistent with the page-level navigation (which\n// hardcodes /kb paths). One wildcard route covers every sub-path so adding new\n// kb/* routes does not require maintaining a parallel knowledge-base/* mirror.\nfunction KnowledgeBaseAliasRedirect() {\n const location = useLocation();\n const targetPath = location.pathname.replace('/knowledge-base', '/kb');\n return <Navigate to={`${targetPath}${location.search}${location.hash}`} replace />;\n}\n\n/**\n * User-facing routes for the Support microfrontend.\n *\n * Only includes routes relevant to end users:\n * - Ticket management (list, create, view)\n * - Knowledge base browsing (read-only, published articles)\n * - With `variant=\"fluidgrids\"`, a help hub at the index route\n *\n * Admin-only features (inquiries, analytics, settings, KB authoring)\n * are excluded — see SupportAdminRoutes for those.\n */\nexport function SupportUserRoutes() {\n const isFluidgrids = useIsFluidgridsVariant();\n return (\n <Suspense fallback={<PageLoader />}>\n <Routes>\n {/* Default: the FluidGrids help hub, otherwise a redirect to the ticket list */}\n <Route index element={isFluidgrids ? <HelpHubPage /> : <Navigate to=\"tickets\" replace />} />\n\n {/* Tickets */}\n <Route path=\"tickets\" element={<TicketListPage />} />\n <Route path=\"tickets/new\" element={<CreateTicketPage />} />\n <Route path=\"tickets/:ticketId\" element={<TicketDetailUserPage />} />\n\n {/* Knowledge Base — canonical /kb paths */}\n <Route path=\"kb\" element={<KnowledgeBaseUserPage />} />\n <Route path=\"kb/articles/:slug\" element={<ArticleDetailUserPage />} />\n\n {/* /knowledge-base/* alias — redirects to the canonical /kb/* path */}\n <Route path=\"knowledge-base/*\" element={<KnowledgeBaseAliasRedirect />} />\n\n {/* Catch-all redirect */}\n <Route path=\"*\" element={<CatchAllRedirect />} />\n </Routes>\n </Suspense>\n );\n}\n"],"mappings":";;;;;;;;AAYA,IAAMA,IAAuBC,QAC3B,OAAO,kCAA+B,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,qBAAqB,EAAE,CAC1F,GACMC,IAAmBF,QACvB,OAAO,8BAA2B,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,iBAAiB,EAAE,CAClF,GACME,IAAwBH,QAC5B,OAAO,mCAAgC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,sBAAsB,EAAE,CAC5F,GACMG,IAAwBJ,QAC5B,OAAO,mCAAgC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,sBAAsB,EAAE,CAC5F;AAMA,SAASI,IAA6B;CACpC,IAAMC,IAAWC,EAAY,GACvBC,IAAaF,EAAS,SAAS,QAAQ,mBAAmB,KAAK;CACrE,OAAO,kBAACG,GAAD;EAAU,IAAI,GAAGD,IAAaF,EAAS,SAASA,EAAS;EAAQ,SAAA;CAAS,CAAA;AACnF;AAaA,SAAgBI,IAAoB;CAClC,IAAMC,IAAeC,EAAuB;CAC5C,OACE,kBAACC,GAAD;EAAU,UAAU,kBAACC,GAAD,CAAa,CAAA;EAC/B,UAAA,kBAACC,GAAD,EAAA,UAAA;GAEE,kBAACC,GAAD;IAAO,OAAA;IAAM,SAASL,IAAe,kBAACM,GAAD,CAAc,CAAA,IAAI,kBAACR,GAAD;KAAU,IAAG;KAAU,SAAA;IAAS,CAAA;GAAI,CAAA;GAG3F,kBAACO,GAAD;IAAO,MAAK;IAAU,SAAS,kBAACE,GAAD,CAAiB,CAAA;GAAI,CAAA;GACpD,kBAACF,GAAD;IAAO,MAAK;IAAc,SAAS,kBAACd,GAAD,CAAmB,CAAA;GAAI,CAAA;GAC1D,kBAACc,GAAD;IAAO,MAAK;IAAoB,SAAS,kBAACjB,GAAD,CAAuB,CAAA;GAAI,CAAA;GAGpE,kBAACiB,GAAD;IAAO,MAAK;IAAK,SAAS,kBAACb,GAAD,CAAwB,CAAA;GAAI,CAAA;GACtD,kBAACa,GAAD;IAAO,MAAK;IAAoB,SAAS,kBAACZ,GAAD,CAAwB,CAAA;GAAI,CAAA;GAGrE,kBAACY,GAAD;IAAO,MAAK;IAAmB,SAAS,kBAACX,GAAD,CAA6B,CAAA;GAAI,CAAA;GAGzE,kBAACW,GAAD;IAAO,MAAK;IAAI,SAAS,kBAACG,GAAD,CAAmB,CAAA;GAAI,CAAA;EAC1C,EAAA,CAAA;CACA,CAAA;AAEd"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn as e } from "../utils/cn.js";
|
|
2
2
|
import { useTr as t } from "../hooks/useTr.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { AuroraBackground as n, GradientText as r, IllustratedEmptyState as i } from "@burdenoff/fe-libs/ui";
|
|
4
|
+
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
5
5
|
// src/support/components/PageLayout.tsx
|
|
6
6
|
var c = {
|
|
7
7
|
sm: "max-w-screen-sm",
|
|
@@ -12,70 +12,70 @@ var c = {
|
|
|
12
12
|
"3xl": "max-w-[1600px]",
|
|
13
13
|
full: "max-w-full"
|
|
14
14
|
};
|
|
15
|
-
function l({ children: t, title:
|
|
16
|
-
let y = v &&
|
|
17
|
-
return /* @__PURE__ */
|
|
15
|
+
function l({ children: t, title: i, subtitle: l, icon: u, headerActions: d, headerContent: f, maxWidth: p = "xl", showHeader: m = !0, className: h, contentClassName: g, aurora: _ = !1, titleAccent: v }) {
|
|
16
|
+
let y = v && i && i.endsWith(v) ? i.slice(0, i.length - v.length) : null;
|
|
17
|
+
return /* @__PURE__ */ o("div", {
|
|
18
18
|
className: e("min-size-full", "px-4 sm:px-6 lg:px-8 xl:px-12", "py-6 sm:py-8 lg:py-10", "animate-in fade-in-0 slide-in-from-bottom-4 duration-200", h),
|
|
19
|
-
children: /* @__PURE__ */
|
|
19
|
+
children: /* @__PURE__ */ s("div", {
|
|
20
20
|
className: e("mx-auto w-full", c[p], g),
|
|
21
|
-
children: [m && (
|
|
21
|
+
children: [m && (i || d) && /* @__PURE__ */ s("header", {
|
|
22
22
|
className: e("mb-6 sm:mb-8", _ && "relative overflow-hidden rounded-2xl border border-border-seam bg-bg-surface/40 p-4 sm:p-6 backdrop-blur-[var(--blur-glass)]"),
|
|
23
23
|
children: [
|
|
24
|
-
_ && /* @__PURE__ */
|
|
25
|
-
/* @__PURE__ */
|
|
24
|
+
_ && /* @__PURE__ */ o(n, { intensity: "subtle" }),
|
|
25
|
+
/* @__PURE__ */ s("div", {
|
|
26
26
|
className: "flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",
|
|
27
|
-
children: [/* @__PURE__ */
|
|
27
|
+
children: [/* @__PURE__ */ s("div", {
|
|
28
28
|
className: "space-y-1",
|
|
29
|
-
children: [(
|
|
29
|
+
children: [(i || u) && /* @__PURE__ */ s("div", {
|
|
30
30
|
className: "flex items-center gap-3",
|
|
31
|
-
children: [u && /* @__PURE__ */
|
|
31
|
+
children: [u && /* @__PURE__ */ o("div", {
|
|
32
32
|
className: "flex-shrink-0 p-2.5 rounded-xl bg-action-primary-bg/10 text-primary",
|
|
33
33
|
children: u
|
|
34
|
-
}),
|
|
34
|
+
}), i && /* @__PURE__ */ o("h1", {
|
|
35
35
|
className: "text-2xl sm:text-3xl font-bold tracking-tight text-text-primary",
|
|
36
|
-
children: y === null ?
|
|
36
|
+
children: y === null ? i : /* @__PURE__ */ s(a, { children: [y, /* @__PURE__ */ o(r, { children: v })] })
|
|
37
37
|
})]
|
|
38
|
-
}), l && /* @__PURE__ */
|
|
38
|
+
}), l && /* @__PURE__ */ o("p", {
|
|
39
39
|
className: "text-sm sm:text-base text-text-secondary max-w-2xl",
|
|
40
40
|
children: l
|
|
41
41
|
})]
|
|
42
|
-
}), d && /* @__PURE__ */
|
|
42
|
+
}), d && /* @__PURE__ */ o("div", {
|
|
43
43
|
className: "flex items-center gap-2 flex-shrink-0",
|
|
44
44
|
children: d
|
|
45
45
|
})]
|
|
46
46
|
}),
|
|
47
|
-
f && /* @__PURE__ */
|
|
47
|
+
f && /* @__PURE__ */ o("div", {
|
|
48
48
|
className: "mt-4",
|
|
49
49
|
children: f
|
|
50
50
|
})
|
|
51
51
|
]
|
|
52
|
-
}), /* @__PURE__ */
|
|
52
|
+
}), /* @__PURE__ */ o("div", {
|
|
53
53
|
className: "space-y-6",
|
|
54
54
|
children: t
|
|
55
55
|
})]
|
|
56
56
|
})
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
|
-
function u({ icon: t, illustration: n, illustrationAlt:
|
|
60
|
-
return n ? /* @__PURE__ */
|
|
59
|
+
function u({ icon: t, illustration: n, illustrationAlt: r, title: a, description: c, action: l, className: u }) {
|
|
60
|
+
return n ? /* @__PURE__ */ o(i, {
|
|
61
61
|
illustration: n,
|
|
62
|
-
alt:
|
|
63
|
-
title:
|
|
62
|
+
alt: r,
|
|
63
|
+
title: a,
|
|
64
64
|
description: c,
|
|
65
65
|
action: l,
|
|
66
66
|
className: e("animate-in fade-in-0 zoom-in-95 duration-200", u)
|
|
67
|
-
}) : /* @__PURE__ */
|
|
67
|
+
}) : /* @__PURE__ */ s("div", {
|
|
68
68
|
className: e("flex flex-col items-center justify-center", "py-12 sm:py-16 px-4", "text-center", "animate-in fade-in-0 zoom-in-95 duration-200", u),
|
|
69
69
|
children: [
|
|
70
|
-
t && /* @__PURE__ */
|
|
70
|
+
t && /* @__PURE__ */ o("div", {
|
|
71
71
|
className: "mb-4 p-4 rounded-2xl bg-bg-sunken/50 text-text-secondary",
|
|
72
72
|
children: t
|
|
73
73
|
}),
|
|
74
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ o("h3", {
|
|
75
75
|
className: "text-lg font-semibold text-text-primary mb-1",
|
|
76
|
-
children:
|
|
76
|
+
children: a
|
|
77
77
|
}),
|
|
78
|
-
c && /* @__PURE__ */
|
|
78
|
+
c && /* @__PURE__ */ o("p", {
|
|
79
79
|
className: "text-sm text-text-secondary max-w-sm mb-4",
|
|
80
80
|
children: c
|
|
81
81
|
}),
|
|
@@ -83,16 +83,16 @@ function u({ icon: t, illustration: n, illustrationAlt: a, title: o, description
|
|
|
83
83
|
]
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
|
-
function d({ message: n, className:
|
|
87
|
-
let
|
|
88
|
-
return /* @__PURE__ */
|
|
89
|
-
className: e("flex flex-col items-center justify-center py-20",
|
|
90
|
-
children: [/* @__PURE__ */
|
|
86
|
+
function d({ message: n, className: r }) {
|
|
87
|
+
let i = t();
|
|
88
|
+
return /* @__PURE__ */ s("div", {
|
|
89
|
+
className: e("flex flex-col items-center justify-center py-20", r),
|
|
90
|
+
children: [/* @__PURE__ */ s("div", {
|
|
91
91
|
className: "relative",
|
|
92
|
-
children: [/* @__PURE__ */
|
|
93
|
-
}), /* @__PURE__ */
|
|
92
|
+
children: [/* @__PURE__ */ o("div", { className: "absolute inset-0 bg-action-primary-bg/20 rounded-full blur-xl animate-pulse" }), /* @__PURE__ */ o("div", { className: "relative size-12 border-4 border-primary/30 border-t-primary rounded-full animate-spin" })]
|
|
93
|
+
}), /* @__PURE__ */ o("span", {
|
|
94
94
|
className: "mt-6 text-sm font-medium text-text-secondary",
|
|
95
|
-
children: n ??
|
|
95
|
+
children: n ?? i("support.loading.default", "Loading...")
|
|
96
96
|
})]
|
|
97
97
|
});
|
|
98
98
|
}
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export declare function PageLoader(): import('react').JSX.Element;
|
|
5
5
|
/**
|
|
6
|
-
* Catch-all redirect that sends unknown paths to the tickets page
|
|
6
|
+
* Catch-all redirect that sends unknown paths to the tickets page, or to the
|
|
7
|
+
* help hub for the FluidGrids variant (its landing page).
|
|
7
8
|
* Uses basePath from SupportProvider context and joinPath to avoid double-slashes.
|
|
8
9
|
*/
|
|
9
10
|
export declare function CatchAllRedirect(): null;
|
|
@@ -11,10 +11,10 @@ function a() {
|
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
13
|
function o() {
|
|
14
|
-
let { basePath: i = "/" } = e(),
|
|
14
|
+
let { basePath: i = "/", variant: a } = e(), o = r(), s = a === "fluidgrids" ? t(i, "").replace(/(.)\/$/, "$1") : t(i, "tickets");
|
|
15
15
|
return n(() => {
|
|
16
|
-
|
|
17
|
-
}, [
|
|
16
|
+
o(s, { replace: !0 });
|
|
17
|
+
}, [s, o]), null;
|
|
18
18
|
}
|
|
19
19
|
export { o as CatchAllRedirect, a as PageLoader };
|
|
20
20
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RouteHelpers.js","names":["PageLoader","CatchAllRedirect","useSupport","navigate","useNavigate","
|
|
1
|
+
{"version":3,"file":"RouteHelpers.js","names":["PageLoader","CatchAllRedirect","useSupport","navigate","useNavigate","target","variant","joinPath","basePath","useEffect"],"sources":["../../../src/support/components/RouteHelpers.tsx"],"sourcesContent":["import { useEffect } from 'react';\nimport { useNavigate } from 'react-router';\nimport { useSupport } from '../providers/SupportProvider';\nimport { joinPath } from '../utils';\n\n/**\n * Shared loading fallback for lazy-loaded route pages.\n */\nexport function PageLoader() {\n return (\n <div className=\"flex h-64 items-center justify-center\">\n <div className=\"size-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n </div>\n );\n}\n\n/**\n * Catch-all redirect that sends unknown paths to the tickets page, or to the\n * help hub for the FluidGrids variant (its landing page).\n * Uses basePath from SupportProvider context and joinPath to avoid double-slashes.\n */\nexport function CatchAllRedirect() {\n const { basePath = '/', variant } = useSupport();\n const navigate = useNavigate();\n // joinPath(base, '') keeps a trailing slash; drop it unless it is the root.\n const target =\n variant === 'fluidgrids'\n ? joinPath(basePath, '').replace(/(.)\\/$/, '$1')\n : joinPath(basePath, 'tickets');\n useEffect(() => {\n navigate(target, { replace: true });\n }, [target, navigate]);\n return null;\n}\n"],"mappings":";;;;;;AAQA,SAAgBA,IAAa;CAC3B,OACE,kBAAC,OAAD;EAAK,WAAU;EACb,UAAA,kBAAC,OAAD,EAAK,WAAU,gFAAiF,CAAA;CAC7F,CAAA;AAET;AAOA,SAAgBC,IAAmB;CACjC,IAAM,EAAE,cAAW,KAAK,eAAYC,EAAW,GACzCC,IAAWC,EAAY,GAEvBC,IACJC,MAAY,eACRC,EAASC,GAAU,EAAE,CAAC,CAAC,QAAQ,UAAU,IAAI,IAC7CD,EAASC,GAAU,SAAS;CAIlC,OAHAC,QAAgB;EACd,EAASJ,GAAQ,EAAE,SAAS,GAAK,CAAC;CACpC,GAAG,CAACA,GAAQF,CAAQ,CAAC,GACd;AACT"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface RelatedArticlesProps {
|
|
2
|
+
categoryId: string;
|
|
3
|
+
currentArticleId: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Published articles from the same category, minus the one being read
|
|
7
|
+
* (BOFF-11844, SUP-ART-12). Renders nothing while loading, on error or when
|
|
8
|
+
* the category has no other articles, so it never pushes an empty box onto
|
|
9
|
+
* the page.
|
|
10
|
+
*/
|
|
11
|
+
export declare function RelatedArticles({ categoryId, currentArticleId }: RelatedArticlesProps): import('react').JSX.Element | null;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { useGetArticlesQuery as e } from "../../../generated/global-operations.js";
|
|
2
|
+
import { ArticleStatus as t } from "../../../generated/global-types.js";
|
|
3
|
+
import { useTr as n } from "../../hooks/useTr.js";
|
|
4
|
+
import { useSupport as r } from "../../providers/SupportProvider.js";
|
|
5
|
+
import { joinPath as i } from "../../utils/index.js";
|
|
6
|
+
import { useId as a } from "react";
|
|
7
|
+
import { BookOpen as o, ChevronRight as s } from "lucide-react";
|
|
8
|
+
import { Link as c } from "react-router";
|
|
9
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
10
|
+
// src/support/components/help/RelatedArticles.tsx
|
|
11
|
+
var d = 4;
|
|
12
|
+
function f({ categoryId: f, currentArticleId: p }) {
|
|
13
|
+
let m = n(), h = a(), { basePath: g = "" } = r(), { data: _ } = e({ variables: {
|
|
14
|
+
filter: {
|
|
15
|
+
categoryId: f,
|
|
16
|
+
status: t.Published
|
|
17
|
+
},
|
|
18
|
+
limit: 5,
|
|
19
|
+
offset: 0
|
|
20
|
+
} }), v = (_?.knowledgeBaseArticles?.nodes ?? []).filter((e) => e.id !== p).slice(0, d);
|
|
21
|
+
return v.length === 0 ? null : /* @__PURE__ */ u("section", {
|
|
22
|
+
"aria-labelledby": h,
|
|
23
|
+
className: "mx-auto max-w-4xl",
|
|
24
|
+
children: [/* @__PURE__ */ l("h2", {
|
|
25
|
+
id: h,
|
|
26
|
+
className: "mb-3 text-xs font-semibold uppercase tracking-wider text-text-secondary",
|
|
27
|
+
children: m("support.helpArticle.related.title", "Related articles")
|
|
28
|
+
}), /* @__PURE__ */ l("ul", {
|
|
29
|
+
className: "divide-y divide-border-subtle overflow-hidden rounded-xl border border-border-seam bg-bg-surface",
|
|
30
|
+
children: v.map((e) => /* @__PURE__ */ l("li", { children: /* @__PURE__ */ u(c, {
|
|
31
|
+
to: i(g, `kb/articles/${encodeURIComponent(e.slug)}`),
|
|
32
|
+
className: "flex min-h-14 items-center gap-3 px-4 py-3 transition-colors hover:bg-bg-sunken focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary",
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ l("span", {
|
|
35
|
+
"aria-hidden": "true",
|
|
36
|
+
className: "flex size-9 shrink-0 items-center justify-center rounded-lg bg-bg-sunken text-text-secondary",
|
|
37
|
+
children: /* @__PURE__ */ l(o, { size: 18 })
|
|
38
|
+
}),
|
|
39
|
+
/* @__PURE__ */ l("span", {
|
|
40
|
+
className: "min-w-0 flex-1 truncate font-medium text-text-primary",
|
|
41
|
+
children: e.title
|
|
42
|
+
}),
|
|
43
|
+
/* @__PURE__ */ l(s, {
|
|
44
|
+
size: 18,
|
|
45
|
+
"aria-hidden": "true",
|
|
46
|
+
className: "shrink-0 text-text-secondary"
|
|
47
|
+
})
|
|
48
|
+
]
|
|
49
|
+
}) }, e.id))
|
|
50
|
+
})]
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
export { f as RelatedArticles };
|
|
54
|
+
|
|
55
|
+
//# sourceMappingURL=RelatedArticles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RelatedArticles.js","names":["Link","Link$1","RELATED_ARTICLE_LIMIT","RelatedArticles","tr","useTr","headingId","useId","useSupport","useGetArticlesQuery","ArticleStatus","related","data","article","currentArticleId","joinPath","basePath","BookOpen","ChevronRight"],"sources":["../../../../src/support/components/help/RelatedArticles.tsx"],"sourcesContent":["import { useId } from 'react';\nimport { Link } from 'react-router';\nimport { BookOpen, ChevronRight } from 'lucide-react';\nimport { useGetArticlesQuery } from '../../../generated/global-operations';\nimport { ArticleStatus, type KnowledgeBaseArticle } from '../../../generated/global-types';\nimport { useTr } from '../../hooks/useTr';\nimport { useSupport } from '../../providers/SupportProvider';\nimport { joinPath } from '../../utils';\n\n/** Most related articles shown under an article. */\nconst RELATED_ARTICLE_LIMIT = 4;\n\ntype RelatedArticle = Pick<KnowledgeBaseArticle, 'id' | 'slug' | 'title'>;\n\ninterface RelatedArticlesProps {\n categoryId: string;\n currentArticleId: string;\n}\n\n/**\n * Published articles from the same category, minus the one being read\n * (BOFF-11844, SUP-ART-12). Renders nothing while loading, on error or when\n * the category has no other articles, so it never pushes an empty box onto\n * the page.\n */\nexport function RelatedArticles({ categoryId, currentArticleId }: RelatedArticlesProps) {\n const tr = useTr();\n const headingId = useId();\n const { basePath = '' } = useSupport();\n // One extra row so the list is still full after the current article is\n // dropped from it.\n const { data } = useGetArticlesQuery({\n variables: {\n filter: { categoryId, status: ArticleStatus.Published },\n limit: RELATED_ARTICLE_LIMIT + 1,\n offset: 0,\n },\n });\n const related: RelatedArticle[] = (data?.knowledgeBaseArticles?.nodes ?? [])\n .filter((article: RelatedArticle) => article.id !== currentArticleId)\n .slice(0, RELATED_ARTICLE_LIMIT);\n\n if (related.length === 0) return null;\n\n return (\n <section aria-labelledby={headingId} className=\"mx-auto max-w-4xl\">\n <h2\n id={headingId}\n className=\"mb-3 text-xs font-semibold uppercase tracking-wider text-text-secondary\"\n >\n {tr('support.helpArticle.related.title', 'Related articles')}\n </h2>\n <ul className=\"divide-y divide-border-subtle overflow-hidden rounded-xl border border-border-seam bg-bg-surface\">\n {related.map((article) => (\n <li key={article.id}>\n <Link\n to={joinPath(basePath, `kb/articles/${encodeURIComponent(article.slug)}`)}\n className=\"flex min-h-14 items-center gap-3 px-4 py-3 transition-colors hover:bg-bg-sunken focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary\"\n >\n <span\n aria-hidden=\"true\"\n className=\"flex size-9 shrink-0 items-center justify-center rounded-lg bg-bg-sunken text-text-secondary\"\n >\n <BookOpen size={18} />\n </span>\n <span className=\"min-w-0 flex-1 truncate font-medium text-text-primary\">\n {article.title}\n </span>\n <ChevronRight size={18} aria-hidden=\"true\" className=\"shrink-0 text-text-secondary\" />\n </Link>\n </li>\n ))}\n </ul>\n </section>\n );\n}\n"],"mappings":";;;;;;;;;;AAUA,IAAME,IAAwB;AAe9B,SAAgBC,EAAgB,EAAE,eAAY,uBAA0C;CACtF,IAAMC,IAAKC,EAAM,GACXC,IAAYC,EAAM,GAClB,EAAE,cAAW,OAAOC,EAAW,GAG/B,EAAE,YAASC,EAAoB,EACnC,WAAW;EACT,QAAQ;GAAE;GAAY,QAAQC,EAAc;EAAU;EACtD,OAAO;EACP,QAAQ;CACV,EACF,CAAC,GACKC,KAA6BC,GAAM,uBAAuB,SAAS,CAAC,EAAA,CACvE,QAAQ,MAA4BC,EAAQ,OAAOC,CAAgB,CAAC,CACpE,MAAM,GAAGZ,CAAqB;CAIjC,OAFIS,EAAQ,WAAW,IAAU,OAG/B,kBAAC,WAAD;EAAS,mBAAiBL;EAAW,WAAU;EAA/C,UAAA,CACE,kBAAC,MAAD;GACE,IAAIA;GACJ,WAAU;GAET,UAAAF,EAAG,qCAAqC,kBAAkB;EACzD,CAAA,GACJ,kBAAC,MAAD;GAAI,WAAU;GACX,UAAAO,EAAQ,KAAK,MACZ,kBAAC,MAAD,EAAA,UACE,kBAACX,GAAD;IACE,IAAIe,EAASC,GAAU,eAAe,mBAAmBH,EAAQ,IAAI,GAAG;IACxE,WAAU;IAFZ,UAAA;KAIE,kBAAC,QAAD;MACE,eAAY;MACZ,WAAU;MAEV,UAAA,kBAACI,GAAD,EAAU,MAAM,GAAK,CAAA;KACjB,CAAA;KACN,kBAAC,QAAD;MAAM,WAAU;MACb,UAAAJ,EAAQ;KACL,CAAA;KACN,kBAACK,GAAD;MAAc,MAAM;MAAI,eAAY;MAAO,WAAU;KAAgC,CAAA;IACjF;GACJ,CAAA,EAAA,GAhBKL,EAAQ,EAgBb,CACL;EACC,CAAA,CACG;;AAEb"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SupportTicket } from '../../../generated/global-types';
|
|
2
|
+
interface RequestDetailHeaderProps {
|
|
3
|
+
ticket: SupportTicket;
|
|
4
|
+
onBack: () => void;
|
|
5
|
+
onReopenTicket: () => Promise<void>;
|
|
6
|
+
onAskForHelp: () => void;
|
|
7
|
+
actionsDisabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Customer-facing request header for the FluidGrids variant (BOFF-11844).
|
|
11
|
+
*
|
|
12
|
+
* Keeps what the customer needs (status, category, created and updated dates,
|
|
13
|
+
* their rating, Reopen and the reopen-limit notice). Priority, the reopen
|
|
14
|
+
* counter and other agent-side fields live in the page's "Show technical
|
|
15
|
+
* details" block instead.
|
|
16
|
+
*/
|
|
17
|
+
export declare function RequestDetailHeader({ ticket, onBack, onReopenTicket, onAskForHelp, actionsDisabled, }: RequestDetailHeaderProps): import('react').JSX.Element;
|
|
18
|
+
export {};
|