@knkcs/contenthub-ui 0.1.0 → 0.3.0
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/CHANGELOG.md +14 -0
- package/README.md +2 -2
- package/dist/{branch-content-fields-WBpviLQg.js → branch-content-fields-LyF6sD2e.js} +2 -2
- package/dist/{branch-content-fields-WBpviLQg.js.map → branch-content-fields-LyF6sD2e.js.map} +1 -1
- package/dist/{content-library-B2eauvHt.js → content-library-v0mjVD4J.js} +452 -405
- package/dist/content-library-v0mjVD4J.js.map +1 -0
- package/dist/{heads-Brd2Gtjm.js → heads-dBmqNcOB.js} +12 -12
- package/dist/heads-dBmqNcOB.js.map +1 -0
- package/dist/index.d.ts +68 -13
- package/dist/index.js +2349 -2306
- package/dist/index.js.map +1 -1
- package/dist/testing.d.ts +65 -13
- package/dist/testing.js +494 -467
- package/dist/testing.js.map +1 -1
- package/package.json +1 -1
- package/dist/content-library-B2eauvHt.js.map +0 -1
- package/dist/heads-Brd2Gtjm.js.map +0 -1
|
@@ -1,123 +1,123 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useCallback as
|
|
3
|
-
import { Fragment as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { DataTable as
|
|
6
|
-
import { Alert as
|
|
7
|
-
import { IndexPageTemplate as
|
|
8
|
-
import { keepPreviousData as
|
|
9
|
-
import { ChevronRight as
|
|
10
|
-
import { useTranslation as
|
|
11
|
-
import { zodResolver as
|
|
12
|
-
import { BaseSelectField as
|
|
13
|
-
import { FormProvider as
|
|
14
|
-
import { z as
|
|
15
|
-
import { useHostIdentity as
|
|
16
|
-
import { useSearchParams as
|
|
1
|
+
import { C as e, S as t, h as n, y as r } from "./heads-dBmqNcOB.js";
|
|
2
|
+
import { useCallback as i, useEffect as a, useMemo as o, useRef as s, useState as c } from "react";
|
|
3
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
4
|
+
import { Button as f, EmptyState as p } from "@knkcs/anker/atoms";
|
|
5
|
+
import { DataTable as m, DateCell as h, Modal as g, Toolbar as _, TreeViewBranchControl as v, TreeViewBranchIndicator as y, TreeViewBranchText as b, TreeViewItem as x, TreeViewItemText as S, TreeViewLabel as ee, TreeViewNode as C, TreeViewRoot as w, TreeViewTree as T, TruncatedTextCell as te, createTreeCollection as E } from "@knkcs/anker/components";
|
|
6
|
+
import { Alert as D, HStack as O, NativeSelect as k, Spinner as A, Stack as j, Text as M } from "@knkcs/anker/primitives";
|
|
7
|
+
import { IndexPageTemplate as ne, SubNavLayout as N } from "@knkcs/anker/templates";
|
|
8
|
+
import { keepPreviousData as re, useInfiniteQuery as ie, useQuery as P, useQueryClient as ae } from "@tanstack/react-query";
|
|
9
|
+
import { ChevronRight as F, FileText as oe, Lock as se, Plus as ce } from "lucide-react";
|
|
10
|
+
import { useTranslation as I } from "react-i18next";
|
|
11
|
+
import { zodResolver as L } from "@hookform/resolvers/zod";
|
|
12
|
+
import { BaseSelectField as R, InputField as z, LookupSelectField as B } from "@knkcs/anker/forms";
|
|
13
|
+
import { FormProvider as V, useForm as le, useWatch as H } from "react-hook-form";
|
|
14
|
+
import { z as U } from "zod";
|
|
15
|
+
import { useHostIdentity as ue } from "@knkcs/anker/host";
|
|
16
|
+
import { useSearchParams as de } from "react-router";
|
|
17
17
|
//#region src/common/query-keys.ts
|
|
18
|
-
var
|
|
18
|
+
var W = {
|
|
19
19
|
all: ["contenthub"],
|
|
20
|
-
blockReasons: () => [...
|
|
21
|
-
changeSets: () => [...
|
|
22
|
-
changeSetLists: () => [...
|
|
23
|
-
changeSetList: (e) => [...
|
|
24
|
-
openChangeSets: () => [...
|
|
20
|
+
blockReasons: () => [...W.all, "block-reasons"],
|
|
21
|
+
changeSets: () => [...W.all, "change-sets"],
|
|
22
|
+
changeSetLists: () => [...W.changeSets(), "list"],
|
|
23
|
+
changeSetList: (e) => [...W.changeSetLists(), e],
|
|
24
|
+
openChangeSets: () => [...W.changeSetLists(), "open-picker"],
|
|
25
25
|
changeSet: (e) => [
|
|
26
|
-
...
|
|
26
|
+
...W.changeSets(),
|
|
27
27
|
"detail",
|
|
28
28
|
e
|
|
29
29
|
],
|
|
30
30
|
publishReadiness: (e) => [
|
|
31
|
-
...
|
|
31
|
+
...W.changeSets(),
|
|
32
32
|
"readiness",
|
|
33
33
|
e
|
|
34
34
|
],
|
|
35
|
-
publishReadinessAt: (e, t) => [...
|
|
35
|
+
publishReadinessAt: (e, t) => [...W.publishReadiness(e), t],
|
|
36
36
|
checkStandings: (e) => [
|
|
37
|
-
...
|
|
37
|
+
...W.changeSets(),
|
|
38
38
|
"checks",
|
|
39
39
|
e
|
|
40
40
|
],
|
|
41
|
-
changeSetStatuses: () => [...
|
|
42
|
-
requiredChecks: () => [...
|
|
41
|
+
changeSetStatuses: () => [...W.all, "change-set-statuses"],
|
|
42
|
+
requiredChecks: () => [...W.all, "required-checks"],
|
|
43
43
|
requiredCheckRecorders: (e) => [
|
|
44
|
-
...
|
|
44
|
+
...W.requiredChecks(),
|
|
45
45
|
"recorders",
|
|
46
46
|
e
|
|
47
47
|
],
|
|
48
|
-
collections: () => [...
|
|
48
|
+
collections: () => [...W.all, "collections"],
|
|
49
49
|
collectionGrants: (e) => [
|
|
50
|
-
...
|
|
50
|
+
...W.collections(),
|
|
51
51
|
"grants",
|
|
52
52
|
e
|
|
53
53
|
],
|
|
54
|
-
contents: () => [...
|
|
55
|
-
contentLists: () => [...
|
|
56
|
-
contentList: (e) => [...
|
|
54
|
+
contents: () => [...W.all, "contents"],
|
|
55
|
+
contentLists: () => [...W.contents(), "list"],
|
|
56
|
+
contentList: (e) => [...W.contentLists(), e],
|
|
57
57
|
content: (e) => [
|
|
58
|
-
...
|
|
58
|
+
...W.contents(),
|
|
59
59
|
"detail",
|
|
60
60
|
e
|
|
61
61
|
],
|
|
62
62
|
contentRead: (e, t) => [
|
|
63
|
-
...
|
|
63
|
+
...W.content(e),
|
|
64
64
|
"read",
|
|
65
65
|
t
|
|
66
66
|
],
|
|
67
|
-
contentTimeline: (e) => [...
|
|
67
|
+
contentTimeline: (e) => [...W.content(e), "timeline"],
|
|
68
68
|
contentRevisions: (e, t) => [
|
|
69
|
-
...
|
|
69
|
+
...W.content(e),
|
|
70
70
|
"revisions",
|
|
71
71
|
t
|
|
72
72
|
],
|
|
73
73
|
contentCompare: (e, t, n) => [
|
|
74
|
-
...
|
|
74
|
+
...W.content(e),
|
|
75
75
|
"compare",
|
|
76
76
|
t,
|
|
77
77
|
n
|
|
78
78
|
],
|
|
79
79
|
contentReferences: (e, t) => [
|
|
80
|
-
...
|
|
80
|
+
...W.content(e),
|
|
81
81
|
"references",
|
|
82
82
|
t
|
|
83
83
|
],
|
|
84
|
-
contentReferrers: (e) => [...
|
|
84
|
+
contentReferrers: (e) => [...W.content(e), "referrers"],
|
|
85
85
|
contentOutdatedPins: (e, t) => [
|
|
86
|
-
...
|
|
86
|
+
...W.content(e),
|
|
87
87
|
"outdated-pins",
|
|
88
88
|
t
|
|
89
89
|
],
|
|
90
|
-
contentChangeSets: (e) => [...
|
|
90
|
+
contentChangeSets: (e) => [...W.content(e), "change-sets"],
|
|
91
91
|
chainPreview: (e, t, ...n) => [
|
|
92
|
-
...
|
|
92
|
+
...W.content(e),
|
|
93
93
|
"preview",
|
|
94
94
|
t,
|
|
95
95
|
...n
|
|
96
96
|
],
|
|
97
97
|
previewInForce: (e, t, n) => [
|
|
98
|
-
...
|
|
98
|
+
...W.content(e),
|
|
99
99
|
"preview-in-force",
|
|
100
100
|
t,
|
|
101
101
|
n
|
|
102
102
|
],
|
|
103
103
|
pendingMerge: (e) => [
|
|
104
|
-
...
|
|
104
|
+
...W.all,
|
|
105
105
|
"pending-merge",
|
|
106
106
|
e
|
|
107
107
|
],
|
|
108
|
-
blueprints: () => [...
|
|
108
|
+
blueprints: () => [...W.all, "blueprints"],
|
|
109
109
|
blueprintNames: (e) => [
|
|
110
|
-
...
|
|
110
|
+
...W.blueprints(),
|
|
111
111
|
"names",
|
|
112
112
|
e
|
|
113
113
|
],
|
|
114
|
-
blueprintFilterOptions: () => [...
|
|
114
|
+
blueprintFilterOptions: () => [...W.blueprints(), "filter-options"],
|
|
115
115
|
blueprintReleases: (e) => [
|
|
116
|
-
...
|
|
116
|
+
...W.blueprints(),
|
|
117
117
|
"releases",
|
|
118
118
|
e
|
|
119
119
|
]
|
|
120
|
-
},
|
|
120
|
+
}, G = {
|
|
121
121
|
common: { cancel: "Abbrechen" },
|
|
122
122
|
settings: {
|
|
123
123
|
section: "Einstellungen",
|
|
@@ -574,7 +574,6 @@ var V = {
|
|
|
574
574
|
more: "Mehr anzeigen",
|
|
575
575
|
create: {
|
|
576
576
|
button: "Neuer Inhalt",
|
|
577
|
-
unavailable: "Neue Inhalte brauchen die Blueprints des Arbeitsbereichs, und dieser Host ist nicht mit blueprinthub verbunden.",
|
|
578
577
|
title: "Neuer Inhalt",
|
|
579
578
|
blueprint: "Blueprint",
|
|
580
579
|
blueprintHelp: "Die Art des Inhalts, wie ein Blueprint sie festlegt.",
|
|
@@ -584,6 +583,11 @@ var V = {
|
|
|
584
583
|
releaseHelp: "Das Release, auf das der Inhalt festgelegt wird. Das neueste ist vorausgewählt.",
|
|
585
584
|
releaseRequired: "Wählen Sie ein Release.",
|
|
586
585
|
noRelease: "Dieser Blueprint hat noch kein Release. Erstellen Sie zuerst eines in blueprinthub.",
|
|
586
|
+
noUsableRelease: "Kein Release dieses Blueprints kann verwendet werden. Korrigieren Sie den Blueprint in blueprinthub und erstellen Sie ein neues Release.",
|
|
587
|
+
releasesFailed: "Die Releases konnten nicht geladen werden: blueprinthub antwortet nicht. Versuchen Sie es erneut.",
|
|
588
|
+
refusedRelease: "{{name}} (nicht verwendbar)",
|
|
589
|
+
refusedReleases: "Auf diese Releases kann contenthub nicht festlegen:",
|
|
590
|
+
refusedReleaseReasons: "{{name}}: {{reasons}}",
|
|
587
591
|
changeSet: "Change Set",
|
|
588
592
|
changeSetHelp: "Ein neuer Inhalt entsteht in einem Change Set und existiert nur dort, bis es veröffentlicht wird.",
|
|
589
593
|
changeSetRequired: "Wählen Sie ein Change Set.",
|
|
@@ -834,7 +838,7 @@ var V = {
|
|
|
834
838
|
confirm: "Archivieren"
|
|
835
839
|
}
|
|
836
840
|
}
|
|
837
|
-
},
|
|
841
|
+
}, fe = {
|
|
838
842
|
common: { cancel: "Cancel" },
|
|
839
843
|
settings: {
|
|
840
844
|
section: "Settings",
|
|
@@ -1525,7 +1529,6 @@ var V = {
|
|
|
1525
1529
|
more: "Show more",
|
|
1526
1530
|
create: {
|
|
1527
1531
|
button: "New Content",
|
|
1528
|
-
unavailable: "New Content needs the workspace's Blueprints, and this host has no connection to blueprinthub.",
|
|
1529
1532
|
title: "New Content",
|
|
1530
1533
|
blueprint: "Blueprint",
|
|
1531
1534
|
blueprintHelp: "The kind of Content, as a Blueprint defines it.",
|
|
@@ -1535,6 +1538,11 @@ var V = {
|
|
|
1535
1538
|
releaseHelp: "The Release the Content pins. The newest is chosen for you.",
|
|
1536
1539
|
releaseRequired: "Choose a Release.",
|
|
1537
1540
|
noRelease: "This Blueprint has no Release yet. Cut one in blueprinthub first.",
|
|
1541
|
+
noUsableRelease: "No Release of this Blueprint can be used. Fix the Blueprint in blueprinthub and cut a new Release.",
|
|
1542
|
+
releasesFailed: "The Releases could not be loaded: blueprinthub isn't answering. Try again.",
|
|
1543
|
+
refusedRelease: "{{name}} (can't be used)",
|
|
1544
|
+
refusedReleases: "contenthub can't pin these Releases:",
|
|
1545
|
+
refusedReleaseReasons: "{{name}}: {{reasons}}",
|
|
1538
1546
|
changeSet: "Change Set",
|
|
1539
1547
|
changeSetHelp: "New Content is created in a Change Set and exists only there until it is published.",
|
|
1540
1548
|
changeSetRequired: "Choose a Change Set.",
|
|
@@ -1785,19 +1793,38 @@ var V = {
|
|
|
1785
1793
|
confirm: "Archive"
|
|
1786
1794
|
}
|
|
1787
1795
|
}
|
|
1788
|
-
},
|
|
1789
|
-
en: { [
|
|
1790
|
-
de: { [
|
|
1791
|
-
},
|
|
1792
|
-
namespace:
|
|
1793
|
-
resources:
|
|
1794
|
-
}
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1796
|
+
}, K = "contenthub-ui", q = {
|
|
1797
|
+
en: { [K]: fe },
|
|
1798
|
+
de: { [K]: G }
|
|
1799
|
+
}, pe = {
|
|
1800
|
+
namespace: K,
|
|
1801
|
+
resources: q
|
|
1802
|
+
};
|
|
1803
|
+
//#endregion
|
|
1804
|
+
//#region src/common/blueprint-source.ts
|
|
1805
|
+
function me(t) {
|
|
1806
|
+
return {
|
|
1807
|
+
searchBlueprints: (e) => t.searchBlueprints(e),
|
|
1808
|
+
async getBlueprints(n) {
|
|
1809
|
+
let r = [...new Set(n.filter((e) => e !== ""))], i = [];
|
|
1810
|
+
for (let t = 0; t < r.length; t += e) i.push(r.slice(t, t + e));
|
|
1811
|
+
return (await Promise.all(i.map((e) => t.getBlueprints(e)))).flat();
|
|
1812
|
+
},
|
|
1813
|
+
listReleases: (e) => t.listBlueprintReleases(e)
|
|
1814
|
+
};
|
|
1815
|
+
}
|
|
1816
|
+
function he(e, t) {
|
|
1817
|
+
return o(() => t ?? me(e), [e, t]);
|
|
1818
|
+
}
|
|
1819
|
+
//#endregion
|
|
1820
|
+
//#region src/common/use-open-change-sets.ts
|
|
1821
|
+
var J = 200;
|
|
1822
|
+
function ge(e, t = !0) {
|
|
1823
|
+
return P({
|
|
1824
|
+
queryKey: W.openChangeSets(),
|
|
1798
1825
|
queryFn: () => e.listChangeSets({
|
|
1799
1826
|
state: "open",
|
|
1800
|
-
pageSize:
|
|
1827
|
+
pageSize: J
|
|
1801
1828
|
}),
|
|
1802
1829
|
enabled: t
|
|
1803
1830
|
});
|
|
@@ -1805,20 +1832,20 @@ function J(e, t = !0) {
|
|
|
1805
1832
|
//#endregion
|
|
1806
1833
|
//#region src/screens/collection-tree.tsx
|
|
1807
1834
|
var Y = "__all__";
|
|
1808
|
-
function
|
|
1835
|
+
function _e(e, t) {
|
|
1809
1836
|
let n = new Map(t.map((e) => [e.id, e])), r = [], i = /* @__PURE__ */ new Set(), a = n.get(e);
|
|
1810
1837
|
for (; a && !i.has(a.id);) i.add(a.id), r.unshift(a), a = n.get(a.parentId);
|
|
1811
1838
|
return r;
|
|
1812
1839
|
}
|
|
1813
1840
|
function X() {
|
|
1814
|
-
let { t: e } =
|
|
1815
|
-
return /* @__PURE__ */
|
|
1841
|
+
let { t: e } = I(K);
|
|
1842
|
+
return /* @__PURE__ */ u(se, {
|
|
1816
1843
|
size: 12,
|
|
1817
1844
|
"aria-label": e("library.restricted")
|
|
1818
1845
|
});
|
|
1819
1846
|
}
|
|
1820
|
-
function
|
|
1821
|
-
let { t: r } =
|
|
1847
|
+
function ve({ collections: e, activeId: t, onSelect: n }) {
|
|
1848
|
+
let { t: r } = I(K), i = o(() => new Map(e.map((e) => [e.id, e])), [e]), a = o(() => {
|
|
1822
1849
|
let t = /* @__PURE__ */ new Map();
|
|
1823
1850
|
for (let n of e) {
|
|
1824
1851
|
let e = n.parentId !== "" && i.has(n.parentId) ? n.parentId : "", r = t.get(e) ?? [];
|
|
@@ -1837,7 +1864,7 @@ function ge({ collections: e, activeId: t, onSelect: n }) {
|
|
|
1837
1864
|
children: i.map((e) => n(e, a))
|
|
1838
1865
|
};
|
|
1839
1866
|
}, a = (t.get("") ?? []).map((e) => n(e, /* @__PURE__ */ new Set([e.id])));
|
|
1840
|
-
return
|
|
1867
|
+
return E({
|
|
1841
1868
|
rootNode: {
|
|
1842
1869
|
id: "ROOT",
|
|
1843
1870
|
name: "",
|
|
@@ -1855,24 +1882,24 @@ function ge({ collections: e, activeId: t, onSelect: n }) {
|
|
|
1855
1882
|
e,
|
|
1856
1883
|
i,
|
|
1857
1884
|
r
|
|
1858
|
-
]), [
|
|
1859
|
-
return /* @__PURE__ */
|
|
1860
|
-
collection:
|
|
1885
|
+
]), [s] = c(() => _e(t, e).slice(0, -1).map((e) => e.id));
|
|
1886
|
+
return /* @__PURE__ */ d(w, {
|
|
1887
|
+
collection: a,
|
|
1861
1888
|
size: "sm",
|
|
1862
1889
|
selectedValue: [t === "" ? Y : t],
|
|
1863
|
-
defaultExpandedValue:
|
|
1890
|
+
defaultExpandedValue: s,
|
|
1864
1891
|
onSelectionChange: (e) => {
|
|
1865
1892
|
let t = e.selectedValue[0];
|
|
1866
1893
|
t !== void 0 && n(t === Y ? "" : t);
|
|
1867
1894
|
},
|
|
1868
|
-
children: [/* @__PURE__ */
|
|
1895
|
+
children: [/* @__PURE__ */ u(ee, {
|
|
1869
1896
|
srOnly: !0,
|
|
1870
1897
|
children: r("library.collections")
|
|
1871
|
-
}), /* @__PURE__ */
|
|
1872
|
-
/* @__PURE__ */
|
|
1873
|
-
/* @__PURE__ */
|
|
1874
|
-
e.restricted ? /* @__PURE__ */
|
|
1875
|
-
] }) : /* @__PURE__ */
|
|
1898
|
+
}), /* @__PURE__ */ u(T, { children: /* @__PURE__ */ u(C, { render: ({ node: e, nodeState: t }) => t.isBranch ? /* @__PURE__ */ d(v, { children: [
|
|
1899
|
+
/* @__PURE__ */ u(y, { children: /* @__PURE__ */ u(F, { size: 14 }) }),
|
|
1900
|
+
/* @__PURE__ */ u(b, { children: e.name }),
|
|
1901
|
+
e.restricted ? /* @__PURE__ */ u(X, {}) : null
|
|
1902
|
+
] }) : /* @__PURE__ */ d(x, { children: [/* @__PURE__ */ u(S, { children: e.name }), e.restricted ? /* @__PURE__ */ u(X, {}) : null] }) }) })]
|
|
1876
1903
|
});
|
|
1877
1904
|
}
|
|
1878
1905
|
//#endregion
|
|
@@ -1881,94 +1908,94 @@ var Z = {
|
|
|
1881
1908
|
name: "",
|
|
1882
1909
|
sourceDate: "",
|
|
1883
1910
|
sourceReference: ""
|
|
1884
|
-
},
|
|
1885
|
-
function
|
|
1886
|
-
let { t:
|
|
1887
|
-
name:
|
|
1888
|
-
sourceDate:
|
|
1889
|
-
sourceReference:
|
|
1911
|
+
}, ye = "contenthub-create-change-set", Q = /^[^\u0000-\u001f\u007f]*$/;
|
|
1912
|
+
function be({ open: e, onClose: n, onSubmit: r }) {
|
|
1913
|
+
let { t: i } = I(K), s = o(() => U.object({
|
|
1914
|
+
name: U.string().trim().min(1, i("changeSets.form.nameRequired")).max(200, i("changeSets.form.tooLong", { max: 200 })).regex(Q, i("changeSets.form.oneLine")),
|
|
1915
|
+
sourceDate: U.string().trim(),
|
|
1916
|
+
sourceReference: U.string().trim().max(500, i("changeSets.form.tooLong", { max: 500 })).regex(Q, i("changeSets.form.oneLine"))
|
|
1890
1917
|
}).superRefine((e, t) => {
|
|
1891
1918
|
e.sourceReference !== "" && e.sourceDate === "" && t.addIssue({
|
|
1892
1919
|
code: "custom",
|
|
1893
1920
|
path: ["sourceDate"],
|
|
1894
|
-
message:
|
|
1921
|
+
message: i("changeSets.form.sourceDateRequired")
|
|
1895
1922
|
}), e.sourceDate !== "" && e.sourceReference === "" && t.addIssue({
|
|
1896
1923
|
code: "custom",
|
|
1897
1924
|
path: ["sourceReference"],
|
|
1898
|
-
message:
|
|
1925
|
+
message: i("changeSets.form.sourceReferenceRequired")
|
|
1899
1926
|
});
|
|
1900
|
-
}), [
|
|
1901
|
-
resolver:
|
|
1927
|
+
}), [i]), l = le({
|
|
1928
|
+
resolver: L(s),
|
|
1902
1929
|
defaultValues: Z
|
|
1903
|
-
}), [p, m] =
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
}, [
|
|
1907
|
-
let
|
|
1930
|
+
}), [p, m] = c(null), h = l.formState.isSubmitting;
|
|
1931
|
+
a(() => {
|
|
1932
|
+
e && (l.reset(Z), m(null));
|
|
1933
|
+
}, [e, l]);
|
|
1934
|
+
let _ = l.handleSubmit(async (e) => {
|
|
1908
1935
|
m(null);
|
|
1909
1936
|
try {
|
|
1910
1937
|
await r({
|
|
1911
|
-
name:
|
|
1912
|
-
source:
|
|
1913
|
-
date:
|
|
1914
|
-
reference:
|
|
1938
|
+
name: e.name,
|
|
1939
|
+
source: e.sourceDate === "" ? void 0 : {
|
|
1940
|
+
date: e.sourceDate,
|
|
1941
|
+
reference: e.sourceReference
|
|
1915
1942
|
}
|
|
1916
1943
|
});
|
|
1917
|
-
} catch (
|
|
1918
|
-
m(
|
|
1944
|
+
} catch (e) {
|
|
1945
|
+
m(e instanceof t ? e.message : i("changeSets.form.failed"));
|
|
1919
1946
|
}
|
|
1920
1947
|
});
|
|
1921
|
-
return /* @__PURE__ */
|
|
1922
|
-
open:
|
|
1948
|
+
return /* @__PURE__ */ u(g, {
|
|
1949
|
+
open: e,
|
|
1923
1950
|
onClose: n,
|
|
1924
1951
|
lazyMount: !0,
|
|
1925
1952
|
unmountOnExit: !0,
|
|
1926
1953
|
size: "md",
|
|
1927
|
-
header:
|
|
1928
|
-
footer: /* @__PURE__ */
|
|
1954
|
+
header: i("changeSets.form.createTitle"),
|
|
1955
|
+
footer: /* @__PURE__ */ d(O, {
|
|
1929
1956
|
gap: "2",
|
|
1930
|
-
children: [/* @__PURE__ */
|
|
1957
|
+
children: [/* @__PURE__ */ u(f, {
|
|
1931
1958
|
size: "sm",
|
|
1932
1959
|
variant: "ghost",
|
|
1933
1960
|
onClick: n,
|
|
1934
|
-
children:
|
|
1935
|
-
}), /* @__PURE__ */
|
|
1961
|
+
children: i("common.cancel")
|
|
1962
|
+
}), /* @__PURE__ */ u(f, {
|
|
1936
1963
|
type: "submit",
|
|
1937
|
-
form:
|
|
1964
|
+
form: ye,
|
|
1938
1965
|
size: "sm",
|
|
1939
1966
|
variant: "solid",
|
|
1940
1967
|
loading: h,
|
|
1941
|
-
children:
|
|
1968
|
+
children: i("changeSets.form.createSubmit")
|
|
1942
1969
|
})]
|
|
1943
1970
|
}),
|
|
1944
|
-
children: /* @__PURE__ */
|
|
1945
|
-
...
|
|
1946
|
-
children: /* @__PURE__ */
|
|
1947
|
-
id:
|
|
1971
|
+
children: /* @__PURE__ */ u(V, {
|
|
1972
|
+
...l,
|
|
1973
|
+
children: /* @__PURE__ */ u("form", {
|
|
1974
|
+
id: ye,
|
|
1948
1975
|
onSubmit: (e) => {
|
|
1949
|
-
e.preventDefault(),
|
|
1976
|
+
e.preventDefault(), _();
|
|
1950
1977
|
},
|
|
1951
|
-
children: /* @__PURE__ */
|
|
1978
|
+
children: /* @__PURE__ */ d(j, {
|
|
1952
1979
|
gap: "4",
|
|
1953
1980
|
children: [
|
|
1954
|
-
/* @__PURE__ */
|
|
1981
|
+
/* @__PURE__ */ u(z, {
|
|
1955
1982
|
name: "name",
|
|
1956
|
-
label:
|
|
1957
|
-
helperText:
|
|
1983
|
+
label: i("changeSets.form.name"),
|
|
1984
|
+
helperText: i("changeSets.form.nameHelp"),
|
|
1958
1985
|
required: !0
|
|
1959
1986
|
}),
|
|
1960
|
-
/* @__PURE__ */
|
|
1987
|
+
/* @__PURE__ */ u(z, {
|
|
1961
1988
|
name: "sourceDate",
|
|
1962
1989
|
type: "date",
|
|
1963
|
-
label:
|
|
1964
|
-
helperText:
|
|
1990
|
+
label: i("changeSets.form.sourceDate"),
|
|
1991
|
+
helperText: i("changeSets.form.sourceDateHelp")
|
|
1965
1992
|
}),
|
|
1966
|
-
/* @__PURE__ */
|
|
1993
|
+
/* @__PURE__ */ u(z, {
|
|
1967
1994
|
name: "sourceReference",
|
|
1968
|
-
label:
|
|
1969
|
-
helperText:
|
|
1995
|
+
label: i("changeSets.form.sourceReference"),
|
|
1996
|
+
helperText: i("changeSets.form.sourceReferenceHelp")
|
|
1970
1997
|
}),
|
|
1971
|
-
p ? /* @__PURE__ */
|
|
1998
|
+
p ? /* @__PURE__ */ u(D, {
|
|
1972
1999
|
status: "error",
|
|
1973
2000
|
title: p
|
|
1974
2001
|
}) : null
|
|
@@ -1980,8 +2007,8 @@ function _e({ open: t, onClose: n, onSubmit: r }) {
|
|
|
1980
2007
|
}
|
|
1981
2008
|
//#endregion
|
|
1982
2009
|
//#region src/screens/change-set-choice.tsx
|
|
1983
|
-
var
|
|
1984
|
-
function
|
|
2010
|
+
var xe = "@new";
|
|
2011
|
+
function Se(e, t, n = !1) {
|
|
1985
2012
|
if (!t.changeSetId) return {
|
|
1986
2013
|
path: "changeSetId",
|
|
1987
2014
|
message: e("library.create.changeSetRequired")
|
|
@@ -1994,42 +2021,42 @@ function ye(e, t, n = !1) {
|
|
|
1994
2021
|
} : [...r].length > 200 ? {
|
|
1995
2022
|
path: "changeSetName",
|
|
1996
2023
|
message: e("changeSets.form.tooLong", { max: 200 })
|
|
1997
|
-
} :
|
|
2024
|
+
} : Q.test(r) ? null : {
|
|
1998
2025
|
path: "changeSetName",
|
|
1999
2026
|
message: e("changeSets.form.oneLine")
|
|
2000
2027
|
};
|
|
2001
2028
|
}
|
|
2002
|
-
function
|
|
2003
|
-
let { t:
|
|
2004
|
-
id:
|
|
2005
|
-
label:
|
|
2006
|
-
}, ...(
|
|
2029
|
+
function Ce({ client: e, open: t, helperText: n, nameHelperText: r, nameOptional: i = !1 }) {
|
|
2030
|
+
let { t: a } = I(K), s = ge(e, t), c = o(() => [{
|
|
2031
|
+
id: xe,
|
|
2032
|
+
label: a("library.create.newChangeSet")
|
|
2033
|
+
}, ...(s.data?.changeSets ?? []).map((e) => ({
|
|
2007
2034
|
id: e.id,
|
|
2008
2035
|
label: e.name
|
|
2009
|
-
}))], [
|
|
2010
|
-
return /* @__PURE__ */ l
|
|
2036
|
+
}))], [s.data, a]), f = H({ name: "changeSetId" });
|
|
2037
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(R, {
|
|
2011
2038
|
name: "changeSetId",
|
|
2012
|
-
label:
|
|
2039
|
+
label: a("library.create.changeSet"),
|
|
2013
2040
|
helperText: n,
|
|
2014
|
-
options:
|
|
2041
|
+
options: c,
|
|
2015
2042
|
isClearable: !1,
|
|
2016
2043
|
required: !0
|
|
2017
|
-
}), f === "@new" ? /* @__PURE__ */
|
|
2044
|
+
}), f === "@new" ? /* @__PURE__ */ u(z, {
|
|
2018
2045
|
name: "changeSetName",
|
|
2019
|
-
label:
|
|
2020
|
-
helperText: r ??
|
|
2046
|
+
label: a("library.create.changeSetName"),
|
|
2047
|
+
helperText: r ?? a("changeSets.form.nameHelp"),
|
|
2021
2048
|
required: !i
|
|
2022
2049
|
}) : null] });
|
|
2023
2050
|
}
|
|
2024
2051
|
//#endregion
|
|
2025
2052
|
//#region src/screens/create-content-modal.tsx
|
|
2026
|
-
var
|
|
2027
|
-
function
|
|
2028
|
-
let { t:
|
|
2029
|
-
blueprintId:
|
|
2030
|
-
releaseId:
|
|
2031
|
-
changeSetId:
|
|
2032
|
-
changeSetName:
|
|
2053
|
+
var we = "contenthub-create-content", $ = (e) => !e.refusals?.length, Te = (e) => e.path ? `${e.code} (${e.path})` : e.code;
|
|
2054
|
+
function Ee({ open: e, onClose: l, client: p, blueprintSource: m, initialChangeSetId: h, onCreated: _ }) {
|
|
2055
|
+
let { t: v } = I(K), y = ae(), b = o(() => U.object({
|
|
2056
|
+
blueprintId: U.string().nullable().refine((e) => !!e, v("library.create.blueprintRequired")),
|
|
2057
|
+
releaseId: U.string().nullable().refine((e) => !!e, v("library.create.releaseRequired")),
|
|
2058
|
+
changeSetId: U.string().nullable().refine((e) => !!e, v("library.create.changeSetRequired")),
|
|
2059
|
+
changeSetName: U.string().trim()
|
|
2033
2060
|
}).superRefine((e, t) => {
|
|
2034
2061
|
if (e.changeSetId !== "@new") return;
|
|
2035
2062
|
let n = (e) => t.addIssue({
|
|
@@ -2037,57 +2064,59 @@ function Se({ open: s, onClose: d, client: f, blueprintSource: p, initialChangeS
|
|
|
2037
2064
|
path: ["changeSetName"],
|
|
2038
2065
|
message: e
|
|
2039
2066
|
});
|
|
2040
|
-
e.changeSetName === "" ? n(
|
|
2041
|
-
}), [
|
|
2067
|
+
e.changeSetName === "" ? n(v("changeSets.form.nameRequired")) : [...e.changeSetName].length > 200 ? n(v("changeSets.form.tooLong", { max: 200 })) : Q.test(e.changeSetName) || n(v("changeSets.form.oneLine"));
|
|
2068
|
+
}), [v]), x = o(() => ({
|
|
2042
2069
|
blueprintId: null,
|
|
2043
2070
|
releaseId: null,
|
|
2044
|
-
changeSetId:
|
|
2071
|
+
changeSetId: h || "@new",
|
|
2045
2072
|
changeSetName: ""
|
|
2046
|
-
}), [
|
|
2047
|
-
resolver:
|
|
2048
|
-
defaultValues:
|
|
2049
|
-
}), [
|
|
2050
|
-
control:
|
|
2073
|
+
}), [h]), S = le({
|
|
2074
|
+
resolver: L(b),
|
|
2075
|
+
defaultValues: x
|
|
2076
|
+
}), [ee, C] = c(null), w = S.formState.isSubmitting, T = H({
|
|
2077
|
+
control: S.control,
|
|
2051
2078
|
name: "blueprintId"
|
|
2052
|
-
}),
|
|
2053
|
-
control:
|
|
2079
|
+
}), te = H({
|
|
2080
|
+
control: S.control,
|
|
2054
2081
|
name: "changeSetId"
|
|
2055
2082
|
});
|
|
2056
|
-
|
|
2057
|
-
|
|
2083
|
+
a(() => {
|
|
2084
|
+
e && (S.reset(x), C(null));
|
|
2058
2085
|
}, [
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2086
|
+
e,
|
|
2087
|
+
S,
|
|
2088
|
+
x
|
|
2062
2089
|
]);
|
|
2063
|
-
let
|
|
2064
|
-
id:
|
|
2065
|
-
label:
|
|
2066
|
-
}, ...(
|
|
2090
|
+
let E = ge(p, e), k = o(() => [{
|
|
2091
|
+
id: xe,
|
|
2092
|
+
label: v("library.create.newChangeSet")
|
|
2093
|
+
}, ...(E.data?.changeSets ?? []).map((e) => ({
|
|
2067
2094
|
id: e.id,
|
|
2068
2095
|
label: e.name
|
|
2069
|
-
}))], [
|
|
2070
|
-
queryKey:
|
|
2071
|
-
queryFn: () =>
|
|
2072
|
-
enabled:
|
|
2073
|
-
}),
|
|
2096
|
+
}))], [E.data, v]), A = P({
|
|
2097
|
+
queryKey: W.blueprintReleases(T ?? ""),
|
|
2098
|
+
queryFn: () => m.listReleases(T),
|
|
2099
|
+
enabled: e && !!T
|
|
2100
|
+
}), ne = o(() => (A.data ?? []).map((e) => ({
|
|
2074
2101
|
id: e.id,
|
|
2075
|
-
label: e.name
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2102
|
+
label: $(e) ? e.name : v("library.create.refusedRelease", { name: e.name }),
|
|
2103
|
+
data: { refused: !$(e) }
|
|
2104
|
+
})), [A.data, v]), N = o(() => (A.data ?? []).filter((e) => !$(e)), [A.data]), re = s(T);
|
|
2105
|
+
a(() => {
|
|
2106
|
+
re.current !== T && (re.current = T, S.setValue("releaseId", null));
|
|
2107
|
+
let e = S.getValues("releaseId"), t = A.data;
|
|
2108
|
+
if (!T) {
|
|
2109
|
+
e !== null && S.setValue("releaseId", null);
|
|
2081
2110
|
return;
|
|
2082
2111
|
}
|
|
2083
|
-
t && !t.some((t) => t.id === e) &&
|
|
2112
|
+
t && !t.some((t) => t.id === e && $(t)) && S.setValue("releaseId", t.find($)?.id ?? null);
|
|
2084
2113
|
}, [
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2114
|
+
T,
|
|
2115
|
+
A.data,
|
|
2116
|
+
S
|
|
2088
2117
|
]);
|
|
2089
|
-
let
|
|
2090
|
-
let r = await
|
|
2118
|
+
let ie = !!T && A.isSuccess && A.data.length === 0, F = !!T && A.isSuccess && A.data.length > 0 && !A.data.some($), oe = i(async ({ query: e, cursor: t, signal: n }) => {
|
|
2119
|
+
let r = await m.searchBlueprints({
|
|
2091
2120
|
query: e,
|
|
2092
2121
|
pageToken: t ?? void 0,
|
|
2093
2122
|
signal: n
|
|
@@ -2099,109 +2128,132 @@ function Se({ open: s, onClose: d, client: f, blueprintSource: p, initialChangeS
|
|
|
2099
2128
|
})),
|
|
2100
2129
|
nextCursor: r.nextPageToken || null
|
|
2101
2130
|
};
|
|
2102
|
-
}, [
|
|
2103
|
-
let t = await
|
|
2131
|
+
}, [m]), se = i(async ({ ids: e }) => {
|
|
2132
|
+
let t = await m.getBlueprints(e);
|
|
2104
2133
|
return e.map((e) => ({
|
|
2105
2134
|
id: e,
|
|
2106
2135
|
label: t.find((t) => t.id === e)?.name ?? e
|
|
2107
2136
|
}));
|
|
2108
|
-
}, [
|
|
2109
|
-
|
|
2137
|
+
}, [m]), ce = S.handleSubmit(async (e) => {
|
|
2138
|
+
C(null);
|
|
2110
2139
|
let t = e.changeSetId, n = !1;
|
|
2111
2140
|
try {
|
|
2112
2141
|
if (t === "@new") {
|
|
2113
|
-
let r = await
|
|
2114
|
-
n = !0, t = r.id,
|
|
2142
|
+
let r = await p.createChangeSet({ name: e.changeSetName.trim() });
|
|
2143
|
+
n = !0, t = r.id, S.setValue("changeSetId", t);
|
|
2115
2144
|
}
|
|
2116
|
-
let r = await
|
|
2145
|
+
let r = await p.createContent({
|
|
2117
2146
|
changeSetId: t,
|
|
2118
2147
|
blueprintReleaseId: e.releaseId
|
|
2119
2148
|
});
|
|
2120
|
-
|
|
2149
|
+
y.invalidateQueries({ queryKey: W.contents() }), _(r);
|
|
2121
2150
|
} catch (e) {
|
|
2122
|
-
if (
|
|
2151
|
+
if (C(ue(e)), !n) return;
|
|
2123
2152
|
}
|
|
2124
|
-
|
|
2153
|
+
y.invalidateQueries({ queryKey: W.changeSets() });
|
|
2125
2154
|
});
|
|
2126
|
-
function
|
|
2127
|
-
if (
|
|
2128
|
-
let
|
|
2129
|
-
return
|
|
2155
|
+
function ue(e) {
|
|
2156
|
+
if (e instanceof r) {
|
|
2157
|
+
let t = e.reasons.map(Te).join(", ");
|
|
2158
|
+
return v("library.create.refused", { reasons: t });
|
|
2130
2159
|
}
|
|
2131
|
-
return
|
|
2160
|
+
return e instanceof n ? v("library.create.changeSetClosed") : e instanceof t ? e.message : v("library.create.failed");
|
|
2132
2161
|
}
|
|
2133
|
-
return /* @__PURE__ */
|
|
2134
|
-
open:
|
|
2135
|
-
onClose:
|
|
2162
|
+
return /* @__PURE__ */ u(g, {
|
|
2163
|
+
open: e,
|
|
2164
|
+
onClose: l,
|
|
2136
2165
|
lazyMount: !0,
|
|
2137
2166
|
unmountOnExit: !0,
|
|
2138
2167
|
size: "md",
|
|
2139
|
-
header:
|
|
2140
|
-
footer: /* @__PURE__ */
|
|
2168
|
+
header: v("library.create.title"),
|
|
2169
|
+
footer: /* @__PURE__ */ d(O, {
|
|
2141
2170
|
gap: "2",
|
|
2142
|
-
children: [/* @__PURE__ */
|
|
2171
|
+
children: [/* @__PURE__ */ u(f, {
|
|
2143
2172
|
size: "sm",
|
|
2144
2173
|
variant: "ghost",
|
|
2145
|
-
onClick:
|
|
2146
|
-
children:
|
|
2147
|
-
}), /* @__PURE__ */
|
|
2174
|
+
onClick: l,
|
|
2175
|
+
children: v("common.cancel")
|
|
2176
|
+
}), /* @__PURE__ */ u(f, {
|
|
2148
2177
|
type: "submit",
|
|
2149
|
-
form:
|
|
2178
|
+
form: we,
|
|
2150
2179
|
size: "sm",
|
|
2151
2180
|
variant: "solid",
|
|
2152
|
-
loading:
|
|
2153
|
-
disabled:
|
|
2154
|
-
children:
|
|
2181
|
+
loading: w,
|
|
2182
|
+
disabled: ie || F || A.isError,
|
|
2183
|
+
children: v("library.create.submit")
|
|
2155
2184
|
})]
|
|
2156
2185
|
}),
|
|
2157
|
-
children: /* @__PURE__ */
|
|
2158
|
-
...
|
|
2159
|
-
children: /* @__PURE__ */
|
|
2160
|
-
id:
|
|
2186
|
+
children: /* @__PURE__ */ u(V, {
|
|
2187
|
+
...S,
|
|
2188
|
+
children: /* @__PURE__ */ u("form", {
|
|
2189
|
+
id: we,
|
|
2161
2190
|
onSubmit: (e) => {
|
|
2162
|
-
e.preventDefault(),
|
|
2191
|
+
e.preventDefault(), ce();
|
|
2163
2192
|
},
|
|
2164
|
-
children: /* @__PURE__ */
|
|
2193
|
+
children: /* @__PURE__ */ d(j, {
|
|
2165
2194
|
gap: "4",
|
|
2166
2195
|
children: [
|
|
2167
|
-
/* @__PURE__ */
|
|
2196
|
+
/* @__PURE__ */ u(B, {
|
|
2168
2197
|
name: "blueprintId",
|
|
2169
|
-
label:
|
|
2170
|
-
helperText:
|
|
2171
|
-
search:
|
|
2172
|
-
resolve:
|
|
2173
|
-
placeholder:
|
|
2198
|
+
label: v("library.create.blueprint"),
|
|
2199
|
+
helperText: v("library.create.blueprintHelp"),
|
|
2200
|
+
search: oe,
|
|
2201
|
+
resolve: se,
|
|
2202
|
+
placeholder: v("library.create.pickBlueprint"),
|
|
2174
2203
|
required: !0
|
|
2175
2204
|
}),
|
|
2176
|
-
|
|
2205
|
+
T ? /* @__PURE__ */ u(R, {
|
|
2177
2206
|
name: "releaseId",
|
|
2178
|
-
label:
|
|
2179
|
-
helperText:
|
|
2180
|
-
options:
|
|
2207
|
+
label: v("library.create.release"),
|
|
2208
|
+
helperText: v("library.create.releaseHelp"),
|
|
2209
|
+
options: ne,
|
|
2181
2210
|
isClearable: !1,
|
|
2182
|
-
required: !0
|
|
2211
|
+
required: !0,
|
|
2212
|
+
selectProps: { isOptionDisabled: (e) => e.data?.refused === !0 }
|
|
2213
|
+
}) : null,
|
|
2214
|
+
ie ? /* @__PURE__ */ u(D, {
|
|
2215
|
+
status: "warning",
|
|
2216
|
+
title: v("library.create.noRelease")
|
|
2183
2217
|
}) : null,
|
|
2184
|
-
|
|
2218
|
+
F ? /* @__PURE__ */ u(D, {
|
|
2185
2219
|
status: "warning",
|
|
2186
|
-
title:
|
|
2220
|
+
title: v("library.create.noUsableRelease")
|
|
2187
2221
|
}) : null,
|
|
2188
|
-
/* @__PURE__ */
|
|
2222
|
+
A.isError ? /* @__PURE__ */ u(D, {
|
|
2223
|
+
status: "error",
|
|
2224
|
+
title: v("library.create.releasesFailed")
|
|
2225
|
+
}) : null,
|
|
2226
|
+
N.length > 0 ? /* @__PURE__ */ u(D, {
|
|
2227
|
+
status: "info",
|
|
2228
|
+
title: v("library.create.refusedReleases"),
|
|
2229
|
+
children: /* @__PURE__ */ u(j, {
|
|
2230
|
+
gap: "1",
|
|
2231
|
+
children: N.map((e) => /* @__PURE__ */ u(M, {
|
|
2232
|
+
textStyle: "sm",
|
|
2233
|
+
children: v("library.create.refusedReleaseReasons", {
|
|
2234
|
+
name: e.name,
|
|
2235
|
+
reasons: (e.refusals ?? []).map(Te).join(", ")
|
|
2236
|
+
})
|
|
2237
|
+
}, e.id))
|
|
2238
|
+
})
|
|
2239
|
+
}) : null,
|
|
2240
|
+
/* @__PURE__ */ u(R, {
|
|
2189
2241
|
name: "changeSetId",
|
|
2190
|
-
label:
|
|
2191
|
-
helperText:
|
|
2192
|
-
options:
|
|
2242
|
+
label: v("library.create.changeSet"),
|
|
2243
|
+
helperText: v("library.create.changeSetHelp"),
|
|
2244
|
+
options: k,
|
|
2193
2245
|
isClearable: !1,
|
|
2194
2246
|
required: !0
|
|
2195
2247
|
}),
|
|
2196
|
-
|
|
2248
|
+
te === "@new" ? /* @__PURE__ */ u(z, {
|
|
2197
2249
|
name: "changeSetName",
|
|
2198
|
-
label:
|
|
2199
|
-
helperText:
|
|
2250
|
+
label: v("library.create.changeSetName"),
|
|
2251
|
+
helperText: v("changeSets.form.nameHelp"),
|
|
2200
2252
|
required: !0
|
|
2201
2253
|
}) : null,
|
|
2202
|
-
|
|
2254
|
+
ee ? /* @__PURE__ */ u(D, {
|
|
2203
2255
|
status: "error",
|
|
2204
|
-
title:
|
|
2256
|
+
title: ee
|
|
2205
2257
|
}) : null
|
|
2206
2258
|
]
|
|
2207
2259
|
})
|
|
@@ -2211,82 +2263,90 @@ function Se({ open: s, onClose: d, client: f, blueprintSource: p, initialChangeS
|
|
|
2211
2263
|
}
|
|
2212
2264
|
//#endregion
|
|
2213
2265
|
//#region src/screens/content-library.tsx
|
|
2214
|
-
var
|
|
2266
|
+
var De = [
|
|
2215
2267
|
"main",
|
|
2216
2268
|
"in_force",
|
|
2217
2269
|
"change_set"
|
|
2218
|
-
],
|
|
2219
|
-
function
|
|
2270
|
+
], Oe = 50, ke = 300, Ae = 5, je = "@me", Me = "collection";
|
|
2271
|
+
function Ne(e) {
|
|
2220
2272
|
return Object.values(e).filter((e) => typeof e == "string" && e.trim() !== "" && e.length <= 200).slice(0, 2).join(" ");
|
|
2221
2273
|
}
|
|
2222
|
-
function
|
|
2223
|
-
let { t:
|
|
2224
|
-
|
|
2225
|
-
let e = setTimeout(() =>
|
|
2274
|
+
function Pe({ client: e, blueprintSource: n, onOpenContent: r, onOpenBranch: s }) {
|
|
2275
|
+
let { t: l } = I(K), g = he(e, n), [v, y] = de(), b = v.get("collection") ?? "", [x, S] = c("main"), [ee, C] = c(""), [w, T] = c(""), [E, ae] = c(""), [F, se] = c(""), [L, R] = c(""), [z, B] = c(!1), { userId: V, members: le } = ue();
|
|
2276
|
+
a(() => {
|
|
2277
|
+
let e = setTimeout(() => ae(w), ke);
|
|
2226
2278
|
return () => clearTimeout(e);
|
|
2227
|
-
}, [
|
|
2228
|
-
let
|
|
2279
|
+
}, [w]);
|
|
2280
|
+
let H = i((e) => y((t) => {
|
|
2229
2281
|
let n = new URLSearchParams(t);
|
|
2230
|
-
return e ? n.set(
|
|
2231
|
-
}), [
|
|
2232
|
-
queryKey:
|
|
2233
|
-
queryFn: () =>
|
|
2234
|
-
}),
|
|
2282
|
+
return e ? n.set(Me, e) : n.delete(Me), n;
|
|
2283
|
+
}), [y]), U = P({
|
|
2284
|
+
queryKey: W.collections(),
|
|
2285
|
+
queryFn: () => e.listCollections()
|
|
2286
|
+
}), G = ge(e), fe = i((e) => G.data?.changeSets.find((t) => t.id === e)?.name ?? e, [G.data]), q = ee || G.data?.changeSets[0]?.id || "", pe = o(() => x === "change_set" ? q ? {
|
|
2235
2287
|
kind: "change_set",
|
|
2236
|
-
changeSetId:
|
|
2237
|
-
} : void 0 : { kind:
|
|
2238
|
-
view:
|
|
2239
|
-
collectionId:
|
|
2240
|
-
search:
|
|
2241
|
-
blueprintIds:
|
|
2242
|
-
assigneeId:
|
|
2288
|
+
changeSetId: q
|
|
2289
|
+
} : void 0 : { kind: x }, [x, q]), me = o(() => ({
|
|
2290
|
+
view: pe,
|
|
2291
|
+
collectionId: b || void 0,
|
|
2292
|
+
search: x === "in_force" ? void 0 : E.trim() || void 0,
|
|
2293
|
+
blueprintIds: F ? [F] : void 0,
|
|
2294
|
+
assigneeId: L === je ? V : L || void 0
|
|
2243
2295
|
}), [
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
N,
|
|
2296
|
+
pe,
|
|
2297
|
+
b,
|
|
2298
|
+
x,
|
|
2299
|
+
E,
|
|
2249
2300
|
F,
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2301
|
+
L,
|
|
2302
|
+
V
|
|
2303
|
+
]), J = ie({
|
|
2304
|
+
queryKey: W.contentList(me),
|
|
2305
|
+
queryFn: ({ pageParam: t }) => e.listContents({
|
|
2306
|
+
...me,
|
|
2307
|
+
pageSize: Oe,
|
|
2308
|
+
pageToken: t
|
|
2257
2309
|
}),
|
|
2258
2310
|
initialPageParam: "",
|
|
2259
2311
|
getNextPageParam: (e) => e.nextPageToken || void 0,
|
|
2260
|
-
enabled:
|
|
2261
|
-
placeholderData:
|
|
2262
|
-
}),
|
|
2263
|
-
queryKey:
|
|
2264
|
-
queryFn: () =>
|
|
2265
|
-
enabled:
|
|
2266
|
-
placeholderData:
|
|
2312
|
+
enabled: pe !== void 0,
|
|
2313
|
+
placeholderData: re
|
|
2314
|
+
}), Y = o(() => J.data?.pages.flatMap((e) => e.contents) ?? [], [J.data]), X = o(() => [...new Set(Y.map((e) => e.blueprintId))].sort(), [Y]), Z = P({
|
|
2315
|
+
queryKey: W.blueprintNames(X),
|
|
2316
|
+
queryFn: () => g.getBlueprints(X),
|
|
2317
|
+
enabled: X.length > 0,
|
|
2318
|
+
placeholderData: re,
|
|
2267
2319
|
staleTime: 6e4
|
|
2268
|
-
}),
|
|
2269
|
-
queryKey:
|
|
2320
|
+
}), ye = i((e) => Z.data?.find((t) => t.id === e)?.name ?? e, [Z.data]), Q = P({
|
|
2321
|
+
queryKey: W.blueprintFilterOptions(),
|
|
2270
2322
|
queryFn: async () => {
|
|
2271
|
-
let e =
|
|
2272
|
-
for (let n = 0; n <
|
|
2273
|
-
let n = await
|
|
2323
|
+
let e = [], t = "";
|
|
2324
|
+
for (let n = 0; n < Ae; n++) {
|
|
2325
|
+
let n = await g.searchBlueprints({
|
|
2274
2326
|
query: "",
|
|
2275
|
-
pageToken:
|
|
2327
|
+
pageToken: t
|
|
2276
2328
|
});
|
|
2277
|
-
if (
|
|
2329
|
+
if (e.push(...n.blueprints), t = n.nextPageToken, t === "") break;
|
|
2278
2330
|
}
|
|
2279
|
-
return
|
|
2331
|
+
return e;
|
|
2280
2332
|
},
|
|
2281
|
-
enabled: n !== void 0,
|
|
2282
2333
|
staleTime: 6e4
|
|
2283
|
-
}),
|
|
2334
|
+
}), be = o(() => /* @__PURE__ */ new Map(), [g]), xe = o(() => {
|
|
2335
|
+
for (let e of Z.data ?? []) be.set(e.id, e);
|
|
2336
|
+
let e = new Map(be);
|
|
2337
|
+
for (let t of Q.data ?? []) e.set(t.id, t);
|
|
2338
|
+
return [...e.values()].sort((e, t) => e.name.localeCompare(t.name));
|
|
2339
|
+
}, [
|
|
2340
|
+
be,
|
|
2341
|
+
Q.data,
|
|
2342
|
+
Z.data
|
|
2343
|
+
]), Se = o(() => [
|
|
2284
2344
|
{
|
|
2285
2345
|
id: "content",
|
|
2286
|
-
header:
|
|
2346
|
+
header: l("library.columns.content"),
|
|
2287
2347
|
cell: ({ row: e }) => {
|
|
2288
|
-
let t =
|
|
2289
|
-
return /* @__PURE__ */
|
|
2348
|
+
let t = Ne(e.original.data);
|
|
2349
|
+
return /* @__PURE__ */ u(te, {
|
|
2290
2350
|
value: t || e.original.id,
|
|
2291
2351
|
subText: t ? e.original.id : void 0
|
|
2292
2352
|
});
|
|
@@ -2294,201 +2354,188 @@ function Ae({ client: t, blueprintSource: n, onOpenContent: s, onOpenBranch: ee
|
|
|
2294
2354
|
},
|
|
2295
2355
|
{
|
|
2296
2356
|
id: "blueprint",
|
|
2297
|
-
header:
|
|
2298
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
2357
|
+
header: l("library.columns.blueprint"),
|
|
2358
|
+
cell: ({ row: e }) => /* @__PURE__ */ u(te, { value: ye(e.original.blueprintId) })
|
|
2299
2359
|
},
|
|
2300
2360
|
{
|
|
2301
2361
|
id: "readOn",
|
|
2302
|
-
header:
|
|
2362
|
+
header: l("library.columns.readOn"),
|
|
2303
2363
|
cell: ({ row: e }) => {
|
|
2304
|
-
let t = e.original, n = t.changeSetId ?
|
|
2305
|
-
return /* @__PURE__ */
|
|
2364
|
+
let t = e.original, n = t.changeSetId ? fe(t.changeSetId) : t.releaseId ? l("library.readOn.release") : l("library.readOn.main");
|
|
2365
|
+
return /* @__PURE__ */ u(te, { value: n });
|
|
2306
2366
|
}
|
|
2307
2367
|
},
|
|
2308
2368
|
{
|
|
2309
2369
|
id: "revised",
|
|
2310
|
-
header:
|
|
2311
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
2370
|
+
header: l("library.columns.revised"),
|
|
2371
|
+
cell: ({ row: e }) => /* @__PURE__ */ u(h, { value: e.original.revisionCreateTime })
|
|
2312
2372
|
}
|
|
2313
2373
|
], [
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
]),
|
|
2374
|
+
l,
|
|
2375
|
+
ye,
|
|
2376
|
+
fe
|
|
2377
|
+
]), Ce = /* @__PURE__ */ d(f, {
|
|
2318
2378
|
size: "sm",
|
|
2319
2379
|
variant: "solid",
|
|
2320
|
-
onClick: () =>
|
|
2321
|
-
children: [/* @__PURE__ */
|
|
2322
|
-
}) :
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
variant: "solid",
|
|
2330
|
-
disabled: !0,
|
|
2331
|
-
title: h("library.create.unavailable"),
|
|
2332
|
-
children: [/* @__PURE__ */ c(ue, { size: 16 }), h("library.create.button")]
|
|
2333
|
-
})
|
|
2334
|
-
})
|
|
2335
|
-
}), xe = X.error instanceof e ? X.error.message : h("library.loadError"), Ae = v ? he(v, H.data ?? []).map((e) => e.name).join(" / ") || v : h("library.allContent");
|
|
2336
|
-
return /* @__PURE__ */ l(ie, {
|
|
2337
|
-
title: h("library.title"),
|
|
2338
|
-
breadcrumbs: [{ label: h("library.title") }],
|
|
2339
|
-
actions: be,
|
|
2340
|
-
toolbar: /* @__PURE__ */ l(m, { children: [
|
|
2341
|
-
y === "in_force" ? /* @__PURE__ */ c(A, {
|
|
2380
|
+
onClick: () => B(!0),
|
|
2381
|
+
children: [/* @__PURE__ */ u(ce, { size: 16 }), l("library.create.button")]
|
|
2382
|
+
}), we = J.error instanceof t ? J.error.message : l("library.loadError"), $ = b ? _e(b, U.data ?? []).map((e) => e.name).join(" / ") || b : l("library.allContent");
|
|
2383
|
+
return /* @__PURE__ */ d(ne, {
|
|
2384
|
+
title: l("library.title"),
|
|
2385
|
+
breadcrumbs: [{ label: l("library.title") }],
|
|
2386
|
+
actions: Ce,
|
|
2387
|
+
toolbar: /* @__PURE__ */ d(_, { children: [
|
|
2388
|
+
x === "in_force" ? /* @__PURE__ */ u(M, {
|
|
2342
2389
|
fontSize: "sm",
|
|
2343
2390
|
color: "muted",
|
|
2344
|
-
children:
|
|
2345
|
-
}) : /* @__PURE__ */
|
|
2346
|
-
placeholder:
|
|
2347
|
-
value:
|
|
2391
|
+
children: l("library.filter.searchInForce")
|
|
2392
|
+
}) : /* @__PURE__ */ u(_.Search, {
|
|
2393
|
+
placeholder: l("library.filter.searchPlaceholder"),
|
|
2394
|
+
value: w,
|
|
2348
2395
|
onChange: (e) => T([...e].slice(0, 200).join(""))
|
|
2349
2396
|
}),
|
|
2350
|
-
/* @__PURE__ */
|
|
2351
|
-
/* @__PURE__ */
|
|
2397
|
+
/* @__PURE__ */ d(_.Filters, { children: [
|
|
2398
|
+
/* @__PURE__ */ u(k, {
|
|
2352
2399
|
size: "sm",
|
|
2353
|
-
"aria-label":
|
|
2354
|
-
value:
|
|
2400
|
+
"aria-label": l("library.filter.view"),
|
|
2401
|
+
value: x,
|
|
2355
2402
|
onChange: (e) => {
|
|
2356
2403
|
let t = e.target.value;
|
|
2357
|
-
t === "in_force" && (T(""),
|
|
2404
|
+
t === "in_force" && (T(""), ae("")), S(t);
|
|
2358
2405
|
},
|
|
2359
|
-
children:
|
|
2406
|
+
children: De.map((e) => /* @__PURE__ */ u("option", {
|
|
2360
2407
|
value: e,
|
|
2361
|
-
children:
|
|
2408
|
+
children: l(`library.view.${e}`)
|
|
2362
2409
|
}, e))
|
|
2363
2410
|
}),
|
|
2364
|
-
|
|
2411
|
+
x === "change_set" ? /* @__PURE__ */ d(k, {
|
|
2365
2412
|
size: "sm",
|
|
2366
|
-
"aria-label":
|
|
2367
|
-
value:
|
|
2368
|
-
onChange: (e) =>
|
|
2369
|
-
children: [
|
|
2413
|
+
"aria-label": l("library.filter.changeSet"),
|
|
2414
|
+
value: q,
|
|
2415
|
+
onChange: (e) => C(e.target.value),
|
|
2416
|
+
children: [G.data?.changeSets.length ? null : /* @__PURE__ */ u("option", {
|
|
2370
2417
|
value: "",
|
|
2371
|
-
children:
|
|
2372
|
-
}), (
|
|
2418
|
+
children: l("library.filter.noOpenChangeSet")
|
|
2419
|
+
}), (G.data?.changeSets ?? []).map((e) => /* @__PURE__ */ u("option", {
|
|
2373
2420
|
value: e.id,
|
|
2374
2421
|
children: e.name
|
|
2375
2422
|
}, e.id))]
|
|
2376
2423
|
}) : null,
|
|
2377
|
-
|
|
2424
|
+
/* @__PURE__ */ d(k, {
|
|
2378
2425
|
size: "sm",
|
|
2379
|
-
"aria-label":
|
|
2380
|
-
value:
|
|
2381
|
-
onChange: (e) =>
|
|
2382
|
-
children: [/* @__PURE__ */
|
|
2426
|
+
"aria-label": l("library.filter.blueprint"),
|
|
2427
|
+
value: F,
|
|
2428
|
+
onChange: (e) => se(e.target.value),
|
|
2429
|
+
children: [/* @__PURE__ */ u("option", {
|
|
2383
2430
|
value: "",
|
|
2384
|
-
children:
|
|
2385
|
-
}),
|
|
2431
|
+
children: l("library.filter.anyBlueprint")
|
|
2432
|
+
}), xe.map((e) => /* @__PURE__ */ u("option", {
|
|
2386
2433
|
value: e.id,
|
|
2387
2434
|
children: e.name
|
|
2388
2435
|
}, e.id))]
|
|
2389
|
-
})
|
|
2390
|
-
/* @__PURE__ */
|
|
2436
|
+
}),
|
|
2437
|
+
/* @__PURE__ */ d(k, {
|
|
2391
2438
|
size: "sm",
|
|
2392
|
-
"aria-label":
|
|
2393
|
-
value:
|
|
2394
|
-
onChange: (e) =>
|
|
2439
|
+
"aria-label": l("library.filter.assignee"),
|
|
2440
|
+
value: L,
|
|
2441
|
+
onChange: (e) => R(e.target.value),
|
|
2395
2442
|
children: [
|
|
2396
|
-
/* @__PURE__ */
|
|
2443
|
+
/* @__PURE__ */ u("option", {
|
|
2397
2444
|
value: "",
|
|
2398
|
-
children:
|
|
2445
|
+
children: l("library.filter.anyone")
|
|
2399
2446
|
}),
|
|
2400
|
-
/* @__PURE__ */
|
|
2401
|
-
value:
|
|
2402
|
-
children:
|
|
2447
|
+
/* @__PURE__ */ u("option", {
|
|
2448
|
+
value: je,
|
|
2449
|
+
children: l("library.filter.me")
|
|
2403
2450
|
}),
|
|
2404
|
-
|
|
2451
|
+
le.list().filter((e) => e.userId !== V).map((e) => /* @__PURE__ */ u("option", {
|
|
2405
2452
|
value: e.userId,
|
|
2406
2453
|
children: e.displayName
|
|
2407
2454
|
}, e.userId))
|
|
2408
2455
|
]
|
|
2409
2456
|
})
|
|
2410
2457
|
] }),
|
|
2411
|
-
/* @__PURE__ */
|
|
2458
|
+
/* @__PURE__ */ u(_.Right, { children: J.isError ? null : /* @__PURE__ */ d(_.Count, { children: [l("library.count", { count: Y.length }), J.hasNextPage ? "+" : ""] }) })
|
|
2412
2459
|
] }),
|
|
2413
|
-
children: [/* @__PURE__ */
|
|
2460
|
+
children: [/* @__PURE__ */ d(N, {
|
|
2414
2461
|
storageKey: "contenthub-library-subnav",
|
|
2415
|
-
children: [/* @__PURE__ */
|
|
2416
|
-
"aria-label":
|
|
2417
|
-
children:
|
|
2418
|
-
collections:
|
|
2419
|
-
activeId:
|
|
2420
|
-
onSelect:
|
|
2421
|
-
}) :
|
|
2462
|
+
children: [/* @__PURE__ */ u(N.Nav, {
|
|
2463
|
+
"aria-label": l("library.collections"),
|
|
2464
|
+
children: U.isSuccess ? /* @__PURE__ */ u(ve, {
|
|
2465
|
+
collections: U.data,
|
|
2466
|
+
activeId: b,
|
|
2467
|
+
onSelect: H
|
|
2468
|
+
}) : U.isError ? /* @__PURE__ */ u(M, {
|
|
2422
2469
|
fontSize: "sm",
|
|
2423
2470
|
color: "muted",
|
|
2424
2471
|
px: "3",
|
|
2425
2472
|
py: "2",
|
|
2426
|
-
children:
|
|
2427
|
-
}) : /* @__PURE__ */
|
|
2473
|
+
children: l("library.collectionsError")
|
|
2474
|
+
}) : /* @__PURE__ */ u(O, {
|
|
2428
2475
|
justify: "center",
|
|
2429
2476
|
py: "4",
|
|
2430
|
-
children: /* @__PURE__ */
|
|
2477
|
+
children: /* @__PURE__ */ u(A, { size: "sm" })
|
|
2431
2478
|
})
|
|
2432
|
-
}), /* @__PURE__ */
|
|
2479
|
+
}), /* @__PURE__ */ d(N.Detail, { children: [/* @__PURE__ */ u(N.Toolbar, { children: /* @__PURE__ */ u(M, {
|
|
2433
2480
|
fontSize: "sm",
|
|
2434
2481
|
fontWeight: "medium",
|
|
2435
|
-
children:
|
|
2436
|
-
}) }), /* @__PURE__ */
|
|
2482
|
+
children: $
|
|
2483
|
+
}) }), /* @__PURE__ */ d(j, {
|
|
2437
2484
|
gap: "3",
|
|
2438
2485
|
children: [
|
|
2439
|
-
|
|
2486
|
+
J.isError ? /* @__PURE__ */ u(D, {
|
|
2440
2487
|
status: "error",
|
|
2441
|
-
title:
|
|
2488
|
+
title: we,
|
|
2442
2489
|
mx: "8",
|
|
2443
2490
|
mt: "4"
|
|
2444
2491
|
}) : null,
|
|
2445
|
-
/* @__PURE__ */
|
|
2446
|
-
columns:
|
|
2447
|
-
data:
|
|
2448
|
-
loading:
|
|
2492
|
+
/* @__PURE__ */ u(m, {
|
|
2493
|
+
columns: Se,
|
|
2494
|
+
data: Y,
|
|
2495
|
+
loading: J.isLoading,
|
|
2449
2496
|
getRowId: (e) => `${e.id}/${e.branchId}/${e.releaseId}`,
|
|
2450
|
-
onRowClick: (e) =>
|
|
2497
|
+
onRowClick: (e) => r({
|
|
2451
2498
|
contentId: e.id,
|
|
2452
2499
|
changeSetId: e.changeSetId || void 0
|
|
2453
2500
|
}),
|
|
2454
2501
|
variant: "hoverable",
|
|
2455
|
-
emptyState: /* @__PURE__ */
|
|
2456
|
-
icon: /* @__PURE__ */
|
|
2457
|
-
header:
|
|
2458
|
-
description:
|
|
2502
|
+
emptyState: /* @__PURE__ */ u(p, {
|
|
2503
|
+
icon: /* @__PURE__ */ u(oe, { size: 32 }),
|
|
2504
|
+
header: l("library.empty"),
|
|
2505
|
+
description: l("library.emptyHint")
|
|
2459
2506
|
})
|
|
2460
2507
|
}),
|
|
2461
|
-
|
|
2508
|
+
J.hasNextPage ? /* @__PURE__ */ u(O, {
|
|
2462
2509
|
justify: "center",
|
|
2463
2510
|
pb: "4",
|
|
2464
|
-
children: /* @__PURE__ */
|
|
2511
|
+
children: /* @__PURE__ */ u(f, {
|
|
2465
2512
|
size: "sm",
|
|
2466
2513
|
variant: "outline",
|
|
2467
|
-
loading:
|
|
2468
|
-
onClick: () => void
|
|
2469
|
-
children:
|
|
2514
|
+
loading: J.isFetchingNextPage,
|
|
2515
|
+
onClick: () => void J.fetchNextPage(),
|
|
2516
|
+
children: l("library.more")
|
|
2470
2517
|
})
|
|
2471
2518
|
}) : null
|
|
2472
2519
|
]
|
|
2473
2520
|
})] })]
|
|
2474
|
-
}),
|
|
2475
|
-
open:
|
|
2476
|
-
onClose: () =>
|
|
2477
|
-
client:
|
|
2478
|
-
blueprintSource:
|
|
2479
|
-
initialChangeSetId:
|
|
2521
|
+
}), /* @__PURE__ */ u(Ee, {
|
|
2522
|
+
open: z,
|
|
2523
|
+
onClose: () => B(!1),
|
|
2524
|
+
client: e,
|
|
2525
|
+
blueprintSource: g,
|
|
2526
|
+
initialChangeSetId: x === "change_set" ? q : void 0,
|
|
2480
2527
|
onCreated: (e) => {
|
|
2481
|
-
|
|
2528
|
+
B(!1), s({
|
|
2482
2529
|
changeSetId: e.changeSetId,
|
|
2483
2530
|
contentId: e.id,
|
|
2484
2531
|
branchId: e.branchId
|
|
2485
2532
|
});
|
|
2486
2533
|
}
|
|
2487
|
-
})
|
|
2534
|
+
})]
|
|
2488
2535
|
});
|
|
2489
2536
|
}
|
|
2490
|
-
|
|
2537
|
+
Pe.displayName = "ContentLibrary";
|
|
2491
2538
|
//#endregion
|
|
2492
|
-
export {
|
|
2539
|
+
export { xe as a, _e as c, K as d, pe as f, Ce as i, ge as l, W as m, Pe as n, Se as o, q as p, Ne as r, be as s, Me as t, he as u };
|
|
2493
2540
|
|
|
2494
|
-
//# sourceMappingURL=content-library-
|
|
2541
|
+
//# sourceMappingURL=content-library-v0mjVD4J.js.map
|