@backstage/plugin-scaffolder 1.9.0-next.0 → 1.9.0-next.1
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 +21 -0
- package/alpha/package.json +1 -1
- package/dist/esm/{Router-c72ed8e0.esm.js → Router-95a01240.esm.js} +801 -897
- package/dist/esm/Router-95a01240.esm.js.map +1 -0
- package/dist/esm/{index-ed1a1fba.esm.js → index-102258f6.esm.js} +518 -423
- package/dist/esm/{index-ed1a1fba.esm.js.map → index-102258f6.esm.js.map} +1 -1
- package/dist/esm/{index-36d7755a.esm.js → index-cb47594c.esm.js} +228 -273
- package/dist/esm/{index-36d7755a.esm.js.map → index-cb47594c.esm.js.map} +1 -1
- package/dist/esm/{schema-b28a29ab.esm.js → schema-4db0f1ff.esm.js} +2 -2
- package/dist/esm/{schema-b28a29ab.esm.js.map → schema-4db0f1ff.esm.js.map} +1 -1
- package/dist/index.esm.js +1 -1
- package/package.json +20 -20
- package/dist/esm/Router-c72ed8e0.esm.js.map +0 -1
|
@@ -16,13 +16,13 @@ import { Link } from 'react-router-dom';
|
|
|
16
16
|
import AddCircleOutline from '@material-ui/icons/AddCircleOutline';
|
|
17
17
|
import { catalogEntityCreatePermission } from '@backstage/plugin-catalog-common';
|
|
18
18
|
import { usePermission } from '@backstage/plugin-permission-react';
|
|
19
|
-
import { B as nextSelectedTemplateRouteRef, v as viewTechDocRouteRef, r as registerComponentRouteRef, s as selectedTemplateRouteRef, C as nextRouteRef, d as scaffolderTaskRouteRef, S as SecretsContext, c as scaffolderApiRef, F as FIELD_EXTENSION_WRAPPER_KEY, i as FIELD_EXTENSION_KEY, k as SecretsContextProvider } from './index-
|
|
19
|
+
import { B as nextSelectedTemplateRouteRef, v as viewTechDocRouteRef, r as registerComponentRouteRef, s as selectedTemplateRouteRef, C as nextRouteRef, d as scaffolderTaskRouteRef, S as SecretsContext, c as scaffolderApiRef, F as FIELD_EXTENSION_WRAPPER_KEY, i as FIELD_EXTENSION_KEY, k as SecretsContextProvider } from './index-102258f6.esm.js';
|
|
20
20
|
import { RELATION_OWNED_BY, parseEntityRef, stringifyEntityRef, DEFAULT_NAMESPACE } from '@backstage/catalog-model';
|
|
21
21
|
import LanguageIcon from '@material-ui/icons/Language';
|
|
22
22
|
import useAsync from 'react-use/lib/useAsync';
|
|
23
23
|
import { withTheme } from '@rjsf/core-v5';
|
|
24
24
|
import { Draft07 } from 'json-schema-library';
|
|
25
|
-
import { c as createFieldValidation, e as extractSchemaFromStep, D as DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS } from './schema-
|
|
25
|
+
import { c as createFieldValidation, e as extractSchemaFromStep, D as DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS } from './schema-4db0f1ff.esm.js';
|
|
26
26
|
import validator from '@rjsf/validator-ajv8';
|
|
27
27
|
import { getDefaultFormState } from '@rjsf/utils';
|
|
28
28
|
import '@backstage/errors';
|
|
@@ -52,12 +52,8 @@ import 'luxon';
|
|
|
52
52
|
import 'react-use/lib/useInterval';
|
|
53
53
|
import 'use-immer';
|
|
54
54
|
|
|
55
|
-
const icon = /* @__PURE__ */ React.createElement(CheckBoxOutlineBlankIcon, {
|
|
56
|
-
|
|
57
|
-
});
|
|
58
|
-
const checkedIcon = /* @__PURE__ */ React.createElement(CheckBoxIcon, {
|
|
59
|
-
fontSize: "small"
|
|
60
|
-
});
|
|
55
|
+
const icon = /* @__PURE__ */ React.createElement(CheckBoxOutlineBlankIcon, { fontSize: "small" });
|
|
56
|
+
const checkedIcon = /* @__PURE__ */ React.createElement(CheckBoxIcon, { fontSize: "small" });
|
|
61
57
|
const CategoryPicker = () => {
|
|
62
58
|
const alertApi = useApi(alertApiRef);
|
|
63
59
|
const { error, loading, availableTypes, selectedTypes, setSelectedTypes } = useEntityTypeFilter();
|
|
@@ -72,32 +68,33 @@ const CategoryPicker = () => {
|
|
|
72
68
|
}
|
|
73
69
|
if (!availableTypes)
|
|
74
70
|
return null;
|
|
75
|
-
return /* @__PURE__ */ React.createElement(Box, {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
71
|
+
return /* @__PURE__ */ React.createElement(Box, { pb: 1, pt: 1 }, /* @__PURE__ */ React.createElement(Typography, { variant: "button" }, "Categories"), /* @__PURE__ */ React.createElement(
|
|
72
|
+
Autocomplete,
|
|
73
|
+
{
|
|
74
|
+
multiple: true,
|
|
75
|
+
"aria-label": "Categories",
|
|
76
|
+
options: availableTypes,
|
|
77
|
+
value: selectedTypes,
|
|
78
|
+
onChange: (_, value) => setSelectedTypes(value),
|
|
79
|
+
renderOption: (option, { selected }) => /* @__PURE__ */ React.createElement(
|
|
80
|
+
FormControlLabel,
|
|
81
|
+
{
|
|
82
|
+
control: /* @__PURE__ */ React.createElement(
|
|
83
|
+
Checkbox,
|
|
84
|
+
{
|
|
85
|
+
icon,
|
|
86
|
+
checkedIcon,
|
|
87
|
+
checked: selected
|
|
88
|
+
}
|
|
89
|
+
),
|
|
90
|
+
label: capitalize(option)
|
|
91
|
+
}
|
|
92
|
+
),
|
|
93
|
+
size: "small",
|
|
94
|
+
popupIcon: /* @__PURE__ */ React.createElement(ExpandMoreIcon, null),
|
|
95
|
+
renderInput: (params) => /* @__PURE__ */ React.createElement(TextField, { ...params, variant: "outlined" })
|
|
96
|
+
}
|
|
97
|
+
));
|
|
101
98
|
};
|
|
102
99
|
|
|
103
100
|
const RegisterExistingButton = (props) => {
|
|
@@ -111,18 +108,17 @@ const RegisterExistingButton = (props) => {
|
|
|
111
108
|
if (!to || !allowed) {
|
|
112
109
|
return null;
|
|
113
110
|
}
|
|
114
|
-
return isXSScreen ? /* @__PURE__ */ React.createElement(
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}, title);
|
|
111
|
+
return isXSScreen ? /* @__PURE__ */ React.createElement(
|
|
112
|
+
IconButton,
|
|
113
|
+
{
|
|
114
|
+
component: Link,
|
|
115
|
+
color: "primary",
|
|
116
|
+
title,
|
|
117
|
+
size: "small",
|
|
118
|
+
to
|
|
119
|
+
},
|
|
120
|
+
/* @__PURE__ */ React.createElement(AddCircleOutline, null)
|
|
121
|
+
) : /* @__PURE__ */ React.createElement(Button, { component: Link, variant: "contained", color: "primary", to }, title);
|
|
126
122
|
};
|
|
127
123
|
|
|
128
124
|
const useStyles$4 = makeStyles(
|
|
@@ -148,17 +144,15 @@ const CardHeader = (props) => {
|
|
|
148
144
|
const styles = useStyles$4({
|
|
149
145
|
cardBackgroundImage: themeForType.backgroundImage
|
|
150
146
|
});
|
|
151
|
-
const SubtitleComponent = /* @__PURE__ */ React.createElement("div", {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
classes: { root: styles.header }
|
|
161
|
-
});
|
|
147
|
+
const SubtitleComponent = /* @__PURE__ */ React.createElement("div", { className: styles.subtitleWrapper }, /* @__PURE__ */ React.createElement("div", null, type), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(FavoriteEntity, { entity: props.template, style: { padding: 0 } })));
|
|
148
|
+
return /* @__PURE__ */ React.createElement(
|
|
149
|
+
ItemCardHeader,
|
|
150
|
+
{
|
|
151
|
+
title: title != null ? title : name,
|
|
152
|
+
subtitle: SubtitleComponent,
|
|
153
|
+
classes: { root: styles.header }
|
|
154
|
+
}
|
|
155
|
+
);
|
|
162
156
|
};
|
|
163
157
|
|
|
164
158
|
const useStyles$3 = makeStyles(() => ({
|
|
@@ -169,14 +163,7 @@ const useStyles$3 = makeStyles(() => ({
|
|
|
169
163
|
}));
|
|
170
164
|
const CardLink = ({ icon: Icon, text, url }) => {
|
|
171
165
|
const styles = useStyles$3();
|
|
172
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
173
|
-
className: styles.linkText
|
|
174
|
-
}, /* @__PURE__ */ React.createElement(Icon, {
|
|
175
|
-
fontSize: "small"
|
|
176
|
-
}), /* @__PURE__ */ React.createElement(Link$1, {
|
|
177
|
-
style: { marginLeft: "8px" },
|
|
178
|
-
to: url
|
|
179
|
-
}, text || url));
|
|
166
|
+
return /* @__PURE__ */ React.createElement("div", { className: styles.linkText }, /* @__PURE__ */ React.createElement(Icon, { fontSize: "small" }), /* @__PURE__ */ React.createElement(Link$1, { style: { marginLeft: "8px" }, to: url }, text || url));
|
|
180
167
|
};
|
|
181
168
|
|
|
182
169
|
const useStyles$2 = makeStyles((theme) => ({
|
|
@@ -238,97 +225,52 @@ const TemplateCard = (props) => {
|
|
|
238
225
|
kind: template.kind,
|
|
239
226
|
name: template.metadata.name
|
|
240
227
|
});
|
|
241
|
-
return /* @__PURE__ */ React.createElement(Card, null, /* @__PURE__ */ React.createElement(CardHeader, {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
container: true,
|
|
278
|
-
spacing: 2
|
|
279
|
-
}, viewTechDocsLink && /* @__PURE__ */ React.createElement(Grid, {
|
|
280
|
-
className: styles.linkText,
|
|
281
|
-
item: true,
|
|
282
|
-
xs: 6
|
|
283
|
-
}, /* @__PURE__ */ React.createElement(CardLink, {
|
|
284
|
-
icon: iconResolver("docs"),
|
|
285
|
-
text: "View TechDocs",
|
|
286
|
-
url: viewTechDocsLink
|
|
287
|
-
})), (_g = template.metadata.links) == null ? void 0 : _g.map(({ url, icon, title }) => /* @__PURE__ */ React.createElement(Grid, {
|
|
288
|
-
className: styles.linkText,
|
|
289
|
-
item: true,
|
|
290
|
-
xs: 6
|
|
291
|
-
}, /* @__PURE__ */ React.createElement(CardLink, {
|
|
292
|
-
icon: iconResolver(icon),
|
|
293
|
-
text: title || url,
|
|
294
|
-
url
|
|
295
|
-
})))))))), /* @__PURE__ */ React.createElement(CardActions, {
|
|
296
|
-
style: { padding: "16px" }
|
|
297
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
298
|
-
className: styles.footer
|
|
299
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
300
|
-
className: styles.ownedBy
|
|
301
|
-
}, ownedByRelations.length > 0 && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(UserIcon, {
|
|
302
|
-
fontSize: "small"
|
|
303
|
-
}), /* @__PURE__ */ React.createElement(EntityRefLinks, {
|
|
304
|
-
style: { marginLeft: "8px" },
|
|
305
|
-
entityRefs: ownedByRelations,
|
|
306
|
-
defaultKind: "Group"
|
|
307
|
-
}))), /* @__PURE__ */ React.createElement(Button$1, {
|
|
308
|
-
size: "small",
|
|
309
|
-
variant: "outlined",
|
|
310
|
-
color: "primary",
|
|
311
|
-
to: href
|
|
312
|
-
}, "Choose"))));
|
|
228
|
+
return /* @__PURE__ */ React.createElement(Card, null, /* @__PURE__ */ React.createElement(CardHeader, { template }), /* @__PURE__ */ React.createElement(CardContent, null, /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 2 }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Box, { className: styles.box }, /* @__PURE__ */ React.createElement(
|
|
229
|
+
MarkdownContent,
|
|
230
|
+
{
|
|
231
|
+
className: styles.markdown,
|
|
232
|
+
content: (_b = template.metadata.description) != null ? _b : "No description"
|
|
233
|
+
}
|
|
234
|
+
))), ((_d = (_c = template.metadata.tags) == null ? void 0 : _c.length) != null ? _d : 0) > 0 && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Divider, null)), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 2 }, (_e = template.metadata.tags) == null ? void 0 : _e.map((tag) => /* @__PURE__ */ React.createElement(Grid, { item: true }, /* @__PURE__ */ React.createElement(
|
|
235
|
+
Chip,
|
|
236
|
+
{
|
|
237
|
+
style: { margin: 0 },
|
|
238
|
+
size: "small",
|
|
239
|
+
label: tag,
|
|
240
|
+
key: tag
|
|
241
|
+
}
|
|
242
|
+
)))))), (!!viewTechDocsLink || ((_f = template.metadata.links) == null ? void 0 : _f.length)) && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Divider, null)), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 2 }, viewTechDocsLink && /* @__PURE__ */ React.createElement(Grid, { className: styles.linkText, item: true, xs: 6 }, /* @__PURE__ */ React.createElement(
|
|
243
|
+
CardLink,
|
|
244
|
+
{
|
|
245
|
+
icon: iconResolver("docs"),
|
|
246
|
+
text: "View TechDocs",
|
|
247
|
+
url: viewTechDocsLink
|
|
248
|
+
}
|
|
249
|
+
)), (_g = template.metadata.links) == null ? void 0 : _g.map(({ url, icon, title }) => /* @__PURE__ */ React.createElement(Grid, { className: styles.linkText, item: true, xs: 6 }, /* @__PURE__ */ React.createElement(
|
|
250
|
+
CardLink,
|
|
251
|
+
{
|
|
252
|
+
icon: iconResolver(icon),
|
|
253
|
+
text: title || url,
|
|
254
|
+
url
|
|
255
|
+
}
|
|
256
|
+
)))))))), /* @__PURE__ */ React.createElement(CardActions, { style: { padding: "16px" } }, /* @__PURE__ */ React.createElement("div", { className: styles.footer }, /* @__PURE__ */ React.createElement("div", { className: styles.ownedBy }, ownedByRelations.length > 0 && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(UserIcon, { fontSize: "small" }), /* @__PURE__ */ React.createElement(
|
|
257
|
+
EntityRefLinks,
|
|
258
|
+
{
|
|
259
|
+
style: { marginLeft: "8px" },
|
|
260
|
+
entityRefs: ownedByRelations,
|
|
261
|
+
defaultKind: "Group"
|
|
262
|
+
}
|
|
263
|
+
))), /* @__PURE__ */ React.createElement(Button$1, { size: "small", variant: "outlined", color: "primary", to: href }, "Choose"))));
|
|
313
264
|
};
|
|
314
265
|
|
|
315
266
|
const TemplateGroup = (props) => {
|
|
316
267
|
const { templates, title, components: { CardComponent } = {} } = props;
|
|
317
|
-
const titleComponent = typeof title === "string" ? /* @__PURE__ */ React.createElement(ContentHeader, {
|
|
318
|
-
title
|
|
319
|
-
}) : title;
|
|
268
|
+
const titleComponent = typeof title === "string" ? /* @__PURE__ */ React.createElement(ContentHeader, { title }) : title;
|
|
320
269
|
if (templates.length === 0) {
|
|
321
|
-
return /* @__PURE__ */ React.createElement(Content, null, titleComponent, /* @__PURE__ */ React.createElement(Typography, {
|
|
322
|
-
variant: "body2"
|
|
323
|
-
}, "No templates found that match your filter. Learn more about", " ", /* @__PURE__ */ React.createElement(Link$1, {
|
|
324
|
-
to: "https://backstage.io/docs/features/software-templates/adding-templates"
|
|
325
|
-
}, "adding templates"), "."));
|
|
270
|
+
return /* @__PURE__ */ React.createElement(Content, null, titleComponent, /* @__PURE__ */ React.createElement(Typography, { variant: "body2" }, "No templates found that match your filter. Learn more about", " ", /* @__PURE__ */ React.createElement(Link$1, { to: "https://backstage.io/docs/features/software-templates/adding-templates" }, "adding templates"), "."));
|
|
326
271
|
}
|
|
327
272
|
const Card = CardComponent || TemplateCard;
|
|
328
|
-
return /* @__PURE__ */ React.createElement(Content, null, titleComponent, /* @__PURE__ */ React.createElement(ItemCardGrid, null, templates.map((template) => /* @__PURE__ */ React.createElement(Card, {
|
|
329
|
-
key: stringifyEntityRef(template),
|
|
330
|
-
template
|
|
331
|
-
}))));
|
|
273
|
+
return /* @__PURE__ */ React.createElement(Content, null, titleComponent, /* @__PURE__ */ React.createElement(ItemCardGrid, null, templates.map((template) => /* @__PURE__ */ React.createElement(Card, { key: stringifyEntityRef(template), template }))));
|
|
332
274
|
};
|
|
333
275
|
|
|
334
276
|
const TemplateGroups = (props) => {
|
|
@@ -343,20 +285,19 @@ const TemplateGroups = (props) => {
|
|
|
343
285
|
return null;
|
|
344
286
|
}
|
|
345
287
|
if (!entities || !entities.length) {
|
|
346
|
-
return /* @__PURE__ */ React.createElement(Typography, {
|
|
347
|
-
variant: "body2"
|
|
348
|
-
}, "No templates found that match your filter. Learn more about", " ", /* @__PURE__ */ React.createElement(Link$1, {
|
|
349
|
-
to: "https://backstage.io/docs/features/software-templates/adding-templates"
|
|
350
|
-
}, "adding templates"), ".");
|
|
288
|
+
return /* @__PURE__ */ React.createElement(Typography, { variant: "body2" }, "No templates found that match your filter. Learn more about", " ", /* @__PURE__ */ React.createElement(Link$1, { to: "https://backstage.io/docs/features/software-templates/adding-templates" }, "adding templates"), ".");
|
|
351
289
|
}
|
|
352
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, groups.map(({ title, filter }, index) => /* @__PURE__ */ React.createElement(
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
290
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, groups.map(({ title, filter }, index) => /* @__PURE__ */ React.createElement(
|
|
291
|
+
TemplateGroup,
|
|
292
|
+
{
|
|
293
|
+
key: index,
|
|
294
|
+
templates: entities.filter(
|
|
295
|
+
(e) => filter(e)
|
|
296
|
+
),
|
|
297
|
+
title,
|
|
298
|
+
components: { CardComponent: TemplateCardComponent }
|
|
299
|
+
}
|
|
300
|
+
)));
|
|
360
301
|
};
|
|
361
302
|
|
|
362
303
|
const defaultGroup = {
|
|
@@ -366,27 +307,32 @@ const defaultGroup = {
|
|
|
366
307
|
const TemplateListPage = (props) => {
|
|
367
308
|
const registerComponentLink = useRouteRef(registerComponentRouteRef);
|
|
368
309
|
const { TemplateCardComponent, groups = [] } = props;
|
|
369
|
-
return /* @__PURE__ */ React.createElement(EntityListProvider, null, /* @__PURE__ */ React.createElement(Page, {
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
310
|
+
return /* @__PURE__ */ React.createElement(EntityListProvider, null, /* @__PURE__ */ React.createElement(Page, { themeId: "website" }, /* @__PURE__ */ React.createElement(
|
|
311
|
+
Header,
|
|
312
|
+
{
|
|
313
|
+
pageTitleOverride: "Create a new component",
|
|
314
|
+
title: "Create a new component",
|
|
315
|
+
subtitle: "Create new software components using standard templates in your organization"
|
|
316
|
+
}
|
|
317
|
+
), /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(ContentHeader, { title: "Available Templates" }, /* @__PURE__ */ React.createElement(
|
|
318
|
+
RegisterExistingButton,
|
|
319
|
+
{
|
|
320
|
+
title: "Register Existing Component",
|
|
321
|
+
to: registerComponentLink && registerComponentLink()
|
|
322
|
+
}
|
|
323
|
+
), /* @__PURE__ */ React.createElement(SupportButton, null, "Create new software components using standard templates. Different templates create different kinds of components (services, websites, documentation, ...).")), /* @__PURE__ */ React.createElement(CatalogFilterLayout, null, /* @__PURE__ */ React.createElement(CatalogFilterLayout.Filters, null, /* @__PURE__ */ React.createElement(EntitySearchBar, null), /* @__PURE__ */ React.createElement(EntityKindPicker, { initialFilter: "template", hidden: true }), /* @__PURE__ */ React.createElement(
|
|
324
|
+
UserListPicker,
|
|
325
|
+
{
|
|
326
|
+
initialFilter: "all",
|
|
327
|
+
availableFilters: ["all", "starred"]
|
|
328
|
+
}
|
|
329
|
+
), /* @__PURE__ */ React.createElement(CategoryPicker, null), /* @__PURE__ */ React.createElement(EntityTagPicker, null)), /* @__PURE__ */ React.createElement(CatalogFilterLayout.Content, null, /* @__PURE__ */ React.createElement(
|
|
330
|
+
TemplateGroups,
|
|
331
|
+
{
|
|
332
|
+
groups: [...groups, defaultGroup],
|
|
333
|
+
TemplateCardComponent
|
|
334
|
+
}
|
|
335
|
+
))))));
|
|
390
336
|
};
|
|
391
337
|
|
|
392
338
|
const createAsyncValidators = (rootSchema, validators, context) => {
|
|
@@ -479,9 +425,7 @@ const ReviewState = (props) => {
|
|
|
479
425
|
return [key, value];
|
|
480
426
|
})
|
|
481
427
|
);
|
|
482
|
-
return /* @__PURE__ */ React.createElement(StructuredMetadataTable, {
|
|
483
|
-
metadata: reviewData
|
|
484
|
-
});
|
|
428
|
+
return /* @__PURE__ */ React.createElement(StructuredMetadataTable, { metadata: reviewData });
|
|
485
429
|
};
|
|
486
430
|
|
|
487
431
|
const useStyles$1 = makeStyles((theme) => ({
|
|
@@ -559,55 +503,52 @@ const Stepper = (props) => {
|
|
|
559
503
|
}
|
|
560
504
|
setFormState((current) => ({ ...current, ...newFormData }));
|
|
561
505
|
};
|
|
562
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Stepper$1, {
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
);
|
|
609
|
-
}
|
|
610
|
-
}, "Create")))));
|
|
506
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Stepper$1, { activeStep, alternativeLabel: true, variant: "elevation" }, steps.map((step, index) => /* @__PURE__ */ React.createElement(Step, { key: index }, /* @__PURE__ */ React.createElement(StepLabel, null, step.title))), /* @__PURE__ */ React.createElement(Step, null, /* @__PURE__ */ React.createElement(StepLabel, null, "Review"))), /* @__PURE__ */ React.createElement("div", { className: styles.formWrapper }, activeStep < steps.length ? /* @__PURE__ */ React.createElement(
|
|
507
|
+
Form,
|
|
508
|
+
{
|
|
509
|
+
validator,
|
|
510
|
+
extraErrors: errors,
|
|
511
|
+
formData: formState,
|
|
512
|
+
formContext: { formData: formState },
|
|
513
|
+
schema: steps[activeStep].schema,
|
|
514
|
+
uiSchema: steps[activeStep].uiSchema,
|
|
515
|
+
onSubmit: handleNext,
|
|
516
|
+
fields: extensions,
|
|
517
|
+
showErrorList: false,
|
|
518
|
+
transformErrors: props.transformErrors
|
|
519
|
+
},
|
|
520
|
+
/* @__PURE__ */ React.createElement("div", { className: styles.footer }, /* @__PURE__ */ React.createElement(
|
|
521
|
+
Button$2,
|
|
522
|
+
{
|
|
523
|
+
onClick: handleBack,
|
|
524
|
+
className: styles.backButton,
|
|
525
|
+
disabled: activeStep < 1
|
|
526
|
+
},
|
|
527
|
+
"Back"
|
|
528
|
+
), /* @__PURE__ */ React.createElement(Button$2, { variant: "contained", color: "primary", type: "submit" }, activeStep === steps.length - 1 ? "Review" : "Next"))
|
|
529
|
+
) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ReviewState, { formState, schemas: steps }), /* @__PURE__ */ React.createElement("div", { className: styles.footer }, /* @__PURE__ */ React.createElement(
|
|
530
|
+
Button$2,
|
|
531
|
+
{
|
|
532
|
+
onClick: handleBack,
|
|
533
|
+
className: styles.backButton,
|
|
534
|
+
disabled: activeStep < 1
|
|
535
|
+
},
|
|
536
|
+
"Back"
|
|
537
|
+
), /* @__PURE__ */ React.createElement(
|
|
538
|
+
Button$2,
|
|
539
|
+
{
|
|
540
|
+
variant: "contained",
|
|
541
|
+
onClick: () => {
|
|
542
|
+
props.onComplete(formState);
|
|
543
|
+
const name = typeof formState.name === "string" ? formState.name : void 0;
|
|
544
|
+
analytics.captureEvent(
|
|
545
|
+
"create",
|
|
546
|
+
name || `new ${templateName}`
|
|
547
|
+
);
|
|
548
|
+
}
|
|
549
|
+
},
|
|
550
|
+
"Create"
|
|
551
|
+
)))));
|
|
611
552
|
};
|
|
612
553
|
|
|
613
554
|
const useStyles = makeStyles(() => ({
|
|
@@ -660,32 +601,39 @@ const TemplateWizardPage = (props) => {
|
|
|
660
601
|
}
|
|
661
602
|
}, [error, errorApi]);
|
|
662
603
|
if (error) {
|
|
663
|
-
return /* @__PURE__ */ React.createElement(Navigate, {
|
|
664
|
-
to: rootRef()
|
|
665
|
-
});
|
|
604
|
+
return /* @__PURE__ */ React.createElement(Navigate, { to: rootRef() });
|
|
666
605
|
}
|
|
667
|
-
return /* @__PURE__ */ React.createElement(AnalyticsContext, {
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
606
|
+
return /* @__PURE__ */ React.createElement(AnalyticsContext, { attributes: { entityRef: templateRef } }, /* @__PURE__ */ React.createElement(Page, { themeId: "website" }, /* @__PURE__ */ React.createElement(
|
|
607
|
+
Header,
|
|
608
|
+
{
|
|
609
|
+
pageTitleOverride: "Create a new component",
|
|
610
|
+
title: "Create a new component",
|
|
611
|
+
subtitle: "Create new software components using standard templates in your organization"
|
|
612
|
+
}
|
|
613
|
+
), /* @__PURE__ */ React.createElement(Content, null, loading && /* @__PURE__ */ React.createElement(Progress, null), manifest && /* @__PURE__ */ React.createElement(
|
|
614
|
+
InfoCard,
|
|
615
|
+
{
|
|
616
|
+
title: manifest.title,
|
|
617
|
+
subheader: /* @__PURE__ */ React.createElement(
|
|
618
|
+
MarkdownContent,
|
|
619
|
+
{
|
|
620
|
+
className: styles.markdown,
|
|
621
|
+
content: (_b = manifest.description) != null ? _b : "No description"
|
|
622
|
+
}
|
|
623
|
+
),
|
|
624
|
+
noPadding: true,
|
|
625
|
+
titleTypographyProps: { component: "h2" }
|
|
626
|
+
},
|
|
627
|
+
/* @__PURE__ */ React.createElement(
|
|
628
|
+
Stepper,
|
|
629
|
+
{
|
|
630
|
+
manifest,
|
|
631
|
+
extensions: props.customFieldExtensions,
|
|
632
|
+
onComplete,
|
|
633
|
+
transformErrors: props.transformErrors
|
|
634
|
+
}
|
|
635
|
+
)
|
|
636
|
+
))));
|
|
689
637
|
};
|
|
690
638
|
|
|
691
639
|
const Router = (props) => {
|
|
@@ -707,19 +655,26 @@ const Router = (props) => {
|
|
|
707
655
|
)
|
|
708
656
|
)
|
|
709
657
|
];
|
|
710
|
-
return /* @__PURE__ */ React.createElement(Routes, null, /* @__PURE__ */ React.createElement(
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
658
|
+
return /* @__PURE__ */ React.createElement(Routes, null, /* @__PURE__ */ React.createElement(
|
|
659
|
+
Route,
|
|
660
|
+
{
|
|
661
|
+
path: "/",
|
|
662
|
+
element: /* @__PURE__ */ React.createElement(
|
|
663
|
+
TemplateListPage,
|
|
664
|
+
{
|
|
665
|
+
TemplateCardComponent,
|
|
666
|
+
groups: props.groups
|
|
667
|
+
}
|
|
668
|
+
)
|
|
669
|
+
}
|
|
670
|
+
), /* @__PURE__ */ React.createElement(
|
|
671
|
+
Route,
|
|
672
|
+
{
|
|
673
|
+
path: nextSelectedTemplateRouteRef.path,
|
|
674
|
+
element: /* @__PURE__ */ React.createElement(SecretsContextProvider, null, /* @__PURE__ */ React.createElement(TemplateWizardPage, { customFieldExtensions: fieldExtensions }))
|
|
675
|
+
}
|
|
676
|
+
));
|
|
722
677
|
};
|
|
723
678
|
|
|
724
679
|
export { Router };
|
|
725
|
-
//# sourceMappingURL=index-
|
|
680
|
+
//# sourceMappingURL=index-cb47594c.esm.js.map
|