@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.
@@ -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-ed1a1fba.esm.js';
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-b28a29ab.esm.js';
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
- fontSize: "small"
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
- pb: 1,
77
- pt: 1
78
- }, /* @__PURE__ */ React.createElement(Typography, {
79
- variant: "button"
80
- }, "Categories"), /* @__PURE__ */ React.createElement(Autocomplete, {
81
- multiple: true,
82
- "aria-label": "Categories",
83
- options: availableTypes,
84
- value: selectedTypes,
85
- onChange: (_, value) => setSelectedTypes(value),
86
- renderOption: (option, { selected }) => /* @__PURE__ */ React.createElement(FormControlLabel, {
87
- control: /* @__PURE__ */ React.createElement(Checkbox, {
88
- icon,
89
- checkedIcon,
90
- checked: selected
91
- }),
92
- label: capitalize(option)
93
- }),
94
- size: "small",
95
- popupIcon: /* @__PURE__ */ React.createElement(ExpandMoreIcon, null),
96
- renderInput: (params) => /* @__PURE__ */ React.createElement(TextField, {
97
- ...params,
98
- variant: "outlined"
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(IconButton, {
115
- component: Link,
116
- color: "primary",
117
- title,
118
- size: "small",
119
- to
120
- }, /* @__PURE__ */ React.createElement(AddCircleOutline, null)) : /* @__PURE__ */ React.createElement(Button, {
121
- component: Link,
122
- variant: "contained",
123
- color: "primary",
124
- to
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
- className: styles.subtitleWrapper
153
- }, /* @__PURE__ */ React.createElement("div", null, type), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(FavoriteEntity, {
154
- entity: props.template,
155
- style: { padding: 0 }
156
- })));
157
- return /* @__PURE__ */ React.createElement(ItemCardHeader, {
158
- title: title != null ? title : name,
159
- subtitle: SubtitleComponent,
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
- template
243
- }), /* @__PURE__ */ React.createElement(CardContent, null, /* @__PURE__ */ React.createElement(Grid, {
244
- container: true,
245
- spacing: 2
246
- }, /* @__PURE__ */ React.createElement(Grid, {
247
- item: true,
248
- xs: 12
249
- }, /* @__PURE__ */ React.createElement(Box, {
250
- className: styles.box
251
- }, /* @__PURE__ */ React.createElement(MarkdownContent, {
252
- className: styles.markdown,
253
- content: (_b = template.metadata.description) != null ? _b : "No description"
254
- }))), ((_d = (_c = template.metadata.tags) == null ? void 0 : _c.length) != null ? _d : 0) > 0 && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Grid, {
255
- item: true,
256
- xs: 12
257
- }, /* @__PURE__ */ React.createElement(Divider, null)), /* @__PURE__ */ React.createElement(Grid, {
258
- item: true,
259
- xs: 12
260
- }, /* @__PURE__ */ React.createElement(Grid, {
261
- container: true,
262
- spacing: 2
263
- }, (_e = template.metadata.tags) == null ? void 0 : _e.map((tag) => /* @__PURE__ */ React.createElement(Grid, {
264
- item: true
265
- }, /* @__PURE__ */ React.createElement(Chip, {
266
- style: { margin: 0 },
267
- size: "small",
268
- label: tag,
269
- key: tag
270
- })))))), (!!viewTechDocsLink || ((_f = template.metadata.links) == null ? void 0 : _f.length)) && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Grid, {
271
- item: true,
272
- xs: 12
273
- }, /* @__PURE__ */ React.createElement(Divider, null)), /* @__PURE__ */ React.createElement(Grid, {
274
- item: true,
275
- xs: 12
276
- }, /* @__PURE__ */ React.createElement(Grid, {
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(TemplateGroup, {
353
- key: index,
354
- templates: entities.filter(
355
- (e) => filter(e)
356
- ),
357
- title,
358
- components: { CardComponent: TemplateCardComponent }
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
- themeId: "website"
371
- }, /* @__PURE__ */ React.createElement(Header, {
372
- pageTitleOverride: "Create a new component",
373
- title: "Create a new component",
374
- subtitle: "Create new software components using standard templates in your organization"
375
- }), /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(ContentHeader, {
376
- title: "Available Templates"
377
- }, /* @__PURE__ */ React.createElement(RegisterExistingButton, {
378
- title: "Register Existing Component",
379
- to: registerComponentLink && registerComponentLink()
380
- }), /* @__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, {
381
- initialFilter: "template",
382
- hidden: true
383
- }), /* @__PURE__ */ React.createElement(UserListPicker, {
384
- initialFilter: "all",
385
- availableFilters: ["all", "starred"]
386
- }), /* @__PURE__ */ React.createElement(CategoryPicker, null), /* @__PURE__ */ React.createElement(EntityTagPicker, null)), /* @__PURE__ */ React.createElement(CatalogFilterLayout.Content, null, /* @__PURE__ */ React.createElement(TemplateGroups, {
387
- groups: [...groups, defaultGroup],
388
- TemplateCardComponent
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
- activeStep,
564
- alternativeLabel: true,
565
- variant: "elevation"
566
- }, steps.map((step, index) => /* @__PURE__ */ React.createElement(Step, {
567
- key: index
568
- }, /* @__PURE__ */ React.createElement(StepLabel, null, step.title))), /* @__PURE__ */ React.createElement(Step, null, /* @__PURE__ */ React.createElement(StepLabel, null, "Review"))), /* @__PURE__ */ React.createElement("div", {
569
- className: styles.formWrapper
570
- }, activeStep < steps.length ? /* @__PURE__ */ React.createElement(Form, {
571
- validator,
572
- extraErrors: errors,
573
- formData: formState,
574
- formContext: { formData: formState },
575
- schema: steps[activeStep].schema,
576
- uiSchema: steps[activeStep].uiSchema,
577
- onSubmit: handleNext,
578
- fields: extensions,
579
- showErrorList: false,
580
- transformErrors: props.transformErrors
581
- }, /* @__PURE__ */ React.createElement("div", {
582
- className: styles.footer
583
- }, /* @__PURE__ */ React.createElement(Button$2, {
584
- onClick: handleBack,
585
- className: styles.backButton,
586
- disabled: activeStep < 1
587
- }, "Back"), /* @__PURE__ */ React.createElement(Button$2, {
588
- variant: "contained",
589
- color: "primary",
590
- type: "submit"
591
- }, activeStep === steps.length - 1 ? "Review" : "Next"))) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ReviewState, {
592
- formState,
593
- schemas: steps
594
- }), /* @__PURE__ */ React.createElement("div", {
595
- className: styles.footer
596
- }, /* @__PURE__ */ React.createElement(Button$2, {
597
- onClick: handleBack,
598
- className: styles.backButton,
599
- disabled: activeStep < 1
600
- }, "Back"), /* @__PURE__ */ React.createElement(Button$2, {
601
- variant: "contained",
602
- onClick: () => {
603
- props.onComplete(formState);
604
- const name = typeof formState.name === "string" ? formState.name : void 0;
605
- analytics.captureEvent(
606
- "create",
607
- name || `new ${templateName}`
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
- attributes: { entityRef: templateRef }
669
- }, /* @__PURE__ */ React.createElement(Page, {
670
- themeId: "website"
671
- }, /* @__PURE__ */ React.createElement(Header, {
672
- pageTitleOverride: "Create a new component",
673
- title: "Create a new component",
674
- subtitle: "Create new software components using standard templates in your organization"
675
- }), /* @__PURE__ */ React.createElement(Content, null, loading && /* @__PURE__ */ React.createElement(Progress, null), manifest && /* @__PURE__ */ React.createElement(InfoCard, {
676
- title: manifest.title,
677
- subheader: /* @__PURE__ */ React.createElement(MarkdownContent, {
678
- className: styles.markdown,
679
- content: (_b = manifest.description) != null ? _b : "No description"
680
- }),
681
- noPadding: true,
682
- titleTypographyProps: { component: "h2" }
683
- }, /* @__PURE__ */ React.createElement(Stepper, {
684
- manifest,
685
- extensions: props.customFieldExtensions,
686
- onComplete,
687
- transformErrors: props.transformErrors
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(Route, {
711
- path: "/",
712
- element: /* @__PURE__ */ React.createElement(TemplateListPage, {
713
- TemplateCardComponent,
714
- groups: props.groups
715
- })
716
- }), /* @__PURE__ */ React.createElement(Route, {
717
- path: nextSelectedTemplateRouteRef.path,
718
- element: /* @__PURE__ */ React.createElement(SecretsContextProvider, null, /* @__PURE__ */ React.createElement(TemplateWizardPage, {
719
- customFieldExtensions: fieldExtensions
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-36d7755a.esm.js.map
680
+ //# sourceMappingURL=index-cb47594c.esm.js.map