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