@backstage/plugin-scaffolder 1.3.0-next.2 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,50 @@
1
1
  # @backstage/plugin-scaffolder
2
2
 
3
+ ## 1.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - dc39366bdb: - Added a new page under `/create/tasks` to show tasks that have been run by the Scaffolder.
8
+ - Ability to filter these tasks by the signed in user, and all tasks.
9
+ - Added optional method to the `ScaffolderApi` interface called `listTasks` to get tasks with an required `filterByOwnership` parameter.
10
+ - 86a4a0f72d: Get data of other fields in Form from a custom field in template Scaffolder.
11
+ following:
12
+
13
+ ```tsx
14
+ const CustomFieldExtensionComponent = (props: FieldExtensionComponentProps<string[]>) => {
15
+ const { formData } = props.formContext;
16
+ ...
17
+ };
18
+
19
+ const CustomFieldExtension = scaffolderPlugin.provide(
20
+ createScaffolderFieldExtension({
21
+ name: ...,
22
+ component: CustomFieldExtensionComponent,
23
+ validation: ...
24
+ })
25
+ );
26
+ ```
27
+
28
+ - 72dfcbc8bf: Gerrit Integration: Implemented a `RepoUrlPicker` for Gerrit.
29
+ - f93af969cd: Added the ability to support running of templates that are not in the `default` namespace
30
+
31
+ ### Patch Changes
32
+
33
+ - ac0c7e45ee: Fixes review mask in `MultistepJsonForm` to work as documented. `show: true` no longer needed when mask is set.
34
+ - 8f7b1835df: Updated dependency `msw` to `^0.41.0`.
35
+ - fd505f40c0: Handle binary files and files that are too large during dry-run content upload.
36
+ - Updated dependencies
37
+ - @backstage/plugin-catalog-react@1.1.1
38
+ - @backstage/plugin-catalog-common@1.0.3
39
+ - @backstage/core-components@0.9.5
40
+ - @backstage/integration@1.2.1
41
+ - @backstage/catalog-client@1.0.3
42
+ - @backstage/core-plugin-api@1.0.3
43
+ - @backstage/integration-react@1.1.1
44
+ - @backstage/catalog-model@1.0.3
45
+ - @backstage/plugin-permission-react@0.4.2
46
+ - @backstage/plugin-scaffolder-common@1.1.1
47
+
3
48
  ## 1.3.0-next.2
4
49
 
5
50
  ### Minor Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-scaffolder",
3
- "version": "1.3.0-next.2",
3
+ "version": "1.3.0",
4
4
  "main": "../dist/index.esm.js",
5
5
  "types": "../dist/index.alpha.d.ts"
6
6
  }
@@ -1,10 +1,10 @@
1
1
  import React, { useState, useContext, useCallback, createContext, useEffect, useRef, useMemo, Children, Component, Fragment } from 'react';
2
- import { useNavigate, Navigate, useOutlet, Routes, Route } from 'react-router';
2
+ import { useNavigate, Navigate, useOutlet, Routes, Route, useParams as useParams$1 } from 'react-router';
3
3
  import { ItemCardHeader, MarkdownContent, Button, ContentHeader, Progress, WarningPanel, Link as Link$1, Content, ItemCardGrid, Page, Header, CreateButton, SupportButton, StructuredMetadataTable, InfoCard, ErrorPage, ErrorPanel, LogViewer, StatusError, StatusOK, StatusPending, Lifecycle, EmptyState } from '@backstage/core-components';
4
4
  import { useRouteRef, useApi, errorApiRef, featureFlagsApiRef, useApiHolder, alertApiRef, useElementFilter } from '@backstage/core-plugin-api';
5
5
  import { getEntityRelations, getEntitySourceLocation, FavoriteEntity, EntityRefLinks, useEntityList, EntityListProvider, CatalogFilterLayout, EntitySearchBar, EntityKindPicker, UserListPicker, EntityTagPicker, catalogApiRef, humanizeEntityRef, EntityRefLink } from '@backstage/plugin-catalog-react';
6
- import { s as selectedTemplateRouteRef, e as editRouteRef, a as actionsRouteRef, b as scaffolderListTaskRouteRef, r as registerComponentRouteRef, T as TemplateTypePicker, S as SecretsContext, c as scaffolderApiRef, d as scaffolderTaskRouteRef, f as rootRouteRef, g as TaskStatusStepper, h as TaskPageLinks, F as FIELD_EXTENSION_WRAPPER_KEY, i as FIELD_EXTENSION_KEY, j as SecretsContextProvider, k as TaskPage } from './index-b64713a1.esm.js';
7
- import { RELATION_OWNED_BY, stringifyEntityRef, parseEntityRef } from '@backstage/catalog-model';
6
+ import { s as selectedTemplateRouteRef, e as editRouteRef, a as actionsRouteRef, b as scaffolderListTaskRouteRef, r as registerComponentRouteRef, T as TemplateTypePicker, S as SecretsContext, c as scaffolderApiRef, d as scaffolderTaskRouteRef, f as rootRouteRef, g as TaskStatusStepper, h as TaskPageLinks, F as FIELD_EXTENSION_WRAPPER_KEY, i as FIELD_EXTENSION_KEY, l as legacySelectedTemplateRouteRef, j as SecretsContextProvider, k as TaskPage } from './index-6712a69a.esm.js';
7
+ import { RELATION_OWNED_BY, parseEntityRef, stringifyEntityRef } from '@backstage/catalog-model';
8
8
  import { makeStyles, useTheme, Card, CardMedia, CardContent, Box, Typography, Chip, CardActions, IconButton, Tooltip, Link, Stepper, Step, StepLabel, StepContent, Button as Button$1, Paper, LinearProgress, TableContainer, Table, TableHead, TableRow, TableCell, TableBody, Divider as Divider$1, FormControl, InputLabel, Select, MenuItem as MenuItem$1, List as List$2, ListItemIcon as ListItemIcon$1, ListItemText as ListItemText$1 } from '@material-ui/core';
