@keycloak/keycloak-admin-ui 26.3.4 → 26.4.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/lib/.vite/manifest.json +71 -31
- package/lib/AddKubernetesConnect-CLVPWkrb.js +65 -0
- package/lib/AddKubernetesConnect-CLVPWkrb.js.map +1 -0
- package/lib/{AddOAuth2-F7FgeYW0.js → AddOAuth2-CC0H-fVr.js} +8 -8
- package/lib/{AddOAuth2-F7FgeYW0.js.map → AddOAuth2-CC0H-fVr.js.map} +1 -1
- package/lib/AddSpiffeConnect-Dji06y_O.js +69 -0
- package/lib/AddSpiffeConnect-Dji06y_O.js.map +1 -0
- package/lib/{CreateFlow-DUsT9qkU.js → CreateFlow-Cz-lg73m.js} +2 -2
- package/lib/{CreateFlow-DUsT9qkU.js.map → CreateFlow-Cz-lg73m.js.map} +1 -1
- package/lib/CreateWorkflow-ua79h89c.js +86 -0
- package/lib/CreateWorkflow-ua79h89c.js.map +1 -0
- package/lib/{DetailOrganization-CV_4J5fR.js → DetailOrganization-Ysk1nTgF.js} +2 -2
- package/lib/{DetailOrganization-CV_4J5fR.js.map → DetailOrganization-Ysk1nTgF.js.map} +1 -1
- package/lib/{ExecutorForm-CaqwAS8a.js → ExecutorForm-BccZ7QZF.js} +2 -2
- package/lib/{ExecutorForm-CaqwAS8a.js.map → ExecutorForm-BccZ7QZF.js.map} +1 -1
- package/lib/{FlowDetails-BM76-t9x.js → FlowDetails-B4lQG8Pg.js} +17 -17
- package/lib/{FlowDetails-BM76-t9x.js.map → FlowDetails-B4lQG8Pg.js.map} +1 -1
- package/lib/{NewOrganization-Cme4dF_4.js → NewOrganization-DnnmflIu.js} +2 -2
- package/lib/{NewOrganization-Cme4dF_4.js.map → NewOrganization-DnnmflIu.js.map} +1 -1
- package/lib/{PermissionConfigurationDetails-j8xO_ttP.js → PermissionConfigurationDetails-OCQEx-d3.js} +32 -32
- package/lib/PermissionConfigurationDetails-OCQEx-d3.js.map +1 -0
- package/lib/{PermissionDetails-DniNzN93.js → PermissionDetails-DgCmusN2.js} +2 -2
- package/lib/{PermissionDetails-DniNzN93.js.map → PermissionDetails-DgCmusN2.js.map} +1 -1
- package/lib/{RealmSection-oePxR5vr.js → RealmSection-CxxB3s3W.js} +3 -3
- package/lib/RealmSection-CxxB3s3W.js.map +1 -0
- package/lib/{ResourceDetails-B4CtAi8P.js → ResourceDetails-BbSJrYuX.js} +3 -3
- package/lib/{ResourceDetails-B4CtAi8P.js.map → ResourceDetails-BbSJrYuX.js.map} +1 -1
- package/lib/{ScopeDetails-CnXDe51U.js → ScopeDetails-DJNNCcbt.js} +2 -2
- package/lib/{ScopeDetails-CnXDe51U.js.map → ScopeDetails-DJNNCcbt.js.map} +1 -1
- package/lib/{ScopePicker-B1sz9ms-.js → ScopePicker-BB_n0zxI.js} +2 -2
- package/lib/{ScopePicker-B1sz9ms-.js.map → ScopePicker-BB_n0zxI.js.map} +1 -1
- package/lib/WorkflowsSection-DbR36xIx.js +92 -0
- package/lib/WorkflowsSection-DbR36xIx.js.map +1 -0
- package/lib/clients/add/SamlEncryption.d.ts +1 -0
- package/lib/clients/advanced/OpenIdVerifiableCredentials.d.ts +9 -0
- package/lib/components/form/CodeEditor.d.ts +1 -1
- package/lib/components/json-file-upload/FileUploadForm.d.ts +2 -1
- package/lib/context/whoami/WhoAmI.d.ts +2 -16
- package/lib/help-urls.d.ts +1 -0
- package/lib/identity-providers/add/AddKubernetesConnect.d.ts +1 -0
- package/lib/identity-providers/add/AddSpiffeConnect.d.ts +1 -0
- package/lib/identity-providers/add/KubernetesSettings.d.ts +1 -0
- package/lib/identity-providers/add/SpiffeSettings.d.ts +1 -0
- package/lib/identity-providers/routes/IdentityProviderKubernetes.d.ts +7 -0
- package/lib/identity-providers/routes/IdentityProviderSpiffe.d.ts +7 -0
- package/lib/{index-mwKZBR4z.js → index-DyTQe_VT.js} +21239 -20585
- package/lib/{index-mwKZBR4z.js.map → index-DyTQe_VT.js.map} +1 -1
- package/lib/keycloak-admin-ui.js +78 -78
- package/lib/utils/useIsFeatureEnabled.d.ts +3 -1
- package/lib/workflows/CreateWorkflow.d.ts +1 -0
- package/lib/workflows/WorkflowsSection.d.ts +1 -0
- package/lib/workflows/routes/AddWorkflow.d.ts +7 -0
- package/lib/workflows/routes/Workflows.d.ts +7 -0
- package/lib/workflows/routes.d.ts +3 -0
- package/package.json +25 -19
- package/lib/PermissionConfigurationDetails-j8xO_ttP.js.map +0 -1
- package/lib/RealmSection-oePxR5vr.js.map +0 -1
- package/lib/components/keycloak-spinner/KeycloakSpinner.d.ts +0 -1
package/lib/.vite/manifest.json
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
{
|
2
|
-
"_ScopePicker-
|
3
|
-
"file": "ScopePicker-
|
2
|
+
"_ScopePicker-BB_n0zxI.js": {
|
3
|
+
"file": "ScopePicker-BB_n0zxI.js",
|
4
4
|
"name": "ScopePicker",
|
5
5
|
"imports": [
|
6
|
-
"_index-
|
6
|
+
"_index-DyTQe_VT.js"
|
7
7
|
]
|
8
8
|
},
|
9
|
-
"_index-
|
10
|
-
"file": "index-
|
9
|
+
"_index-DyTQe_VT.js": {
|
10
|
+
"file": "index-DyTQe_VT.js",
|
11
11
|
"name": "index",
|
12
12
|
"dynamicImports": [
|
13
13
|
"src/authentication/FlowDetails.tsx",
|
@@ -19,68 +19,90 @@
|
|
19
19
|
"src/clients/authorization/PermissionDetails.tsx",
|
20
20
|
"src/clients/authorization/ScopeDetails.tsx",
|
21
21
|
"src/clients/authorization/ScopeDetails.tsx",
|
22
|
+
"src/identity-providers/add/AddSpiffeConnect.tsx",
|
23
|
+
"src/identity-providers/add/AddKubernetesConnect.tsx",
|
22
24
|
"src/identity-providers/add/AddOAuth2.tsx",
|
23
25
|
"src/organizations/NewOrganization.tsx",
|
24
26
|
"src/permissions-configuration/permission-configuration/PermissionConfigurationDetails.tsx",
|
25
27
|
"src/permissions-configuration/permission-configuration/PermissionConfigurationDetails.tsx",
|
26
28
|
"src/realm-settings/ExecutorForm.tsx",
|
27
29
|
"src/realm-settings/ExecutorForm.tsx",
|
28
|
-
"src/realm/RealmSection.tsx"
|
30
|
+
"src/realm/RealmSection.tsx",
|
31
|
+
"src/workflows/CreateWorkflow.tsx",
|
32
|
+
"src/workflows/WorkflowsSection.tsx"
|
29
33
|
]
|
30
34
|
},
|
31
35
|
"src/authentication/FlowDetails.tsx": {
|
32
|
-
"file": "FlowDetails-
|
36
|
+
"file": "FlowDetails-B4lQG8Pg.js",
|
33
37
|
"name": "FlowDetails",
|
34
38
|
"src": "src/authentication/FlowDetails.tsx",
|
35
39
|
"isDynamicEntry": true,
|
36
40
|
"imports": [
|
37
|
-
"_index-
|
41
|
+
"_index-DyTQe_VT.js"
|
38
42
|
]
|
39
43
|
},
|
40
44
|
"src/authentication/form/CreateFlow.tsx": {
|
41
|
-
"file": "CreateFlow-
|
45
|
+
"file": "CreateFlow-Cz-lg73m.js",
|
42
46
|
"name": "CreateFlow",
|
43
47
|
"src": "src/authentication/form/CreateFlow.tsx",
|
44
48
|
"isDynamicEntry": true,
|
45
49
|
"imports": [
|
46
|
-
"_index-
|
50
|
+
"_index-DyTQe_VT.js"
|
47
51
|
]
|
48
52
|
},
|
49
53
|
"src/clients/authorization/PermissionDetails.tsx": {
|
50
|
-
"file": "PermissionDetails-
|
54
|
+
"file": "PermissionDetails-DgCmusN2.js",
|
51
55
|
"name": "PermissionDetails",
|
52
56
|
"src": "src/clients/authorization/PermissionDetails.tsx",
|
53
57
|
"isDynamicEntry": true,
|
54
58
|
"imports": [
|
55
|
-
"_index-
|
59
|
+
"_index-DyTQe_VT.js"
|
56
60
|
]
|
57
61
|
},
|
58
62
|
"src/clients/authorization/ResourceDetails.tsx": {
|
59
|
-
"file": "ResourceDetails-
|
63
|
+
"file": "ResourceDetails-BbSJrYuX.js",
|
60
64
|
"name": "ResourceDetails",
|
61
65
|
"src": "src/clients/authorization/ResourceDetails.tsx",
|
62
66
|
"isDynamicEntry": true,
|
63
67
|
"imports": [
|
64
|
-
"_index-
|
65
|
-
"_ScopePicker-
|
68
|
+
"_index-DyTQe_VT.js",
|
69
|
+
"_ScopePicker-BB_n0zxI.js"
|
66
70
|
]
|
67
71
|
},
|
68
72
|
"src/clients/authorization/ScopeDetails.tsx": {
|
69
|
-
"file": "ScopeDetails-
|
73
|
+
"file": "ScopeDetails-DJNNCcbt.js",
|
70
74
|
"name": "ScopeDetails",
|
71
75
|
"src": "src/clients/authorization/ScopeDetails.tsx",
|
72
76
|
"isDynamicEntry": true,
|
73
77
|
"imports": [
|
74
|
-
"_index-
|
78
|
+
"_index-DyTQe_VT.js"
|
79
|
+
]
|
80
|
+
},
|
81
|
+
"src/identity-providers/add/AddKubernetesConnect.tsx": {
|
82
|
+
"file": "AddKubernetesConnect-CLVPWkrb.js",
|
83
|
+
"name": "AddKubernetesConnect",
|
84
|
+
"src": "src/identity-providers/add/AddKubernetesConnect.tsx",
|
85
|
+
"isDynamicEntry": true,
|
86
|
+
"imports": [
|
87
|
+
"_index-DyTQe_VT.js"
|
75
88
|
]
|
76
89
|
},
|
77
90
|
"src/identity-providers/add/AddOAuth2.tsx": {
|
78
|
-
"file": "AddOAuth2-
|
91
|
+
"file": "AddOAuth2-CC0H-fVr.js",
|
79
92
|
"name": "AddOAuth2",
|
80
93
|
"src": "src/identity-providers/add/AddOAuth2.tsx",
|
81
94
|
"isDynamicEntry": true,
|
82
95
|
"imports": [
|
83
|
-
"_index-
|
96
|
+
"_index-DyTQe_VT.js"
|
97
|
+
]
|
98
|
+
},
|
99
|
+
"src/identity-providers/add/AddSpiffeConnect.tsx": {
|
100
|
+
"file": "AddSpiffeConnect-Dji06y_O.js",
|
101
|
+
"name": "AddSpiffeConnect",
|
102
|
+
"src": "src/identity-providers/add/AddSpiffeConnect.tsx",
|
103
|
+
"isDynamicEntry": true,
|
104
|
+
"imports": [
|
105
|
+
"_index-DyTQe_VT.js"
|
84
106
|
]
|
85
107
|
},
|
86
108
|
"src/index.ts": {
|
@@ -89,53 +111,71 @@
|
|
89
111
|
"src": "src/index.ts",
|
90
112
|
"isEntry": true,
|
91
113
|
"imports": [
|
92
|
-
"_index-
|
114
|
+
"_index-DyTQe_VT.js"
|
93
115
|
]
|
94
116
|
},
|
95
117
|
"src/organizations/DetailOrganization.tsx": {
|
96
|
-
"file": "DetailOrganization-
|
118
|
+
"file": "DetailOrganization-Ysk1nTgF.js",
|
97
119
|
"name": "DetailOrganization",
|
98
120
|
"src": "src/organizations/DetailOrganization.tsx",
|
99
121
|
"isDynamicEntry": true,
|
100
122
|
"imports": [
|
101
|
-
"_index-
|
123
|
+
"_index-DyTQe_VT.js"
|
102
124
|
]
|
103
125
|
},
|
104
126
|
"src/organizations/NewOrganization.tsx": {
|
105
|
-
"file": "NewOrganization-
|
127
|
+
"file": "NewOrganization-DnnmflIu.js",
|
106
128
|
"name": "NewOrganization",
|
107
129
|
"src": "src/organizations/NewOrganization.tsx",
|
108
130
|
"isDynamicEntry": true,
|
109
131
|
"imports": [
|
110
|
-
"_index-
|
132
|
+
"_index-DyTQe_VT.js"
|
111
133
|
]
|
112
134
|
},
|
113
135
|
"src/permissions-configuration/permission-configuration/PermissionConfigurationDetails.tsx": {
|
114
|
-
"file": "PermissionConfigurationDetails-
|
136
|
+
"file": "PermissionConfigurationDetails-OCQEx-d3.js",
|
115
137
|
"name": "PermissionConfigurationDetails",
|
116
138
|
"src": "src/permissions-configuration/permission-configuration/PermissionConfigurationDetails.tsx",
|
117
139
|
"isDynamicEntry": true,
|
118
140
|
"imports": [
|
119
|
-
"_index-
|
120
|
-
"_ScopePicker-
|
141
|
+
"_index-DyTQe_VT.js",
|
142
|
+
"_ScopePicker-BB_n0zxI.js"
|
121
143
|
]
|
122
144
|
},
|
123
145
|
"src/realm-settings/ExecutorForm.tsx": {
|
124
|
-
"file": "ExecutorForm-
|
146
|
+
"file": "ExecutorForm-BccZ7QZF.js",
|
125
147
|
"name": "ExecutorForm",
|
126
148
|
"src": "src/realm-settings/ExecutorForm.tsx",
|
127
149
|
"isDynamicEntry": true,
|
128
150
|
"imports": [
|
129
|
-
"_index-
|
151
|
+
"_index-DyTQe_VT.js"
|
130
152
|
]
|
131
153
|
},
|
132
154
|
"src/realm/RealmSection.tsx": {
|
133
|
-
"file": "RealmSection-
|
155
|
+
"file": "RealmSection-CxxB3s3W.js",
|
134
156
|
"name": "RealmSection",
|
135
157
|
"src": "src/realm/RealmSection.tsx",
|
136
158
|
"isDynamicEntry": true,
|
137
159
|
"imports": [
|
138
|
-
"_index-
|
160
|
+
"_index-DyTQe_VT.js"
|
161
|
+
]
|
162
|
+
},
|
163
|
+
"src/workflows/CreateWorkflow.tsx": {
|
164
|
+
"file": "CreateWorkflow-ua79h89c.js",
|
165
|
+
"name": "CreateWorkflow",
|
166
|
+
"src": "src/workflows/CreateWorkflow.tsx",
|
167
|
+
"isDynamicEntry": true,
|
168
|
+
"imports": [
|
169
|
+
"_index-DyTQe_VT.js"
|
170
|
+
]
|
171
|
+
},
|
172
|
+
"src/workflows/WorkflowsSection.tsx": {
|
173
|
+
"file": "WorkflowsSection-DbR36xIx.js",
|
174
|
+
"name": "WorkflowsSection",
|
175
|
+
"src": "src/workflows/WorkflowsSection.tsx",
|
176
|
+
"isDynamicEntry": true,
|
177
|
+
"imports": [
|
178
|
+
"_index-DyTQe_VT.js"
|
139
179
|
]
|
140
180
|
},
|
141
181
|
"style.css": {
|
@@ -0,0 +1,65 @@
|
|
1
|
+
import { jsxs as i, Fragment as y, jsx as e } from "react/jsx-runtime";
|
2
|
+
import { u as h, b as p, _ as g, a as P, V as f, P as A, F as I, c as S, bA as C, A as F, B as o, by as K, d as V, bz as k } from "./index-DyTQe_VT.js";
|
3
|
+
import { useTranslation as w } from "react-i18next";
|
4
|
+
import { useNavigate as x, Link as E } from "react-router-dom";
|
5
|
+
function _() {
|
6
|
+
const { adminClient: d } = h(), { t: r } = w(), c = x(), a = "kubernetes", n = p({
|
7
|
+
defaultValues: { alias: a, config: { allowCreate: "true" } },
|
8
|
+
mode: "onChange"
|
9
|
+
}), { handleSubmit: l } = n, { addAlert: m, addError: u } = g(), { realm: s } = P(), v = async (t) => {
|
10
|
+
delete t.discoveryEndpoint;
|
11
|
+
try {
|
12
|
+
await d.identityProviders.create({
|
13
|
+
...t,
|
14
|
+
providerId: a
|
15
|
+
}), m(r("createIdentityProviderSuccess"), V.success), c(
|
16
|
+
k({
|
17
|
+
realm: s,
|
18
|
+
providerId: a,
|
19
|
+
alias: t.alias,
|
20
|
+
tab: "settings"
|
21
|
+
})
|
22
|
+
);
|
23
|
+
} catch (b) {
|
24
|
+
u("createIdentityProviderError", b);
|
25
|
+
}
|
26
|
+
};
|
27
|
+
return /* @__PURE__ */ i(y, { children: [
|
28
|
+
/* @__PURE__ */ e(f, { titleKey: r("addKubernetesProvider") }),
|
29
|
+
/* @__PURE__ */ e(A, { variant: "light", children: /* @__PURE__ */ e(I, { ...n, children: /* @__PURE__ */ i(
|
30
|
+
S,
|
31
|
+
{
|
32
|
+
role: "manage-identity-providers",
|
33
|
+
isHorizontal: !0,
|
34
|
+
onSubmit: l(v),
|
35
|
+
children: [
|
36
|
+
/* @__PURE__ */ e(C, {}),
|
37
|
+
/* @__PURE__ */ i(F, { children: [
|
38
|
+
/* @__PURE__ */ e(
|
39
|
+
o,
|
40
|
+
{
|
41
|
+
variant: "primary",
|
42
|
+
type: "submit",
|
43
|
+
"data-testid": "createProvider",
|
44
|
+
children: r("add")
|
45
|
+
}
|
46
|
+
),
|
47
|
+
/* @__PURE__ */ e(
|
48
|
+
o,
|
49
|
+
{
|
50
|
+
variant: "link",
|
51
|
+
"data-testid": "cancel",
|
52
|
+
component: (t) => /* @__PURE__ */ e(E, { ...t, to: K({ realm: s }) }),
|
53
|
+
children: r("cancel")
|
54
|
+
}
|
55
|
+
)
|
56
|
+
] })
|
57
|
+
]
|
58
|
+
}
|
59
|
+
) }) })
|
60
|
+
] });
|
61
|
+
}
|
62
|
+
export {
|
63
|
+
_ as default
|
64
|
+
};
|
65
|
+
//# sourceMappingURL=AddKubernetesConnect-CLVPWkrb.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AddKubernetesConnect-CLVPWkrb.js","sources":["../src/identity-providers/add/AddKubernetesConnect.tsx"],"sourcesContent":["import type IdentityProviderRepresentation from \"@keycloak/keycloak-admin-client/lib/defs/identityProviderRepresentation\";\nimport {\n ActionGroup,\n AlertVariant,\n Button,\n PageSection,\n} from \"@patternfly/react-core\";\nimport { FormProvider, useForm } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\nimport { Link, useNavigate } from \"react-router-dom\";\nimport { useAdminClient } from \"../../admin-client\";\nimport { useAlerts } from \"@keycloak/keycloak-ui-shared\";\nimport { FormAccess } from \"../../components/form/FormAccess\";\nimport { ViewHeader } from \"../../components/view-header/ViewHeader\";\nimport { useRealm } from \"../../context/realm-context/RealmContext\";\nimport { toIdentityProvider } from \"../routes/IdentityProvider\";\nimport { toIdentityProviders } from \"../routes/IdentityProviders\";\nimport { KubernetesSettings } from \"./KubernetesSettings\";\n\ntype DiscoveryIdentityProvider = IdentityProviderRepresentation & {\n discoveryEndpoint?: string;\n};\n\nexport default function AddKubernetesConnect() {\n const { adminClient } = useAdminClient();\n\n const { t } = useTranslation();\n const navigate = useNavigate();\n const id = \"kubernetes\";\n\n const form = useForm<DiscoveryIdentityProvider>({\n defaultValues: { alias: id, config: { allowCreate: \"true\" } },\n mode: \"onChange\",\n });\n const { handleSubmit } = form;\n\n const { addAlert, addError } = useAlerts();\n const { realm } = useRealm();\n\n const onSubmit = async (provider: DiscoveryIdentityProvider) => {\n delete provider.discoveryEndpoint;\n try {\n await adminClient.identityProviders.create({\n ...provider,\n providerId: id,\n });\n addAlert(t(\"createIdentityProviderSuccess\"), AlertVariant.success);\n navigate(\n toIdentityProvider({\n realm,\n providerId: id,\n alias: provider.alias!,\n tab: \"settings\",\n }),\n );\n } catch (error: any) {\n addError(\"createIdentityProviderError\", error);\n }\n };\n\n return (\n <>\n <ViewHeader titleKey={t(\"addKubernetesProvider\")} />\n <PageSection variant=\"light\">\n <FormProvider {...form}>\n <FormAccess\n role=\"manage-identity-providers\"\n isHorizontal\n onSubmit={handleSubmit(onSubmit)}\n >\n <KubernetesSettings />\n <ActionGroup>\n <Button\n variant=\"primary\"\n type=\"submit\"\n data-testid=\"createProvider\"\n >\n {t(\"add\")}\n </Button>\n <Button\n variant=\"link\"\n data-testid=\"cancel\"\n component={(props) => (\n <Link {...props} to={toIdentityProviders({ realm })} />\n )}\n >\n {t(\"cancel\")}\n </Button>\n </ActionGroup>\n </FormAccess>\n </FormProvider>\n </PageSection>\n </>\n );\n}\n"],"names":["AddKubernetesConnect","adminClient","useAdminClient","t","useTranslation","navigate","useNavigate","id","form","useForm","handleSubmit","addAlert","addError","useAlerts","realm","useRealm","onSubmit","provider","AlertVariant","toIdentityProvider","error","jsxs","Fragment","jsx","ViewHeader","PageSection","FormProvider","FormAccess","KubernetesSettings","ActionGroup","Button","props","Link","toIdentityProviders"],"mappings":";;;;AAuBA,SAAwBA,IAAuB;AAC7C,QAAM,EAAE,aAAAC,EAAA,IAAgBC,EAAA,GAElB,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACRC,IAAWC,EAAA,GACXC,IAAK,cAELC,IAAOC,EAAmC;AAAA,IAC9C,eAAe,EAAE,OAAOF,GAAI,QAAQ,EAAE,aAAa,SAAO;AAAA,IAC1D,MAAM;AAAA,EAAA,CACP,GACK,EAAE,cAAAG,MAAiBF,GAEnB,EAAE,UAAAG,GAAU,UAAAC,EAAA,IAAaC,EAAA,GACzB,EAAE,OAAAC,EAAA,IAAUC,EAAA,GAEZC,IAAW,OAAOC,MAAwC;AAC9D,WAAOA,EAAS;AAChB,QAAI;AACF,YAAMhB,EAAY,kBAAkB,OAAO;AAAA,QACzC,GAAGgB;AAAA,QACH,YAAYV;AAAA,MAAA,CACb,GACDI,EAASR,EAAE,+BAA+B,GAAGe,EAAa,OAAO,GACjEb;AA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P, P as
|
2
|
+
import { u as p, b as f, _ as g, a as I, V as P, P as C, F as A, c as S, bB as D, bC as O, bD as F, bE as E, A as V, B as o, by as x, d as B, bz as j } from "./index-DyTQe_VT.js";
|
3
3
|
import { useTranslation as k } from "react-i18next";
|
4
4
|
import { useNavigate as w, Link as z } from "react-router-dom";
|
5
5
|
function L() {
|
@@ -15,7 +15,7 @@ function L() {
|
|
15
15
|
await d.identityProviders.create({
|
16
16
|
...e,
|
17
17
|
providerId: i
|
18
|
-
}), u(a("createIdentityProviderSuccess"),
|
18
|
+
}), u(a("createIdentityProviderSuccess"), B.success), c(
|
19
19
|
j({
|
20
20
|
realm: s,
|
21
21
|
providerId: i,
|
@@ -29,17 +29,17 @@ function L() {
|
|
29
29
|
};
|
30
30
|
return /* @__PURE__ */ r(b, { children: [
|
31
31
|
/* @__PURE__ */ t(P, { titleKey: a("addOAuth2Provider") }),
|
32
|
-
/* @__PURE__ */ t(
|
32
|
+
/* @__PURE__ */ t(C, { variant: "light", children: /* @__PURE__ */ t(A, { ...n, children: /* @__PURE__ */ r(
|
33
33
|
S,
|
34
34
|
{
|
35
35
|
role: "manage-identity-providers",
|
36
36
|
isHorizontal: !0,
|
37
37
|
onSubmit: l(h),
|
38
38
|
children: [
|
39
|
-
/* @__PURE__ */ t(
|
40
|
-
/* @__PURE__ */ t(
|
39
|
+
/* @__PURE__ */ t(D, {}),
|
40
|
+
/* @__PURE__ */ t(O, { isOIDC: !1 }),
|
41
41
|
/* @__PURE__ */ t(F, {}),
|
42
|
-
/* @__PURE__ */ t(
|
42
|
+
/* @__PURE__ */ t(E, {}),
|
43
43
|
/* @__PURE__ */ r(V, { children: [
|
44
44
|
/* @__PURE__ */ t(
|
45
45
|
o,
|
@@ -56,7 +56,7 @@ function L() {
|
|
56
56
|
{
|
57
57
|
variant: "link",
|
58
58
|
"data-testid": "cancel",
|
59
|
-
component: (e) => /* @__PURE__ */ t(z, { ...e, to:
|
59
|
+
component: (e) => /* @__PURE__ */ t(z, { ...e, to: x({ realm: s }) }),
|
60
60
|
children: a("cancel")
|
61
61
|
}
|
62
62
|
)
|
@@ -69,4 +69,4 @@ function L() {
|
|
69
69
|
export {
|
70
70
|
L as default
|
71
71
|
};
|
72
|
-
//# sourceMappingURL=AddOAuth2-
|
72
|
+
//# sourceMappingURL=AddOAuth2-CC0H-fVr.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AddOAuth2-
|
1
|
+
{"version":3,"file":"AddOAuth2-CC0H-fVr.js","sources":["../src/identity-providers/add/AddOAuth2.tsx"],"sourcesContent":["import type IdentityProviderRepresentation from \"@keycloak/keycloak-admin-client/lib/defs/identityProviderRepresentation\";\nimport {\n ActionGroup,\n AlertVariant,\n Button,\n PageSection,\n} from \"@patternfly/react-core\";\nimport { FormProvider, useForm } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\nimport { Link, useNavigate } from \"react-router-dom\";\nimport { useAdminClient } from \"../../admin-client\";\nimport { useAlerts } from \"@keycloak/keycloak-ui-shared\";\nimport { FormAccess } from \"../../components/form/FormAccess\";\nimport { ViewHeader } from \"../../components/view-header/ViewHeader\";\nimport { useRealm } from \"../../context/realm-context/RealmContext\";\nimport { toIdentityProvider } from \"../routes/IdentityProvider\";\nimport { toIdentityProviders } from \"../routes/IdentityProviders\";\nimport { OIDCAuthentication } from \"./OIDCAuthentication\";\nimport { OIDCGeneralSettings } from \"./OIDCGeneralSettings\";\nimport { OpenIdConnectSettings } from \"./OpenIdConnectSettings\";\nimport { UserProfileClaimsSettings } from \"./OAuth2UserProfileClaimsSettings\";\n\ntype DiscoveryIdentity = IdentityProviderRepresentation & {\n discoveryEndpoint?: string;\n};\n\nexport default function AddOpenIdConnect() {\n const { adminClient } = useAdminClient();\n\n const { t } = useTranslation();\n const navigate = useNavigate();\n const id = `oauth2`;\n\n const form = useForm<IdentityProviderRepresentation>({\n defaultValues: { alias: id },\n mode: \"onChange\",\n });\n const {\n handleSubmit,\n formState: { isDirty },\n } = form;\n\n const { addAlert, addError } = useAlerts();\n const { realm } = useRealm();\n\n const onSubmit = async (provider: DiscoveryIdentity) => {\n delete provider.discoveryEndpoint;\n try {\n await adminClient.identityProviders.create({\n ...provider,\n providerId: id,\n });\n addAlert(t(\"createIdentityProviderSuccess\"), AlertVariant.success);\n navigate(\n toIdentityProvider({\n realm,\n providerId: id,\n alias: provider.alias!,\n tab: \"settings\",\n }),\n );\n } catch (error) {\n addError(\"createIdentityProviderError\", error);\n }\n };\n\n return (\n <>\n <ViewHeader titleKey={t(\"addOAuth2Provider\")} />\n <PageSection variant=\"light\">\n <FormProvider {...form}>\n <FormAccess\n role=\"manage-identity-providers\"\n isHorizontal\n onSubmit={handleSubmit(onSubmit)}\n >\n <OIDCGeneralSettings />\n <OpenIdConnectSettings isOIDC={false} />\n <OIDCAuthentication />\n <UserProfileClaimsSettings />\n <ActionGroup>\n <Button\n isDisabled={!isDirty}\n variant=\"primary\"\n type=\"submit\"\n data-testid=\"createProvider\"\n >\n {t(\"add\")}\n </Button>\n <Button\n variant=\"link\"\n data-testid=\"cancel\"\n component={(props) => (\n <Link {...props} to={toIdentityProviders({ realm })} />\n )}\n >\n {t(\"cancel\")}\n </Button>\n </ActionGroup>\n </FormAccess>\n </FormProvider>\n </PageSection>\n </>\n );\n}\n"],"names":["AddOpenIdConnect","adminClient","useAdminClient","t","useTranslation","navigate","useNavigate","id","form","useForm","handleSubmit","isDirty","addAlert","addError","useAlerts","realm","useRealm","onSubmit","provider","AlertVariant","toIdentityProvider","error","jsxs","Fragment","jsx","ViewHeader","PageSection","FormProvider","FormAccess","OIDCGeneralSettings","OpenIdConnectSettings","OIDCAuthentication","UserProfileClaimsSettings","ActionGroup","Button","props","Link","toIdentityProviders"],"mappings":";;;;AA0BA,SAAwBA,IAAmB;AACzC,QAAM,EAAE,aAAAC,EAAA,IAAgBC,EAAA,GAElB,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACRC,IAAWC,EAAA,GACXC,IAAK,UAELC,IAAO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AA,gBACC,YAAY,CAACvB;AAAA,gBACb,SAAQ;AAAA,gBACR,MAAK;AAAA,gBACL,eAAY;AAAA,gBAEX,YAAE,KAAK;AAAA,cAAA;AAAA,YAAA;AAAA,YAEV,gBAAAa;AAAA,cAACU;AAAA,cAAA;AAAA,gBACC,SAAQ;AAAA,gBACR,eAAY;AAAA,gBACZ,WAAW,CAACC,MACV,gBAAAX,EAACY,GAAA,EAAM,GAAGD,GAAO,IAAIE,EAAoB,EAAE,OAAAtB,EAAA,CAAO,EAAA,CAAG;AAAA,gBAGtD,YAAE,QAAQ;AAAA,cAAA;AAAA,YAAA;AAAA,UACb,EAAA,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,GAEJ,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
|
@@ -0,0 +1,69 @@
|
|
1
|
+
import { jsxs as i, Fragment as y, jsx as e } from "react/jsx-runtime";
|
2
|
+
import { u as h, b, _ as g, a as P, V as S, P as A, F as I, c as C, bx as F, A as x, B as o, by as V, d as w, bz as E } from "./index-DyTQe_VT.js";
|
3
|
+
import { useTranslation as j } from "react-i18next";
|
4
|
+
import { useNavigate as k, Link as z } from "react-router-dom";
|
5
|
+
function G() {
|
6
|
+
const { adminClient: d } = h(), { t: a } = j(), c = k(), r = "spiffe", n = b({
|
7
|
+
defaultValues: { alias: r, config: { allowCreate: "true" } },
|
8
|
+
mode: "onChange"
|
9
|
+
}), {
|
10
|
+
handleSubmit: l,
|
11
|
+
formState: { isDirty: m }
|
12
|
+
} = n, { addAlert: u, addError: f } = g(), { realm: s } = P(), v = async (t) => {
|
13
|
+
delete t.discoveryEndpoint;
|
14
|
+
try {
|
15
|
+
await d.identityProviders.create({
|
16
|
+
...t,
|
17
|
+
providerId: r
|
18
|
+
}), u(a("createIdentityProviderSuccess"), w.success), c(
|
19
|
+
E({
|
20
|
+
realm: s,
|
21
|
+
providerId: r,
|
22
|
+
alias: t.alias,
|
23
|
+
tab: "settings"
|
24
|
+
})
|
25
|
+
);
|
26
|
+
} catch (p) {
|
27
|
+
f("createIdentityProviderError", p);
|
28
|
+
}
|
29
|
+
};
|
30
|
+
return /* @__PURE__ */ i(y, { children: [
|
31
|
+
/* @__PURE__ */ e(S, { titleKey: a("addSpiffeProvider") }),
|
32
|
+
/* @__PURE__ */ e(A, { variant: "light", children: /* @__PURE__ */ e(I, { ...n, children: /* @__PURE__ */ i(
|
33
|
+
C,
|
34
|
+
{
|
35
|
+
role: "manage-identity-providers",
|
36
|
+
isHorizontal: !0,
|
37
|
+
onSubmit: l(v),
|
38
|
+
children: [
|
39
|
+
/* @__PURE__ */ e(F, {}),
|
40
|
+
/* @__PURE__ */ i(x, { children: [
|
41
|
+
/* @__PURE__ */ e(
|
42
|
+
o,
|
43
|
+
{
|
44
|
+
isDisabled: !m,
|
45
|
+
variant: "primary",
|
46
|
+
type: "submit",
|
47
|
+
"data-testid": "createProvider",
|
48
|
+
children: a("add")
|
49
|
+
}
|
50
|
+
),
|
51
|
+
/* @__PURE__ */ e(
|
52
|
+
o,
|
53
|
+
{
|
54
|
+
variant: "link",
|
55
|
+
"data-testid": "cancel",
|
56
|
+
component: (t) => /* @__PURE__ */ e(z, { ...t, to: V({ realm: s }) }),
|
57
|
+
children: a("cancel")
|
58
|
+
}
|
59
|
+
)
|
60
|
+
] })
|
61
|
+
]
|
62
|
+
}
|
63
|
+
) }) })
|
64
|
+
] });
|
65
|
+
}
|
66
|
+
export {
|
67
|
+
G as default
|
68
|
+
};
|
69
|
+
//# sourceMappingURL=AddSpiffeConnect-Dji06y_O.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AddSpiffeConnect-Dji06y_O.js","sources":["../src/identity-providers/add/AddSpiffeConnect.tsx"],"sourcesContent":["import type IdentityProviderRepresentation from \"@keycloak/keycloak-admin-client/lib/defs/identityProviderRepresentation\";\nimport {\n ActionGroup,\n AlertVariant,\n Button,\n PageSection,\n} from \"@patternfly/react-core\";\nimport { FormProvider, useForm } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\nimport { Link, useNavigate } from \"react-router-dom\";\nimport { useAdminClient } from \"../../admin-client\";\nimport { useAlerts } from \"@keycloak/keycloak-ui-shared\";\nimport { FormAccess } from \"../../components/form/FormAccess\";\nimport { ViewHeader } from \"../../components/view-header/ViewHeader\";\nimport { useRealm } from \"../../context/realm-context/RealmContext\";\nimport { toIdentityProvider } from \"../routes/IdentityProvider\";\nimport { toIdentityProviders } from \"../routes/IdentityProviders\";\nimport { SpiffeSettings } from \"./SpiffeSettings\";\n\ntype DiscoveryIdentityProvider = IdentityProviderRepresentation & {\n discoveryEndpoint?: string;\n};\n\nexport default function AddSamlConnect() {\n const { adminClient } = useAdminClient();\n\n const { t } = useTranslation();\n const navigate = useNavigate();\n const id = \"spiffe\";\n\n const form = useForm<DiscoveryIdentityProvider>({\n defaultValues: { alias: id, config: { allowCreate: \"true\" } },\n mode: \"onChange\",\n });\n const {\n handleSubmit,\n formState: { isDirty },\n } = form;\n\n const { addAlert, addError } = useAlerts();\n const { realm } = useRealm();\n\n const onSubmit = async (provider: DiscoveryIdentityProvider) => {\n delete provider.discoveryEndpoint;\n try {\n await adminClient.identityProviders.create({\n ...provider,\n providerId: id,\n });\n addAlert(t(\"createIdentityProviderSuccess\"), AlertVariant.success);\n navigate(\n toIdentityProvider({\n realm,\n providerId: id,\n alias: provider.alias!,\n tab: \"settings\",\n }),\n );\n } catch (error: any) {\n addError(\"createIdentityProviderError\", error);\n }\n };\n\n return (\n <>\n <ViewHeader titleKey={t(\"addSpiffeProvider\")} />\n <PageSection variant=\"light\">\n <FormProvider {...form}>\n <FormAccess\n role=\"manage-identity-providers\"\n isHorizontal\n onSubmit={handleSubmit(onSubmit)}\n >\n <SpiffeSettings />\n <ActionGroup>\n <Button\n isDisabled={!isDirty}\n variant=\"primary\"\n type=\"submit\"\n data-testid=\"createProvider\"\n >\n {t(\"add\")}\n </Button>\n <Button\n variant=\"link\"\n data-testid=\"cancel\"\n component={(props) => (\n <Link {...props} to={toIdentityProviders({ realm })} />\n )}\n >\n {t(\"cancel\")}\n </Button>\n </ActionGroup>\n </FormAccess>\n </FormProvider>\n </PageSection>\n </>\n );\n}\n"],"names":["AddSamlConnect","adminClient","useAdminClient","t","useTranslation","navigate","useNavigate","id","form","useForm","handleSubmit","isDirty","addAlert","addError","useAlerts","realm","useRealm","onSubmit","provider","AlertVariant","toIdentityProvider","error","jsxs","Fragment","jsx","ViewHeader","PageSection","FormProvider","FormAccess","SpiffeSettings","ActionGroup","Button","props","Link","toIdentityProviders"],"mappings":";;;;AAuBA,SAAwBA,IAAiB;AACvC,QAAM,EAAE,aAAAC,EAAA,IAAgBC,EAAA,GAElB,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACRC,IAAWC,EAAA,GACXC,IAAK,UAELC,IAAOC,EAAmC;AAAA,IAC9C,eAAe,EAAE,OAAOF,GAAI,QAAQ,EAAE,aAAa,SAAO;AAAA,IAC1D,MAAM;AAAA,EAAA,CACP,GACK;AAAA,IACJ,cAAAG;AAAA,IACA,WAAW,EAAE,SAAAC,EAAA;AAAA,EAAQ,IACnBH,GAEE,EAAE,UAAAI,GAAU,UAAAC,EAAA,IAAaC,EAAA,GACzB,EAAE,OAAAC,EAAA,IAAUC,EAAA,GAEZC,IAAW,OAAOC,MAAwC;AAC9D,WAAOA,EAAS;AAChB,QAAI;AACF,YAAMjB,EAAY,kBAAkB,OAAO;AAAA,QACzC,GAAGiB;AAAA,QACH,YAAYX;AAAA,MAAA,CACb,GACDK,EAAST,EAAE,+BAA+B,GAAGgB,EAAa,OAAO,GACjEd;AAAA,QACEe,EAAmB;AAAA,UACjB,OAAAL;AAAA,UACA,YAAYR;AAAA,UACZ,OAAOW,EAAS;AAAA,UAChB,KAAK;AAAA,QAAA,CACN;AAAA,MAAA;AAAA,IAEL,SAASG,GAAY;AACnB,MAAAR,EAAS,+BAA+BQ,CAAK;AAAA,IAC/C;AAAA,EACF;AAEA,SACE,gBAAAC,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAA,EAAW,UAAUtB,EAAE,mBAAmB,EAAA,CAAG;AAAA,sBAC7CuB,GAAA,EAAY,SAAQ,SACnB,UAAA,gBAAAF,EAACG,GAAA,EAAc,GAAGnB,GAChB,UAAA,gBAAAc;AAAA,MAACM;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,cAAY;AAAA,QACZ,UAAUlB,EAAaO,CAAQ;AAAA,QAE/B,UAAA;AAAA,UAAA,gBAAAO,EAACK,GAAA,EAAe;AAAA,4BACfC,GAAA,EACC,UAAA;AAAA,YAAA,gBAAAN;AAAA,cAACO;AAAA,cAAA;AAAA,gBACC,YAAY,CAACpB;AAAA,gBACb,SAAQ;AAAA,gBACR,MAAK;AAAA,gBACL,eAAY;AAAA,gBAEX,YAAE,KAAK;AAAA,cAAA;AAAA,YAAA;AAAA,YAEV,gBAAAa;AAAA,cAACO;AAAA,cAAA;AAAA,gBACC,SAAQ;AAAA,gBACR,eAAY;AAAA,gBACZ,WAAW,CAACC,MACV,gBAAAR,EAACS,GAAA,EAAM,GAAGD,GAAO,IAAIE,EAAoB,EAAE,OAAAnB,EAAA,CAAO,EAAA,CAAG;AAAA,gBAGtD,YAAE,QAAQ;AAAA,cAAA;AAAA,YAAA;AAAA,UACb,EAAA,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,GAEJ,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { jsxs as r, Fragment as w, jsx as t } from "react/jsx-runtime";
|
2
|
-
import { u as h, a as F, _ as b, b as v, V as y, P as g, F as S, c as A, N as C, U as I, A as T, e as H, B as N, t as P, d as i, f as V } from "./index-
|
2
|
+
import { u as h, a as F, _ as b, b as v, V as y, P as g, F as S, c as A, N as C, U as I, A as T, e as H, B as N, t as P, d as i, f as V } from "./index-DyTQe_VT.js";
|
3
3
|
import { useTranslation as k } from "react-i18next";
|
4
4
|
import { useNavigate as x, Link as B } from "react-router-dom";
|
5
5
|
const c = ["basic-flow", "client-flow"];
|
@@ -77,4 +77,4 @@ function E() {
|
|
77
77
|
export {
|
78
78
|
E as default
|
79
79
|
};
|
80
|
-
//# sourceMappingURL=CreateFlow-
|
80
|
+
//# sourceMappingURL=CreateFlow-Cz-lg73m.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CreateFlow-
|
1
|
+
{"version":3,"file":"CreateFlow-Cz-lg73m.js","sources":["../src/authentication/form/CreateFlow.tsx"],"sourcesContent":["import type AuthenticationFlowRepresentation from \"@keycloak/keycloak-admin-client/lib/defs/authenticationFlowRepresentation\";\nimport {\n ActionGroup,\n AlertVariant,\n Button,\n PageSection,\n} from \"@patternfly/react-core\";\nimport { FormProvider, useForm } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\nimport { Link, useNavigate } from \"react-router-dom\";\nimport { FormSubmitButton, SelectControl } from \"@keycloak/keycloak-ui-shared\";\nimport { useAdminClient } from \"../../admin-client\";\nimport { useAlerts } from \"@keycloak/keycloak-ui-shared\";\nimport { FormAccess } from \"../../components/form/FormAccess\";\nimport { ViewHeader } from \"../../components/view-header/ViewHeader\";\nimport { useRealm } from \"../../context/realm-context/RealmContext\";\nimport { toAuthentication } from \"../routes/Authentication\";\nimport { toFlow } from \"../routes/Flow\";\nimport { NameDescription } from \"./NameDescription\";\n\nconst TYPES = [\"basic-flow\", \"client-flow\"] as const;\n\nexport default function CreateFlow() {\n const { adminClient } = useAdminClient();\n\n const { t } = useTranslation();\n const navigate = useNavigate();\n const { realm } = useRealm();\n const { addAlert } = useAlerts();\n const form = useForm<AuthenticationFlowRepresentation>();\n const { handleSubmit, formState } = form;\n\n const onSubmit = async (formValues: AuthenticationFlowRepresentation) => {\n const flow = { ...formValues, builtIn: false, topLevel: true };\n\n try {\n const { id } =\n await adminClient.authenticationManagement.createFlow(flow);\n addAlert(t(\"flowCreatedSuccess\"), AlertVariant.success);\n navigate(\n toFlow({\n realm,\n id: id!,\n usedBy: \"notInUse\",\n }),\n );\n } catch (error: any) {\n addAlert(\n t(\"flowCreateError\", {\n error: error.response?.data?.errorMessage || error,\n }),\n AlertVariant.danger,\n );\n }\n };\n\n return (\n <>\n <ViewHeader titleKey=\"createFlow\" subKey=\"authenticationCreateFlowHelp\" />\n <PageSection variant=\"light\">\n <FormProvider {...form}>\n <FormAccess\n isHorizontal\n role=\"manage-authorization\"\n onSubmit={handleSubmit(onSubmit)}\n >\n <NameDescription />\n <SelectControl\n name=\"providerId\"\n label={t(\"flowType\")}\n labelIcon={t(\"topLevelFlowTypeHelp\")}\n aria-label={t(\"selectFlowType\")}\n controller={{ defaultValue: TYPES[0] }}\n options={TYPES.map((type) => ({\n key: type,\n value: t(`top-level-flow-type.${type}`),\n }))}\n />\n <ActionGroup>\n <FormSubmitButton\n formState={formState}\n data-testid=\"create\"\n allowInvalid\n allowNonDirty\n >\n {t(\"create\")}\n </FormSubmitButton>\n <Button\n data-testid=\"cancel\"\n variant=\"link\"\n component={(props) => (\n <Link {...props} to={toAuthentication({ realm })}></Link>\n )}\n >\n {t(\"cancel\")}\n </Button>\n </ActionGroup>\n </FormAccess>\n </FormProvider>\n </PageSection>\n </>\n );\n}\n"],"names":["TYPES","CreateFlow","adminClient","useAdminClient","t","useTranslation","navigate","useNavigate","realm","useRealm","addAlert","useAlerts","form","useForm","handleSubmit","formState","jsxs","Fragment","jsx","ViewHeader","PageSection","FormProvider","FormAccess","formValues","flow","id","AlertVariant","toFlow","error","NameDescription","SelectControl","type","ActionGroup","FormSubmitButton","Button","props","Link","toAuthentication"],"mappings":";;;;AAoBA,MAAMA,IAAQ,CAAC,cAAc,aAAa;AAE1C,SAAwBC,IAAa;AACnC,QAAM,EAAE,aAAAC,EAAA,IAAgBC,EAAA,GAElB,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACRC,IAAWC,EAAA,GACX,EAAE,OAAAC,EAAA,IAAUC,EAAA,GACZ,EAAE,UAAAC,EA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C5B,KAAKA;AAAA,gBACL,OAAO3B,EAAE,uBAAuB2B,CAAI,EAAE;AAAA,cAAA,EACtC;AAAA,YAAA;AAAA,UAAA;AAAA,4BAEHC,GAAA,EACC,UAAA;AAAA,YAAA,gBAAAd;AAAA,cAACe;AAAAA,cAAA;AAAA,gBACC,WAAAlB;AAAA,gBACA,eAAY;AAAA,gBACZ,cAAY;AAAA,gBACZ,eAAa;AAAA,gBAEZ,YAAE,QAAQ;AAAA,cAAA;AAAA,YAAA;AAAA,YAEb,gBAAAG;AAAA,cAACgB;AAAA,cAAA;AAAA,gBACC,eAAY;AAAA,gBACZ,SAAQ;AAAA,gBACR,WAAW,CAACC,MACV,gBAAAjB,EAACkB,GAAA,EAAM,GAAGD,GAAO,IAAIE,EAAiB,EAAE,OAAA7B,EAAA,CAAO,EAAA,CAAG;AAAA,gBAGnD,YAAE,QAAQ;AAAA,cAAA;AAAA,YAAA;AAAA,UACb,EAAA,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,GAEJ,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
|
@@ -0,0 +1,86 @@
|
|
1
|
+
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
2
|
+
import { useState as k } from "react";
|
3
|
+
import { u as S, b as p, a as g, _ as v, F as N, P as b, c as C, au as J, al as A, bF as O, a7 as F, A as j, e as x, B as y, bG as s, d as E } from "./index-DyTQe_VT.js";
|
4
|
+
import { useTranslation as G } from "react-i18next";
|
5
|
+
import { useNavigate as I, Link as q } from "react-router-dom";
|
6
|
+
function T() {
|
7
|
+
const { adminClient: i } = S(), { t: a } = G(), r = p({ mode: "onChange" }), { control: c, handleSubmit: d } = r, m = I(), { realm: t } = g(), { addAlert: u, addError: f } = v(), [w, h] = k("");
|
8
|
+
return /* @__PURE__ */ e(N, { ...r, children: /* @__PURE__ */ e(b, { variant: "light", children: /* @__PURE__ */ l(
|
9
|
+
C,
|
10
|
+
{
|
11
|
+
isHorizontal: !0,
|
12
|
+
onSubmit: d(async () => {
|
13
|
+
try {
|
14
|
+
const o = JSON.parse(w);
|
15
|
+
if (!o.name)
|
16
|
+
throw new Error(a("workflowNameRequired"));
|
17
|
+
const n = {
|
18
|
+
realm: t,
|
19
|
+
...o
|
20
|
+
};
|
21
|
+
await i.workflows.create(n), u(a("workflowCreated"), E.success), m(s({ realm: t }));
|
22
|
+
} catch (o) {
|
23
|
+
f("workflowCreateError", o);
|
24
|
+
}
|
25
|
+
}),
|
26
|
+
role: "manage-realm",
|
27
|
+
className: "pf-v5-u-mt-lg",
|
28
|
+
fineGrainedAccess: !0,
|
29
|
+
children: [
|
30
|
+
/* @__PURE__ */ e(
|
31
|
+
J,
|
32
|
+
{
|
33
|
+
label: a("workflowJSON"),
|
34
|
+
labelIcon: /* @__PURE__ */ e(F, { helpText: a("workflowJsonHelp"), fieldLabelId: "code" }),
|
35
|
+
fieldId: "code",
|
36
|
+
isRequired: !0,
|
37
|
+
children: /* @__PURE__ */ e(
|
38
|
+
A,
|
39
|
+
{
|
40
|
+
name: "workflowJSON",
|
41
|
+
defaultValue: "",
|
42
|
+
control: c,
|
43
|
+
render: ({ field: o }) => /* @__PURE__ */ e(
|
44
|
+
O,
|
45
|
+
{
|
46
|
+
id: "workflowJSON",
|
47
|
+
"data-testid": "workflowJSON",
|
48
|
+
value: o.value,
|
49
|
+
onChange: (n) => h(n ?? ""),
|
50
|
+
language: "json",
|
51
|
+
height: 600
|
52
|
+
}
|
53
|
+
)
|
54
|
+
}
|
55
|
+
)
|
56
|
+
}
|
57
|
+
),
|
58
|
+
/* @__PURE__ */ l(j, { children: [
|
59
|
+
/* @__PURE__ */ e(
|
60
|
+
x,
|
61
|
+
{
|
62
|
+
formState: r.formState,
|
63
|
+
"data-testid": "save",
|
64
|
+
allowInvalid: !0,
|
65
|
+
allowNonDirty: !0,
|
66
|
+
children: a("save")
|
67
|
+
}
|
68
|
+
),
|
69
|
+
/* @__PURE__ */ e(
|
70
|
+
y,
|
71
|
+
{
|
72
|
+
"data-testid": "cancel",
|
73
|
+
variant: "link",
|
74
|
+
component: (o) => /* @__PURE__ */ e(q, { ...o, to: s({ realm: t }) }),
|
75
|
+
children: a("cancel")
|
76
|
+
}
|
77
|
+
)
|
78
|
+
] })
|
79
|
+
]
|
80
|
+
}
|
81
|
+
) }) });
|
82
|
+
}
|
83
|
+
export {
|
84
|
+
T as default
|
85
|
+
};
|
86
|
+
//# sourceMappingURL=CreateWorkflow-ua79h89c.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"CreateWorkflow-ua79h89c.js","sources":["../src/workflows/CreateWorkflow.tsx"],"sourcesContent":["import {\n ActionGroup,\n Button,\n FormGroup,\n PageSection,\n} from \"@patternfly/react-core\";\nimport { AlertVariant } from \"@patternfly/react-core\";\nimport { useState } from \"react\";\nimport {\n Controller,\n FormProvider,\n SubmitHandler,\n useForm,\n} from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\nimport { Link, useNavigate } from \"react-router-dom\";\nimport { useAdminClient } from \"../admin-client\";\nimport {\n HelpItem,\n FormSubmitButton,\n useAlerts,\n} from \"@keycloak/keycloak-ui-shared\";\nimport { useRealm } from \"../context/realm-context/RealmContext\";\nimport { FormAccess } from \"../components/form/FormAccess\";\nimport { toWorkflows } from \"./routes/Workflows\";\nimport CodeEditor from \"../components/form/CodeEditor\";\n\ntype AttributeForm = {\n workflowJSON?: string;\n [key: string]: any;\n};\n\nexport default function CreateWorkflow() {\n const { adminClient } = useAdminClient();\n\n const { t } = useTranslation();\n const form = useForm<AttributeForm>({ mode: \"onChange\" });\n const { control, handleSubmit } = form;\n const navigate = useNavigate();\n const { realm } = useRealm();\n const { addAlert, addError } = useAlerts();\n const [workflowJSON, setWorkflowJSON] = useState(\"\");\n\n const onSubmit: SubmitHandler<AttributeForm> = async () => {\n try {\n const json = JSON.parse(workflowJSON);\n if (!json.name) {\n throw new Error(t(\"workflowNameRequired\"));\n }\n\n const payload = {\n realm,\n ...json,\n };\n await adminClient.workflows.create(payload);\n\n addAlert(t(\"workflowCreated\"), AlertVariant.success);\n navigate(toWorkflows({ realm }));\n } catch (error) {\n addError(\"workflowCreateError\", error);\n }\n };\n\n return (\n <FormProvider {...form}>\n <PageSection variant=\"light\">\n <FormAccess\n isHorizontal\n onSubmit={handleSubmit(onSubmit)}\n role={\"manage-realm\"}\n className=\"pf-v5-u-mt-lg\"\n fineGrainedAccess={true} // TODO: Set this properly\n >\n <FormGroup\n label={t(\"workflowJSON\")}\n labelIcon={\n <HelpItem helpText={t(\"workflowJsonHelp\")} fieldLabelId=\"code\" />\n }\n fieldId=\"code\"\n isRequired\n >\n <Controller\n name=\"workflowJSON\"\n defaultValue=\"\"\n control={control}\n render={({ field }) => (\n <CodeEditor\n id=\"workflowJSON\"\n data-testid=\"workflowJSON\"\n value={field.value}\n onChange={(value) => setWorkflowJSON(value ?? \"\")}\n language=\"json\"\n height={600}\n />\n )}\n />\n </FormGroup>\n <ActionGroup>\n <FormSubmitButton\n formState={form.formState}\n data-testid=\"save\"\n allowInvalid\n allowNonDirty\n >\n {t(\"save\")}\n </FormSubmitButton>\n <Button\n data-testid=\"cancel\"\n variant=\"link\"\n component={(props) => (\n <Link {...props} to={toWorkflows({ realm })} />\n )}\n >\n {t(\"cancel\")}\n </Button>\n </ActionGroup>\n </FormAccess>\n </PageSection>\n </FormProvider>\n );\n}\n"],"names":["CreateWorkflow","adminClient","useAdminClient","t","useTranslation","form","useForm","control","handleSubmit","navigate","useNavigate","realm","useRealm","addAlert","addError","useAlerts","workflowJSON","setWorkflowJSON","useState","FormProvider","jsx","PageSection","jsxs","FormAccess","json","payload","AlertVariant","toWorkflows","error","FormGroup","HelpItem","Controller","field","CodeEditor","value","ActionGroup","FormSubmitButton","Button","props","Link"],"mappings":";;;;;AAgCA,SAAwBA,IAAiB;AACvC,QAAM,EAAE,aAAAC,EAAA,IAAgBC,EAAA,GAElB,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACRC,IAAOC,EAAuB,EAAE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AAA,MACT,gBAAAZ;AAAA,kBAACa;AAAA,kBAAA;AAAA,oBACC,IAAG;AAAA,oBACH,eAAY;AAAA,oBACZ,OAAOD,EAAM;AAAA,oBACb,UAAU,CAACE,MAAUjB,EAAgBiB,KAAS,EAAE;AAAA,oBAChD,UAAS;AAAA,oBACT,QAAQ;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACV;AAAA,YAAA;AAAA,UAEJ;AAAA,QAAA;AAAA,0BAEDC,GAAA,EACC,UAAA;AAAA,UAAA,gBAAAf;AAAA,YAACgB;AAAAA,YAAA;AAAA,cACC,WAAW/B,EAAK;AAAA,cAChB,eAAY;AAAA,cACZ,cAAY;AAAA,cACZ,eAAa;AAAA,cAEZ,YAAE,MAAM;AAAA,YAAA;AAAA,UAAA;AAAA,UAEX,gBAAAe;AAAA,YAACiB;AAAA,YAAA;AAAA,cACC,eAAY;AAAA,cACZ,SAAQ;AAAA,cACR,WAAW,CAACC,MACV,gBAAAlB,EAACmB,GAAA,EAAM,GAAGD,GAAO,IAAIX,EAAY,EAAE,OAAAhB,EAAA,CAAO,EAAA,CAAG;AAAA,cAG9C,YAAE,QAAQ;AAAA,YAAA;AAAA,UAAA;AAAA,QACb,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAEJ,EAAA,CACF;AAEJ;"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { jsx as e, jsxs as c } from "react/jsx-runtime";
|
2
|
-
import { u as O, _ as F, a as x, ao as K, b as R, y as w, aG as B, aH as C, ap as H, P as m, F as I, aI as V, aJ as _, aK as n, c as j, aL as k, A as D, e as G, B as M, aM as r, aN as N, aO as $, aP as J, aQ as L, aR as u, aS as Q, aT as q } from "./index-
|
2
|
+
import { u as O, _ as F, a as x, ao as K, b as R, y as w, aG as B, aH as C, ap as H, P as m, F as I, aI as V, aJ as _, aK as n, c as j, aL as k, A as D, e as G, B as M, aM as r, aN as N, aO as $, aP as J, aQ as L, aR as u, aS as Q, aT as q } from "./index-DyTQe_VT.js";
|
3
3
|
import { useTranslation as U } from "react-i18next";
|
4
4
|
import { useState as W } from "react";
|
5
5
|
function te() {
|
@@ -161,4 +161,4 @@ function te() {
|
|
161
161
|
export {
|
162
162
|
te as default
|
163
163
|
};
|
164
|
-
//# sourceMappingURL=DetailOrganization-
|
164
|
+
//# sourceMappingURL=DetailOrganization-Ysk1nTgF.js.map
|