@burdenoff/microfe-assethandler 2026.820.2 → 2026.820.4
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/assethandler/components/AssetTag.d.ts +20 -0
- package/dist/assethandler/components/AssetTag.d.ts.map +1 -0
- package/dist/assethandler/components/AssetTag.js +8 -0
- package/dist/assethandler/components/AssetTag.js.map +1 -0
- package/dist/assethandler/components/index.d.ts +2 -0
- package/dist/assethandler/components/index.d.ts.map +1 -1
- package/dist/assethandler/components/index.js +1 -0
- package/dist/assethandler/pages/AssetsAssetCheckInOutPage.d.ts.map +1 -1
- package/dist/assethandler/pages/AssetsAssetCheckInOutPage.js +344 -181
- package/dist/assethandler/pages/AssetsAssetCheckInOutPage.js.map +1 -1
- package/dist/assethandler/pages/AssetsAssetDetailPage.d.ts.map +1 -1
- package/dist/assethandler/pages/AssetsAssetDetailPage.js +338 -325
- package/dist/assethandler/pages/AssetsAssetDetailPage.js.map +1 -1
- package/dist/assethandler/pages/AssetsAssetListPage.d.ts.map +1 -1
- package/dist/assethandler/pages/AssetsAssetListPage.js +177 -163
- package/dist/assethandler/pages/AssetsAssetListPage.js.map +1 -1
- package/dist/assethandler/pages/KnowledgeBasePage.d.ts.map +1 -1
- package/dist/assethandler/pages/KnowledgeBasePage.js +394 -287
- package/dist/assethandler/pages/KnowledgeBasePage.js.map +1 -1
- package/dist/assethandler/providers/AssetHandlerProvider.d.ts.map +1 -1
- package/dist/assethandler/providers/AssetHandlerProvider.js +1 -0
- package/dist/assethandler/providers/AssetHandlerProvider.js.map +1 -1
- package/dist/assethandler/store/assethandlerStore.d.ts +2 -0
- package/dist/assethandler/store/assethandlerStore.d.ts.map +1 -1
- package/dist/assethandler/store/assethandlerStore.js +1 -0
- package/dist/assethandler/store/assethandlerStore.js.map +1 -1
- package/dist/assethandler/utils/knowledgeBase.d.ts +17 -0
- package/dist/assethandler/utils/knowledgeBase.d.ts.map +1 -0
- package/dist/assethandler/utils/knowledgeBase.js +17 -0
- package/dist/assethandler/utils/knowledgeBase.js.map +1 -0
- package/dist/assethandler/utils/printAssetTag.d.ts +24 -0
- package/dist/assethandler/utils/printAssetTag.d.ts.map +1 -0
- package/dist/assethandler/utils/printAssetTag.js +124 -0
- package/dist/assethandler/utils/printAssetTag.js.map +1 -0
- package/dist/node_modules/dijkstrajs/dijkstra.js +61 -0
- package/dist/node_modules/dijkstrajs/dijkstra.js.map +1 -0
- package/dist/node_modules/qrcode/lib/browser.js +40 -0
- package/dist/node_modules/qrcode/lib/browser.js.map +1 -0
- package/dist/node_modules/qrcode/lib/can-promise.js +12 -0
- package/dist/node_modules/qrcode/lib/can-promise.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/alignment-pattern.js +21 -0
- package/dist/node_modules/qrcode/lib/core/alignment-pattern.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/alphanumeric-data.js +28 -0
- package/dist/node_modules/qrcode/lib/core/alphanumeric-data.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/bit-buffer.js +28 -0
- package/dist/node_modules/qrcode/lib/core/bit-buffer.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/bit-matrix.js +23 -0
- package/dist/node_modules/qrcode/lib/core/bit-matrix.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/byte-data.js +23 -0
- package/dist/node_modules/qrcode/lib/core/byte-data.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/error-correction-code.js +350 -0
- package/dist/node_modules/qrcode/lib/core/error-correction-code.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/error-correction-level.js +34 -0
- package/dist/node_modules/qrcode/lib/core/error-correction-level.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/finder-pattern.js +19 -0
- package/dist/node_modules/qrcode/lib/core/finder-pattern.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/format-info.js +16 -0
- package/dist/node_modules/qrcode/lib/core/format-info.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/galois-field.js +22 -0
- package/dist/node_modules/qrcode/lib/core/galois-field.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/kanji-data.js +31 -0
- package/dist/node_modules/qrcode/lib/core/kanji-data.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/mask-pattern.js +84 -0
- package/dist/node_modules/qrcode/lib/core/mask-pattern.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/mode.js +74 -0
- package/dist/node_modules/qrcode/lib/core/mode.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/numeric-data.js +26 -0
- package/dist/node_modules/qrcode/lib/core/numeric-data.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/polynomial.js +30 -0
- package/dist/node_modules/qrcode/lib/core/polynomial.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/qrcode.js +117 -0
- package/dist/node_modules/qrcode/lib/core/qrcode.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/reed-solomon-encoder.js +27 -0
- package/dist/node_modules/qrcode/lib/core/reed-solomon-encoder.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/regex.js +21 -0
- package/dist/node_modules/qrcode/lib/core/regex.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/segments.js +144 -0
- package/dist/node_modules/qrcode/lib/core/segments.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/utils.js +70 -0
- package/dist/node_modules/qrcode/lib/core/utils.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/version-check.js +12 -0
- package/dist/node_modules/qrcode/lib/core/version-check.js.map +1 -0
- package/dist/node_modules/qrcode/lib/core/version.js +60 -0
- package/dist/node_modules/qrcode/lib/core/version.js.map +1 -0
- package/dist/node_modules/qrcode/lib/renderer/canvas.js +32 -0
- package/dist/node_modules/qrcode/lib/renderer/canvas.js.map +1 -0
- package/dist/node_modules/qrcode/lib/renderer/svg-tag.js +31 -0
- package/dist/node_modules/qrcode/lib/renderer/svg-tag.js.map +1 -0
- package/dist/node_modules/qrcode/lib/renderer/utils.js +55 -0
- package/dist/node_modules/qrcode/lib/renderer/utils.js.map +1 -0
- package/package.json +3 -1
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
1
|
+
import { useAssetHandlerStore as e } from "../store/assethandlerStore.js";
|
|
2
|
+
import { seriesColor as t } from "../components/charts/chartTheme.js";
|
|
3
|
+
import { useAssetHandlerNavigate as n } from "../hooks/useAssetHandlerNavigate.js";
|
|
4
|
+
import { cn as r } from "../utils/cn.js";
|
|
5
|
+
import { notify as i } from "../utils/toast.js";
|
|
6
|
+
import { BarsChart as a } from "../components/charts/BarsChart.js";
|
|
7
|
+
import { DonutChart as o } from "../components/charts/DonutChart.js";
|
|
8
|
+
import { Pagination as s, usePagination as c } from "../components/Pagination.js";
|
|
9
|
+
import { ChartCard as l } from "../components/ChartCard.js";
|
|
10
|
+
import { SectionHeader as u } from "../components/SectionHeader.js";
|
|
10
11
|
import "../components/index.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
12
|
+
import { formatAssetOption as d, formatIncidentOption as f, parseTagsInput as ee } from "../utils/knowledgeBase.js";
|
|
13
|
+
import { useMemo as p, useState as m } from "react";
|
|
14
|
+
import { BookOpen as h, ExternalLink as g, Eye as _, Link2 as v, Pencil as y, Plus as b, Search as x, User as S, X as C } from "lucide-react";
|
|
15
|
+
import { gql as w } from "@apollo/client";
|
|
16
|
+
import { useMutation as T, useQuery as E } from "@apollo/client/react";
|
|
17
|
+
import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
|
|
18
|
+
import { Button as A, GlassCard as j, IllustratedEmptyState as M, Input as N, Label as P, PagePurpose as F, ResponsiveDialog as I, ResponsiveDialogContent as L, ResponsiveDialogDescription as R, ResponsiveDialogFooter as te, ResponsiveDialogHeader as z, ResponsiveDialogTitle as B, Select as V, SelectContent as H, SelectItem as U, SelectTrigger as W, SelectValue as G, Textarea as K } from "@burdenoff/fe-libs/ui";
|
|
17
19
|
//#region src/assethandler/pages/KnowledgeBasePage.tsx
|
|
18
|
-
var
|
|
20
|
+
var ne = w`
|
|
19
21
|
query AssetHandlerKnowledgeArticles {
|
|
20
22
|
knowledgeArticles {
|
|
21
23
|
id
|
|
@@ -35,18 +37,25 @@ var H = y`
|
|
|
35
37
|
relatedIncidentId
|
|
36
38
|
}
|
|
37
39
|
}
|
|
38
|
-
`,
|
|
40
|
+
`, q = w`
|
|
39
41
|
mutation AssetHandlerCreateKnowledgeArticle($input: CreateKnowledgeArticleInput!) {
|
|
40
42
|
createKnowledgeArticle(input: $input) {
|
|
41
43
|
id
|
|
42
44
|
title
|
|
43
45
|
}
|
|
44
46
|
}
|
|
45
|
-
`,
|
|
47
|
+
`, J = w`
|
|
48
|
+
mutation AssetHandlerUpdateKnowledgeArticle($id: ID!, $input: UpdateKnowledgeArticleInput!) {
|
|
49
|
+
updateKnowledgeArticle(id: $id, input: $input) {
|
|
50
|
+
id
|
|
51
|
+
title
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
`, re = [
|
|
46
55
|
"DRAFT",
|
|
47
56
|
"PUBLISHED",
|
|
48
57
|
"ARCHIVED"
|
|
49
|
-
],
|
|
58
|
+
], Y = {
|
|
50
59
|
PUBLISHED: {
|
|
51
60
|
label: "Published",
|
|
52
61
|
className: "bg-status-success-bg-subtle text-status-success-text"
|
|
@@ -59,193 +68,285 @@ var H = y`
|
|
|
59
68
|
label: "Archived",
|
|
60
69
|
className: "bg-status-warning-bg-subtle text-status-warning-text"
|
|
61
70
|
}
|
|
62
|
-
},
|
|
71
|
+
}, X = (e) => e.toLowerCase().trim().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, ""), Z = (e) => e ? new Date(e).toLocaleDateString(void 0, {
|
|
63
72
|
year: "numeric",
|
|
64
73
|
month: "short",
|
|
65
74
|
day: "numeric"
|
|
66
75
|
}) : "—";
|
|
67
|
-
function
|
|
76
|
+
function ie(e) {
|
|
68
77
|
if (e.summary && e.summary.trim()) return e.summary.trim();
|
|
69
78
|
let t = e.content.replace(/\s+/g, " ").trim();
|
|
70
79
|
return t.length > 160 ? `${t.slice(0, 160)}…` : t;
|
|
71
80
|
}
|
|
72
|
-
function
|
|
81
|
+
function Q(e) {
|
|
73
82
|
return (e.replace(/[^a-zA-Z0-9]/g, "").slice(0, 2) || "?").toUpperCase();
|
|
74
83
|
}
|
|
75
|
-
function
|
|
76
|
-
let t =
|
|
84
|
+
function $({ status: e }) {
|
|
85
|
+
let t = Y[e] ?? {
|
|
77
86
|
label: e,
|
|
78
87
|
className: "bg-bg-sunken text-text-secondary"
|
|
79
88
|
};
|
|
80
|
-
return /* @__PURE__ */
|
|
81
|
-
className:
|
|
89
|
+
return /* @__PURE__ */ O("span", {
|
|
90
|
+
className: r("inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium", t.className),
|
|
82
91
|
children: t.label
|
|
83
92
|
});
|
|
84
93
|
}
|
|
85
|
-
function
|
|
86
|
-
|
|
87
|
-
a(""), s(""), l(!1), f(""), m(""), g(""), v("PUBLISHED");
|
|
88
|
-
}, [x, { loading: S }] = b(U, {
|
|
89
|
-
onCompleted: (e) => {
|
|
90
|
-
r.success("Article published", `${e.createKnowledgeArticle.title} is now available.`), y(), t(!1), n();
|
|
91
|
-
},
|
|
92
|
-
onError: (e) => r.error("Could not publish article", e.message)
|
|
93
|
-
}), E = (e) => {
|
|
94
|
-
a(e), c || s(K(e));
|
|
95
|
-
};
|
|
96
|
-
return /* @__PURE__ */ C(A, {
|
|
94
|
+
function ae({ open: e, onOpenChange: t, article: n, onSaved: r }) {
|
|
95
|
+
return /* @__PURE__ */ O(I, {
|
|
97
96
|
open: e,
|
|
98
97
|
onOpenChange: t,
|
|
99
|
-
children: /* @__PURE__ */
|
|
98
|
+
children: /* @__PURE__ */ O(L, {
|
|
100
99
|
className: "max-h-[85vh] overflow-y-auto sm:max-w-2xl",
|
|
100
|
+
children: e && /* @__PURE__ */ O(oe, {
|
|
101
|
+
article: n,
|
|
102
|
+
onOpenChange: t,
|
|
103
|
+
onSaved: r
|
|
104
|
+
}, n?.id ?? "new")
|
|
105
|
+
})
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
function oe({ article: t, onOpenChange: n, onSaved: r }) {
|
|
109
|
+
let a = !!t, { assets: o, incidents: s } = e(), [c, l] = m(t?.title ?? ""), [u, h] = m(t?.slug ?? ""), [g, _] = m(a), [v, y] = m(t?.summary ?? ""), [b, x] = m(t?.content ?? ""), [S, w] = m(t ? t.tags.join(", ") : ""), [E, j] = m(t?.status ?? "PUBLISHED"), [M, F] = m(t?.relatedAssetId ?? ""), [I, L] = m(t?.relatedIncidentId ?? ""), ne = () => {
|
|
110
|
+
l(""), h(""), _(!1), y(""), x(""), w(""), j("PUBLISHED"), F(""), L("");
|
|
111
|
+
}, [Y, { loading: Z }] = T(q, {
|
|
112
|
+
onCompleted: (e) => {
|
|
113
|
+
i.success("Article published", `${e.createKnowledgeArticle.title} is now available.`), ne(), n(!1), r();
|
|
114
|
+
},
|
|
115
|
+
onError: (e) => i.error("Could not publish article", e.message)
|
|
116
|
+
}), [ie, { loading: Q }] = T(J, {
|
|
117
|
+
refetchQueries: ["AssetHandlerKnowledgeArticles"],
|
|
118
|
+
onCompleted: (e) => {
|
|
119
|
+
i.success("Article updated", `${e.updateKnowledgeArticle.title} has been saved.`), n(!1), r();
|
|
120
|
+
},
|
|
121
|
+
onError: (e) => i.error("Could not update article", e.message)
|
|
122
|
+
}), $ = p(() => o.find((e) => e.id === M), [o, M]), ae = p(() => s.find((e) => e.id === I), [s, I]), oe = (e) => {
|
|
123
|
+
l(e), g || h(X(e));
|
|
124
|
+
};
|
|
125
|
+
return /* @__PURE__ */ k(D, { children: [
|
|
126
|
+
/* @__PURE__ */ k(z, { children: [/* @__PURE__ */ O(B, { children: a ? "Edit article" : "New Article" }), /* @__PURE__ */ O(R, { children: a ? "Update the runbook or fix so the team has the latest guidance." : "Capture a runbook or fix so your team can find it later." })] }),
|
|
127
|
+
/* @__PURE__ */ k("div", {
|
|
128
|
+
className: "space-y-4",
|
|
101
129
|
children: [
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
/* @__PURE__ */
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
})]
|
|
122
|
-
})]
|
|
123
|
-
}),
|
|
124
|
-
/* @__PURE__ */ w("div", {
|
|
125
|
-
className: "space-y-2",
|
|
126
|
-
children: [/* @__PURE__ */ C(k, { children: "Summary" }), /* @__PURE__ */ C(O, {
|
|
127
|
-
placeholder: "One-line description",
|
|
128
|
-
value: u,
|
|
129
|
-
onChange: (e) => f(e.target.value)
|
|
130
|
-
})]
|
|
131
|
-
}),
|
|
132
|
-
/* @__PURE__ */ w("div", {
|
|
133
|
-
className: "space-y-2",
|
|
134
|
-
children: [/* @__PURE__ */ C(k, { children: "Body *" }), /* @__PURE__ */ C(V, {
|
|
135
|
-
placeholder: "Write the full article body — steps, context, links…",
|
|
136
|
-
value: p,
|
|
137
|
-
onChange: (e) => m(e.target.value),
|
|
138
|
-
rows: 8
|
|
139
|
-
})]
|
|
140
|
-
}),
|
|
141
|
-
/* @__PURE__ */ w("div", {
|
|
142
|
-
className: "grid gap-4 md:grid-cols-2",
|
|
143
|
-
children: [/* @__PURE__ */ w("div", {
|
|
144
|
-
className: "space-y-2",
|
|
145
|
-
children: [/* @__PURE__ */ C(k, { children: "Category tags" }), /* @__PURE__ */ C(O, {
|
|
146
|
-
placeholder: "Runbooks, Fixes, Procedures…",
|
|
147
|
-
value: h,
|
|
148
|
-
onChange: (e) => g(e.target.value)
|
|
149
|
-
})]
|
|
150
|
-
}), /* @__PURE__ */ w("div", {
|
|
151
|
-
className: "space-y-2",
|
|
152
|
-
children: [/* @__PURE__ */ C(k, { children: "Status" }), /* @__PURE__ */ w(I, {
|
|
153
|
-
value: _,
|
|
154
|
-
onValueChange: (e) => v(e),
|
|
155
|
-
children: [/* @__PURE__ */ C(z, { children: /* @__PURE__ */ C(B, {}) }), /* @__PURE__ */ C(L, { children: W.map((e) => /* @__PURE__ */ C(R, {
|
|
156
|
-
value: e,
|
|
157
|
-
children: e
|
|
158
|
-
}, e)) })]
|
|
159
|
-
})]
|
|
160
|
-
})]
|
|
161
|
-
})
|
|
162
|
-
]
|
|
130
|
+
/* @__PURE__ */ k("div", {
|
|
131
|
+
className: "grid gap-4 md:grid-cols-2",
|
|
132
|
+
children: [/* @__PURE__ */ k("div", {
|
|
133
|
+
className: "space-y-2",
|
|
134
|
+
children: [/* @__PURE__ */ O(P, { children: "Title *" }), /* @__PURE__ */ O(N, {
|
|
135
|
+
value: c,
|
|
136
|
+
onChange: (e) => oe(e.target.value)
|
|
137
|
+
})]
|
|
138
|
+
}), /* @__PURE__ */ k("div", {
|
|
139
|
+
className: "space-y-2",
|
|
140
|
+
children: [/* @__PURE__ */ O(P, { children: "Slug *" }), /* @__PURE__ */ O(N, {
|
|
141
|
+
value: u,
|
|
142
|
+
disabled: a,
|
|
143
|
+
onChange: (e) => {
|
|
144
|
+
_(!0), h(e.target.value);
|
|
145
|
+
}
|
|
146
|
+
})]
|
|
147
|
+
})]
|
|
163
148
|
}),
|
|
164
|
-
/* @__PURE__ */
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
149
|
+
/* @__PURE__ */ k("div", {
|
|
150
|
+
className: "space-y-2",
|
|
151
|
+
children: [/* @__PURE__ */ O(P, { children: "Summary" }), /* @__PURE__ */ O(N, {
|
|
152
|
+
placeholder: "One-line description",
|
|
153
|
+
value: v,
|
|
154
|
+
onChange: (e) => y(e.target.value)
|
|
155
|
+
})]
|
|
156
|
+
}),
|
|
157
|
+
/* @__PURE__ */ k("div", {
|
|
158
|
+
className: "space-y-2",
|
|
159
|
+
children: [/* @__PURE__ */ O(P, { children: "Body *" }), /* @__PURE__ */ O(K, {
|
|
160
|
+
placeholder: "Write the full article body — steps, context, links…",
|
|
161
|
+
value: b,
|
|
162
|
+
onChange: (e) => x(e.target.value),
|
|
163
|
+
rows: 8
|
|
164
|
+
})]
|
|
165
|
+
}),
|
|
166
|
+
/* @__PURE__ */ k("div", {
|
|
167
|
+
className: "grid gap-4 md:grid-cols-2",
|
|
168
|
+
children: [/* @__PURE__ */ k("div", {
|
|
169
|
+
className: "space-y-2",
|
|
170
|
+
children: [/* @__PURE__ */ O(P, { children: "Category tags" }), /* @__PURE__ */ O(N, {
|
|
171
|
+
placeholder: "Runbooks, Fixes, Procedures…",
|
|
172
|
+
value: S,
|
|
173
|
+
onChange: (e) => w(e.target.value)
|
|
174
|
+
})]
|
|
175
|
+
}), /* @__PURE__ */ k("div", {
|
|
176
|
+
className: "space-y-2",
|
|
177
|
+
children: [/* @__PURE__ */ O(P, { children: "Status" }), /* @__PURE__ */ k(V, {
|
|
178
|
+
value: E,
|
|
179
|
+
onValueChange: j,
|
|
180
|
+
children: [/* @__PURE__ */ O(W, { children: /* @__PURE__ */ O(G, {}) }), /* @__PURE__ */ O(H, { children: re.map((e) => /* @__PURE__ */ O(U, {
|
|
181
|
+
value: e,
|
|
182
|
+
children: e
|
|
183
|
+
}, e)) })]
|
|
184
|
+
})]
|
|
185
|
+
})]
|
|
186
|
+
}),
|
|
187
|
+
/* @__PURE__ */ k("div", {
|
|
188
|
+
className: "grid gap-4 md:grid-cols-2",
|
|
189
|
+
children: [/* @__PURE__ */ k("div", {
|
|
190
|
+
className: "space-y-2",
|
|
191
|
+
children: [
|
|
192
|
+
/* @__PURE__ */ O(P, { children: "Related asset" }),
|
|
193
|
+
/* @__PURE__ */ k(V, {
|
|
194
|
+
value: M,
|
|
195
|
+
onValueChange: F,
|
|
196
|
+
children: [/* @__PURE__ */ O(W, { children: /* @__PURE__ */ O(G, { placeholder: "Select an asset" }) }), /* @__PURE__ */ k(H, { children: [/* @__PURE__ */ O(U, {
|
|
197
|
+
value: "",
|
|
198
|
+
children: "None"
|
|
199
|
+
}), o.map((e) => /* @__PURE__ */ O(U, {
|
|
200
|
+
value: e.id,
|
|
201
|
+
children: d(e)
|
|
202
|
+
}, e.id))] })]
|
|
203
|
+
}),
|
|
204
|
+
$ ? /* @__PURE__ */ O("div", {
|
|
205
|
+
className: "flex flex-wrap gap-2",
|
|
206
|
+
children: /* @__PURE__ */ k("span", {
|
|
207
|
+
className: "inline-flex items-center gap-1 rounded-full bg-action-primary-bg/10 px-2 py-0.5 text-xs font-medium text-primary",
|
|
208
|
+
children: [d($), /* @__PURE__ */ O("button", {
|
|
209
|
+
type: "button",
|
|
210
|
+
onClick: () => F(""),
|
|
211
|
+
className: "rounded-full p-0.5 hover:bg-action-primary-bg/20",
|
|
212
|
+
"aria-label": "Clear related asset",
|
|
213
|
+
children: /* @__PURE__ */ O(C, { className: "h-3 w-3" })
|
|
214
|
+
})]
|
|
215
|
+
})
|
|
216
|
+
}) : null
|
|
217
|
+
]
|
|
218
|
+
}), /* @__PURE__ */ k("div", {
|
|
219
|
+
className: "space-y-2",
|
|
220
|
+
children: [
|
|
221
|
+
/* @__PURE__ */ O(P, { children: "Related incident" }),
|
|
222
|
+
/* @__PURE__ */ k(V, {
|
|
223
|
+
value: I,
|
|
224
|
+
onValueChange: L,
|
|
225
|
+
children: [/* @__PURE__ */ O(W, { children: /* @__PURE__ */ O(G, { placeholder: "Select an incident" }) }), /* @__PURE__ */ k(H, { children: [/* @__PURE__ */ O(U, {
|
|
226
|
+
value: "",
|
|
227
|
+
children: "None"
|
|
228
|
+
}), s.map((e) => /* @__PURE__ */ O(U, {
|
|
229
|
+
value: e.id,
|
|
230
|
+
children: f(e)
|
|
231
|
+
}, e.id))] })]
|
|
232
|
+
}),
|
|
233
|
+
ae ? /* @__PURE__ */ O("div", {
|
|
234
|
+
className: "flex flex-wrap gap-2",
|
|
235
|
+
children: /* @__PURE__ */ k("span", {
|
|
236
|
+
className: "inline-flex items-center gap-1 rounded-full bg-action-primary-bg/10 px-2 py-0.5 text-xs font-medium text-primary",
|
|
237
|
+
children: [f(ae), /* @__PURE__ */ O("button", {
|
|
238
|
+
type: "button",
|
|
239
|
+
onClick: () => L(""),
|
|
240
|
+
className: "rounded-full p-0.5 hover:bg-action-primary-bg/20",
|
|
241
|
+
"aria-label": "Clear related incident",
|
|
242
|
+
children: /* @__PURE__ */ O(C, { className: "h-3 w-3" })
|
|
243
|
+
})]
|
|
244
|
+
})
|
|
245
|
+
}) : null
|
|
246
|
+
]
|
|
247
|
+
})]
|
|
248
|
+
})
|
|
192
249
|
]
|
|
193
|
-
})
|
|
194
|
-
|
|
250
|
+
}),
|
|
251
|
+
/* @__PURE__ */ k(te, { children: [/* @__PURE__ */ O(A, {
|
|
252
|
+
variant: "outline",
|
|
253
|
+
onClick: () => n(!1),
|
|
254
|
+
disabled: Z || Q,
|
|
255
|
+
children: "Cancel"
|
|
256
|
+
}), /* @__PURE__ */ O(A, {
|
|
257
|
+
onClick: () => {
|
|
258
|
+
if (!c.trim() || !u.trim()) {
|
|
259
|
+
i.warning("Missing details", "Title and slug are required.");
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
if (!b.trim()) {
|
|
263
|
+
i.warning("Body required", "Write the article body before publishing.");
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
let e = ee(S), n = {
|
|
267
|
+
title: c.trim(),
|
|
268
|
+
summary: v.trim() || null,
|
|
269
|
+
content: b.trim(),
|
|
270
|
+
tags: e,
|
|
271
|
+
status: E,
|
|
272
|
+
relatedAssetId: M || null,
|
|
273
|
+
relatedIncidentId: I || null
|
|
274
|
+
};
|
|
275
|
+
a && t ? ie({ variables: {
|
|
276
|
+
id: t.id,
|
|
277
|
+
input: n
|
|
278
|
+
} }) : Y({ variables: { input: {
|
|
279
|
+
...n,
|
|
280
|
+
slug: u.trim()
|
|
281
|
+
} } });
|
|
282
|
+
},
|
|
283
|
+
disabled: Z || Q,
|
|
284
|
+
children: a ? Q ? "Saving…" : "Save changes" : Z ? "Publishing…" : "Publish article"
|
|
285
|
+
})] })
|
|
286
|
+
] });
|
|
195
287
|
}
|
|
196
|
-
function
|
|
197
|
-
let
|
|
198
|
-
return /* @__PURE__ */
|
|
288
|
+
function se({ article: e, onOpenChange: t, onEdit: r }) {
|
|
289
|
+
let i = n();
|
|
290
|
+
return /* @__PURE__ */ O(I, {
|
|
199
291
|
open: !!e,
|
|
200
|
-
onOpenChange:
|
|
201
|
-
children: /* @__PURE__ */
|
|
292
|
+
onOpenChange: t,
|
|
293
|
+
children: /* @__PURE__ */ O(L, {
|
|
202
294
|
className: "max-h-[85vh] overflow-y-auto sm:max-w-2xl",
|
|
203
|
-
children: e ? /* @__PURE__ */
|
|
204
|
-
/* @__PURE__ */
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
/* @__PURE__ */
|
|
213
|
-
className: "
|
|
214
|
-
children:
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
295
|
+
children: e ? /* @__PURE__ */ k(D, { children: [
|
|
296
|
+
/* @__PURE__ */ k(z, { children: [/* @__PURE__ */ k("div", {
|
|
297
|
+
className: "flex flex-wrap items-center gap-2",
|
|
298
|
+
children: [/* @__PURE__ */ O($, { status: e.status }), e.tags.map((e) => /* @__PURE__ */ O("span", {
|
|
299
|
+
className: "rounded-full bg-action-primary-bg/10 px-2 py-0.5 text-xs font-medium text-primary",
|
|
300
|
+
children: e
|
|
301
|
+
}, e))]
|
|
302
|
+
}), /* @__PURE__ */ k("div", {
|
|
303
|
+
className: "flex items-start justify-between gap-4",
|
|
304
|
+
children: [/* @__PURE__ */ k("div", {
|
|
305
|
+
className: "min-w-0 flex-1",
|
|
306
|
+
children: [/* @__PURE__ */ O(B, {
|
|
307
|
+
className: "mt-1",
|
|
308
|
+
children: e.title
|
|
309
|
+
}), /* @__PURE__ */ k(R, { children: [
|
|
310
|
+
"Updated ",
|
|
311
|
+
Z(e.updatedAt),
|
|
312
|
+
" · ",
|
|
313
|
+
e.views.toLocaleString(),
|
|
314
|
+
" views"
|
|
315
|
+
] })]
|
|
316
|
+
}), /* @__PURE__ */ k(A, {
|
|
317
|
+
variant: "outline",
|
|
318
|
+
size: "sm",
|
|
319
|
+
onClick: () => {
|
|
320
|
+
t(!1), r(e);
|
|
321
|
+
},
|
|
322
|
+
children: [/* @__PURE__ */ O(y, { className: "mr-1.5 h-3.5 w-3.5" }), "Edit"]
|
|
323
|
+
})]
|
|
324
|
+
})] }),
|
|
325
|
+
/* @__PURE__ */ O("div", {
|
|
225
326
|
className: "whitespace-pre-wrap text-sm leading-relaxed text-text-primary",
|
|
226
327
|
children: e.content
|
|
227
328
|
}),
|
|
228
|
-
e.relatedAssetId || e.relatedIncidentId ? /* @__PURE__ */
|
|
329
|
+
e.relatedAssetId || e.relatedIncidentId ? /* @__PURE__ */ k("div", {
|
|
229
330
|
className: "mt-4 space-y-2 border-t border-border-seam pt-4",
|
|
230
|
-
children: [/* @__PURE__ */
|
|
331
|
+
children: [/* @__PURE__ */ k("h4", {
|
|
231
332
|
className: "flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wide text-text-secondary",
|
|
232
|
-
children: [/* @__PURE__ */
|
|
233
|
-
}), /* @__PURE__ */
|
|
333
|
+
children: [/* @__PURE__ */ O(v, { className: "h-3.5 w-3.5" }), "Linked records"]
|
|
334
|
+
}), /* @__PURE__ */ k("div", {
|
|
234
335
|
className: "flex flex-wrap gap-2",
|
|
235
|
-
children: [e.relatedAssetId ? /* @__PURE__ */
|
|
336
|
+
children: [e.relatedAssetId ? /* @__PURE__ */ k(A, {
|
|
236
337
|
variant: "outline",
|
|
237
338
|
size: "sm",
|
|
238
339
|
onClick: () => {
|
|
239
|
-
|
|
340
|
+
t(!1), i(`/assets/${e.relatedAssetId}`);
|
|
240
341
|
},
|
|
241
|
-
children: ["View linked asset", /* @__PURE__ */
|
|
242
|
-
}) : null, e.relatedIncidentId ? /* @__PURE__ */
|
|
342
|
+
children: ["View linked asset", /* @__PURE__ */ O(g, { className: "ml-1.5 h-3.5 w-3.5" })]
|
|
343
|
+
}) : null, e.relatedIncidentId ? /* @__PURE__ */ k(A, {
|
|
243
344
|
variant: "outline",
|
|
244
345
|
size: "sm",
|
|
245
346
|
onClick: () => {
|
|
246
|
-
|
|
347
|
+
t(!1), i(`/itil/incidents/${e.relatedIncidentId}`);
|
|
247
348
|
},
|
|
248
|
-
children: ["View linked incident", /* @__PURE__ */
|
|
349
|
+
children: ["View linked incident", /* @__PURE__ */ O(g, { className: "ml-1.5 h-3.5 w-3.5" })]
|
|
249
350
|
}) : null]
|
|
250
351
|
})]
|
|
251
352
|
}) : null
|
|
@@ -253,90 +354,96 @@ function ie({ article: e, onOpenChange: n }) {
|
|
|
253
354
|
})
|
|
254
355
|
});
|
|
255
356
|
}
|
|
256
|
-
function
|
|
257
|
-
let [
|
|
357
|
+
function ce() {
|
|
358
|
+
let [e, n] = m(!1), [i, d] = m(null), [f, ee] = m(""), [g, v] = m("ALL"), [y, C] = m("ALL"), [w, T] = m("recent"), [D, I] = m(null), { data: L, loading: R, refetch: te } = E(ne, { fetchPolicy: "cache-and-network" }), z = p(() => L?.knowledgeArticles ?? [], [L?.knowledgeArticles]), B = p(() => {
|
|
258
359
|
let e = /* @__PURE__ */ new Map();
|
|
259
|
-
for (let t of
|
|
360
|
+
for (let t of z) for (let n of t.tags) e.set(n, (e.get(n) ?? 0) + 1);
|
|
260
361
|
return [...e.entries()].sort((e, t) => t[1] - e[1]);
|
|
261
|
-
}, [
|
|
262
|
-
let e =
|
|
263
|
-
return [...
|
|
362
|
+
}, [z]), K = p(() => {
|
|
363
|
+
let e = f.trim().toLowerCase();
|
|
364
|
+
return [...z.filter((t) => g !== "ALL" && !t.tags.includes(g) || y !== "ALL" && t.status !== y ? !1 : e ? [
|
|
264
365
|
t.title,
|
|
265
366
|
t.summary ?? "",
|
|
266
367
|
t.content,
|
|
267
368
|
t.tags.join(" ")
|
|
268
|
-
].join(" ").toLowerCase().includes(e) : !0)].sort((e, t) =>
|
|
369
|
+
].join(" ").toLowerCase().includes(e) : !0)].sort((e, t) => w === "views" ? t.views - e.views : new Date(t.updatedAt).getTime() - new Date(e.updatedAt).getTime());
|
|
269
370
|
}, [
|
|
270
|
-
|
|
271
|
-
|
|
371
|
+
z,
|
|
372
|
+
f,
|
|
373
|
+
g,
|
|
272
374
|
y,
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
name: G[t]?.label ?? t,
|
|
375
|
+
w
|
|
376
|
+
]), q = p(() => {
|
|
377
|
+
let e = z.reduce((e, t) => (e[t.status] = (e[t.status] ?? 0) + 1, e), {});
|
|
378
|
+
return Object.entries(e).map(([e, n], r) => ({
|
|
379
|
+
name: Y[e]?.label ?? e,
|
|
279
380
|
value: n,
|
|
280
|
-
color:
|
|
381
|
+
color: t(r)
|
|
281
382
|
}));
|
|
282
|
-
}, [
|
|
383
|
+
}, [z]), J = p(() => [...z].filter((e) => e.views > 0).sort((e, t) => t.views - e.views).slice(0, 6).map((e) => ({
|
|
283
384
|
name: e.title,
|
|
284
385
|
views: e.views
|
|
285
|
-
})), [
|
|
386
|
+
})), [z]), X = c(K, {
|
|
286
387
|
pageSize: 9,
|
|
287
|
-
resetKey: `${
|
|
388
|
+
resetKey: `${f}|${g}|${y}|${w}`
|
|
288
389
|
});
|
|
289
|
-
return /* @__PURE__ */
|
|
390
|
+
return /* @__PURE__ */ k("div", {
|
|
290
391
|
className: "space-y-5 p-4 sm:p-6",
|
|
291
392
|
children: [
|
|
292
|
-
/* @__PURE__ */
|
|
393
|
+
/* @__PURE__ */ O(u, {
|
|
293
394
|
hero: !0,
|
|
294
|
-
icon:
|
|
395
|
+
icon: h,
|
|
295
396
|
title: "Knowledge Base",
|
|
296
397
|
description: "Turn one-off fixes and runbooks into repeatable, searchable operational knowledge.",
|
|
297
|
-
actions: /* @__PURE__ */
|
|
398
|
+
actions: /* @__PURE__ */ k(A, {
|
|
298
399
|
className: "w-full sm:w-auto",
|
|
299
|
-
onClick: () =>
|
|
300
|
-
|
|
400
|
+
onClick: () => {
|
|
401
|
+
d(null), n(!0);
|
|
402
|
+
},
|
|
403
|
+
children: [/* @__PURE__ */ O(b, { className: "mr-2 h-4 w-4" }), "New Article"]
|
|
301
404
|
})
|
|
302
405
|
}),
|
|
303
|
-
/* @__PURE__ */
|
|
304
|
-
/* @__PURE__ */
|
|
305
|
-
open:
|
|
306
|
-
onOpenChange:
|
|
307
|
-
|
|
406
|
+
/* @__PURE__ */ O(F, { children: "Capture the fixes and runbooks your team relies on so the next person doesn't start from scratch. Link articles to incidents and assets, then search them when troubleshooting." }),
|
|
407
|
+
/* @__PURE__ */ O(ae, {
|
|
408
|
+
open: e,
|
|
409
|
+
onOpenChange: n,
|
|
410
|
+
article: i,
|
|
411
|
+
onSaved: () => void te()
|
|
308
412
|
}),
|
|
309
|
-
/* @__PURE__ */
|
|
310
|
-
article:
|
|
311
|
-
onOpenChange: (e) => !e &&
|
|
413
|
+
/* @__PURE__ */ O(se, {
|
|
414
|
+
article: D,
|
|
415
|
+
onOpenChange: (e) => !e && I(null),
|
|
416
|
+
onEdit: (e) => {
|
|
417
|
+
I(null), d(e), n(!0);
|
|
418
|
+
}
|
|
312
419
|
}),
|
|
313
|
-
/* @__PURE__ */
|
|
420
|
+
/* @__PURE__ */ k("div", {
|
|
314
421
|
className: "relative",
|
|
315
|
-
children: [/* @__PURE__ */
|
|
422
|
+
children: [/* @__PURE__ */ O(x, { className: "absolute left-3.5 top-1/2 h-4.5 w-4.5 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ O(N, {
|
|
316
423
|
className: "h-12 pl-11 text-base",
|
|
317
424
|
placeholder: "Search runbooks, fixes and procedures…",
|
|
318
|
-
value:
|
|
319
|
-
onChange: (e) =>
|
|
425
|
+
value: f,
|
|
426
|
+
onChange: (e) => ee(e.target.value),
|
|
320
427
|
"aria-label": "Search knowledge articles"
|
|
321
428
|
})]
|
|
322
429
|
}),
|
|
323
|
-
|
|
430
|
+
z.length > 0 && (q.length > 0 || J.length > 0) ? /* @__PURE__ */ k("div", {
|
|
324
431
|
className: "grid gap-4 lg:grid-cols-2",
|
|
325
|
-
children: [/* @__PURE__ */
|
|
432
|
+
children: [/* @__PURE__ */ O(l, {
|
|
326
433
|
title: "Publishing status",
|
|
327
434
|
subtitle: "Articles by status",
|
|
328
|
-
children: /* @__PURE__ */
|
|
329
|
-
data:
|
|
435
|
+
children: /* @__PURE__ */ O(o, {
|
|
436
|
+
data: q,
|
|
330
437
|
height: 200,
|
|
331
438
|
centerLabel: "Articles",
|
|
332
|
-
centerValue:
|
|
439
|
+
centerValue: z.length,
|
|
333
440
|
ariaLabel: "Articles by status"
|
|
334
441
|
})
|
|
335
|
-
}), /* @__PURE__ */
|
|
442
|
+
}), /* @__PURE__ */ O(l, {
|
|
336
443
|
title: "Most consulted",
|
|
337
444
|
subtitle: "Top articles by views",
|
|
338
|
-
children: /* @__PURE__ */
|
|
339
|
-
data:
|
|
445
|
+
children: /* @__PURE__ */ O(a, {
|
|
446
|
+
data: J,
|
|
340
447
|
xKey: "name",
|
|
341
448
|
series: [{
|
|
342
449
|
key: "views",
|
|
@@ -350,89 +457,89 @@ function Y() {
|
|
|
350
457
|
})
|
|
351
458
|
})]
|
|
352
459
|
}) : null,
|
|
353
|
-
/* @__PURE__ */
|
|
460
|
+
/* @__PURE__ */ k("div", {
|
|
354
461
|
className: "grid gap-5 lg:grid-cols-[200px_1fr]",
|
|
355
|
-
children: [/* @__PURE__ */
|
|
462
|
+
children: [/* @__PURE__ */ k("aside", {
|
|
356
463
|
className: "space-y-3",
|
|
357
464
|
children: [
|
|
358
|
-
/* @__PURE__ */
|
|
465
|
+
/* @__PURE__ */ k("div", {
|
|
359
466
|
className: "flex items-center justify-between gap-2",
|
|
360
|
-
children: [/* @__PURE__ */
|
|
467
|
+
children: [/* @__PURE__ */ O("h3", {
|
|
361
468
|
className: "text-sm font-semibold text-text-primary",
|
|
362
469
|
children: "Category"
|
|
363
|
-
}), /* @__PURE__ */
|
|
364
|
-
value:
|
|
365
|
-
onValueChange: (e) =>
|
|
366
|
-
children: [/* @__PURE__ */
|
|
470
|
+
}), /* @__PURE__ */ k(V, {
|
|
471
|
+
value: w,
|
|
472
|
+
onValueChange: (e) => T(e),
|
|
473
|
+
children: [/* @__PURE__ */ O(W, {
|
|
367
474
|
className: "h-8 w-[130px] text-xs lg:hidden",
|
|
368
|
-
children: /* @__PURE__ */
|
|
369
|
-
}), /* @__PURE__ */
|
|
475
|
+
children: /* @__PURE__ */ O(G, {})
|
|
476
|
+
}), /* @__PURE__ */ k(H, { children: [/* @__PURE__ */ O(U, {
|
|
370
477
|
value: "recent",
|
|
371
478
|
children: "Recently updated"
|
|
372
|
-
}), /* @__PURE__ */
|
|
479
|
+
}), /* @__PURE__ */ O(U, {
|
|
373
480
|
value: "views",
|
|
374
481
|
children: "Most viewed"
|
|
375
482
|
})] })]
|
|
376
483
|
})]
|
|
377
484
|
}),
|
|
378
|
-
/* @__PURE__ */
|
|
485
|
+
/* @__PURE__ */ k("div", {
|
|
379
486
|
className: "flex gap-2 overflow-x-auto pb-1 lg:flex-col lg:overflow-visible lg:pb-0",
|
|
380
|
-
children: [/* @__PURE__ */
|
|
487
|
+
children: [/* @__PURE__ */ k("button", {
|
|
381
488
|
type: "button",
|
|
382
|
-
onClick: () =>
|
|
383
|
-
className:
|
|
384
|
-
children: ["All articles", /* @__PURE__ */
|
|
489
|
+
onClick: () => v("ALL"),
|
|
490
|
+
className: r("shrink-0 rounded-md px-3 py-1.5 text-left text-sm font-medium transition-colors lg:w-full", g === "ALL" ? "bg-action-primary-bg/10 text-primary" : "text-text-secondary hover:text-text-primary"),
|
|
491
|
+
children: ["All articles", /* @__PURE__ */ O("span", {
|
|
385
492
|
className: "ml-1.5 text-xs text-text-muted tabular-nums",
|
|
386
|
-
children:
|
|
493
|
+
children: z.length
|
|
387
494
|
})]
|
|
388
|
-
}),
|
|
495
|
+
}), B.map(([e, t]) => /* @__PURE__ */ k("button", {
|
|
389
496
|
type: "button",
|
|
390
|
-
onClick: () =>
|
|
391
|
-
className:
|
|
392
|
-
children: [/* @__PURE__ */
|
|
497
|
+
onClick: () => v(e),
|
|
498
|
+
className: r("flex shrink-0 items-center justify-between gap-2 rounded-md px-3 py-1.5 text-left text-sm font-medium transition-colors lg:w-full", g === e ? "bg-action-primary-bg/10 text-primary" : "text-text-secondary hover:text-text-primary"),
|
|
499
|
+
children: [/* @__PURE__ */ O("span", {
|
|
393
500
|
className: "truncate",
|
|
394
501
|
children: e
|
|
395
|
-
}), /* @__PURE__ */
|
|
502
|
+
}), /* @__PURE__ */ O("span", {
|
|
396
503
|
className: "text-xs text-text-muted tabular-nums",
|
|
397
504
|
children: t
|
|
398
505
|
})]
|
|
399
506
|
}, e))]
|
|
400
507
|
}),
|
|
401
|
-
/* @__PURE__ */
|
|
508
|
+
/* @__PURE__ */ k("div", {
|
|
402
509
|
className: "hidden space-y-1.5 border-t border-border-seam pt-3 lg:block",
|
|
403
510
|
children: [
|
|
404
|
-
/* @__PURE__ */
|
|
511
|
+
/* @__PURE__ */ O(P, {
|
|
405
512
|
className: "text-xs",
|
|
406
513
|
children: "Status"
|
|
407
514
|
}),
|
|
408
|
-
/* @__PURE__ */
|
|
409
|
-
value:
|
|
410
|
-
onValueChange:
|
|
411
|
-
children: [/* @__PURE__ */
|
|
515
|
+
/* @__PURE__ */ k(V, {
|
|
516
|
+
value: y,
|
|
517
|
+
onValueChange: C,
|
|
518
|
+
children: [/* @__PURE__ */ O(W, {
|
|
412
519
|
className: "h-9",
|
|
413
|
-
children: /* @__PURE__ */
|
|
414
|
-
}), /* @__PURE__ */
|
|
520
|
+
children: /* @__PURE__ */ O(G, {})
|
|
521
|
+
}), /* @__PURE__ */ k(H, { children: [/* @__PURE__ */ O(U, {
|
|
415
522
|
value: "ALL",
|
|
416
523
|
children: "All statuses"
|
|
417
|
-
}),
|
|
524
|
+
}), re.map((e) => /* @__PURE__ */ O(U, {
|
|
418
525
|
value: e,
|
|
419
526
|
children: e
|
|
420
527
|
}, e))] })]
|
|
421
528
|
}),
|
|
422
|
-
/* @__PURE__ */
|
|
529
|
+
/* @__PURE__ */ O(P, {
|
|
423
530
|
className: "text-xs",
|
|
424
531
|
children: "Sort"
|
|
425
532
|
}),
|
|
426
|
-
/* @__PURE__ */
|
|
427
|
-
value:
|
|
428
|
-
onValueChange: (e) =>
|
|
429
|
-
children: [/* @__PURE__ */
|
|
533
|
+
/* @__PURE__ */ k(V, {
|
|
534
|
+
value: w,
|
|
535
|
+
onValueChange: (e) => T(e),
|
|
536
|
+
children: [/* @__PURE__ */ O(W, {
|
|
430
537
|
className: "h-9",
|
|
431
|
-
children: /* @__PURE__ */
|
|
432
|
-
}), /* @__PURE__ */
|
|
538
|
+
children: /* @__PURE__ */ O(G, {})
|
|
539
|
+
}), /* @__PURE__ */ k(H, { children: [/* @__PURE__ */ O(U, {
|
|
433
540
|
value: "recent",
|
|
434
541
|
children: "Recently updated"
|
|
435
|
-
}), /* @__PURE__ */
|
|
542
|
+
}), /* @__PURE__ */ O(U, {
|
|
436
543
|
value: "views",
|
|
437
544
|
children: "Most viewed"
|
|
438
545
|
})] })]
|
|
@@ -440,73 +547,73 @@ function Y() {
|
|
|
440
547
|
]
|
|
441
548
|
})
|
|
442
549
|
]
|
|
443
|
-
}), /* @__PURE__ */
|
|
444
|
-
|
|
550
|
+
}), /* @__PURE__ */ k("div", { children: [
|
|
551
|
+
R && z.length === 0 ? /* @__PURE__ */ O("div", {
|
|
445
552
|
className: "grid gap-4 sm:grid-cols-2 xl:grid-cols-3",
|
|
446
|
-
children: Array.from({ length: 6 }).map((e, t) => /* @__PURE__ */
|
|
553
|
+
children: Array.from({ length: 6 }).map((e, t) => /* @__PURE__ */ O("div", { className: "h-40 rounded-xl bg-bg-sunken motion-safe:animate-vc-shimmer" }, t))
|
|
447
554
|
}) : null,
|
|
448
|
-
!
|
|
449
|
-
illustration:
|
|
450
|
-
title:
|
|
451
|
-
description:
|
|
555
|
+
!R && K.length === 0 ? /* @__PURE__ */ O(M, {
|
|
556
|
+
illustration: f || g !== "ALL" || y !== "ALL" ? "empty-search" : "empty-data",
|
|
557
|
+
title: f || g !== "ALL" || y !== "ALL" ? "No articles match your filters" : "No knowledge articles found",
|
|
558
|
+
description: f || g !== "ALL" || y !== "ALL" ? "Try a different term, category or status." : "Publish an article to start building your knowledge base."
|
|
452
559
|
}) : null,
|
|
453
|
-
/* @__PURE__ */
|
|
560
|
+
/* @__PURE__ */ O("div", {
|
|
454
561
|
className: "grid gap-4 sm:grid-cols-2 xl:grid-cols-3",
|
|
455
|
-
children:
|
|
562
|
+
children: X.pageItems.map((e) => /* @__PURE__ */ O(j, {
|
|
456
563
|
treatment: "glass",
|
|
457
564
|
className: "border-border-seam",
|
|
458
|
-
children: /* @__PURE__ */
|
|
565
|
+
children: /* @__PURE__ */ k("button", {
|
|
459
566
|
type: "button",
|
|
460
|
-
onClick: () =>
|
|
567
|
+
onClick: () => I(e),
|
|
461
568
|
className: "flex h-full w-full flex-col gap-3 p-4 text-left",
|
|
462
569
|
children: [
|
|
463
|
-
/* @__PURE__ */
|
|
570
|
+
/* @__PURE__ */ k("div", {
|
|
464
571
|
className: "flex flex-wrap items-center gap-1.5",
|
|
465
|
-
children: [/* @__PURE__ */
|
|
572
|
+
children: [/* @__PURE__ */ O($, { status: e.status }), e.tags.slice(0, 1).map((e) => /* @__PURE__ */ O("span", {
|
|
466
573
|
className: "rounded-full bg-action-primary-bg/10 px-2 py-0.5 text-xs font-medium text-primary",
|
|
467
574
|
children: e
|
|
468
575
|
}, e))]
|
|
469
576
|
}),
|
|
470
|
-
/* @__PURE__ */
|
|
577
|
+
/* @__PURE__ */ O("h2", {
|
|
471
578
|
className: "line-clamp-2 text-base font-semibold text-text-primary",
|
|
472
579
|
children: e.title
|
|
473
580
|
}),
|
|
474
|
-
/* @__PURE__ */
|
|
581
|
+
/* @__PURE__ */ O("p", {
|
|
475
582
|
className: "line-clamp-2 flex-1 text-sm text-text-secondary",
|
|
476
|
-
children:
|
|
583
|
+
children: ie(e)
|
|
477
584
|
}),
|
|
478
|
-
/* @__PURE__ */
|
|
585
|
+
/* @__PURE__ */ k("div", {
|
|
479
586
|
className: "flex items-center justify-between gap-2 border-t border-border-seam/60 pt-3",
|
|
480
|
-
children: [/* @__PURE__ */
|
|
587
|
+
children: [/* @__PURE__ */ k("div", {
|
|
481
588
|
className: "flex min-w-0 items-center gap-2",
|
|
482
|
-
children: [/* @__PURE__ */
|
|
589
|
+
children: [/* @__PURE__ */ O("span", {
|
|
483
590
|
className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-bg-sunken text-[10px] font-semibold text-text-secondary",
|
|
484
|
-
children: e.updatedBy ?
|
|
485
|
-
}), /* @__PURE__ */
|
|
591
|
+
children: e.updatedBy ? Q(e.updatedBy) : /* @__PURE__ */ O(S, { className: "h-3 w-3" })
|
|
592
|
+
}), /* @__PURE__ */ k("span", {
|
|
486
593
|
className: "truncate text-xs text-text-secondary",
|
|
487
|
-
children: ["Updated ",
|
|
594
|
+
children: ["Updated ", Z(e.updatedAt)]
|
|
488
595
|
})]
|
|
489
|
-
}), /* @__PURE__ */
|
|
596
|
+
}), /* @__PURE__ */ k("span", {
|
|
490
597
|
className: "flex shrink-0 items-center gap-1 text-xs text-text-muted tabular-nums",
|
|
491
|
-
children: [/* @__PURE__ */
|
|
598
|
+
children: [/* @__PURE__ */ O(_, { className: "h-3.5 w-3.5" }), e.views.toLocaleString()]
|
|
492
599
|
})]
|
|
493
600
|
})
|
|
494
601
|
]
|
|
495
602
|
})
|
|
496
603
|
}, e.id))
|
|
497
604
|
}),
|
|
498
|
-
/* @__PURE__ */
|
|
605
|
+
/* @__PURE__ */ O("div", {
|
|
499
606
|
className: "mt-4",
|
|
500
|
-
children: /* @__PURE__ */
|
|
501
|
-
page:
|
|
502
|
-
pageCount:
|
|
503
|
-
rangeStart:
|
|
504
|
-
rangeEnd:
|
|
505
|
-
totalItems:
|
|
506
|
-
canPrev:
|
|
507
|
-
canNext:
|
|
508
|
-
onPrev:
|
|
509
|
-
onNext:
|
|
607
|
+
children: /* @__PURE__ */ O(s, {
|
|
608
|
+
page: X.page,
|
|
609
|
+
pageCount: X.pageCount,
|
|
610
|
+
rangeStart: X.rangeStart,
|
|
611
|
+
rangeEnd: X.rangeEnd,
|
|
612
|
+
totalItems: X.totalItems,
|
|
613
|
+
canPrev: X.canPrev,
|
|
614
|
+
canNext: X.canNext,
|
|
615
|
+
onPrev: X.prevPage,
|
|
616
|
+
onNext: X.nextPage,
|
|
510
617
|
itemLabel: "articles"
|
|
511
618
|
})
|
|
512
619
|
})
|
|
@@ -516,6 +623,6 @@ function Y() {
|
|
|
516
623
|
});
|
|
517
624
|
}
|
|
518
625
|
//#endregion
|
|
519
|
-
export {
|
|
626
|
+
export { ce as KnowledgeBasePage };
|
|
520
627
|
|
|
521
628
|
//# sourceMappingURL=KnowledgeBasePage.js.map
|