9
9
  import { scmIntegrationsApiRef, ScmIntegrationIcon } from '@backstage/integration-react';
10
10
  import WarningIcon from '@material-ui/icons/Warning';
@@ -67,7 +67,7 @@ import SettingsIcon from '@material-ui/icons/Settings';
67
67
  import AllIcon from '@material-ui/icons/FontDownload';
68
68
  import { DateTime, Interval } from 'luxon';
69
69
  import humanizeDuration from 'humanize-duration';
70
- import { D as DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS } from './default-554cb9ad.esm.js';
70
+ import { D as DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS } from './default-6ab4a4ed.esm.js';
71
71
  import '@backstage/errors';
72
72
  import 'zen-observable';
73
73
  import '@material-ui/core/FormControl';
@@ -169,7 +169,8 @@ const TemplateCard = ({ template, deprecated }) => {
169
169
  const themeId = backstageTheme.getPageTheme({ themeId: templateProps.type }) ? templateProps.type : "other";
170
170
  const theme = backstageTheme.getPageTheme({ themeId });
171
171
  const classes = useStyles$e({ backgroundImage: theme.backgroundImage });
172
- const href = templateRoute({ templateName: templateProps.name });
172
+ const { name, namespace } = parseEntityRef(stringifyEntityRef(template));
173
+ const href = templateRoute({ templateName: name, namespace });
173
174
  const scmIntegrationsApi = useApi(scmIntegrationsApiRef);
174
175
  const sourceLocation = getEntitySourceLocation(template, scmIntegrationsApi);
175
176
  return /* @__PURE__ */ React.createElement(Card, null, /* @__PURE__ */ React.createElement(CardMedia, {
@@ -671,11 +672,16 @@ const TemplatePage = ({
671
672
  const secretsContext = useContext(SecretsContext);
672
673
  const errorApi = useApi(errorApiRef);
673
674
  const scaffolderApi = useApi(scaffolderApiRef);
674
- const { templateName } = useParams();
675
+ const { templateName, namespace } = useParams();
676
+ const templateRef = stringifyEntityRef({
677
+ name: templateName,
678
+ kind: "template",
679
+ namespace
680
+ });
675
681
  const navigate = useNavigate();
676
682
  const scaffolderTaskRoute = useRouteRef(scaffolderTaskRouteRef);
677
683
  const rootRoute = useRouteRef(rootRouteRef);
678
- const { schema, loading, error } = useTemplateParameterSchema(templateName);
684
+ const { schema, loading, error } = useTemplateParameterSchema(templateRef);
679
685
  const [formState, setFormState] = useState(() => {
680
686
  var _a;
681
687
  const query = qs.parse(window.location.search, {
@@ -692,11 +698,7 @@ const TemplatePage = ({
692
698
  const handleCreate = async () => {
693
699
  var _a;
694
700
  const { taskId } = await scaffolderApi.scaffold({
695
- templateRef: stringifyEntityRef({
696
- name: templateName,
697
- kind: "template",
698
- namespace: "default"
699
- }),
701
+ templateRef,
700
702
  values: formState,
701
703
  secrets: secretsContext == null ? void 0 : secretsContext.secrets
702
704
  });
@@ -2342,6 +2344,14 @@ const Router = (props) => {
2342
2344
  ...customFieldExtensions,
2343
2345
  ...DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS.filter(({ name }) => !customFieldExtensions.some((customFieldExtension) => customFieldExtension.name === name))
2344
2346
  ];
2347
+ const RedirectingComponent = () => {
2348
+ const { templateName } = useParams$1();
2349
+ const newLink = useRouteRef(selectedTemplateRouteRef);
2350
+ useEffect(() => console.warn("The route /template/:templateName is deprecated, please use the new /template/:namespace/:templateName route instead"), []);
2351
+ return /* @__PURE__ */ React.createElement(Navigate, {
2352
+ to: newLink({ namespace: "default", templateName })
2353
+ });
2354
+ };
2345
2355
  return /* @__PURE__ */ React.createElement(Routes, null, /* @__PURE__ */ React.createElement(Route, {
2346
2356
  element: /* @__PURE__ */ React.createElement(ScaffolderPage, {
2347
2357
  groups,
@@ -2349,6 +2359,8 @@ const Router = (props) => {
2349
2359
  contextMenu: props.contextMenu
2350
2360
  })
2351
2361
  }), /* @__PURE__ */ React.createElement(Route, {
2362
+ path: legacySelectedTemplateRouteRef.path
2363
+ }, /* @__PURE__ */ React.createElement(RedirectingComponent, null)), /* @__PURE__ */ React.createElement(Route, {
2352
2364
  path: selectedTemplateRouteRef.path,
2353
2365
  element: /* @__PURE__ */ React.createElement(SecretsContextProvider, null, /* @__PURE__ */ React.createElement(TemplatePage, {
2354
2366
  customFieldExtensions: fieldExtensions
@@ -2377,4 +2389,4 @@ const Router = (props) => {
2377
2389
  };
2378
2390
 
2379
2391
  export { Router };
2380
- //# sourceMappingURL=Router-09b6a7c3.esm.js.map
2392
+ //# sourceMappingURL=Router-2a5afa3f.esm.js.map