@knkcs/contenthub-ui 0.2.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 +7 -0
- package/README.md +2 -2
- package/dist/{branch-content-fields-SshLLDRV.js → branch-content-fields-LyF6sD2e.js} +2 -2
- package/dist/{branch-content-fields-SshLLDRV.js.map → branch-content-fields-LyF6sD2e.js.map} +1 -1
- package/dist/{content-library-B6Y9Bxph.js → content-library-v0mjVD4J.js} +344 -341
- 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 +8 -0
- package/dist/index.js +1984 -1978
- package/dist/index.js.map +1 -1
- package/dist/testing.d.ts +14 -3
- package/dist/testing.js +442 -432
- package/dist/testing.js.map +1 -1
- package/package.json +1 -1
- package/dist/content-library-B6Y9Bxph.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 D, HStack as
|
|
7
|
-
import { IndexPageTemplate as
|
|
8
|
-
import { keepPreviousData as re, useInfiniteQuery as ie, useQuery as
|
|
9
|
-
import { ChevronRight 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
10
|
import { useTranslation as I } from "react-i18next";
|
|
11
|
-
import { zodResolver as
|
|
12
|
-
import { BaseSelectField as
|
|
13
|
-
import { FormProvider as
|
|
14
|
-
import { z as
|
|
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
15
|
import { useHostIdentity as ue } from "@knkcs/anker/host";
|
|
16
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",
|
|
@@ -838,7 +838,7 @@ var U = {
|
|
|
838
838
|
confirm: "Archivieren"
|
|
839
839
|
}
|
|
840
840
|
}
|
|
841
|
-
},
|
|
841
|
+
}, fe = {
|
|
842
842
|
common: { cancel: "Cancel" },
|
|
843
843
|
settings: {
|
|
844
844
|
section: "Settings",
|
|
@@ -1794,43 +1794,37 @@ var U = {
|
|
|
1794
1794
|
}
|
|
1795
1795
|
}
|
|
1796
1796
|
}, K = "contenthub-ui", q = {
|
|
1797
|
-
en: { [K]:
|
|
1798
|
-
de: { [K]:
|
|
1799
|
-
},
|
|
1797
|
+
en: { [K]: fe },
|
|
1798
|
+
de: { [K]: G }
|
|
1799
|
+
}, pe = {
|
|
1800
1800
|
namespace: K,
|
|
1801
1801
|
resources: q
|
|
1802
1802
|
};
|
|
1803
1803
|
//#endregion
|
|
1804
1804
|
//#region src/common/blueprint-source.ts
|
|
1805
|
-
function
|
|
1806
|
-
let t = /* @__PURE__ */ new Map();
|
|
1805
|
+
function me(t) {
|
|
1807
1806
|
return {
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
async getBlueprints(e) {
|
|
1814
|
-
return e.flatMap((e) => {
|
|
1815
|
-
let n = t.get(e);
|
|
1816
|
-
return n ? [{ ...n }] : [];
|
|
1817
|
-
});
|
|
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();
|
|
1818
1812
|
},
|
|
1819
|
-
listReleases: (
|
|
1813
|
+
listReleases: (e) => t.listBlueprintReleases(e)
|
|
1820
1814
|
};
|
|
1821
1815
|
}
|
|
1822
|
-
function
|
|
1823
|
-
return
|
|
1816
|
+
function he(e, t) {
|
|
1817
|
+
return o(() => t ?? me(e), [e, t]);
|
|
1824
1818
|
}
|
|
1825
1819
|
//#endregion
|
|
1826
1820
|
//#region src/common/use-open-change-sets.ts
|
|
1827
|
-
var
|
|
1828
|
-
function
|
|
1829
|
-
return
|
|
1830
|
-
queryKey:
|
|
1821
|
+
var J = 200;
|
|
1822
|
+
function ge(e, t = !0) {
|
|
1823
|
+
return P({
|
|
1824
|
+
queryKey: W.openChangeSets(),
|
|
1831
1825
|
queryFn: () => e.listChangeSets({
|
|
1832
1826
|
state: "open",
|
|
1833
|
-
pageSize:
|
|
1827
|
+
pageSize: J
|
|
1834
1828
|
}),
|
|
1835
1829
|
enabled: t
|
|
1836
1830
|
});
|
|
@@ -1838,20 +1832,20 @@ function he(e, t = !0) {
|
|
|
1838
1832
|
//#endregion
|
|
1839
1833
|
//#region src/screens/collection-tree.tsx
|
|
1840
1834
|
var Y = "__all__";
|
|
1841
|
-
function
|
|
1835
|
+
function _e(e, t) {
|
|
1842
1836
|
let n = new Map(t.map((e) => [e.id, e])), r = [], i = /* @__PURE__ */ new Set(), a = n.get(e);
|
|
1843
1837
|
for (; a && !i.has(a.id);) i.add(a.id), r.unshift(a), a = n.get(a.parentId);
|
|
1844
1838
|
return r;
|
|
1845
1839
|
}
|
|
1846
1840
|
function X() {
|
|
1847
1841
|
let { t: e } = I(K);
|
|
1848
|
-
return /* @__PURE__ */
|
|
1842
|
+
return /* @__PURE__ */ u(se, {
|
|
1849
1843
|
size: 12,
|
|
1850
1844
|
"aria-label": e("library.restricted")
|
|
1851
1845
|
});
|
|
1852
1846
|
}
|
|
1853
|
-
function
|
|
1854
|
-
let { t: r } = I(K), i =
|
|
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(() => {
|
|
1855
1849
|
let t = /* @__PURE__ */ new Map();
|
|
1856
1850
|
for (let n of e) {
|
|
1857
1851
|
let e = n.parentId !== "" && i.has(n.parentId) ? n.parentId : "", r = t.get(e) ?? [];
|
|
@@ -1888,24 +1882,24 @@ function _e({ collections: e, activeId: t, onSelect: n }) {
|
|
|
1888
1882
|
e,
|
|
1889
1883
|
i,
|
|
1890
1884
|
r
|
|
1891
|
-
]), [
|
|
1892
|
-
return /* @__PURE__ */
|
|
1893
|
-
collection:
|
|
1885
|
+
]), [s] = c(() => _e(t, e).slice(0, -1).map((e) => e.id));
|
|
1886
|
+
return /* @__PURE__ */ d(w, {
|
|
1887
|
+
collection: a,
|
|
1894
1888
|
size: "sm",
|
|
1895
1889
|
selectedValue: [t === "" ? Y : t],
|
|
1896
|
-
defaultExpandedValue:
|
|
1890
|
+
defaultExpandedValue: s,
|
|
1897
1891
|
onSelectionChange: (e) => {
|
|
1898
1892
|
let t = e.selectedValue[0];
|
|
1899
1893
|
t !== void 0 && n(t === Y ? "" : t);
|
|
1900
1894
|
},
|
|
1901
|
-
children: [/* @__PURE__ */
|
|
1895
|
+
children: [/* @__PURE__ */ u(ee, {
|
|
1902
1896
|
srOnly: !0,
|
|
1903
1897
|
children: r("library.collections")
|
|
1904
|
-
}), /* @__PURE__ */
|
|
1905
|
-
/* @__PURE__ */
|
|
1906
|
-
/* @__PURE__ */
|
|
1907
|
-
e.restricted ? /* @__PURE__ */
|
|
1908
|
-
] }) : /* @__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] }) }) })]
|
|
1909
1903
|
});
|
|
1910
1904
|
}
|
|
1911
1905
|
//#endregion
|
|
@@ -1914,94 +1908,94 @@ var Z = {
|
|
|
1914
1908
|
name: "",
|
|
1915
1909
|
sourceDate: "",
|
|
1916
1910
|
sourceReference: ""
|
|
1917
|
-
},
|
|
1918
|
-
function
|
|
1919
|
-
let { t:
|
|
1920
|
-
name:
|
|
1921
|
-
sourceDate:
|
|
1922
|
-
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"))
|
|
1923
1917
|
}).superRefine((e, t) => {
|
|
1924
1918
|
e.sourceReference !== "" && e.sourceDate === "" && t.addIssue({
|
|
1925
1919
|
code: "custom",
|
|
1926
1920
|
path: ["sourceDate"],
|
|
1927
|
-
message:
|
|
1921
|
+
message: i("changeSets.form.sourceDateRequired")
|
|
1928
1922
|
}), e.sourceDate !== "" && e.sourceReference === "" && t.addIssue({
|
|
1929
1923
|
code: "custom",
|
|
1930
1924
|
path: ["sourceReference"],
|
|
1931
|
-
message:
|
|
1925
|
+
message: i("changeSets.form.sourceReferenceRequired")
|
|
1932
1926
|
});
|
|
1933
|
-
}), [
|
|
1934
|
-
resolver:
|
|
1927
|
+
}), [i]), l = le({
|
|
1928
|
+
resolver: L(s),
|
|
1935
1929
|
defaultValues: Z
|
|
1936
|
-
}), [p, m] =
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
}, [
|
|
1940
|
-
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) => {
|
|
1941
1935
|
m(null);
|
|
1942
1936
|
try {
|
|
1943
1937
|
await r({
|
|
1944
|
-
name:
|
|
1945
|
-
source:
|
|
1946
|
-
date:
|
|
1947
|
-
reference:
|
|
1938
|
+
name: e.name,
|
|
1939
|
+
source: e.sourceDate === "" ? void 0 : {
|
|
1940
|
+
date: e.sourceDate,
|
|
1941
|
+
reference: e.sourceReference
|
|
1948
1942
|
}
|
|
1949
1943
|
});
|
|
1950
|
-
} catch (
|
|
1951
|
-
m(
|
|
1944
|
+
} catch (e) {
|
|
1945
|
+
m(e instanceof t ? e.message : i("changeSets.form.failed"));
|
|
1952
1946
|
}
|
|
1953
1947
|
});
|
|
1954
|
-
return /* @__PURE__ */
|
|
1955
|
-
open:
|
|
1948
|
+
return /* @__PURE__ */ u(g, {
|
|
1949
|
+
open: e,
|
|
1956
1950
|
onClose: n,
|
|
1957
1951
|
lazyMount: !0,
|
|
1958
1952
|
unmountOnExit: !0,
|
|
1959
1953
|
size: "md",
|
|
1960
|
-
header:
|
|
1961
|
-
footer: /* @__PURE__ */
|
|
1954
|
+
header: i("changeSets.form.createTitle"),
|
|
1955
|
+
footer: /* @__PURE__ */ d(O, {
|
|
1962
1956
|
gap: "2",
|
|
1963
|
-
children: [/* @__PURE__ */
|
|
1957
|
+
children: [/* @__PURE__ */ u(f, {
|
|
1964
1958
|
size: "sm",
|
|
1965
1959
|
variant: "ghost",
|
|
1966
1960
|
onClick: n,
|
|
1967
|
-
children:
|
|
1968
|
-
}), /* @__PURE__ */
|
|
1961
|
+
children: i("common.cancel")
|
|
1962
|
+
}), /* @__PURE__ */ u(f, {
|
|
1969
1963
|
type: "submit",
|
|
1970
|
-
form:
|
|
1964
|
+
form: ye,
|
|
1971
1965
|
size: "sm",
|
|
1972
1966
|
variant: "solid",
|
|
1973
|
-
loading:
|
|
1974
|
-
children:
|
|
1967
|
+
loading: h,
|
|
1968
|
+
children: i("changeSets.form.createSubmit")
|
|
1975
1969
|
})]
|
|
1976
1970
|
}),
|
|
1977
|
-
children: /* @__PURE__ */
|
|
1978
|
-
...
|
|
1979
|
-
children: /* @__PURE__ */
|
|
1980
|
-
id:
|
|
1971
|
+
children: /* @__PURE__ */ u(V, {
|
|
1972
|
+
...l,
|
|
1973
|
+
children: /* @__PURE__ */ u("form", {
|
|
1974
|
+
id: ye,
|
|
1981
1975
|
onSubmit: (e) => {
|
|
1982
1976
|
e.preventDefault(), _();
|
|
1983
1977
|
},
|
|
1984
|
-
children: /* @__PURE__ */
|
|
1978
|
+
children: /* @__PURE__ */ d(j, {
|
|
1985
1979
|
gap: "4",
|
|
1986
1980
|
children: [
|
|
1987
|
-
/* @__PURE__ */
|
|
1981
|
+
/* @__PURE__ */ u(z, {
|
|
1988
1982
|
name: "name",
|
|
1989
|
-
label:
|
|
1990
|
-
helperText:
|
|
1983
|
+
label: i("changeSets.form.name"),
|
|
1984
|
+
helperText: i("changeSets.form.nameHelp"),
|
|
1991
1985
|
required: !0
|
|
1992
1986
|
}),
|
|
1993
|
-
/* @__PURE__ */
|
|
1987
|
+
/* @__PURE__ */ u(z, {
|
|
1994
1988
|
name: "sourceDate",
|
|
1995
1989
|
type: "date",
|
|
1996
|
-
label:
|
|
1997
|
-
helperText:
|
|
1990
|
+
label: i("changeSets.form.sourceDate"),
|
|
1991
|
+
helperText: i("changeSets.form.sourceDateHelp")
|
|
1998
1992
|
}),
|
|
1999
|
-
/* @__PURE__ */
|
|
1993
|
+
/* @__PURE__ */ u(z, {
|
|
2000
1994
|
name: "sourceReference",
|
|
2001
|
-
label:
|
|
2002
|
-
helperText:
|
|
1995
|
+
label: i("changeSets.form.sourceReference"),
|
|
1996
|
+
helperText: i("changeSets.form.sourceReferenceHelp")
|
|
2003
1997
|
}),
|
|
2004
|
-
p ? /* @__PURE__ */
|
|
1998
|
+
p ? /* @__PURE__ */ u(D, {
|
|
2005
1999
|
status: "error",
|
|
2006
2000
|
title: p
|
|
2007
2001
|
}) : null
|
|
@@ -2013,8 +2007,8 @@ function ye({ open: t, onClose: n, onSubmit: r }) {
|
|
|
2013
2007
|
}
|
|
2014
2008
|
//#endregion
|
|
2015
2009
|
//#region src/screens/change-set-choice.tsx
|
|
2016
|
-
var
|
|
2017
|
-
function
|
|
2010
|
+
var xe = "@new";
|
|
2011
|
+
function Se(e, t, n = !1) {
|
|
2018
2012
|
if (!t.changeSetId) return {
|
|
2019
2013
|
path: "changeSetId",
|
|
2020
2014
|
message: e("library.create.changeSetRequired")
|
|
@@ -2032,37 +2026,37 @@ function xe(e, t, n = !1) {
|
|
|
2032
2026
|
message: e("changeSets.form.oneLine")
|
|
2033
2027
|
};
|
|
2034
2028
|
}
|
|
2035
|
-
function
|
|
2036
|
-
let { t:
|
|
2037
|
-
id:
|
|
2038
|
-
label:
|
|
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")
|
|
2039
2033
|
}, ...(s.data?.changeSets ?? []).map((e) => ({
|
|
2040
2034
|
id: e.id,
|
|
2041
2035
|
label: e.name
|
|
2042
|
-
}))], [s.data,
|
|
2043
|
-
return /* @__PURE__ */
|
|
2036
|
+
}))], [s.data, a]), f = H({ name: "changeSetId" });
|
|
2037
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(R, {
|
|
2044
2038
|
name: "changeSetId",
|
|
2045
|
-
label:
|
|
2039
|
+
label: a("library.create.changeSet"),
|
|
2046
2040
|
helperText: n,
|
|
2047
|
-
options:
|
|
2041
|
+
options: c,
|
|
2048
2042
|
isClearable: !1,
|
|
2049
2043
|
required: !0
|
|
2050
|
-
}), f === "@new" ? /* @__PURE__ */
|
|
2044
|
+
}), f === "@new" ? /* @__PURE__ */ u(z, {
|
|
2051
2045
|
name: "changeSetName",
|
|
2052
|
-
label:
|
|
2053
|
-
helperText: r ??
|
|
2046
|
+
label: a("library.create.changeSetName"),
|
|
2047
|
+
helperText: r ?? a("changeSets.form.nameHelp"),
|
|
2054
2048
|
required: !i
|
|
2055
2049
|
}) : null] });
|
|
2056
2050
|
}
|
|
2057
2051
|
//#endregion
|
|
2058
2052
|
//#region src/screens/create-content-modal.tsx
|
|
2059
|
-
var
|
|
2060
|
-
function
|
|
2061
|
-
let { t: v } = I(K), y = ae(), b =
|
|
2062
|
-
blueprintId:
|
|
2063
|
-
releaseId:
|
|
2064
|
-
changeSetId:
|
|
2065
|
-
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()
|
|
2066
2060
|
}).superRefine((e, t) => {
|
|
2067
2061
|
if (e.changeSetId !== "@new") return;
|
|
2068
2062
|
let n = (e) => t.addIssue({
|
|
@@ -2071,46 +2065,46 @@ function Te({ open: c, onClose: f, client: p, blueprintSource: m, initialChangeS
|
|
|
2071
2065
|
message: e
|
|
2072
2066
|
});
|
|
2073
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"));
|
|
2074
|
-
}), [v]), x =
|
|
2068
|
+
}), [v]), x = o(() => ({
|
|
2075
2069
|
blueprintId: null,
|
|
2076
2070
|
releaseId: null,
|
|
2077
|
-
changeSetId:
|
|
2071
|
+
changeSetId: h || "@new",
|
|
2078
2072
|
changeSetName: ""
|
|
2079
|
-
}), [
|
|
2080
|
-
resolver:
|
|
2073
|
+
}), [h]), S = le({
|
|
2074
|
+
resolver: L(b),
|
|
2081
2075
|
defaultValues: x
|
|
2082
|
-
}), [ee, C] =
|
|
2076
|
+
}), [ee, C] = c(null), w = S.formState.isSubmitting, T = H({
|
|
2083
2077
|
control: S.control,
|
|
2084
2078
|
name: "blueprintId"
|
|
2085
|
-
}),
|
|
2079
|
+
}), te = H({
|
|
2086
2080
|
control: S.control,
|
|
2087
2081
|
name: "changeSetId"
|
|
2088
2082
|
});
|
|
2089
|
-
|
|
2090
|
-
|
|
2083
|
+
a(() => {
|
|
2084
|
+
e && (S.reset(x), C(null));
|
|
2091
2085
|
}, [
|
|
2092
|
-
|
|
2086
|
+
e,
|
|
2093
2087
|
S,
|
|
2094
2088
|
x
|
|
2095
2089
|
]);
|
|
2096
|
-
let
|
|
2097
|
-
id:
|
|
2090
|
+
let E = ge(p, e), k = o(() => [{
|
|
2091
|
+
id: xe,
|
|
2098
2092
|
label: v("library.create.newChangeSet")
|
|
2099
|
-
}, ...(
|
|
2093
|
+
}, ...(E.data?.changeSets ?? []).map((e) => ({
|
|
2100
2094
|
id: e.id,
|
|
2101
2095
|
label: e.name
|
|
2102
|
-
}))], [
|
|
2103
|
-
queryKey:
|
|
2096
|
+
}))], [E.data, v]), A = P({
|
|
2097
|
+
queryKey: W.blueprintReleases(T ?? ""),
|
|
2104
2098
|
queryFn: () => m.listReleases(T),
|
|
2105
|
-
enabled:
|
|
2106
|
-
}),
|
|
2099
|
+
enabled: e && !!T
|
|
2100
|
+
}), ne = o(() => (A.data ?? []).map((e) => ({
|
|
2107
2101
|
id: e.id,
|
|
2108
2102
|
label: $(e) ? e.name : v("library.create.refusedRelease", { name: e.name }),
|
|
2109
2103
|
data: { refused: !$(e) }
|
|
2110
|
-
})), [
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
let e = S.getValues("releaseId"), t =
|
|
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;
|
|
2114
2108
|
if (!T) {
|
|
2115
2109
|
e !== null && S.setValue("releaseId", null);
|
|
2116
2110
|
return;
|
|
@@ -2118,10 +2112,10 @@ function Te({ open: c, onClose: f, client: p, blueprintSource: m, initialChangeS
|
|
|
2118
2112
|
t && !t.some((t) => t.id === e && $(t)) && S.setValue("releaseId", t.find($)?.id ?? null);
|
|
2119
2113
|
}, [
|
|
2120
2114
|
T,
|
|
2121
|
-
|
|
2115
|
+
A.data,
|
|
2122
2116
|
S
|
|
2123
2117
|
]);
|
|
2124
|
-
let
|
|
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 }) => {
|
|
2125
2119
|
let r = await m.searchBlueprints({
|
|
2126
2120
|
query: e,
|
|
2127
2121
|
pageToken: t ?? void 0,
|
|
@@ -2134,13 +2128,13 @@ function Te({ open: c, onClose: f, client: p, blueprintSource: m, initialChangeS
|
|
|
2134
2128
|
})),
|
|
2135
2129
|
nextCursor: r.nextPageToken || null
|
|
2136
2130
|
};
|
|
2137
|
-
}, [m]), se =
|
|
2131
|
+
}, [m]), se = i(async ({ ids: e }) => {
|
|
2138
2132
|
let t = await m.getBlueprints(e);
|
|
2139
2133
|
return e.map((e) => ({
|
|
2140
2134
|
id: e,
|
|
2141
2135
|
label: t.find((t) => t.id === e)?.name ?? e
|
|
2142
2136
|
}));
|
|
2143
|
-
}, [m]),
|
|
2137
|
+
}, [m]), ce = S.handleSubmit(async (e) => {
|
|
2144
2138
|
C(null);
|
|
2145
2139
|
let t = e.changeSetId, n = !1;
|
|
2146
2140
|
try {
|
|
@@ -2152,112 +2146,112 @@ function Te({ open: c, onClose: f, client: p, blueprintSource: m, initialChangeS
|
|
|
2152
2146
|
changeSetId: t,
|
|
2153
2147
|
blueprintReleaseId: e.releaseId
|
|
2154
2148
|
});
|
|
2155
|
-
y.invalidateQueries({ queryKey:
|
|
2149
|
+
y.invalidateQueries({ queryKey: W.contents() }), _(r);
|
|
2156
2150
|
} catch (e) {
|
|
2157
|
-
if (C(
|
|
2151
|
+
if (C(ue(e)), !n) return;
|
|
2158
2152
|
}
|
|
2159
|
-
y.invalidateQueries({ queryKey:
|
|
2153
|
+
y.invalidateQueries({ queryKey: W.changeSets() });
|
|
2160
2154
|
});
|
|
2161
|
-
function
|
|
2162
|
-
if (
|
|
2163
|
-
let
|
|
2164
|
-
return v("library.create.refused", { reasons:
|
|
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 });
|
|
2165
2159
|
}
|
|
2166
|
-
return
|
|
2160
|
+
return e instanceof n ? v("library.create.changeSetClosed") : e instanceof t ? e.message : v("library.create.failed");
|
|
2167
2161
|
}
|
|
2168
|
-
return /* @__PURE__ */
|
|
2169
|
-
open:
|
|
2170
|
-
onClose:
|
|
2162
|
+
return /* @__PURE__ */ u(g, {
|
|
2163
|
+
open: e,
|
|
2164
|
+
onClose: l,
|
|
2171
2165
|
lazyMount: !0,
|
|
2172
2166
|
unmountOnExit: !0,
|
|
2173
2167
|
size: "md",
|
|
2174
2168
|
header: v("library.create.title"),
|
|
2175
|
-
footer: /* @__PURE__ */
|
|
2169
|
+
footer: /* @__PURE__ */ d(O, {
|
|
2176
2170
|
gap: "2",
|
|
2177
|
-
children: [/* @__PURE__ */
|
|
2171
|
+
children: [/* @__PURE__ */ u(f, {
|
|
2178
2172
|
size: "sm",
|
|
2179
2173
|
variant: "ghost",
|
|
2180
|
-
onClick:
|
|
2174
|
+
onClick: l,
|
|
2181
2175
|
children: v("common.cancel")
|
|
2182
|
-
}), /* @__PURE__ */
|
|
2176
|
+
}), /* @__PURE__ */ u(f, {
|
|
2183
2177
|
type: "submit",
|
|
2184
|
-
form:
|
|
2178
|
+
form: we,
|
|
2185
2179
|
size: "sm",
|
|
2186
2180
|
variant: "solid",
|
|
2187
2181
|
loading: w,
|
|
2188
|
-
disabled:
|
|
2182
|
+
disabled: ie || F || A.isError,
|
|
2189
2183
|
children: v("library.create.submit")
|
|
2190
2184
|
})]
|
|
2191
2185
|
}),
|
|
2192
|
-
children: /* @__PURE__ */
|
|
2186
|
+
children: /* @__PURE__ */ u(V, {
|
|
2193
2187
|
...S,
|
|
2194
|
-
children: /* @__PURE__ */
|
|
2195
|
-
id:
|
|
2188
|
+
children: /* @__PURE__ */ u("form", {
|
|
2189
|
+
id: we,
|
|
2196
2190
|
onSubmit: (e) => {
|
|
2197
|
-
e.preventDefault(),
|
|
2191
|
+
e.preventDefault(), ce();
|
|
2198
2192
|
},
|
|
2199
|
-
children: /* @__PURE__ */
|
|
2193
|
+
children: /* @__PURE__ */ d(j, {
|
|
2200
2194
|
gap: "4",
|
|
2201
2195
|
children: [
|
|
2202
|
-
/* @__PURE__ */
|
|
2196
|
+
/* @__PURE__ */ u(B, {
|
|
2203
2197
|
name: "blueprintId",
|
|
2204
2198
|
label: v("library.create.blueprint"),
|
|
2205
2199
|
helperText: v("library.create.blueprintHelp"),
|
|
2206
|
-
search:
|
|
2200
|
+
search: oe,
|
|
2207
2201
|
resolve: se,
|
|
2208
2202
|
placeholder: v("library.create.pickBlueprint"),
|
|
2209
2203
|
required: !0
|
|
2210
2204
|
}),
|
|
2211
|
-
T ? /* @__PURE__ */
|
|
2205
|
+
T ? /* @__PURE__ */ u(R, {
|
|
2212
2206
|
name: "releaseId",
|
|
2213
2207
|
label: v("library.create.release"),
|
|
2214
2208
|
helperText: v("library.create.releaseHelp"),
|
|
2215
|
-
options:
|
|
2209
|
+
options: ne,
|
|
2216
2210
|
isClearable: !1,
|
|
2217
2211
|
required: !0,
|
|
2218
2212
|
selectProps: { isOptionDisabled: (e) => e.data?.refused === !0 }
|
|
2219
2213
|
}) : null,
|
|
2220
|
-
|
|
2214
|
+
ie ? /* @__PURE__ */ u(D, {
|
|
2221
2215
|
status: "warning",
|
|
2222
2216
|
title: v("library.create.noRelease")
|
|
2223
2217
|
}) : null,
|
|
2224
|
-
|
|
2218
|
+
F ? /* @__PURE__ */ u(D, {
|
|
2225
2219
|
status: "warning",
|
|
2226
2220
|
title: v("library.create.noUsableRelease")
|
|
2227
2221
|
}) : null,
|
|
2228
|
-
|
|
2222
|
+
A.isError ? /* @__PURE__ */ u(D, {
|
|
2229
2223
|
status: "error",
|
|
2230
2224
|
title: v("library.create.releasesFailed")
|
|
2231
2225
|
}) : null,
|
|
2232
|
-
|
|
2226
|
+
N.length > 0 ? /* @__PURE__ */ u(D, {
|
|
2233
2227
|
status: "info",
|
|
2234
2228
|
title: v("library.create.refusedReleases"),
|
|
2235
|
-
children: /* @__PURE__ */
|
|
2229
|
+
children: /* @__PURE__ */ u(j, {
|
|
2236
2230
|
gap: "1",
|
|
2237
|
-
children:
|
|
2231
|
+
children: N.map((e) => /* @__PURE__ */ u(M, {
|
|
2238
2232
|
textStyle: "sm",
|
|
2239
2233
|
children: v("library.create.refusedReleaseReasons", {
|
|
2240
2234
|
name: e.name,
|
|
2241
|
-
reasons: (e.refusals ?? []).map(
|
|
2235
|
+
reasons: (e.refusals ?? []).map(Te).join(", ")
|
|
2242
2236
|
})
|
|
2243
2237
|
}, e.id))
|
|
2244
2238
|
})
|
|
2245
2239
|
}) : null,
|
|
2246
|
-
/* @__PURE__ */
|
|
2240
|
+
/* @__PURE__ */ u(R, {
|
|
2247
2241
|
name: "changeSetId",
|
|
2248
2242
|
label: v("library.create.changeSet"),
|
|
2249
2243
|
helperText: v("library.create.changeSetHelp"),
|
|
2250
|
-
options:
|
|
2244
|
+
options: k,
|
|
2251
2245
|
isClearable: !1,
|
|
2252
2246
|
required: !0
|
|
2253
2247
|
}),
|
|
2254
|
-
|
|
2248
|
+
te === "@new" ? /* @__PURE__ */ u(z, {
|
|
2255
2249
|
name: "changeSetName",
|
|
2256
2250
|
label: v("library.create.changeSetName"),
|
|
2257
2251
|
helperText: v("changeSets.form.nameHelp"),
|
|
2258
2252
|
required: !0
|
|
2259
2253
|
}) : null,
|
|
2260
|
-
ee ? /* @__PURE__ */
|
|
2254
|
+
ee ? /* @__PURE__ */ u(D, {
|
|
2261
2255
|
status: "error",
|
|
2262
2256
|
title: ee
|
|
2263
2257
|
}) : null
|
|
@@ -2269,66 +2263,66 @@ function Te({ open: c, onClose: f, client: p, blueprintSource: m, initialChangeS
|
|
|
2269
2263
|
}
|
|
2270
2264
|
//#endregion
|
|
2271
2265
|
//#region src/screens/content-library.tsx
|
|
2272
|
-
var
|
|
2266
|
+
var De = [
|
|
2273
2267
|
"main",
|
|
2274
2268
|
"in_force",
|
|
2275
2269
|
"change_set"
|
|
2276
|
-
],
|
|
2277
|
-
function
|
|
2270
|
+
], Oe = 50, ke = 300, Ae = 5, je = "@me", Me = "collection";
|
|
2271
|
+
function Ne(e) {
|
|
2278
2272
|
return Object.values(e).filter((e) => typeof e == "string" && e.trim() !== "" && e.length <= 200).slice(0, 2).join(" ");
|
|
2279
2273
|
}
|
|
2280
|
-
function
|
|
2281
|
-
let { t:
|
|
2282
|
-
|
|
2283
|
-
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);
|
|
2284
2278
|
return () => clearTimeout(e);
|
|
2285
2279
|
}, [w]);
|
|
2286
|
-
let H =
|
|
2280
|
+
let H = i((e) => y((t) => {
|
|
2287
2281
|
let n = new URLSearchParams(t);
|
|
2288
|
-
return e ? n.set(
|
|
2289
|
-
}), [y]),
|
|
2290
|
-
queryKey:
|
|
2291
|
-
queryFn: () =>
|
|
2292
|
-
}), G =
|
|
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 ? {
|
|
2293
2287
|
kind: "change_set",
|
|
2294
|
-
changeSetId:
|
|
2295
|
-
} : void 0 : { kind: x }, [x,
|
|
2296
|
-
view:
|
|
2288
|
+
changeSetId: q
|
|
2289
|
+
} : void 0 : { kind: x }, [x, q]), me = o(() => ({
|
|
2290
|
+
view: pe,
|
|
2297
2291
|
collectionId: b || void 0,
|
|
2298
|
-
search: x === "in_force" ? void 0 :
|
|
2292
|
+
search: x === "in_force" ? void 0 : E.trim() || void 0,
|
|
2299
2293
|
blueprintIds: F ? [F] : void 0,
|
|
2300
|
-
assigneeId: L ===
|
|
2294
|
+
assigneeId: L === je ? V : L || void 0
|
|
2301
2295
|
}), [
|
|
2302
|
-
|
|
2296
|
+
pe,
|
|
2303
2297
|
b,
|
|
2304
2298
|
x,
|
|
2305
|
-
|
|
2299
|
+
E,
|
|
2306
2300
|
F,
|
|
2307
2301
|
L,
|
|
2308
|
-
|
|
2309
|
-
]),
|
|
2310
|
-
queryKey:
|
|
2311
|
-
queryFn: ({ pageParam:
|
|
2302
|
+
V
|
|
2303
|
+
]), J = ie({
|
|
2304
|
+
queryKey: W.contentList(me),
|
|
2305
|
+
queryFn: ({ pageParam: t }) => e.listContents({
|
|
2312
2306
|
...me,
|
|
2313
|
-
pageSize:
|
|
2314
|
-
pageToken:
|
|
2307
|
+
pageSize: Oe,
|
|
2308
|
+
pageToken: t
|
|
2315
2309
|
}),
|
|
2316
2310
|
initialPageParam: "",
|
|
2317
2311
|
getNextPageParam: (e) => e.nextPageToken || void 0,
|
|
2318
|
-
enabled:
|
|
2312
|
+
enabled: pe !== void 0,
|
|
2319
2313
|
placeholderData: re
|
|
2320
|
-
}),
|
|
2321
|
-
queryKey:
|
|
2322
|
-
queryFn: () =>
|
|
2323
|
-
enabled:
|
|
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,
|
|
2324
2318
|
placeholderData: re,
|
|
2325
2319
|
staleTime: 6e4
|
|
2326
|
-
}),
|
|
2327
|
-
queryKey:
|
|
2320
|
+
}), ye = i((e) => Z.data?.find((t) => t.id === e)?.name ?? e, [Z.data]), Q = P({
|
|
2321
|
+
queryKey: W.blueprintFilterOptions(),
|
|
2328
2322
|
queryFn: async () => {
|
|
2329
2323
|
let e = [], t = "";
|
|
2330
|
-
for (let n = 0; n <
|
|
2331
|
-
let n = await
|
|
2324
|
+
for (let n = 0; n < Ae; n++) {
|
|
2325
|
+
let n = await g.searchBlueprints({
|
|
2332
2326
|
query: "",
|
|
2333
2327
|
pageToken: t
|
|
2334
2328
|
});
|
|
@@ -2337,13 +2331,22 @@ function Ne({ client: t, blueprintSource: n, onOpenContent: o, onOpenBranch: c }
|
|
|
2337
2331
|
return e;
|
|
2338
2332
|
},
|
|
2339
2333
|
staleTime: 6e4
|
|
2340
|
-
}), be =
|
|
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(() => [
|
|
2341
2344
|
{
|
|
2342
2345
|
id: "content",
|
|
2343
|
-
header:
|
|
2346
|
+
header: l("library.columns.content"),
|
|
2344
2347
|
cell: ({ row: e }) => {
|
|
2345
|
-
let t =
|
|
2346
|
-
return /* @__PURE__ */
|
|
2348
|
+
let t = Ne(e.original.data);
|
|
2349
|
+
return /* @__PURE__ */ u(te, {
|
|
2347
2350
|
value: t || e.original.id,
|
|
2348
2351
|
subText: t ? e.original.id : void 0
|
|
2349
2352
|
});
|
|
@@ -2351,178 +2354,178 @@ function Ne({ client: t, blueprintSource: n, onOpenContent: o, onOpenBranch: c }
|
|
|
2351
2354
|
},
|
|
2352
2355
|
{
|
|
2353
2356
|
id: "blueprint",
|
|
2354
|
-
header:
|
|
2355
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
2357
|
+
header: l("library.columns.blueprint"),
|
|
2358
|
+
cell: ({ row: e }) => /* @__PURE__ */ u(te, { value: ye(e.original.blueprintId) })
|
|
2356
2359
|
},
|
|
2357
2360
|
{
|
|
2358
2361
|
id: "readOn",
|
|
2359
|
-
header:
|
|
2362
|
+
header: l("library.columns.readOn"),
|
|
2360
2363
|
cell: ({ row: e }) => {
|
|
2361
|
-
let t = e.original, n = t.changeSetId ?
|
|
2362
|
-
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 });
|
|
2363
2366
|
}
|
|
2364
2367
|
},
|
|
2365
2368
|
{
|
|
2366
2369
|
id: "revised",
|
|
2367
|
-
header:
|
|
2368
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
2370
|
+
header: l("library.columns.revised"),
|
|
2371
|
+
cell: ({ row: e }) => /* @__PURE__ */ u(h, { value: e.original.revisionCreateTime })
|
|
2369
2372
|
}
|
|
2370
2373
|
], [
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
]),
|
|
2374
|
+
l,
|
|
2375
|
+
ye,
|
|
2376
|
+
fe
|
|
2377
|
+
]), Ce = /* @__PURE__ */ d(f, {
|
|
2375
2378
|
size: "sm",
|
|
2376
2379
|
variant: "solid",
|
|
2377
|
-
onClick: () =>
|
|
2378
|
-
children: [/* @__PURE__ */
|
|
2379
|
-
}),
|
|
2380
|
-
return /* @__PURE__ */
|
|
2381
|
-
title:
|
|
2382
|
-
breadcrumbs: [{ label:
|
|
2383
|
-
actions:
|
|
2384
|
-
toolbar: /* @__PURE__ */
|
|
2385
|
-
x === "in_force" ? /* @__PURE__ */
|
|
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, {
|
|
2386
2389
|
fontSize: "sm",
|
|
2387
2390
|
color: "muted",
|
|
2388
|
-
children:
|
|
2389
|
-
}) : /* @__PURE__ */
|
|
2390
|
-
placeholder:
|
|
2391
|
+
children: l("library.filter.searchInForce")
|
|
2392
|
+
}) : /* @__PURE__ */ u(_.Search, {
|
|
2393
|
+
placeholder: l("library.filter.searchPlaceholder"),
|
|
2391
2394
|
value: w,
|
|
2392
|
-
onChange: (e) =>
|
|
2395
|
+
onChange: (e) => T([...e].slice(0, 200).join(""))
|
|
2393
2396
|
}),
|
|
2394
|
-
/* @__PURE__ */
|
|
2395
|
-
/* @__PURE__ */
|
|
2397
|
+
/* @__PURE__ */ d(_.Filters, { children: [
|
|
2398
|
+
/* @__PURE__ */ u(k, {
|
|
2396
2399
|
size: "sm",
|
|
2397
|
-
"aria-label":
|
|
2400
|
+
"aria-label": l("library.filter.view"),
|
|
2398
2401
|
value: x,
|
|
2399
2402
|
onChange: (e) => {
|
|
2400
2403
|
let t = e.target.value;
|
|
2401
|
-
t === "in_force" && (
|
|
2404
|
+
t === "in_force" && (T(""), ae("")), S(t);
|
|
2402
2405
|
},
|
|
2403
|
-
children:
|
|
2406
|
+
children: De.map((e) => /* @__PURE__ */ u("option", {
|
|
2404
2407
|
value: e,
|
|
2405
|
-
children:
|
|
2408
|
+
children: l(`library.view.${e}`)
|
|
2406
2409
|
}, e))
|
|
2407
2410
|
}),
|
|
2408
|
-
x === "change_set" ? /* @__PURE__ */
|
|
2411
|
+
x === "change_set" ? /* @__PURE__ */ d(k, {
|
|
2409
2412
|
size: "sm",
|
|
2410
|
-
"aria-label":
|
|
2411
|
-
value:
|
|
2413
|
+
"aria-label": l("library.filter.changeSet"),
|
|
2414
|
+
value: q,
|
|
2412
2415
|
onChange: (e) => C(e.target.value),
|
|
2413
|
-
children: [G.data?.changeSets.length ? null : /* @__PURE__ */
|
|
2416
|
+
children: [G.data?.changeSets.length ? null : /* @__PURE__ */ u("option", {
|
|
2414
2417
|
value: "",
|
|
2415
|
-
children:
|
|
2416
|
-
}), (G.data?.changeSets ?? []).map((e) => /* @__PURE__ */
|
|
2418
|
+
children: l("library.filter.noOpenChangeSet")
|
|
2419
|
+
}), (G.data?.changeSets ?? []).map((e) => /* @__PURE__ */ u("option", {
|
|
2417
2420
|
value: e.id,
|
|
2418
2421
|
children: e.name
|
|
2419
2422
|
}, e.id))]
|
|
2420
2423
|
}) : null,
|
|
2421
|
-
/* @__PURE__ */
|
|
2424
|
+
/* @__PURE__ */ d(k, {
|
|
2422
2425
|
size: "sm",
|
|
2423
|
-
"aria-label":
|
|
2426
|
+
"aria-label": l("library.filter.blueprint"),
|
|
2424
2427
|
value: F,
|
|
2425
|
-
onChange: (e) =>
|
|
2426
|
-
children: [/* @__PURE__ */
|
|
2428
|
+
onChange: (e) => se(e.target.value),
|
|
2429
|
+
children: [/* @__PURE__ */ u("option", {
|
|
2427
2430
|
value: "",
|
|
2428
|
-
children:
|
|
2429
|
-
}),
|
|
2431
|
+
children: l("library.filter.anyBlueprint")
|
|
2432
|
+
}), xe.map((e) => /* @__PURE__ */ u("option", {
|
|
2430
2433
|
value: e.id,
|
|
2431
2434
|
children: e.name
|
|
2432
2435
|
}, e.id))]
|
|
2433
2436
|
}),
|
|
2434
|
-
/* @__PURE__ */
|
|
2437
|
+
/* @__PURE__ */ d(k, {
|
|
2435
2438
|
size: "sm",
|
|
2436
|
-
"aria-label":
|
|
2439
|
+
"aria-label": l("library.filter.assignee"),
|
|
2437
2440
|
value: L,
|
|
2438
2441
|
onChange: (e) => R(e.target.value),
|
|
2439
2442
|
children: [
|
|
2440
|
-
/* @__PURE__ */
|
|
2443
|
+
/* @__PURE__ */ u("option", {
|
|
2441
2444
|
value: "",
|
|
2442
|
-
children:
|
|
2445
|
+
children: l("library.filter.anyone")
|
|
2443
2446
|
}),
|
|
2444
|
-
/* @__PURE__ */
|
|
2445
|
-
value:
|
|
2446
|
-
children:
|
|
2447
|
+
/* @__PURE__ */ u("option", {
|
|
2448
|
+
value: je,
|
|
2449
|
+
children: l("library.filter.me")
|
|
2447
2450
|
}),
|
|
2448
|
-
|
|
2451
|
+
le.list().filter((e) => e.userId !== V).map((e) => /* @__PURE__ */ u("option", {
|
|
2449
2452
|
value: e.userId,
|
|
2450
2453
|
children: e.displayName
|
|
2451
2454
|
}, e.userId))
|
|
2452
2455
|
]
|
|
2453
2456
|
})
|
|
2454
2457
|
] }),
|
|
2455
|
-
/* @__PURE__ */
|
|
2458
|
+
/* @__PURE__ */ u(_.Right, { children: J.isError ? null : /* @__PURE__ */ d(_.Count, { children: [l("library.count", { count: Y.length }), J.hasNextPage ? "+" : ""] }) })
|
|
2456
2459
|
] }),
|
|
2457
|
-
children: [/* @__PURE__ */
|
|
2460
|
+
children: [/* @__PURE__ */ d(N, {
|
|
2458
2461
|
storageKey: "contenthub-library-subnav",
|
|
2459
|
-
children: [/* @__PURE__ */
|
|
2460
|
-
"aria-label":
|
|
2461
|
-
children:
|
|
2462
|
-
collections:
|
|
2462
|
+
children: [/* @__PURE__ */ u(N.Nav, {
|
|
2463
|
+
"aria-label": l("library.collections"),
|
|
2464
|
+
children: U.isSuccess ? /* @__PURE__ */ u(ve, {
|
|
2465
|
+
collections: U.data,
|
|
2463
2466
|
activeId: b,
|
|
2464
2467
|
onSelect: H
|
|
2465
|
-
}) :
|
|
2468
|
+
}) : U.isError ? /* @__PURE__ */ u(M, {
|
|
2466
2469
|
fontSize: "sm",
|
|
2467
2470
|
color: "muted",
|
|
2468
2471
|
px: "3",
|
|
2469
2472
|
py: "2",
|
|
2470
|
-
children:
|
|
2471
|
-
}) : /* @__PURE__ */
|
|
2473
|
+
children: l("library.collectionsError")
|
|
2474
|
+
}) : /* @__PURE__ */ u(O, {
|
|
2472
2475
|
justify: "center",
|
|
2473
2476
|
py: "4",
|
|
2474
|
-
children: /* @__PURE__ */
|
|
2477
|
+
children: /* @__PURE__ */ u(A, { size: "sm" })
|
|
2475
2478
|
})
|
|
2476
|
-
}), /* @__PURE__ */
|
|
2479
|
+
}), /* @__PURE__ */ d(N.Detail, { children: [/* @__PURE__ */ u(N.Toolbar, { children: /* @__PURE__ */ u(M, {
|
|
2477
2480
|
fontSize: "sm",
|
|
2478
2481
|
fontWeight: "medium",
|
|
2479
|
-
children:
|
|
2480
|
-
}) }), /* @__PURE__ */
|
|
2482
|
+
children: $
|
|
2483
|
+
}) }), /* @__PURE__ */ d(j, {
|
|
2481
2484
|
gap: "3",
|
|
2482
2485
|
children: [
|
|
2483
|
-
|
|
2486
|
+
J.isError ? /* @__PURE__ */ u(D, {
|
|
2484
2487
|
status: "error",
|
|
2485
|
-
title:
|
|
2488
|
+
title: we,
|
|
2486
2489
|
mx: "8",
|
|
2487
2490
|
mt: "4"
|
|
2488
2491
|
}) : null,
|
|
2489
|
-
/* @__PURE__ */
|
|
2490
|
-
columns:
|
|
2491
|
-
data:
|
|
2492
|
-
loading:
|
|
2492
|
+
/* @__PURE__ */ u(m, {
|
|
2493
|
+
columns: Se,
|
|
2494
|
+
data: Y,
|
|
2495
|
+
loading: J.isLoading,
|
|
2493
2496
|
getRowId: (e) => `${e.id}/${e.branchId}/${e.releaseId}`,
|
|
2494
|
-
onRowClick: (e) =>
|
|
2497
|
+
onRowClick: (e) => r({
|
|
2495
2498
|
contentId: e.id,
|
|
2496
2499
|
changeSetId: e.changeSetId || void 0
|
|
2497
2500
|
}),
|
|
2498
2501
|
variant: "hoverable",
|
|
2499
|
-
emptyState: /* @__PURE__ */
|
|
2500
|
-
icon: /* @__PURE__ */
|
|
2501
|
-
header:
|
|
2502
|
-
description:
|
|
2502
|
+
emptyState: /* @__PURE__ */ u(p, {
|
|
2503
|
+
icon: /* @__PURE__ */ u(oe, { size: 32 }),
|
|
2504
|
+
header: l("library.empty"),
|
|
2505
|
+
description: l("library.emptyHint")
|
|
2503
2506
|
})
|
|
2504
2507
|
}),
|
|
2505
|
-
|
|
2508
|
+
J.hasNextPage ? /* @__PURE__ */ u(O, {
|
|
2506
2509
|
justify: "center",
|
|
2507
2510
|
pb: "4",
|
|
2508
|
-
children: /* @__PURE__ */
|
|
2511
|
+
children: /* @__PURE__ */ u(f, {
|
|
2509
2512
|
size: "sm",
|
|
2510
2513
|
variant: "outline",
|
|
2511
|
-
loading:
|
|
2512
|
-
onClick: () => void
|
|
2513
|
-
children:
|
|
2514
|
+
loading: J.isFetchingNextPage,
|
|
2515
|
+
onClick: () => void J.fetchNextPage(),
|
|
2516
|
+
children: l("library.more")
|
|
2514
2517
|
})
|
|
2515
2518
|
}) : null
|
|
2516
2519
|
]
|
|
2517
2520
|
})] })]
|
|
2518
|
-
}), /* @__PURE__ */
|
|
2519
|
-
open:
|
|
2520
|
-
onClose: () =>
|
|
2521
|
-
client:
|
|
2522
|
-
blueprintSource:
|
|
2523
|
-
initialChangeSetId: x === "change_set" ?
|
|
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,
|
|
2524
2527
|
onCreated: (e) => {
|
|
2525
|
-
|
|
2528
|
+
B(!1), s({
|
|
2526
2529
|
changeSetId: e.changeSetId,
|
|
2527
2530
|
contentId: e.id,
|
|
2528
2531
|
branchId: e.branchId
|
|
@@ -2531,8 +2534,8 @@ function Ne({ client: t, blueprintSource: n, onOpenContent: o, onOpenBranch: c }
|
|
|
2531
2534
|
})]
|
|
2532
2535
|
});
|
|
2533
2536
|
}
|
|
2534
|
-
|
|
2537
|
+
Pe.displayName = "ContentLibrary";
|
|
2535
2538
|
//#endregion
|
|
2536
|
-
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 };
|
|
2537
2540
|
|
|
2538
|
-
//# sourceMappingURL=content-library-
|
|
2541
|
+
//# sourceMappingURL=content-library-v0mjVD4J.js.map
|