@backstage/plugin-scaffolder 1.12.0-next.2 → 1.13.0-next.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.
Files changed (35) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/alpha/package.json +1 -1
  3. package/dist/alpha.d.ts +32 -21
  4. package/dist/alpha.esm.js +13 -21
  5. package/dist/alpha.esm.js.map +1 -1
  6. package/dist/esm/alpha/{ListTasksPage-2e8f4176.esm.js → ListTasksPage-a9fab591.esm.js} +2 -2
  7. package/dist/esm/alpha/{ListTasksPage-2e8f4176.esm.js.map → ListTasksPage-a9fab591.esm.js.map} +1 -1
  8. package/dist/esm/alpha/{Router-2826a2b8.esm.js → Router-ea3122d2.esm.js} +24 -9
  9. package/dist/esm/alpha/Router-ea3122d2.esm.js.map +1 -0
  10. package/dist/esm/alpha/{alpha-714dad1b.esm.js → alpha-0764fae7.esm.js} +243 -255
  11. package/dist/esm/alpha/alpha-0764fae7.esm.js.map +1 -0
  12. package/dist/esm/alpha/{index-2131f4a0.esm.js → index-d45f106a.esm.js} +79 -142
  13. package/dist/esm/alpha/index-d45f106a.esm.js.map +1 -0
  14. package/dist/esm/index/ListTasksPage-64779a2d.esm.js +1310 -0
  15. package/dist/esm/index/ListTasksPage-64779a2d.esm.js.map +1 -0
  16. package/dist/esm/index/{Router-6fd61bff.esm.js → Router-f32000f9.esm.js} +42 -33
  17. package/dist/esm/index/Router-f32000f9.esm.js.map +1 -0
  18. package/dist/esm/index/index-8321766a.esm.js +1741 -0
  19. package/dist/esm/index/index-8321766a.esm.js.map +1 -0
  20. package/dist/esm/index/index-e3edaa49.esm.js +991 -0
  21. package/dist/esm/index/index-e3edaa49.esm.js.map +1 -0
  22. package/dist/index.d.ts +25 -5
  23. package/dist/index.esm.js +9 -59
  24. package/dist/index.esm.js.map +1 -1
  25. package/package.json +23 -23
  26. package/dist/esm/alpha/Router-2826a2b8.esm.js.map +0 -1
  27. package/dist/esm/alpha/alpha-714dad1b.esm.js.map +0 -1
  28. package/dist/esm/alpha/index-2131f4a0.esm.js.map +0 -1
  29. package/dist/esm/index/ListTasksPage-fa403ee3.esm.js +0 -192
  30. package/dist/esm/index/ListTasksPage-fa403ee3.esm.js.map +0 -1
  31. package/dist/esm/index/Router-6fd61bff.esm.js.map +0 -1
  32. package/dist/esm/index/index-0b6cdf44.esm.js +0 -3475
  33. package/dist/esm/index/index-0b6cdf44.esm.js.map +0 -1
  34. package/dist/esm/index/index-f404fb0b.esm.js +0 -449
  35. package/dist/esm/index/index-f404fb0b.esm.js.map +0 -1
@@ -1,29 +1,25 @@
1
1
  import React, { useCallback, useState } from 'react';
2
2
  import { Link, useNavigate, Navigate, useOutlet, Routes, Route } from 'react-router-dom';
3
- import { Progress, Link as Link$1, DocsIcon, Page, Header, Content, ContentHeader, SupportButton, ErrorPage } from '@backstage/core-components';
4
- import { useEntityTypeFilter, useEntityList, EntityListProvider, CatalogFilterLayout, EntitySearchBar, EntityKindPicker, UserListPicker, EntityTagPicker } from '@backstage/plugin-catalog-react';
5
- import capitalize from 'lodash/capitalize';
6
- import { Box, Typography, FormControlLabel, Checkbox, TextField } from '@material-ui/core';
7
- import CheckBoxIcon from '@material-ui/icons/CheckBox';
8
- import CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';
9
- import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
10
- import { Autocomplete } from '@material-ui/lab';
11
- import { useApi, alertApiRef, errorApiRef, useApp, useRouteRef, useRouteRefParams, AnalyticsContext } from '@backstage/core-plugin-api';
3
+ import { useRouteRef, useApp, useApi, useRouteRefParams, AnalyticsContext } from '@backstage/core-plugin-api';
4
+ import { DocsIcon, Page, Header, Content, ContentHeader, SupportButton, ErrorPage } from '@backstage/core-components';
5
+ import { EntityListProvider, CatalogFilterLayout, EntitySearchBar, EntityKindPicker, UserListPicker, EntityTagPicker } from '@backstage/plugin-catalog-react';
6
+ import { ScaffolderPageContextMenu, TemplateCategoryPicker, TemplateGroups, Workflow } from '@backstage/plugin-scaffolder-react/alpha';
12
7
  import Button from '@material-ui/core/Button';
13
8
  import IconButton from '@material-ui/core/IconButton';
14
9
  import useMediaQuery from '@material-ui/core/useMediaQuery';
15
10
  import AddCircleOutline from '@material-ui/icons/AddCircleOutline';
16
11
  import { catalogEntityCreatePermission } from '@backstage/plugin-catalog-common/alpha';
