@wso2/am-core-ui 0.0.12 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Layouts → core-ui/src/Layouts}/OxygenLayout/LeftNavigation.d.ts +1 -3
- package/dist/{Layouts → core-ui/src/Layouts}/OxygenLayout/path-map.d.ts +0 -1
- package/dist/{Layouts → core-ui/src/Layouts}/OxygenLayout/userMenuItems.d.ts +7 -2
- package/dist/{pages → core-ui/src/pages}/index.d.ts +12 -4
- package/dist/{types → core-ui/src/types}/mountPoints.d.ts +4 -1
- package/dist/index-BQlJRlEI.js +236 -0
- package/dist/index-BV8vICwZ.js +263 -0
- package/dist/index-BXsGzHi8.js +3037 -0
- package/dist/{index-C5miD1SI.js → index-BpKdCFaM.js} +21986 -20114
- package/dist/{index-D2KjwhE9.js → index-WAarK3dI.js} +48316 -36956
- package/dist/index.js +429 -293
- package/package.json +1 -1
- package/dist/index-Cdg2qecR.js +0 -189
- package/dist/index-MipkxZ31.js +0 -2227
- /package/dist/{CoreUI.d.ts → core-ui/src/CoreUI.d.ts} +0 -0
- /package/dist/{Layouts → core-ui/src/Layouts}/OxygenLayout/OxygenLayout.d.ts +0 -0
- /package/dist/{Layouts → core-ui/src/Layouts}/OxygenLayout/TopNavigation.d.ts +0 -0
- /package/dist/{Layouts → core-ui/src/Layouts}/OxygenLayout/index.d.ts +0 -0
- /package/dist/{Layouts → core-ui/src/Layouts}/OxygenLayout/navigationItems.d.ts +0 -0
- /package/dist/{Layouts → core-ui/src/Layouts}/index.d.ts +0 -0
- /package/dist/{Providers → core-ui/src/Providers}/GlobalProviders/GlobalProviders.d.ts +0 -0
- /package/dist/{Providers → core-ui/src/Providers}/GlobalProviders/index.d.ts +0 -0
- /package/dist/{Providers → core-ui/src/Providers}/Protected/Protected.d.ts +0 -0
- /package/dist/{Providers → core-ui/src/Providers}/Protected/index.d.ts +0 -0
- /package/dist/{Providers → core-ui/src/Providers}/index.d.ts +0 -0
- /package/dist/{Route → core-ui/src/Route}/Route.d.ts +0 -0
- /package/dist/{Route → core-ui/src/Route}/index.d.ts +0 -0
- /package/dist/{components → core-ui/src/components}/LoadingFallback.d.ts +0 -0
- /package/dist/{index.d.ts → core-ui/src/index.d.ts} +0 -0
- /package/dist/{pages → core-ui/src/pages}/Login/Login.d.ts +0 -0
- /package/dist/{pages → core-ui/src/pages}/Login/index.d.ts +0 -0
- /package/dist/{types → core-ui/src/types}/index.d.ts +0 -0
package/package.json
CHANGED
package/dist/index-Cdg2qecR.js
DELETED
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
import { jsx as r, jsxs as j } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback as z, useMemo as A, useEffect as V, useState as F } from "react";
|
|
3
|
-
import { Alert as L, Box as S, Collapse as B, Button as T, Form as y, TextField as W, Stack as M, CircularProgress as G, Typography as O, Select as q, MenuItem as D } from "@wso2/oxygen-ui";
|
|
4
|
-
import { useParams as R, useNavigate as _, generatePath as k } from "react-router-dom";
|
|
5
|
-
import { bw as H, bV as w, cV as K, bu as $, cT as J, cK as Q, cv as U, ar as I, P as X } from "./index-D2KjwhE9.js";
|
|
6
|
-
import { c as Y } from "react/compiler-runtime";
|
|
7
|
-
import "@tanstack/react-query";
|
|
8
|
-
import { Link as Z, PackagePlus as ee, FolderPlus as te } from "@wso2/oxygen-ui-icons-react";
|
|
9
|
-
const re = H({
|
|
10
|
-
displayName: w().trim().min(1, "Display name is required").min(3, "Display name must be at least 3 characters").max(100, "Display name must be at most 100 characters"),
|
|
11
|
-
name: w().trim().max(50, "Name must be at most 50 characters"),
|
|
12
|
-
description: w().trim().optional(),
|
|
13
|
-
deploymentPipeline: w().trim().min(1, "Deployment pipeline is required")
|
|
14
|
-
}), ne = (i) => {
|
|
15
|
-
const e = Y(22), {
|
|
16
|
-
lastSubmittedValidationErrors: n,
|
|
17
|
-
isPending: N,
|
|
18
|
-
onCancel: s,
|
|
19
|
-
onSubmit: c,
|
|
20
|
-
mode: g,
|
|
21
|
-
isNameEmpty: d
|
|
22
|
-
} = i, P = g === void 0 ? "deploy" : g, C = d === void 0 ? !1 : d, l = P === "connect";
|
|
23
|
-
let t;
|
|
24
|
-
e[0] !== n ? (t = Object.values(n), e[0] = n, e[1] = t) : t = e[1];
|
|
25
|
-
const o = t, m = o.length > 0;
|
|
26
|
-
let a;
|
|
27
|
-
e[2] !== o ? (a = /* @__PURE__ */ r(L, { severity: "error", children: o.map(ie) }), e[2] = o, e[3] = a) : a = e[3];
|
|
28
|
-
let u;
|
|
29
|
-
e[4] !== m || e[5] !== a ? (u = /* @__PURE__ */ r(B, { in: m, timeout: "auto", unmountOnExit: !0, children: a }), e[4] = m, e[5] = a, e[6] = u) : u = e[6];
|
|
30
|
-
let h;
|
|
31
|
-
e[7] !== s ? (h = /* @__PURE__ */ r(T, { variant: "outlined", color: "primary", size: "medium", onClick: s, children: "Cancel" }), e[7] = s, e[8] = h) : h = e[8];
|
|
32
|
-
let p;
|
|
33
|
-
e[9] !== l ? (p = l ? /* @__PURE__ */ r(Z, { size: 16 }) : /* @__PURE__ */ r(ee, { size: 16 }), e[9] = l, e[10] = p) : p = e[10];
|
|
34
|
-
const v = N || C, x = l ? "Register" : "Create";
|
|
35
|
-
let f;
|
|
36
|
-
e[11] !== c || e[12] !== p || e[13] !== v || e[14] !== x ? (f = /* @__PURE__ */ r(T, { variant: "contained", color: "primary", size: "medium", startIcon: p, onClick: c, disabled: v, children: x }), e[11] = c, e[12] = p, e[13] = v, e[14] = x, e[15] = f) : f = e[15];
|
|
37
|
-
let b;
|
|
38
|
-
e[16] !== f || e[17] !== h ? (b = /* @__PURE__ */ j(S, { display: "flex", flexDirection: "row", gap: 1, alignItems: "center", children: [
|
|
39
|
-
h,
|
|
40
|
-
f
|
|
41
|
-
] }), e[16] = f, e[17] = h, e[18] = b) : b = e[18];
|
|
42
|
-
let E;
|
|
43
|
-
return e[19] !== b || e[20] !== u ? (E = /* @__PURE__ */ j(S, { display: "flex", flexDirection: "column", gap: 3, children: [
|
|
44
|
-
u,
|
|
45
|
-
b
|
|
46
|
-
] }), e[19] = b, e[20] = u, e[21] = E) : E = e[21], E;
|
|
47
|
-
};
|
|
48
|
-
function ie(i, e) {
|
|
49
|
-
return /* @__PURE__ */ r(S, { children: i }, e);
|
|
50
|
-
}
|
|
51
|
-
const ae = ({
|
|
52
|
-
formData: i,
|
|
53
|
-
setFormData: e,
|
|
54
|
-
errors: n,
|
|
55
|
-
validateField: N,
|
|
56
|
-
setFieldError: s,
|
|
57
|
-
checkDirty: c
|
|
58
|
-
}) => {
|
|
59
|
-
const {
|
|
60
|
-
orgId: g
|
|
61
|
-
} = R(), d = z((t, o) => {
|
|
62
|
-
const m = {
|
|
63
|
-
...i,
|
|
64
|
-
[t]: o
|
|
65
|
-
};
|
|
66
|
-
e(m), c(m);
|
|
67
|
-
const a = N(t, o);
|
|
68
|
-
s(t, a);
|
|
69
|
-
}, [i, e, c, N, s]), {
|
|
70
|
-
mutate: P,
|
|
71
|
-
isPending: C
|
|
72
|
-
} = K({
|
|
73
|
-
orgName: g
|
|
74
|
-
}), l = A(
|
|
75
|
-
() => $.debounce((t) => {
|
|
76
|
-
if (t.length < 3) {
|
|
77
|
-
d("name", "");
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
P({
|
|
81
|
-
displayName: t,
|
|
82
|
-
resourceType: "project"
|
|
83
|
-
}, {
|
|
84
|
-
onSuccess: (o) => {
|
|
85
|
-
e((m) => {
|
|
86
|
-
const a = {
|
|
87
|
-
...m,
|
|
88
|
-
name: o.name
|
|
89
|
-
};
|
|
90
|
-
return c(a), a;
|
|
91
|
-
});
|
|
92
|
-
},
|
|
93
|
-
onError: (o) => {
|
|
94
|
-
console.error("Failed to generate name:", o);
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
}, 500),
|
|
98
|
-
// 500ms delay
|
|
99
|
-
[P, e, c]
|
|
100
|
-
);
|
|
101
|
-
return V(() => () => {
|
|
102
|
-
l.cancel();
|
|
103
|
-
}, [l]), V(() => {
|
|
104
|
-
i.displayName && i.displayName.length >= 3 ? l(i.displayName) : (l.cancel(), e((t) => ({
|
|
105
|
-
...t,
|
|
106
|
-
name: ""
|
|
107
|
-
})));
|
|
108
|
-
}, [i.displayName, e, l]), /* @__PURE__ */ r(y.Stack, { spacing: 3, children: /* @__PURE__ */ j(y.Section, { children: [
|
|
109
|
-
/* @__PURE__ */ r(y.Subheader, { children: "Project Details" }),
|
|
110
|
-
/* @__PURE__ */ j(y.Stack, { spacing: 2, children: [
|
|
111
|
-
/* @__PURE__ */ r(y.ElementWrapper, { label: "Name", name: "displayName", children: /* @__PURE__ */ r(W, { id: "displayName", value: i.displayName, onChange: (t) => d("displayName", t.target.value), placeholder: "e.g., Customer Support Platform", error: !!n.displayName, helperText: C ? /* @__PURE__ */ j(M, { direction: "row", alignItems: "center", gap: 1, children: [
|
|
112
|
-
/* @__PURE__ */ r(G, { size: 12 }),
|
|
113
|
-
/* @__PURE__ */ r(O, { variant: "caption", children: "Validating name..." })
|
|
114
|
-
] }) : n.displayName, fullWidth: !0 }) }),
|
|
115
|
-
/* @__PURE__ */ r(y.ElementWrapper, { label: "Description (optional)", name: "description", children: /* @__PURE__ */ r(W, { id: "description", value: i.description, onChange: (t) => d("description", t.target.value), placeholder: "Short description of this project", multiline: !0, minRows: 2, maxRows: 6, error: !!n.description, helperText: n.description, fullWidth: !0 }) }),
|
|
116
|
-
/* @__PURE__ */ r(S, { display: "none", children: /* @__PURE__ */ r(y.ElementWrapper, { label: "Deployment Pipeline", name: "deploymentPipeline", children: /* @__PURE__ */ r(q, { id: "deploymentPipeline", value: i.deploymentPipeline, onChange: (t) => d("deploymentPipeline", t.target.value), error: !!n.deploymentPipeline, fullWidth: !0, children: /* @__PURE__ */ r(D, { value: "default", children: "default" }) }) }) })
|
|
117
|
-
] })
|
|
118
|
-
] }) });
|
|
119
|
-
}, oe = () => {
|
|
120
|
-
const i = _(), {
|
|
121
|
-
orgId: e
|
|
122
|
-
} = R(), [n, N] = F({
|
|
123
|
-
name: "",
|
|
124
|
-
displayName: "",
|
|
125
|
-
description: "",
|
|
126
|
-
deploymentPipeline: "default"
|
|
127
|
-
}), {
|
|
128
|
-
errors: s,
|
|
129
|
-
validateField: c,
|
|
130
|
-
validateForm: g,
|
|
131
|
-
clearErrors: d,
|
|
132
|
-
setFieldError: P
|
|
133
|
-
} = J(re), {
|
|
134
|
-
checkDirty: C,
|
|
135
|
-
resetDirty: l
|
|
136
|
-
} = Q(n), t = A(() => ({
|
|
137
|
-
orgName: e ?? "default"
|
|
138
|
-
}), [e]), {
|
|
139
|
-
mutate: o,
|
|
140
|
-
isPending: m,
|
|
141
|
-
error: a
|
|
142
|
-
} = U(t), u = z(() => {
|
|
143
|
-
i(k(I.children.org.path, {
|
|
144
|
-
orgId: e ?? ""
|
|
145
|
-
}));
|
|
146
|
-
}, [i, e]), [h, p] = F({}), v = z(() => {
|
|
147
|
-
if (g(n))
|
|
148
|
-
p({});
|
|
149
|
-
else {
|
|
150
|
-
p(s);
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
o({
|
|
154
|
-
name: n.name,
|
|
155
|
-
displayName: n.displayName,
|
|
156
|
-
description: n.description?.trim() || void 0,
|
|
157
|
-
deploymentPipeline: n.deploymentPipeline
|
|
158
|
-
}, {
|
|
159
|
-
onSuccess: () => {
|
|
160
|
-
l(), d(), i(k(I.children.org.children.projects.path, {
|
|
161
|
-
orgId: t.orgName ?? "",
|
|
162
|
-
projectId: n.name
|
|
163
|
-
}));
|
|
164
|
-
},
|
|
165
|
-
onError: (x) => {
|
|
166
|
-
console.error("Failed to create project:", x);
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
}, [n, g, o, i, t.orgName, l, d, s]);
|
|
170
|
-
return /* @__PURE__ */ r(X, { title: "Create a New Project", description: "Create a new project to organize and manage your agents.", disableIcon: !0, backHref: k(I.children.org.path, {
|
|
171
|
-
orgId: e ?? ""
|
|
172
|
-
}), backLabel: "Back to Organization", children: /* @__PURE__ */ j(S, { display: "flex", flexDirection: "column", gap: 2, children: [
|
|
173
|
-
/* @__PURE__ */ r(ae, { formData: n, setFormData: N, errors: s, validateField: c, setFieldError: P, checkDirty: C }),
|
|
174
|
-
!!a && /* @__PURE__ */ r(L, { severity: "error", sx: {
|
|
175
|
-
mt: 2
|
|
176
|
-
}, children: a instanceof Error ? a.message : "Failed to create project" }),
|
|
177
|
-
/* @__PURE__ */ r(ne, { lastSubmittedValidationErrors: h, isPending: m, onCancel: u, onSubmit: v, isNameEmpty: !n.name.trim(), mode: "deploy" })
|
|
178
|
-
] }) });
|
|
179
|
-
}, ge = {
|
|
180
|
-
title: "Add New Project",
|
|
181
|
-
description: "A page component for Add New Project",
|
|
182
|
-
icon: te,
|
|
183
|
-
path: I.children.org.children.newProject.path,
|
|
184
|
-
component: oe
|
|
185
|
-
};
|
|
186
|
-
export {
|
|
187
|
-
oe as AddNewProject,
|
|
188
|
-
ge as metaData
|
|
189
|
-
};
|