@backstage/plugin-scaffolder 1.7.0 → 1.8.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.
- package/CHANGELOG.md +31 -0
- package/alpha/package.json +1 -1
- package/dist/esm/{Router-4521e309.esm.js → Router-9b4af3fe.esm.js} +29 -17
- package/dist/esm/Router-9b4af3fe.esm.js.map +1 -0
- package/dist/esm/{default-bdf322b4.esm.js → default-bd0adcad.esm.js} +2 -2
- package/dist/esm/{default-bdf322b4.esm.js.map → default-bd0adcad.esm.js.map} +1 -1
- package/dist/esm/{index-e49d2205.esm.js → index-485e2e41.esm.js} +3 -3
- package/dist/esm/index-485e2e41.esm.js.map +1 -0
- package/dist/esm/{index-bac377e4.esm.js → index-e0ac3471.esm.js} +8 -8
- package/dist/esm/index-e0ac3471.esm.js.map +1 -0
- package/dist/index.alpha.d.ts +19 -0
- package/dist/index.beta.d.ts +17 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.esm.js +1 -1
- package/package.json +19 -19
- package/dist/esm/Router-4521e309.esm.js.map +0 -1
- package/dist/esm/index-bac377e4.esm.js.map +0 -1
- package/dist/esm/index-e49d2205.esm.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# @backstage/plugin-scaffolder
|
|
2
2
|
|
|
3
|
+
## 1.8.0-next.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- edae17309e: Added props to override default Scaffolder page title, subtitle and pageTitleOverride.
|
|
8
|
+
Routes like `rootRouteRef`, `selectedTemplateRouteRef`, `nextRouteRef`, `nextSelectedTemplateRouteRef` were made public and can be used in your app (e.g. in custom TemplateCard component).
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- 4830a3569f: Basic analytics instrumentation is now in place:
|
|
13
|
+
|
|
14
|
+
- As users make their way through template steps, a `click` event is fired, including the step number.
|
|
15
|
+
- After a user clicks "Create" a `create` event is fired, including the name of the software that was just created. The template used at creation is set on the `entityRef` context key.
|
|
16
|
+
|
|
17
|
+
- f905853ad6: Prefer using `Link` from `@backstage/core-components` rather than material-UI.
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
- @backstage/plugin-catalog-react@1.2.1-next.0
|
|
20
|
+
- @backstage/core-components@0.12.0-next.0
|
|
21
|
+
- @backstage/core-plugin-api@1.1.0-next.0
|
|
22
|
+
- @backstage/integration@1.4.0-next.0
|
|
23
|
+
- @backstage/catalog-model@1.1.3-next.0
|
|
24
|
+
- @backstage/types@1.0.1-next.0
|
|
25
|
+
- @backstage/integration-react@1.1.6-next.0
|
|
26
|
+
- @backstage/plugin-permission-react@0.4.7-next.0
|
|
27
|
+
- @backstage/catalog-client@1.1.2-next.0
|
|
28
|
+
- @backstage/config@1.0.4-next.0
|
|
29
|
+
- @backstage/errors@1.1.3-next.0
|
|
30
|
+
- @backstage/theme@0.2.16
|
|
31
|
+
- @backstage/plugin-catalog-common@1.0.8-next.0
|
|
32
|
+
- @backstage/plugin-scaffolder-common@1.2.2-next.0
|
|
33
|
+
|
|
3
34
|
## 1.7.0
|
|
4
35
|
|
|
5
36
|
### Minor Changes
|
package/alpha/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React, { useState, useContext, useCallback, createContext, useEffect, useRef, useMemo, Children, Component, Fragment } from 'react';
|
|
2
2
|
import { useNavigate, Navigate, useOutlet, Routes, Route } from 'react-router';
|
|
3
|
-
import { ItemCardHeader, MarkdownContent, Button, ContentHeader, Progress, WarningPanel,
|
|
4
|
-
import { useApp, useRouteRef, useApi, errorApiRef, featureFlagsApiRef, useApiHolder,
|
|
3
|
+
import { ItemCardHeader, MarkdownContent, Button, Link, ContentHeader, Progress, WarningPanel, Content, ItemCardGrid, Page, Header, CreateButton, SupportButton, StructuredMetadataTable, InfoCard, ErrorPage, ErrorPanel, LogViewer, StatusError, StatusOK, StatusPending, Lifecycle, EmptyState, Table as Table$1 } from '@backstage/core-components';
|
|
4
|
+
import { useApp, useRouteRef, useApi, useRouteRefParams, useAnalytics, errorApiRef, featureFlagsApiRef, useApiHolder, AnalyticsContext, 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, v as viewTechDocRouteRef, 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 LAYOUTS_WRAPPER_KEY, j as LAYOUTS_KEY, l as legacySelectedTemplateRouteRef, k as SecretsContextProvider, m as TaskPage } from './index-
|
|
6
|
+
import { s as selectedTemplateRouteRef, v as viewTechDocRouteRef, 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 LAYOUTS_WRAPPER_KEY, j as LAYOUTS_KEY, l as legacySelectedTemplateRouteRef, k as SecretsContextProvider, m as TaskPage } from './index-485e2e41.esm.js';
|
|
7
7
|
import { RELATION_OWNED_BY, parseEntityRef, stringifyEntityRef, DEFAULT_NAMESPACE } from '@backstage/catalog-model';
|
|
8
|
-
import { makeStyles, useTheme, Card, CardMedia, CardContent, Box, Typography, Chip, CardActions, Tooltip, IconButton,
|
|
8
|
+
import { makeStyles, useTheme, Card, CardMedia, CardContent, Box, Typography, Chip, CardActions, Tooltip, IconButton, 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 LanguageIcon from '@material-ui/icons/Language';
|
|
11
11
|
import WarningIcon from '@material-ui/icons/Warning';
|
|
@@ -66,7 +66,7 @@ import SettingsIcon from '@material-ui/icons/Settings';
|
|
|
66
66
|
import AllIcon from '@material-ui/icons/FontDownload';
|
|
67
67
|
import { DateTime, Interval } from 'luxon';
|
|
68
68
|
import humanizeDuration from 'humanize-duration';
|
|
69
|
-
import { D as DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS } from './default-
|
|
69
|
+
import { D as DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS } from './default-bd0adcad.esm.js';
|
|
70
70
|
import '@backstage/errors';
|
|
71
71
|
import 'zen-observable';
|
|
72
72
|
import '@material-ui/core/FormControl';
|
|
@@ -163,7 +163,7 @@ const DeprecationWarning = () => {
|
|
|
163
163
|
}, /* @__PURE__ */ React.createElement(Tooltip, {
|
|
164
164
|
title: Title
|
|
165
165
|
}, /* @__PURE__ */ React.createElement(Link, {
|
|
166
|
-
|
|
166
|
+
to: "https://backstage.io/docs/features/software-templates/migrating-from-v1beta2-to-v1beta3",
|
|
167
167
|
className: styles.link
|
|
168
168
|
}, /* @__PURE__ */ React.createElement(WarningIcon, null))));
|
|
169
169
|
};
|
|
@@ -291,7 +291,7 @@ const TemplateList = ({
|
|
|
291
291
|
title: "Oops! Something went wrong loading the templates"
|
|
292
292
|
}, error.message), !error && !loading && !entities.length && /* @__PURE__ */ React.createElement(Typography, {
|
|
293
293
|
variant: "body2"
|
|
294
|
-
}, "No templates found that match your filter. Learn more about", " ", /* @__PURE__ */ React.createElement(Link
|
|
294
|
+
}, "No templates found that match your filter. Learn more about", " ", /* @__PURE__ */ React.createElement(Link, {
|
|
295
295
|
to: "https://backstage.io/docs/features/software-templates/adding-templates"
|
|
296
296
|
}, "adding templates"), "."), /* @__PURE__ */ React.createElement(Content, null, titleComponent, /* @__PURE__ */ React.createElement(ItemCardGrid, null, maybeFilteredEntities && (maybeFilteredEntities == null ? void 0 : maybeFilteredEntities.length) > 0 && maybeFilteredEntities.map((template) => /* @__PURE__ */ React.createElement(Card, {
|
|
297
297
|
key: stringifyEntityRef(template),
|
|
@@ -362,7 +362,8 @@ function ScaffolderPageContextMenu(props) {
|
|
|
362
362
|
const ScaffolderPageContents = ({
|
|
363
363
|
TemplateCardComponent,
|
|
364
364
|
groups,
|
|
365
|
-
contextMenu
|
|
365
|
+
contextMenu,
|
|
366
|
+
headerOptions
|
|
366
367
|
}) => {
|
|
367
368
|
const registerComponentLink = useRouteRef(registerComponentRouteRef);
|
|
368
369
|
const otherTemplatesGroup = {
|
|
@@ -380,7 +381,8 @@ const ScaffolderPageContents = ({
|
|
|
380
381
|
}, /* @__PURE__ */ React.createElement(Header, {
|
|
381
382
|
pageTitleOverride: "Create a New Component",
|
|
382
383
|
title: "Create a New Component",
|
|
383
|
-
subtitle: "Create new software components using standard templates"
|
|
384
|
+
subtitle: "Create new software components using standard templates",
|
|
385
|
+
...headerOptions
|
|
384
386
|
}, /* @__PURE__ */ React.createElement(ScaffolderPageContextMenu, {
|
|
385
387
|
...contextMenu
|
|
386
388
|
})), /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(ContentHeader, {
|
|
@@ -407,11 +409,13 @@ const ScaffolderPageContents = ({
|
|
|
407
409
|
const ScaffolderPage = ({
|
|
408
410
|
TemplateCardComponent,
|
|
409
411
|
groups,
|
|
410
|
-
contextMenu
|
|
412
|
+
contextMenu,
|
|
413
|
+
headerOptions
|
|
411
414
|
}) => /* @__PURE__ */ React.createElement(EntityListProvider, null, /* @__PURE__ */ React.createElement(ScaffolderPageContents, {
|
|
412
415
|
TemplateCardComponent,
|
|
413
416
|
groups,
|
|
414
|
-
contextMenu
|
|
417
|
+
contextMenu,
|
|
418
|
+
headerOptions
|
|
415
419
|
}));
|
|
416
420
|
|
|
417
421
|
function isObject$1(value) {
|
|
@@ -570,6 +574,8 @@ const MultistepJsonForm = (props) => {
|
|
|
570
574
|
finishButtonLabel,
|
|
571
575
|
layouts
|
|
572
576
|
} = props;
|
|
577
|
+
const { templateName } = useRouteRefParams(selectedTemplateRouteRef);
|
|
578
|
+
const analytics = useAnalytics();
|
|
573
579
|
const [activeStep, setActiveStep] = useState(0);
|
|
574
580
|
const [disableButtons, setDisableButtons] = useState(false);
|
|
575
581
|
const errorApi = useApi(errorApiRef);
|
|
@@ -609,7 +615,9 @@ const MultistepJsonForm = (props) => {
|
|
|
609
615
|
onReset();
|
|
610
616
|
};
|
|
611
617
|
const handleNext = () => {
|
|
612
|
-
|
|
618
|
+
const stepNum = Math.min(activeStep + 1, steps.length);
|
|
619
|
+
setActiveStep(stepNum);
|
|
620
|
+
analytics.captureEvent("click", `Next Step (${stepNum})`);
|
|
613
621
|
};
|
|
614
622
|
const handleBack = () => setActiveStep(Math.max(activeStep - 1, 0));
|
|
615
623
|
const handleCreate = async () => {
|
|
@@ -619,6 +627,7 @@ const MultistepJsonForm = (props) => {
|
|
|
619
627
|
setDisableButtons(true);
|
|
620
628
|
try {
|
|
621
629
|
await onFinish();
|
|
630
|
+
analytics.captureEvent("create", formData.name || `new ${templateName}`);
|
|
622
631
|
} catch (err) {
|
|
623
632
|
errorApi.post(err);
|
|
624
633
|
} finally {
|
|
@@ -810,7 +819,9 @@ const TemplatePage = ({
|
|
|
810
819
|
const customFieldValidators = Object.fromEntries(
|
|
811
820
|
customFieldExtensions.map(({ name, validation }) => [name, validation])
|
|
812
821
|
);
|
|
813
|
-
return /* @__PURE__ */ React.createElement(
|
|
822
|
+
return /* @__PURE__ */ React.createElement(AnalyticsContext, {
|
|
823
|
+
attributes: { entityRef: templateRef }
|
|
824
|
+
}, /* @__PURE__ */ React.createElement(Page, {
|
|
814
825
|
themeId: "home"
|
|
815
826
|
}, /* @__PURE__ */ React.createElement(Header, {
|
|
816
827
|
pageTitleOverride: "Create a New Component",
|
|
@@ -839,7 +850,7 @@ const TemplatePage = ({
|
|
|
839
850
|
)
|
|
840
851
|
};
|
|
841
852
|
})
|
|
842
|
-
}))));
|
|
853
|
+
})))));
|
|
843
854
|
};
|
|
844
855
|
|
|
845
856
|
const useStyles$c = makeStyles((theme) => ({
|
|
@@ -2454,7 +2465,7 @@ const ListTaskPageContent = (props) => {
|
|
|
2454
2465
|
{
|
|
2455
2466
|
title: "Task ID",
|
|
2456
2467
|
field: "id",
|
|
2457
|
-
render: (row) => /* @__PURE__ */ React.createElement(Link
|
|
2468
|
+
render: (row) => /* @__PURE__ */ React.createElement(Link, {
|
|
2458
2469
|
to: `${rootLink()}/tasks/${row.id}`
|
|
2459
2470
|
}, row.id)
|
|
2460
2471
|
},
|
|
@@ -2556,7 +2567,8 @@ const Router = (props) => {
|
|
|
2556
2567
|
element: /* @__PURE__ */ React.createElement(ScaffolderPage, {
|
|
2557
2568
|
groups,
|
|
2558
2569
|
TemplateCardComponent,
|
|
2559
|
-
contextMenu: props.contextMenu
|
|
2570
|
+
contextMenu: props.contextMenu,
|
|
2571
|
+
headerOptions: props.headerOptions
|
|
2560
2572
|
})
|
|
2561
2573
|
}), /* @__PURE__ */ React.createElement(Route, {
|
|
2562
2574
|
path: legacySelectedTemplateRouteRef.path,
|
|
@@ -2592,4 +2604,4 @@ const Router = (props) => {
|
|
|
2592
2604
|
};
|
|
2593
2605
|
|
|
2594
2606
|
export { Router };
|
|
2595
|
-
//# sourceMappingURL=Router-
|
|
2607
|
+
//# sourceMappingURL=Router-9b4af3fe.esm.js.map
|