17
12
  import { usePermission } from '@backstage/plugin-permission-react';
13
+ import { r as registerComponentRouteRef, e as editRouteRef, a as actionsRouteRef, b as scaffolderListTaskRouteRef, v as viewTechDocRouteRef, s as selectedTemplateRouteRef, d as rootRouteRef, c as scaffolderTaskRouteRef, F as TemplateEditor, G as TemplateFormPreviewer, H as CustomFieldExplorer, j as TemplateEditorIntro, W as WebFileSystemAccess, A as ActionsPage, I as OngoingTask } from './alpha-0764fae7.esm.js';
18
14
  import { parseEntityRef, stringifyEntityRef } from '@backstage/catalog-model';
19
- import { TemplateGroup, Workflow } from '@backstage/plugin-scaffolder-react/alpha';
20
- import { v as viewTechDocRouteRef, F as nextSelectedTemplateRouteRef, r as registerComponentRouteRef, G as ContextMenu, H as nextRouteRef, I as nextScaffolderTaskRouteRef, J as TemplateEditor, K as TemplateFormPreviewer, L as CustomFieldExplorer, j as TemplateEditorIntro, W as WebFileSystemAccess, M as nextEditRouteRef, N as nextActionsRouteRef, A as ActionsPage, P as nextScaffolderListTaskRouteRef, Q as OngoingTask } from './alpha-714dad1b.esm.js';
21
15
  import { useTemplateSecrets, scaffolderApiRef, useCustomFieldExtensions, useCustomLayouts, SecretsContextProvider } from '@backstage/plugin-scaffolder-react';
22
- import { D as DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS, L as ListTasksPage } from './ListTasksPage-2e8f4176.esm.js';
16
+ import { D as DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS, L as ListTasksPage } from './ListTasksPage-a9fab591.esm.js';
23
17
  import '@backstage/integration-react';
24
18
  import '@backstage/errors';
25
19
  import 'qs';
26
20
  import 'zen-observable';
21
+ import '@backstage/catalog-client';
22
+ import '@material-ui/core';
27
23
  import '@material-ui/core/FormControl';
28
24
  import '@material-ui/lab/Autocomplete';
29
25
  import 'react-use/lib/useAsync';
@@ -34,19 +30,14 @@ import '@material-ui/core/Input';
34
30
  import '@material-ui/core/InputLabel';
35
31
  import 'react-use/lib/useDebounce';
36
32
  import 'react-use/lib/useEffectOnce';
37
- import '@material-ui/core/ListItemIcon';
38
- import '@material-ui/core/ListItemText';
39
- import '@material-ui/core/MenuItem';
40
- import '@material-ui/core/MenuList';
41
- import '@material-ui/core/Popover';
42
- import '@material-ui/core/styles';
43
- import '@material-ui/icons/Description';
44
- import '@material-ui/icons/Edit';
45
- import '@material-ui/icons/List';
46
- import '@material-ui/icons/MoreVert';
33
+ import '@material-ui/lab';
34
+ import '@react-hookz/web';
35
+ import '@material-ui/icons/Cancel';
47
36
  import '@material-ui/icons/Repeat';
48
37
  import '@material-ui/icons/Toc';
38
+ import '@material-ui/icons/MoreVert';
49
39
  import 'classnames';
40
+ import '@material-ui/icons/ExpandMore';
50
41
  import '@material-ui/icons/Settings';
51
42
  import '@material-ui/icons/FontDownload';
52
43
  import 'luxon';
@@ -57,7 +48,7 @@ import '@codemirror/legacy-modes/mode/yaml';
57
48
  import '@material-ui/icons/Close';
58
49
  import '@uiw/react-codemirror';
59
50
  import 'yaml';
60
- import '@react-hookz/web';
51
+ import '@material-ui/core/styles';
61
52
  import '@rjsf/validator-ajv8';
62
53
  import '@material-ui/core/Accordion';
63
54
  import '@material-ui/core/AccordionDetails';
@@ -66,8 +57,9 @@ import '@material-ui/core/Divider';
66
57
  import '@material-ui/icons/ExpandLess';
67
58
  import '@material-ui/core/List';
68
59
  import '@material-ui/core/ListItem';
60
+ import '@material-ui/core/ListItemIcon';
69
61
  import '@material-ui/core/ListItemSecondaryAction';
70
- import '@material-ui/icons/Cancel';
62
+ import '@material-ui/core/ListItemText';
71
63
  import '@material-ui/icons/Check';
72
64
  import '@material-ui/icons/Delete';
73
65
  import '@material-ui/core/Box';
@@ -92,51 +84,6 @@ import '@material-ui/core/CardContent';
92
84
  import '@material-ui/core/Tooltip';
93
85
  import '@material-ui/icons/InfoOutlined';
94
86
 
95
- const icon = /* @__PURE__ */ React.createElement(CheckBoxOutlineBlankIcon, { fontSize: "small" });
96
- const checkedIcon = /* @__PURE__ */ React.createElement(CheckBoxIcon, { fontSize: "small" });
97
- const CategoryPicker = () => {
98
- const alertApi = useApi(alertApiRef);
99
- const { error, loading, availableTypes, selectedTypes, setSelectedTypes } = useEntityTypeFilter();
100
- if (loading)
101
- return /* @__PURE__ */ React.createElement(Progress, null);
102
- if (error) {
103
- alertApi.post({
104
- message: `Failed to load entity types with error: ${error}`,
105
- severity: "error"
106
- });
107
- return null;
108
- }
109
- if (!availableTypes)
110
- return null;
111
- return /* @__PURE__ */ React.createElement(Box, { pb: 1, pt: 1 }, /* @__PURE__ */ React.createElement(Typography, { variant: "button" }, "Categories"), /* @__PURE__ */ React.createElement(
112
- Autocomplete,
113
- {
114
- multiple: true,
115
- "aria-label": "Categories",
116
- options: availableTypes,
117
- value: selectedTypes,
118
- onChange: (_, value) => setSelectedTypes(value),
119
- renderOption: (option, { selected }) => /* @__PURE__ */ React.createElement(
120
- FormControlLabel,
121
- {
122
- control: /* @__PURE__ */ React.createElement(
123
- Checkbox,
124
- {
125
- icon,
126
- checkedIcon,
127
- checked: selected
128
- }
129
- ),
130
- label: capitalize(option)
131
- }
132
- ),
133
- size: "small",
134
- popupIcon: /* @__PURE__ */ React.createElement(ExpandMoreIcon, null),
135
- renderInput: (params) => /* @__PURE__ */ React.createElement(TextField, { ...params, variant: "outlined" })
136
- }
137
- ));
138
- };
139
-
140
87
  const RegisterExistingButton = (props) => {
141
88
  const { title, to } = props;
142
89
  const { allowed } = usePermission({
@@ -161,62 +108,6 @@ const RegisterExistingButton = (props) => {
161
108
  ) : /* @__PURE__ */ React.createElement(Button, { component: Link, variant: "contained", color: "primary", to }, title);
162
109
  };
163
110
 
164
- const TemplateGroups = (props) => {
165
- const { loading, error, entities } = useEntityList();
166
- const { groups, TemplateCardComponent } = props;
167
- const errorApi = useApi(errorApiRef);
168
- const app = useApp();
169
- const viewTechDocsLink = useRouteRef(viewTechDocRouteRef);
170
- const templateRoute = useRouteRef(nextSelectedTemplateRouteRef);
171
- const navigate = useNavigate();
172
- const onSelected = useCallback(
173
- (template) => {
174
- const { namespace, name } = parseEntityRef(stringifyEntityRef(template));
175
- navigate(templateRoute({ namespace, templateName: name }));
176
- },
177
- [navigate, templateRoute]
178
- );
179
- if (loading) {
180
- return /* @__PURE__ */ React.createElement(Progress, null);
181
- }
182
- if (error) {
183
- errorApi.post(error);
184
- return null;
185
- }
186
- if (!entities || !entities.length) {
187
- 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"), ".");
188
- }
189
- return /* @__PURE__ */ React.createElement(React.Fragment, null, groups.map(({ title, filter }, index) => {
190
- const templates = entities.filter((e) => filter(e)).map((template) => {
191
- var _a, _b;
192
- const { kind, namespace, name } = parseEntityRef(
193
- stringifyEntityRef(template)
194
- );
195
- const additionalLinks = ((_a = template.metadata.annotations) == null ? void 0 : _a["backstage.io/techdocs-ref"]) && viewTechDocsLink ? [
196
- {
197
- icon: (_b = app.getSystemIcon("docs")) != null ? _b : DocsIcon,
198
- text: "View TechDocs",
199
- url: viewTechDocsLink({ kind, namespace, name })
200
- }
201
- ] : [];
202
- return {
203
- template,
204
- additionalLinks
205
- };
206
- });
207
- return /* @__PURE__ */ React.createElement(
208
- TemplateGroup,
209
- {
210
- key: index,
211
- templates,
212
- title,
213
- components: { CardComponent: TemplateCardComponent },
214
- onSelected
215
- }
216
- );
217
- }));
218
- };
219
-
220
111
  const defaultGroup = {
221
112
  title: "Templates",
222
113
  filter: () => true
@@ -229,9 +120,49 @@ const createGroupsWithOther = (groups) => [
229
120
  }
230
121
  ];
231
122
  const TemplateListPage = (props) => {
123
+ var _a, _b, _c;
232
124
  const registerComponentLink = useRouteRef(registerComponentRouteRef);
233
- const { TemplateCardComponent, groups: givenGroups = [] } = props;
125
+ const {
126
+ TemplateCardComponent,
127
+ groups: givenGroups = [],
128
+ templateFilter
129
+ } = props;
130
+ const navigate = useNavigate();
131
+ const editorLink = useRouteRef(editRouteRef);
132
+ const actionsLink = useRouteRef(actionsRouteRef);
133
+ const tasksLink = useRouteRef(scaffolderListTaskRouteRef);
134
+ const viewTechDocsLink = useRouteRef(viewTechDocRouteRef);
135
+ const templateRoute = useRouteRef(selectedTemplateRouteRef);
136
+ const app = useApp();
234
137
  const groups = givenGroups.length ? createGroupsWithOther(givenGroups) : [defaultGroup];
138
+ const scaffolderPageContextMenuProps = {
139
+ onEditorClicked: ((_a = props == null ? void 0 : props.contextMenu) == null ? void 0 : _a.editor) !== false ? () => navigate(editorLink()) : void 0,
140
+ onActionsClicked: ((_b = props == null ? void 0 : props.contextMenu) == null ? void 0 : _b.actions) !== false ? () => navigate(actionsLink()) : void 0,
141
+ onTasksClicked: ((_c = props == null ? void 0 : props.contextMenu) == null ? void 0 : _c.tasks) !== false ? () => navigate(tasksLink()) : void 0
142
+ };
143
+ const additionalLinksForEntity = useCallback(
144
+ (template) => {
145
+ var _a2, _b2;
146
+ const { kind, namespace, name } = parseEntityRef(
147
+ stringifyEntityRef(template)
148
+ );
149
+ return ((_a2 = template.metadata.annotations) == null ? void 0 : _a2["backstage.io/techdocs-ref"]) && viewTechDocsLink ? [
150
+ {
151
+ icon: (_b2 = app.getSystemIcon("docs")) != null ? _b2 : DocsIcon,
152
+ text: "View TechDocs",
153
+ url: viewTechDocsLink({ kind, namespace, name })
154
+ }
155
+ ] : [];
156
+ },
157
+ [app, viewTechDocsLink]
158
+ );
159
+ const onTemplateSelected = useCallback(
160
+ (template) => {
161
+ const { namespace, name } = parseEntityRef(stringifyEntityRef(template));
162
+ navigate(templateRoute({ namespace, templateName: name }));
163
+ },
164
+ [navigate, templateRoute]
165
+ );
235
166
  return /* @__PURE__ */ React.createElement(EntityListProvider, null, /* @__PURE__ */ React.createElement(Page, { themeId: "website" }, /* @__PURE__ */ React.createElement(
236
167
  Header,
237
168
  {
@@ -239,7 +170,7 @@ const TemplateListPage = (props) => {
239
170
  title: "Create a new component",
240
171
  subtitle: "Create new software components using standard templates in your organization"
241
172
  },
242
- /* @__PURE__ */ React.createElement(ContextMenu, { ...props.contextMenu })
173
+ /* @__PURE__ */ React.createElement(ScaffolderPageContextMenu, { ...scaffolderPageContextMenuProps })
243
174
  ), /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(ContentHeader, { title: "Available Templates" }, /* @__PURE__ */ React.createElement(
244
175
  RegisterExistingButton,
245
176
  {
@@ -252,23 +183,26 @@ const TemplateListPage = (props) => {
252
183
  initialFilter: "all",
253
184
  availableFilters: ["all", "starred"]
254
185
  }
255
- ), /* @__PURE__ */ React.createElement(CategoryPicker, null), /* @__PURE__ */ React.createElement(EntityTagPicker, null)), /* @__PURE__ */ React.createElement(CatalogFilterLayout.Content, null, /* @__PURE__ */ React.createElement(
186
+ ), /* @__PURE__ */ React.createElement(TemplateCategoryPicker, null), /* @__PURE__ */ React.createElement(EntityTagPicker, null)), /* @__PURE__ */ React.createElement(CatalogFilterLayout.Content, null, /* @__PURE__ */ React.createElement(
256
187
  TemplateGroups,
257
188
  {
258
189
  groups,
259
- TemplateCardComponent
190
+ templateFilter,
191
+ TemplateCardComponent,
192
+ onTemplateSelected,
193
+ additionalLinksForEntity
260
194
  }
261
195
  ))))));
262
196
  };
263
197
 
264
198
  const TemplateWizardPage = (props) => {
265
- const rootRef = useRouteRef(nextRouteRef);
266
- const taskRoute = useRouteRef(nextScaffolderTaskRouteRef);
199
+ const rootRef = useRouteRef(rootRouteRef);
200
+ const taskRoute = useRouteRef(scaffolderTaskRouteRef);
267
201
  const { secrets } = useTemplateSecrets();
268
202
  const scaffolderApi = useApi(scaffolderApiRef);
269
203
  const navigate = useNavigate();
270
204
  const { templateName, namespace } = useRouteRefParams(
271
- nextSelectedTemplateRouteRef
205
+ selectedTemplateRouteRef
272
206
  );
273
207
  const templateRef = stringifyEntityRef({
274
208
  kind: "Template",
@@ -367,7 +301,9 @@ const Router = (props) => {
367
301
  components: {
368
302
  TemplateCardComponent,
369
303
  TemplateOutputsComponent,
370
- TaskPageComponent = OngoingTask
304
+ TaskPageComponent = OngoingTask,
305
+ TemplateListPageComponent = TemplateListPage,
306
+ TemplateWizardPageComponent = TemplateWizardPage
371
307
  } = {}
372
308
  } = props;
373
309
  const outlet = useOutlet() || props.children;
@@ -386,20 +322,21 @@ const Router = (props) => {
386
322
  {
387
323
  path: "/",
388
324
  element: /* @__PURE__ */ React.createElement(
389
- TemplateListPage,
325
+ TemplateListPageComponent,
390
326
  {
391
327
  TemplateCardComponent,
392
328
  contextMenu: props.contextMenu,
393
- groups: props.groups
329
+ groups: props.groups,
330
+ templateFilter: props.templateFilter
394
331
  }
395
332
  )
396
333
  }
397
334
  ), /* @__PURE__ */ React.createElement(
398
335
  Route,
399
336
  {
400
- path: nextSelectedTemplateRouteRef.path,
337
+ path: selectedTemplateRouteRef.path,
401
338
  element: /* @__PURE__ */ React.createElement(SecretsContextProvider, null, /* @__PURE__ */ React.createElement(
402
- TemplateWizardPage,
339
+ TemplateWizardPageComponent,
403
340
  {
404
341
  customFieldExtensions: fieldExtensions,
405
342
  layouts: customLayouts,
@@ -410,7 +347,7 @@ const Router = (props) => {
410
347
  ), /* @__PURE__ */ React.createElement(
411
348
  Route,
412
349
  {
413
- path: nextScaffolderTaskRouteRef.path,
350
+ path: scaffolderTaskRouteRef.path,
414
351
  element: /* @__PURE__ */ React.createElement(
415
352
  TaskPageComponent,
416
353
  {
@@ -421,7 +358,7 @@ const Router = (props) => {
421
358
  ), /* @__PURE__ */ React.createElement(
422
359
  Route,
423
360
  {
424
- path: nextEditRouteRef.path,
361
+ path: editRouteRef.path,
425
362
  element: /* @__PURE__ */ React.createElement(SecretsContextProvider, null, /* @__PURE__ */ React.createElement(
426
363
  TemplateEditorPage,
427
364
  {
@@ -430,10 +367,10 @@ const Router = (props) => {
430
367
  }
431
368
  ))
432
369
  }
433
- ), /* @__PURE__ */ React.createElement(Route, { path: nextActionsRouteRef.path, element: /* @__PURE__ */ React.createElement(ActionsPage, null) }), /* @__PURE__ */ React.createElement(
370
+ ), /* @__PURE__ */ React.createElement(Route, { path: actionsRouteRef.path, element: /* @__PURE__ */ React.createElement(ActionsPage, null) }), /* @__PURE__ */ React.createElement(
434
371
  Route,
435
372
  {
436
- path: nextScaffolderListTaskRouteRef.path,
373
+ path: scaffolderListTaskRouteRef.path,
437
374
  element: /* @__PURE__ */ React.createElement(ListTasksPage, null)
438
375
  }
439
376
  ), /* @__PURE__ */ React.createElement(
@@ -446,4 +383,4 @@ const Router = (props) => {
446
383
  };
447
384
 
448
385
  export { Router };
449
- //# sourceMappingURL=index-2131f4a0.esm.js.map
386
+ //# sourceMappingURL=index-d45f106a.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-d45f106a.esm.js","sources":["../../../src/next/TemplateListPage/RegisterExistingButton.tsx","../../../src/next/TemplateListPage/TemplateListPage.tsx","../../../src/next/TemplateWizardPage/TemplateWizardPage.tsx","../../../src/next/TemplateEditorPage/TemplateEditorPage.tsx","../../../src/next/Router/Router.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { BackstageTheme } from '@backstage/theme';\nimport Button from '@material-ui/core/Button';\nimport IconButton from '@material-ui/core/IconButton';\nimport useMediaQuery from '@material-ui/core/useMediaQuery';\nimport React from 'react';\nimport { Link as RouterLink, LinkProps } from 'react-router-dom';\nimport AddCircleOutline from '@material-ui/icons/AddCircleOutline';\nimport { catalogEntityCreatePermission } from '@backstage/plugin-catalog-common/alpha';\nimport { usePermission } from '@backstage/plugin-permission-react';\n\n/**\n * Properties for {@link RegisterExistingButton}\n *\n * @alpha\n */\nexport type RegisterExistingButtonProps = {\n title: string;\n} & Partial<Pick<LinkProps, 'to'>>;\n\n/**\n * A button that helps users to register an existing component.\n * @alpha\n */\nexport const RegisterExistingButton = (props: RegisterExistingButtonProps) => {\n const { title, to } = props;\n const { allowed } = usePermission({\n permission: catalogEntityCreatePermission,\n });\n const isXSScreen = useMediaQuery<BackstageTheme>(theme =>\n theme.breakpoints.down('xs'),\n );\n\n if (!to || !allowed) {\n return null;\n }\n\n return isXSScreen ? (\n <IconButton\n component={RouterLink}\n color=\"primary\"\n title={title}\n size=\"small\"\n to={to}\n >\n <AddCircleOutline />\n </IconButton>\n ) : (\n <Button component={RouterLink} variant=\"contained\" color=\"primary\" to={to}>\n {title}\n </Button>\n );\n};\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { useCallback } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';\nimport { useApp, useRouteRef } from '@backstage/core-plugin-api';\n\nimport {\n Content,\n ContentHeader,\n DocsIcon,\n Header,\n Page,\n SupportButton,\n} from '@backstage/core-components';\nimport {\n EntityKindPicker,\n EntityListProvider,\n EntitySearchBar,\n EntityTagPicker,\n CatalogFilterLayout,\n UserListPicker,\n} from '@backstage/plugin-catalog-react';\nimport {\n ScaffolderPageContextMenu,\n TemplateCategoryPicker,\n TemplateGroupFilter,\n TemplateGroups,\n} from '@backstage/plugin-scaffolder-react/alpha';\n\nimport { RegisterExistingButton } from './RegisterExistingButton';\nimport {\n actionsRouteRef,\n editRouteRef,\n registerComponentRouteRef,\n scaffolderListTaskRouteRef,\n selectedTemplateRouteRef,\n viewTechDocRouteRef,\n} from '../../routes';\nimport { parseEntityRef, stringifyEntityRef } from '@backstage/catalog-model';\n\n/**\n * @alpha\n */\nexport type TemplateListPageProps = {\n TemplateCardComponent?: React.ComponentType<{\n template: TemplateEntityV1beta3;\n }>;\n groups?: TemplateGroupFilter[];\n templateFilter?: (entity: TemplateEntityV1beta3) => boolean;\n contextMenu?: {\n editor?: boolean;\n actions?: boolean;\n tasks?: boolean;\n };\n};\n\nconst defaultGroup: TemplateGroupFilter = {\n title: 'Templates',\n filter: () => true,\n};\n\nconst createGroupsWithOther = (\n groups: TemplateGroupFilter[],\n): TemplateGroupFilter[] => [\n ...groups,\n {\n title: 'Other Templates',\n filter: e => ![...groups].some(({ filter }) => filter(e)),\n },\n];\n\n/**\n * @alpha\n */\nexport const TemplateListPage = (props: TemplateListPageProps) => {\n const registerComponentLink = useRouteRef(registerComponentRouteRef);\n const {\n TemplateCardComponent,\n groups: givenGroups = [],\n templateFilter,\n } = props;\n const navigate = useNavigate();\n const editorLink = useRouteRef(editRouteRef);\n const actionsLink = useRouteRef(actionsRouteRef);\n const tasksLink = useRouteRef(scaffolderListTaskRouteRef);\n const viewTechDocsLink = useRouteRef(viewTechDocRouteRef);\n const templateRoute = useRouteRef(selectedTemplateRouteRef);\n const app = useApp();\n\n const groups = givenGroups.length\n ? createGroupsWithOther(givenGroups)\n : [defaultGroup];\n\n const scaffolderPageContextMenuProps = {\n onEditorClicked:\n props?.contextMenu?.editor !== false\n ? () => navigate(editorLink())\n : undefined,\n onActionsClicked:\n props?.contextMenu?.actions !== false\n ? () => navigate(actionsLink())\n : undefined,\n onTasksClicked:\n props?.contextMenu?.tasks !== false\n ? () => navigate(tasksLink())\n : undefined,\n };\n\n const additionalLinksForEntity = useCallback(\n (template: TemplateEntityV1beta3) => {\n const { kind, namespace, name } = parseEntityRef(\n stringifyEntityRef(template),\n );\n return template.metadata.annotations?.['backstage.io/techdocs-ref'] &&\n viewTechDocsLink\n ? [\n {\n icon: app.getSystemIcon('docs') ?? DocsIcon,\n text: 'View TechDocs',\n url: viewTechDocsLink({ kind, namespace, name }),\n },\n ]\n : [];\n },\n [app, viewTechDocsLink],\n );\n\n const onTemplateSelected = useCallback(\n (template: TemplateEntityV1beta3) => {\n const { namespace, name } = parseEntityRef(stringifyEntityRef(template));\n\n navigate(templateRoute({ namespace, templateName: name }));\n },\n [navigate, templateRoute],\n );\n\n return (\n <EntityListProvider>\n <Page themeId=\"website\">\n <Header\n pageTitleOverride=\"Create a new component\"\n title=\"Create a new component\"\n subtitle=\"Create new software components using standard templates in your organization\"\n >\n <ScaffolderPageContextMenu {...scaffolderPageContextMenuProps} />\n </Header>\n <Content>\n <ContentHeader title=\"Available Templates\">\n <RegisterExistingButton\n title=\"Register Existing Component\"\n to={registerComponentLink && registerComponentLink()}\n />\n <SupportButton>\n Create new software components using standard templates. Different\n templates create different kinds of components (services,\n websites, documentation, ...).\n </SupportButton>\n </ContentHeader>\n\n <CatalogFilterLayout>\n <CatalogFilterLayout.Filters>\n <EntitySearchBar />\n <EntityKindPicker initialFilter=\"template\" hidden />\n <UserListPicker\n initialFilter=\"all\"\n availableFilters={['all', 'starred']}\n />\n <TemplateCategoryPicker />\n <EntityTagPicker />\n </CatalogFilterLayout.Filters>\n <CatalogFilterLayout.Content>\n <TemplateGroups\n groups={groups}\n templateFilter={templateFilter}\n TemplateCardComponent={TemplateCardComponent}\n onTemplateSelected={onTemplateSelected}\n additionalLinksForEntity={additionalLinksForEntity}\n />\n </CatalogFilterLayout.Content>\n </CatalogFilterLayout>\n </Content>\n </Page>\n </EntityListProvider>\n );\n};\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React from 'react';\nimport { Navigate, useNavigate } from 'react-router-dom';\nimport { stringifyEntityRef } from '@backstage/catalog-model';\nimport {\n AnalyticsContext,\n useApi,\n useRouteRef,\n useRouteRefParams,\n} from '@backstage/core-plugin-api';\nimport {\n scaffolderApiRef,\n useTemplateSecrets,\n type LayoutOptions,\n} from '@backstage/plugin-scaffolder-react';\nimport {\n FormProps,\n Workflow,\n NextFieldExtensionOptions,\n} from '@backstage/plugin-scaffolder-react/alpha';\nimport { JsonValue } from '@backstage/types';\nimport { Header, Page } from '@backstage/core-components';\n\nimport {\n rootRouteRef,\n scaffolderTaskRouteRef,\n selectedTemplateRouteRef,\n} from '../../routes';\n\n/**\n * @alpha\n */\nexport type TemplateWizardPageProps = {\n customFieldExtensions: NextFieldExtensionOptions<any, any>[];\n layouts?: LayoutOptions[];\n FormProps?: FormProps;\n};\n\nexport const TemplateWizardPage = (props: TemplateWizardPageProps) => {\n const rootRef = useRouteRef(rootRouteRef);\n const taskRoute = useRouteRef(scaffolderTaskRouteRef);\n const { secrets } = useTemplateSecrets();\n const scaffolderApi = useApi(scaffolderApiRef);\n const navigate = useNavigate();\n const { templateName, namespace } = useRouteRefParams(\n selectedTemplateRouteRef,\n );\n\n const templateRef = stringifyEntityRef({\n kind: 'Template',\n namespace,\n name: templateName,\n });\n\n const onCreate = async (values: Record<string, JsonValue>) => {\n const { taskId } = await scaffolderApi.scaffold({\n templateRef,\n values,\n secrets,\n });\n\n navigate(taskRoute({ taskId }));\n };\n\n const onError = () => <Navigate to={rootRef()} />;\n\n return (\n <AnalyticsContext attributes={{ entityRef: templateRef }}>\n <Page themeId=\"website\">\n <Header\n pageTitleOverride=\"Create a new component\"\n title=\"Create a new component\"\n subtitle=\"Create new software components using standard templates in your organization\"\n />\n <Workflow\n namespace={namespace}\n templateName={templateName}\n onCreate={onCreate}\n onError={onError}\n extensions={props.customFieldExtensions}\n FormProps={props.FormProps}\n layouts={props.layouts}\n />\n </Page>\n </AnalyticsContext>\n );\n};\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React, { useState } from 'react';\nimport { Content, Header, Page } from '@backstage/core-components';\nimport {\n TemplateDirectoryAccess,\n WebFileSystemAccess,\n} from '../../lib/filesystem';\nimport { CustomFieldExplorer } from './CustomFieldExplorer';\nimport { TemplateEditor } from './TemplateEditor';\nimport { TemplateFormPreviewer } from './TemplateFormPreviewer';\nimport { type LayoutOptions } from '@backstage/plugin-scaffolder-react';\nimport { NextFieldExtensionOptions } from '@backstage/plugin-scaffolder-react/alpha';\nimport { TemplateEditorIntro } from '../../components/TemplateEditorPage/TemplateEditorIntro';\n\ntype Selection =\n | {\n type: 'local';\n directory: TemplateDirectoryAccess;\n }\n | {\n type: 'form';\n }\n | {\n type: 'field-explorer';\n };\n\ninterface TemplateEditorPageProps {\n defaultPreviewTemplate?: string;\n customFieldExtensions?: NextFieldExtensionOptions<any, any>[];\n layouts?: LayoutOptions[];\n}\n\nexport function TemplateEditorPage(props: TemplateEditorPageProps) {\n const [selection, setSelection] = useState<Selection>();\n\n let content: JSX.Element | null = null;\n if (selection?.type === 'local') {\n content = (\n <TemplateEditor\n directory={selection.directory}\n fieldExtensions={props.customFieldExtensions}\n onClose={() => setSelection(undefined)}\n layouts={props.layouts}\n />\n );\n } else if (selection?.type === 'form') {\n content = (\n <TemplateFormPreviewer\n defaultPreviewTemplate={props.defaultPreviewTemplate}\n customFieldExtensions={props.customFieldExtensions}\n onClose={() => setSelection(undefined)}\n layouts={props.layouts}\n />\n );\n } else if (selection?.type === 'field-explorer') {\n content = (\n <CustomFieldExplorer\n customFieldExtensions={props.customFieldExtensions}\n onClose={() => setSelection(undefined)}\n />\n );\n } else {\n content = (\n <Content>\n <TemplateEditorIntro\n onSelect={option => {\n if (option === 'local') {\n WebFileSystemAccess.requestDirectoryAccess()\n .then(directory => setSelection({ type: 'local', directory }))\n .catch(() => {});\n } else if (option === 'form') {\n setSelection({ type: 'form' });\n } else if (option === 'field-explorer') {\n setSelection({ type: 'field-explorer' });\n }\n }}\n />\n </Content>\n );\n }\n\n return (\n <Page themeId=\"home\">\n <Header\n title=\"Template Editor\"\n subtitle=\"Edit, preview, and try out templates and template forms\"\n />\n {content}\n </Page>\n );\n}\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React, { PropsWithChildren } from 'react';\nimport { Routes, Route, useOutlet } from 'react-router-dom';\nimport { TemplateListPage, TemplateListPageProps } from '../TemplateListPage';\nimport {\n TemplateWizardPage,\n TemplateWizardPageProps,\n} from '../TemplateWizardPage';\nimport {\n NextFieldExtensionOptions,\n FormProps,\n TemplateGroupFilter,\n} from '@backstage/plugin-scaffolder-react/alpha';\nimport {\n ScaffolderTaskOutput,\n SecretsContextProvider,\n useCustomFieldExtensions,\n useCustomLayouts,\n} from '@backstage/plugin-scaffolder-react';\n\nimport { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';\nimport { DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS } from '../../extensions/default';\n\nimport {\n actionsRouteRef,\n editRouteRef,\n scaffolderListTaskRouteRef,\n scaffolderTaskRouteRef,\n selectedTemplateRouteRef,\n} from '../../routes';\nimport { ErrorPage } from '@backstage/core-components';\nimport { OngoingTask } from '../OngoingTask';\nimport { ActionsPage } from '../../components/ActionsPage';\nimport { ListTasksPage } from '../../components/ListTasksPage';\nimport { TemplateEditorPage } from '../TemplateEditorPage';\n\n/**\n * The Props for the Scaffolder Router\n *\n * @alpha\n */\nexport type NextRouterProps = {\n components?: {\n TemplateCardComponent?: React.ComponentType<{\n template: TemplateEntityV1beta3;\n }>;\n TaskPageComponent?: React.ComponentType<{}>;\n TemplateOutputsComponent?: React.ComponentType<{\n output?: ScaffolderTaskOutput;\n }>;\n TemplateListPageComponent?: React.ComponentType<TemplateListPageProps>;\n TemplateWizardPageComponent?: React.ComponentType<TemplateWizardPageProps>;\n };\n groups?: TemplateGroupFilter[];\n templateFilter?: (entity: TemplateEntityV1beta3) => boolean;\n // todo(blam): rename this to formProps\n FormProps?: FormProps;\n contextMenu?: {\n /** Whether to show a link to the template editor */\n editor?: boolean;\n /** Whether to show a link to the actions documentation */\n actions?: boolean;\n /** Whether to show a link to the tasks page */\n tasks?: boolean;\n };\n};\n\n/**\n * The Scaffolder Router\n *\n * @alpha\n */\nexport const Router = (props: PropsWithChildren<NextRouterProps>) => {\n const {\n components: {\n TemplateCardComponent,\n TemplateOutputsComponent,\n TaskPageComponent = OngoingTask,\n TemplateListPageComponent = TemplateListPage,\n TemplateWizardPageComponent = TemplateWizardPage,\n } = {},\n } = props;\n const outlet = useOutlet() || props.children;\n const customFieldExtensions =\n useCustomFieldExtensions<NextFieldExtensionOptions>(outlet);\n\n const fieldExtensions = [\n ...customFieldExtensions,\n ...DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS.filter(\n ({ name }) =>\n !customFieldExtensions.some(\n customFieldExtension => customFieldExtension.name === name,\n ),\n ),\n ] as NextFieldExtensionOptions[];\n\n const customLayouts = useCustomLayouts(outlet);\n\n return (\n <Routes>\n <Route\n path=\"/\"\n element={\n <TemplateListPageComponent\n TemplateCardComponent={TemplateCardComponent}\n contextMenu={props.contextMenu}\n groups={props.groups}\n templateFilter={props.templateFilter}\n />\n }\n />\n <Route\n path={selectedTemplateRouteRef.path}\n element={\n <SecretsContextProvider>\n <TemplateWizardPageComponent\n customFieldExtensions={fieldExtensions}\n layouts={customLayouts}\n FormProps={props.FormProps}\n />\n </SecretsContextProvider>\n }\n />\n <Route\n path={scaffolderTaskRouteRef.path}\n element={\n <TaskPageComponent\n TemplateOutputsComponent={TemplateOutputsComponent}\n />\n }\n />\n <Route\n path={editRouteRef.path}\n element={\n <SecretsContextProvider>\n <TemplateEditorPage\n customFieldExtensions={fieldExtensions}\n layouts={customLayouts}\n />\n </SecretsContextProvider>\n }\n />\n\n <Route path={actionsRouteRef.path} element={<ActionsPage />} />\n <Route\n path={scaffolderListTaskRouteRef.path}\n element={<ListTasksPage />}\n />\n <Route\n path=\"*\"\n element={<ErrorPage status=\"404\" statusMessage=\"Page not found\" />}\n />\n </Routes>\n );\n};\n"],"names":["RouterLink","_a","_b"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCa,MAAA,sBAAA,GAAyB,CAAC,KAAuC,KAAA;AAC5E,EAAM,MAAA,EAAE,KAAO,EAAA,EAAA,EAAO,GAAA,KAAA,CAAA;AACtB,EAAM,MAAA,EAAE,OAAQ,EAAA,GAAI,aAAc,CAAA;AAAA,IAChC,UAAY,EAAA,6BA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