@backstage/plugin-scaffolder 0.12.1 → 0.12.2-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 +12 -0
- package/dist/esm/{Router-d4d39aa6.esm.js → Router-5df57206.esm.js} +36 -427
- package/dist/esm/Router-5df57206.esm.js.map +1 -0
- package/dist/esm/{index-9f303a62.esm.js → index-71578268.esm.js} +430 -14
- package/dist/esm/index-71578268.esm.js.map +1 -0
- package/dist/index.d.ts +20 -2
- package/dist/index.esm.js +15 -1
- package/dist/index.esm.js.map +1 -1
- package/package.json +8 -8
- package/dist/esm/Router-d4d39aa6.esm.js.map +0 -1
- package/dist/esm/index-9f303a62.esm.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @backstage/plugin-scaffolder
|
|
2
2
|
|
|
3
|
+
## 0.12.2-next.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 33e139e652: Adds a loading bar to the scaffolder task page if the task is still loading. This can happen if it takes a while for a task worker to pick up a task.
|
|
8
|
+
- 6458be3307: Encode the `formData` in the `queryString` using `JSON.stringify` to keep the types in the decoded value
|
|
9
|
+
- 319f4b79a2: The ScaffolderPage can be passed an optional `TaskPageComponent` with a `loadingText` string. It will replace the Loading text in the scaffolder task page.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
- @backstage/core-components@0.8.8-next.0
|
|
12
|
+
- @backstage/plugin-catalog-react@0.6.14-next.0
|
|
13
|
+
- @backstage/integration-react@0.1.21-next.0
|
|
14
|
+
|
|
3
15
|
## 0.12.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React, { useState, useContext, useCallback
|
|
2
|
-
import { useNavigate, Navigate, generatePath,
|
|
3
|
-
import { Page, Header, Lifecycle, Content, ContentHeader, CreateButton, SupportButton, MarkdownContent, StructuredMetadataTable, InfoCard,
|
|
4
|
-
import { useRouteRef, useApi, errorApiRef, useApiHolder,
|
|
5
|
-
import { EntityListProvider, EntitySearchBar, EntityKindPicker, UserListPicker, EntityTagPicker
|
|
6
|
-
import { makeStyles, Stepper, Step, StepLabel, Typography, StepContent, Button, Paper, Box, LinearProgress,
|
|
7
|
-
import { E as EntityPicker, a as EntityNamePicker, e as entityNamePickerValidation, b as EntityTagsPicker, R as RepoUrlPicker, r as repoPickerValidation, O as OwnerPicker, c as OwnedEntityPicker, d as registerComponentRouteRef, T as TemplateTypePicker, f as TemplateList, S as SecretsContext, s as scaffolderApiRef, g as rootRouteRef, F as FIELD_EXTENSION_WRAPPER_KEY, h as FIELD_EXTENSION_KEY, i as SecretsContextProvider } from './index-
|
|
1
|
+
import React, { useState, useContext, useCallback } from 'react';
|
|
2
|
+
import { useNavigate, Navigate, generatePath, useOutlet, Routes, Route } from 'react-router';
|
|
3
|
+
import { Page, Header, Lifecycle, Content, ContentHeader, CreateButton, SupportButton, MarkdownContent, StructuredMetadataTable, InfoCard, Progress, ErrorPage } from '@backstage/core-components';
|
|
4
|
+
import { useRouteRef, useApi, errorApiRef, useApiHolder, useElementFilter } from '@backstage/core-plugin-api';
|
|
5
|
+
import { EntityListProvider, EntitySearchBar, EntityKindPicker, UserListPicker, EntityTagPicker } from '@backstage/plugin-catalog-react';
|
|
6
|
+
import { makeStyles, Stepper, Step, StepLabel, Typography, StepContent, Button, Paper, Box, LinearProgress, TableContainer, Table, TableHead, TableRow, TableCell, TableBody } from '@material-ui/core';
|
|
7
|
+
import { E as EntityPicker, a as EntityNamePicker, e as entityNamePickerValidation, b as EntityTagsPicker, R as RepoUrlPicker, r as repoPickerValidation, O as OwnerPicker, c as OwnedEntityPicker, d as registerComponentRouteRef, T as TemplateTypePicker, f as TemplateList, S as SecretsContext, s as scaffolderApiRef, g as rootRouteRef, F as FIELD_EXTENSION_WRAPPER_KEY, h as FIELD_EXTENSION_KEY, i as SecretsContextProvider, j as TaskPage } from './index-71578268.esm.js';
|
|
8
8
|
import { catalogEntityCreatePermission } from '@backstage/plugin-catalog-common';
|
|
9
9
|
import { usePermission } from '@backstage/plugin-permission-react';
|
|
10
10
|
import qs from 'qs';
|
|
@@ -12,25 +12,12 @@ import { useParams } from 'react-router-dom';
|
|
|
12
12
|
import useAsync from 'react-use/lib/useAsync';
|
|
13
13
|
import { withTheme } from '@rjsf/core';
|
|
14
14
|
import { Theme } from '@rjsf/material-ui';
|
|
15
|
-
import Grid$1 from '@material-ui/core/Grid';
|
|
16
|
-
import Step$1 from '@material-ui/core/Step';
|
|
17
|
-
import StepLabel$1 from '@material-ui/core/StepLabel';
|
|
18
|
-
import Stepper$1 from '@material-ui/core/Stepper';
|
|
19
|
-
import { makeStyles as makeStyles$1, createStyles } from '@material-ui/core/styles';
|
|
20
|
-
import Typography$1 from '@material-ui/core/Typography';
|
|
21
|
-
import Cancel from '@material-ui/icons/Cancel';
|
|
22
|
-
import Check from '@material-ui/icons/Check';
|
|
23
|
-
import FiberManualRecordIcon from '@material-ui/icons/FiberManualRecord';
|
|
24
15
|
import classNames from 'classnames';
|
|
25
|
-
import { DateTime, Interval } from 'luxon';
|
|
26
|
-
import useInterval from 'react-use/lib/useInterval';
|
|
27
|
-
import { useImmerReducer } from 'use-immer';
|
|
28
|
-
import { parseEntityName } from '@backstage/catalog-model';
|
|
29
|
-
import LanguageIcon from '@material-ui/icons/Language';
|
|
30
16
|
import '@backstage/errors';
|
|
31
17
|
import 'zen-observable';
|
|
32
18
|
import '@material-ui/core/FormControl';
|
|
33
19
|
import '@material-ui/lab/Autocomplete';
|
|
20
|
+
import '@backstage/catalog-model';
|
|
34
21
|
import 'react-use/lib/useEffectOnce';
|
|
35
22
|
import '@material-ui/lab';
|
|
36
23
|
import '@backstage/integration-react';
|
|
@@ -45,6 +32,19 @@ import 'lodash/capitalize';
|
|
|
45
32
|
import '@material-ui/icons/CheckBox';
|
|
46
33
|
import '@material-ui/icons/CheckBoxOutlineBlank';
|
|
47
34
|
import '@material-ui/icons/ExpandMore';
|
|
35
|
+
import '@material-ui/core/Grid';
|
|
36
|
+
import '@material-ui/core/Step';
|
|
37
|
+
import '@material-ui/core/StepLabel';
|
|
38
|
+
import '@material-ui/core/Stepper';
|
|
39
|
+
import '@material-ui/core/styles';
|
|
40
|
+
import '@material-ui/core/Typography';
|
|
41
|
+
import '@material-ui/icons/Cancel';
|
|
42
|
+
import '@material-ui/icons/Check';
|
|
43
|
+
import '@material-ui/icons/FiberManualRecord';
|
|
44
|
+
import 'luxon';
|
|
45
|
+
import 'react-use/lib/useInterval';
|
|
46
|
+
import 'use-immer';
|
|
47
|
+
import '@material-ui/icons/Language';
|
|
48
48
|
|
|
49
49
|
const DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS = [
|
|
50
50
|
{
|
|
@@ -75,7 +75,7 @@ const DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS = [
|
|
|
75
75
|
}
|
|
76
76
|
];
|
|
77
77
|
|
|
78
|
-
const useStyles$
|
|
78
|
+
const useStyles$1 = makeStyles((theme) => ({
|
|
79
79
|
contentWrapper: {
|
|
80
80
|
display: "grid",
|
|
81
81
|
gridTemplateAreas: "'filters' 'grid'",
|
|
@@ -87,7 +87,7 @@ const ScaffolderPageContents = ({
|
|
|
87
87
|
TemplateCardComponent,
|
|
88
88
|
groups
|
|
89
89
|
}) => {
|
|
90
|
-
const styles = useStyles$
|
|
90
|
+
const styles = useStyles$1();
|
|
91
91
|
const registerComponentLink = useRouteRef(registerComponentRouteRef);
|
|
92
92
|
const otherTemplatesGroup = {
|
|
93
93
|
title: groups ? "Other Templates" : "Templates",
|
|
@@ -415,7 +415,11 @@ const TemplatePage = ({
|
|
|
415
415
|
const query = qs.parse(window.location.search, {
|
|
416
416
|
ignoreQueryPrefix: true
|
|
417
417
|
});
|
|
418
|
-
|
|
418
|
+
try {
|
|
419
|
+
return JSON.parse(query.formData);
|
|
420
|
+
} catch (e) {
|
|
421
|
+
return (_a = query.formData) != null ? _a : {};
|
|
422
|
+
}
|
|
419
423
|
});
|
|
420
424
|
const handleFormReset = () => setFormState({});
|
|
421
425
|
const handleChange = useCallback((e) => setFormState(e.formData), [setFormState]);
|
|
@@ -470,406 +474,6 @@ const TemplatePage = ({
|
|
|
470
474
|
}))));
|
|
471
475
|
};
|
|
472
476
|
|
|
473
|
-
function reducer(draft, action) {
|
|
474
|
-
var _a, _b, _c;
|
|
475
|
-
switch (action.type) {
|
|
476
|
-
case "INIT": {
|
|
477
|
-
draft.steps = action.data.spec.steps.reduce((current, next) => {
|
|
478
|
-
current[next.id] = { status: "open", id: next.id };
|
|
479
|
-
return current;
|
|
480
|
-
}, {});
|
|
481
|
-
draft.stepLogs = action.data.spec.steps.reduce((current, next) => {
|
|
482
|
-
current[next.id] = [];
|
|
483
|
-
return current;
|
|
484
|
-
}, {});
|
|
485
|
-
draft.loading = false;
|
|
486
|
-
draft.error = void 0;
|
|
487
|
-
draft.completed = false;
|
|
488
|
-
draft.task = action.data;
|
|
489
|
-
return;
|
|
490
|
-
}
|
|
491
|
-
case "LOGS": {
|
|
492
|
-
const entries = action.data;
|
|
493
|
-
for (const entry of entries) {
|
|
494
|
-
const logLine = `${entry.createdAt} ${entry.body.message}`;
|
|
495
|
-
if (!entry.body.stepId || !((_a = draft.steps) == null ? void 0 : _a[entry.body.stepId])) {
|
|
496
|
-
continue;
|
|
497
|
-
}
|
|
498
|
-
const currentStepLog = (_b = draft.stepLogs) == null ? void 0 : _b[entry.body.stepId];
|
|
499
|
-
const currentStep = (_c = draft.steps) == null ? void 0 : _c[entry.body.stepId];
|
|
500
|
-
if (entry.body.status && entry.body.status !== currentStep.status) {
|
|
501
|
-
currentStep.status = entry.body.status;
|
|
502
|
-
if (currentStep.status === "processing") {
|
|
503
|
-
currentStep.startedAt = entry.createdAt;
|
|
504
|
-
}
|
|
505
|
-
if (["cancelled", "failed", "completed"].includes(currentStep.status)) {
|
|
506
|
-
currentStep.endedAt = entry.createdAt;
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
currentStepLog == null ? void 0 : currentStepLog.push(logLine);
|
|
510
|
-
}
|
|
511
|
-
return;
|
|
512
|
-
}
|
|
513
|
-
case "COMPLETED": {
|
|
514
|
-
draft.completed = true;
|
|
515
|
-
draft.output = action.data.body.output;
|
|
516
|
-
return;
|
|
517
|
-
}
|
|
518
|
-
case "ERROR": {
|
|
519
|
-
draft.error = action.data;
|
|
520
|
-
draft.loading = false;
|
|
521
|
-
draft.completed = true;
|
|
522
|
-
return;
|
|
523
|
-
}
|
|
524
|
-
default:
|
|
525
|
-
return;
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
const useTaskEventStream = (taskId) => {
|
|
529
|
-
const scaffolderApi = useApi(scaffolderApiRef);
|
|
530
|
-
const [state, dispatch] = useImmerReducer(reducer, {
|
|
531
|
-
loading: true,
|
|
532
|
-
completed: false,
|
|
533
|
-
stepLogs: {},
|
|
534
|
-
steps: {}
|
|
535
|
-
});
|
|
536
|
-
useEffect(() => {
|
|
537
|
-
let didCancel = false;
|
|
538
|
-
let subscription;
|
|
539
|
-
let logPusher;
|
|
540
|
-
scaffolderApi.getTask(taskId).then((task) => {
|
|
541
|
-
if (didCancel) {
|
|
542
|
-
return;
|
|
543
|
-
}
|
|
544
|
-
dispatch({ type: "INIT", data: task });
|
|
545
|
-
const observable = scaffolderApi.streamLogs({ taskId });
|
|
546
|
-
const collectedLogEvents = new Array();
|
|
547
|
-
function emitLogs() {
|
|
548
|
-
if (collectedLogEvents.length) {
|
|
549
|
-
const logs = collectedLogEvents.splice(0, collectedLogEvents.length);
|
|
550
|
-
dispatch({ type: "LOGS", data: logs });
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
logPusher = setInterval(emitLogs, 500);
|
|
554
|
-
subscription = observable.subscribe({
|
|
555
|
-
next: (event) => {
|
|
556
|
-
switch (event.type) {
|
|
557
|
-
case "log":
|
|
558
|
-
return collectedLogEvents.push(event);
|
|
559
|
-
case "completion":
|
|
560
|
-
emitLogs();
|
|
561
|
-
dispatch({ type: "COMPLETED", data: event });
|
|
562
|
-
return void 0;
|
|
563
|
-
default:
|
|
564
|
-
throw new Error(`Unhandled event type ${event.type} in observer`);
|
|
565
|
-
}
|
|
566
|
-
},
|
|
567
|
-
error: (error) => {
|
|
568
|
-
emitLogs();
|
|
569
|
-
dispatch({ type: "ERROR", data: error });
|
|
570
|
-
}
|
|
571
|
-
});
|
|
572
|
-
}, (error) => {
|
|
573
|
-
if (!didCancel) {
|
|
574
|
-
dispatch({ type: "ERROR", data: error });
|
|
575
|
-
}
|
|
576
|
-
});
|
|
577
|
-
return () => {
|
|
578
|
-
didCancel = true;
|
|
579
|
-
if (subscription) {
|
|
580
|
-
subscription.unsubscribe();
|
|
581
|
-
}
|
|
582
|
-
if (logPusher) {
|
|
583
|
-
clearInterval(logPusher);
|
|
584
|
-
}
|
|
585
|
-
};
|
|
586
|
-
}, [scaffolderApi, dispatch, taskId]);
|
|
587
|
-
return state;
|
|
588
|
-
};
|
|
589
|
-
|
|
590
|
-
const useStyles$2 = makeStyles({
|
|
591
|
-
svgIcon: {
|
|
592
|
-
display: "inline-block",
|
|
593
|
-
"& svg": {
|
|
594
|
-
display: "inline-block",
|
|
595
|
-
fontSize: "inherit",
|
|
596
|
-
verticalAlign: "baseline"
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
});
|
|
600
|
-
const IconLink = (props) => {
|
|
601
|
-
const { href, text, Icon, ...linkProps } = props;
|
|
602
|
-
const classes = useStyles$2();
|
|
603
|
-
return /* @__PURE__ */ React.createElement(Grid, {
|
|
604
|
-
container: true,
|
|
605
|
-
direction: "row",
|
|
606
|
-
spacing: 1
|
|
607
|
-
}, /* @__PURE__ */ React.createElement(Grid, {
|
|
608
|
-
item: true
|
|
609
|
-
}, /* @__PURE__ */ React.createElement(Typography, {
|
|
610
|
-
component: "div",
|
|
611
|
-
className: classes.svgIcon
|
|
612
|
-
}, Icon ? /* @__PURE__ */ React.createElement(Icon, null) : /* @__PURE__ */ React.createElement(LanguageIcon, null))), /* @__PURE__ */ React.createElement(Grid, {
|
|
613
|
-
item: true
|
|
614
|
-
}, /* @__PURE__ */ React.createElement(Link, {
|
|
615
|
-
to: href,
|
|
616
|
-
...linkProps
|
|
617
|
-
}, text || href)));
|
|
618
|
-
};
|
|
619
|
-
|
|
620
|
-
const TaskPageLinks = ({ output }) => {
|
|
621
|
-
const { entityRef: entityRefOutput, remoteUrl } = output;
|
|
622
|
-
let { links = [] } = output;
|
|
623
|
-
const app = useApp();
|
|
624
|
-
const entityRoute = useRouteRef(entityRouteRef);
|
|
625
|
-
const iconResolver = (key) => {
|
|
626
|
-
var _a;
|
|
627
|
-
return key ? (_a = app.getSystemIcon(key)) != null ? _a : LanguageIcon : LanguageIcon;
|
|
628
|
-
};
|
|
629
|
-
if (remoteUrl) {
|
|
630
|
-
links = [{ url: remoteUrl, title: "Repo" }, ...links];
|
|
631
|
-
}
|
|
632
|
-
if (entityRefOutput) {
|
|
633
|
-
links = [
|
|
634
|
-
{
|
|
635
|
-
entityRef: entityRefOutput,
|
|
636
|
-
title: "Open in catalog",
|
|
637
|
-
icon: "catalog"
|
|
638
|
-
},
|
|
639
|
-
...links
|
|
640
|
-
];
|
|
641
|
-
}
|
|
642
|
-
return /* @__PURE__ */ React.createElement(Box, {
|
|
643
|
-
px: 3,
|
|
644
|
-
pb: 3
|
|
645
|
-
}, links.filter(({ url, entityRef }) => url || entityRef).map(({ url, entityRef, title, icon }) => {
|
|
646
|
-
if (entityRef) {
|
|
647
|
-
const entityName = parseEntityName(entityRef);
|
|
648
|
-
const target = entityRoute(entityName);
|
|
649
|
-
return { title, icon, url: target };
|
|
650
|
-
}
|
|
651
|
-
return { title, icon, url };
|
|
652
|
-
}).map(({ url, title, icon }, i) => /* @__PURE__ */ React.createElement(IconLink, {
|
|
653
|
-
key: `output-link-${i}`,
|
|
654
|
-
href: url,
|
|
655
|
-
text: title != null ? title : url,
|
|
656
|
-
Icon: iconResolver(icon),
|
|
657
|
-
target: "_blank"
|
|
658
|
-
})));
|
|
659
|
-
};
|
|
660
|
-
|
|
661
|
-
const humanizeDuration = require("humanize-duration");
|
|
662
|
-
const useStyles$1 = makeStyles$1((theme) => createStyles({
|
|
663
|
-
root: {
|
|
664
|
-
width: "100%"
|
|
665
|
-
},
|
|
666
|
-
button: {
|
|
667
|
-
marginBottom: theme.spacing(2),
|
|
668
|
-
marginLeft: theme.spacing(2)
|
|
669
|
-
},
|
|
670
|
-
actionsContainer: {
|
|
671
|
-
marginBottom: theme.spacing(2)
|
|
672
|
-
},
|
|
673
|
-
resetContainer: {
|
|
674
|
-
padding: theme.spacing(3)
|
|
675
|
-
},
|
|
676
|
-
labelWrapper: {
|
|
677
|
-
display: "flex",
|
|
678
|
-
flex: 1,
|
|
679
|
-
flexDirection: "row",
|
|
680
|
-
justifyContent: "space-between"
|
|
681
|
-
},
|
|
682
|
-
stepWrapper: {
|
|
683
|
-
width: "100%"
|
|
684
|
-
}
|
|
685
|
-
}));
|
|
686
|
-
const StepTimeTicker = ({ step }) => {
|
|
687
|
-
const [time, setTime] = useState("");
|
|
688
|
-
useInterval(() => {
|
|
689
|
-
if (!step.startedAt) {
|
|
690
|
-
setTime("");
|
|
691
|
-
return;
|
|
692
|
-
}
|
|
693
|
-
const end = step.endedAt ? DateTime.fromISO(step.endedAt) : DateTime.local();
|
|
694
|
-
const startedAt = DateTime.fromISO(step.startedAt);
|
|
695
|
-
const formatted = Interval.fromDateTimes(startedAt, end).toDuration().valueOf();
|
|
696
|
-
setTime(humanizeDuration(formatted, { round: true }));
|
|
697
|
-
}, 1e3);
|
|
698
|
-
return /* @__PURE__ */ React.createElement(Typography$1, {
|
|
699
|
-
variant: "caption"
|
|
700
|
-
}, time);
|
|
701
|
-
};
|
|
702
|
-
const useStepIconStyles = makeStyles$1((theme) => createStyles({
|
|
703
|
-
root: {
|
|
704
|
-
color: theme.palette.text.disabled,
|
|
705
|
-
display: "flex",
|
|
706
|
-
height: 22,
|
|
707
|
-
alignItems: "center"
|
|
708
|
-
},
|
|
709
|
-
completed: {
|
|
710
|
-
color: theme.palette.status.ok
|
|
711
|
-
},
|
|
712
|
-
error: {
|
|
713
|
-
color: theme.palette.status.error
|
|
714
|
-
}
|
|
715
|
-
}));
|
|
716
|
-
function TaskStepIconComponent(props) {
|
|
717
|
-
const classes = useStepIconStyles();
|
|
718
|
-
const { active, completed, error } = props;
|
|
719
|
-
const getMiddle = () => {
|
|
720
|
-
if (active) {
|
|
721
|
-
return /* @__PURE__ */ React.createElement(CircularProgress, {
|
|
722
|
-
size: "24px"
|
|
723
|
-
});
|
|
724
|
-
}
|
|
725
|
-
if (completed) {
|
|
726
|
-
return /* @__PURE__ */ React.createElement(Check, null);
|
|
727
|
-
}
|
|
728
|
-
if (error) {
|
|
729
|
-
return /* @__PURE__ */ React.createElement(Cancel, null);
|
|
730
|
-
}
|
|
731
|
-
return /* @__PURE__ */ React.createElement(FiberManualRecordIcon, null);
|
|
732
|
-
};
|
|
733
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
734
|
-
className: classNames(classes.root, {
|
|
735
|
-
[classes.completed]: completed,
|
|
736
|
-
[classes.error]: error
|
|
737
|
-
})
|
|
738
|
-
}, getMiddle());
|
|
739
|
-
}
|
|
740
|
-
const TaskStatusStepper = memo(({
|
|
741
|
-
steps,
|
|
742
|
-
currentStepId,
|
|
743
|
-
onUserStepChange
|
|
744
|
-
}) => {
|
|
745
|
-
const classes = useStyles$1();
|
|
746
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
747
|
-
className: classes.root
|
|
748
|
-
}, /* @__PURE__ */ React.createElement(Stepper$1, {
|
|
749
|
-
activeStep: steps.findIndex((s) => s.id === currentStepId),
|
|
750
|
-
orientation: "vertical",
|
|
751
|
-
nonLinear: true
|
|
752
|
-
}, steps.map((step, index) => {
|
|
753
|
-
const isCompleted = step.status === "completed";
|
|
754
|
-
const isFailed = step.status === "failed";
|
|
755
|
-
const isActive = step.status === "processing";
|
|
756
|
-
const isSkipped = step.status === "skipped";
|
|
757
|
-
return /* @__PURE__ */ React.createElement(Step$1, {
|
|
758
|
-
key: String(index),
|
|
759
|
-
expanded: true
|
|
760
|
-
}, /* @__PURE__ */ React.createElement(StepButton, {
|
|
761
|
-
onClick: () => onUserStepChange(step.id)
|
|
762
|
-
}, /* @__PURE__ */ React.createElement(StepLabel$1, {
|
|
763
|
-
StepIconProps: {
|
|
764
|
-
completed: isCompleted,
|
|
765
|
-
error: isFailed,
|
|
766
|
-
active: isActive
|
|
767
|
-
},
|
|
768
|
-
StepIconComponent: TaskStepIconComponent,
|
|
769
|
-
className: classes.stepWrapper
|
|
770
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
771
|
-
className: classes.labelWrapper
|
|
772
|
-
}, /* @__PURE__ */ React.createElement(Typography$1, {
|
|
773
|
-
variant: "subtitle2"
|
|
774
|
-
}, step.name), isSkipped ? /* @__PURE__ */ React.createElement(Typography$1, {
|
|
775
|
-
variant: "caption"
|
|
776
|
-
}, "Skipped") : /* @__PURE__ */ React.createElement(StepTimeTicker, {
|
|
777
|
-
step
|
|
778
|
-
})))));
|
|
779
|
-
})));
|
|
780
|
-
});
|
|
781
|
-
const hasLinks = ({ entityRef, remoteUrl, links = [] }) => !!(entityRef || remoteUrl || links.length > 0);
|
|
782
|
-
const TaskPage = () => {
|
|
783
|
-
const classes = useStyles$1();
|
|
784
|
-
const navigate = useNavigate();
|
|
785
|
-
const rootLink = useRouteRef(rootRouteRef);
|
|
786
|
-
const [userSelectedStepId, setUserSelectedStepId] = useState(void 0);
|
|
787
|
-
const [lastActiveStepId, setLastActiveStepId] = useState(void 0);
|
|
788
|
-
const { taskId } = useParams$1();
|
|
789
|
-
const taskStream = useTaskEventStream(taskId);
|
|
790
|
-
const completed = taskStream.completed;
|
|
791
|
-
const steps = useMemo(() => {
|
|
792
|
-
var _a, _b;
|
|
793
|
-
return (_b = (_a = taskStream.task) == null ? void 0 : _a.spec.steps.map((step) => {
|
|
794
|
-
var _a2;
|
|
795
|
-
return {
|
|
796
|
-
...step,
|
|
797
|
-
...(_a2 = taskStream == null ? void 0 : taskStream.steps) == null ? void 0 : _a2[step.id]
|
|
798
|
-
};
|
|
799
|
-
})) != null ? _b : [];
|
|
800
|
-
}, [taskStream]);
|
|
801
|
-
useEffect(() => {
|
|
802
|
-
var _a;
|
|
803
|
-
const mostRecentFailedOrActiveStep = steps.find((step) => ["failed", "processing"].includes(step.status));
|
|
804
|
-
if (completed && !mostRecentFailedOrActiveStep) {
|
|
805
|
-
setLastActiveStepId((_a = steps[steps.length - 1]) == null ? void 0 : _a.id);
|
|
806
|
-
return;
|
|
807
|
-
}
|
|
808
|
-
setLastActiveStepId(mostRecentFailedOrActiveStep == null ? void 0 : mostRecentFailedOrActiveStep.id);
|
|
809
|
-
}, [steps, completed]);
|
|
810
|
-
const currentStepId = userSelectedStepId != null ? userSelectedStepId : lastActiveStepId;
|
|
811
|
-
const logAsString = useMemo(() => {
|
|
812
|
-
if (!currentStepId) {
|
|
813
|
-
return "Loading...";
|
|
814
|
-
}
|
|
815
|
-
const log = taskStream.stepLogs[currentStepId];
|
|
816
|
-
if (!(log == null ? void 0 : log.length)) {
|
|
817
|
-
return "Waiting for logs...";
|
|
818
|
-
}
|
|
819
|
-
return log.join("\n");
|
|
820
|
-
}, [taskStream.stepLogs, currentStepId]);
|
|
821
|
-
const taskNotFound = taskStream.completed === true && taskStream.loading === false && !taskStream.task;
|
|
822
|
-
const { output } = taskStream;
|
|
823
|
-
const handleStartOver = () => {
|
|
824
|
-
var _a, _b;
|
|
825
|
-
if (!taskStream.task || !((_b = (_a = taskStream.task) == null ? void 0 : _a.spec.metadata) == null ? void 0 : _b.name)) {
|
|
826
|
-
navigate(generatePath(rootLink()));
|
|
827
|
-
}
|
|
828
|
-
const formData = taskStream.task.spec.apiVersion === "backstage.io/v1beta2" ? taskStream.task.spec.values : taskStream.task.spec.parameters;
|
|
829
|
-
navigate(generatePath(`${rootLink()}/templates/:templateName?${qs.stringify({ formData })}`, {
|
|
830
|
-
templateName: taskStream.task.spec.metadata.name
|
|
831
|
-
}));
|
|
832
|
-
};
|
|
833
|
-
return /* @__PURE__ */ React.createElement(Page, {
|
|
834
|
-
themeId: "home"
|
|
835
|
-
}, /* @__PURE__ */ React.createElement(Header, {
|
|
836
|
-
pageTitleOverride: `Task ${taskId}`,
|
|
837
|
-
title: /* @__PURE__ */ React.createElement(React.Fragment, null, "Task Activity ", /* @__PURE__ */ React.createElement(Lifecycle, {
|
|
838
|
-
alpha: true,
|
|
839
|
-
shorthand: true
|
|
840
|
-
})),
|
|
841
|
-
subtitle: `Activity for task: ${taskId}`
|
|
842
|
-
}), /* @__PURE__ */ React.createElement(Content, null, taskNotFound ? /* @__PURE__ */ React.createElement(ErrorPage, {
|
|
843
|
-
status: "404",
|
|
844
|
-
statusMessage: "Task not found",
|
|
845
|
-
additionalInfo: "No task found with this ID"
|
|
846
|
-
}) : /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(Grid$1, {
|
|
847
|
-
container: true
|
|
848
|
-
}, /* @__PURE__ */ React.createElement(Grid$1, {
|
|
849
|
-
item: true,
|
|
850
|
-
xs: 3
|
|
851
|
-
}, /* @__PURE__ */ React.createElement(Paper, null, /* @__PURE__ */ React.createElement(TaskStatusStepper, {
|
|
852
|
-
steps,
|
|
853
|
-
currentStepId,
|
|
854
|
-
onUserStepChange: setUserSelectedStepId
|
|
855
|
-
}), output && hasLinks(output) && /* @__PURE__ */ React.createElement(TaskPageLinks, {
|
|
856
|
-
output
|
|
857
|
-
}), /* @__PURE__ */ React.createElement(Button, {
|
|
858
|
-
className: classes.button,
|
|
859
|
-
onClick: handleStartOver,
|
|
860
|
-
disabled: !completed,
|
|
861
|
-
variant: "contained",
|
|
862
|
-
color: "primary"
|
|
863
|
-
}, "Start Over"))), /* @__PURE__ */ React.createElement(Grid$1, {
|
|
864
|
-
item: true,
|
|
865
|
-
xs: 9
|
|
866
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
867
|
-
style: { height: "80vh" }
|
|
868
|
-
}, /* @__PURE__ */ React.createElement(LogViewer, {
|
|
869
|
-
text: logAsString
|
|
870
|
-
})))))));
|
|
871
|
-
};
|
|
872
|
-
|
|
873
477
|
const useStyles = makeStyles((theme) => ({
|
|
874
478
|
code: {
|
|
875
479
|
fontFamily: "Menlo, monospace",
|
|
@@ -978,8 +582,13 @@ const ActionsPage = () => {
|
|
|
978
582
|
}), /* @__PURE__ */ React.createElement(Content, null, items));
|
|
979
583
|
};
|
|
980
584
|
|
|
981
|
-
const Router = ({
|
|
585
|
+
const Router = ({
|
|
586
|
+
TemplateCardComponent,
|
|
587
|
+
TaskPageComponent,
|
|
588
|
+
groups
|
|
589
|
+
}) => {
|
|
982
590
|
const outlet = useOutlet();
|
|
591
|
+
const TaskPageElement = TaskPageComponent || TaskPage;
|
|
983
592
|
const customFieldExtensions = useElementFilter(outlet, (elements) => elements.selectByComponentData({
|
|
984
593
|
key: FIELD_EXTENSION_WRAPPER_KEY
|
|
985
594
|
}).findComponentData({
|
|
@@ -1002,7 +611,7 @@ const Router = ({ TemplateCardComponent, groups }) => {
|
|
|
1002
611
|
}))
|
|
1003
612
|
}), /* @__PURE__ */ React.createElement(Route, {
|
|
1004
613
|
path: "/tasks/:taskId",
|
|
1005
|
-
element: /* @__PURE__ */ React.createElement(
|
|
614
|
+
element: /* @__PURE__ */ React.createElement(TaskPageElement, null)
|
|
1006
615
|
}), /* @__PURE__ */ React.createElement(Route, {
|
|
1007
616
|
path: "/actions",
|
|
1008
617
|
element: /* @__PURE__ */ React.createElement(ActionsPage, null)
|
|
@@ -1010,4 +619,4 @@ const Router = ({ TemplateCardComponent, groups }) => {
|
|
|
1010
619
|
};
|
|
1011
620
|
|
|
1012
621
|
export { Router };
|
|
1013
|
-
//# sourceMappingURL=Router-
|
|
622
|
+
//# sourceMappingURL=Router-5df57206.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Router-5df57206.esm.js","sources":["../../src/extensions/default.ts","../../src/components/ScaffolderPage/ScaffolderPage.tsx","../../src/components/MultistepJsonForm/schema.ts","../../src/components/MultistepJsonForm/FieldOverrides/DescriptionField.tsx","../../src/components/MultistepJsonForm/MultistepJsonForm.tsx","../../src/components/TemplatePage/TemplatePage.tsx","../../src/components/ActionsPage/ActionsPage.tsx","../../src/components/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 */\nimport { EntityPicker } from '../components/fields/EntityPicker';\nimport {\n EntityNamePicker,\n entityNamePickerValidation,\n} from '../components/fields/EntityNamePicker';\nimport { EntityTagsPicker } from '../components/fields/EntityTagsPicker';\nimport { OwnerPicker } from '../components/fields/OwnerPicker';\nimport {\n repoPickerValidation,\n RepoUrlPicker,\n} from '../components/fields/RepoUrlPicker';\nimport { FieldExtensionOptions } from './types';\nimport { OwnedEntityPicker } from '../components/fields/OwnedEntityPicker';\n\nexport const DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS: FieldExtensionOptions[] = [\n {\n component: EntityPicker,\n name: 'EntityPicker',\n },\n {\n component: EntityNamePicker,\n name: 'EntityNamePicker',\n validation: entityNamePickerValidation,\n },\n {\n component: EntityTagsPicker,\n name: 'EntityTagsPicker',\n },\n {\n component: RepoUrlPicker,\n name: 'RepoUrlPicker',\n validation: repoPickerValidation,\n },\n {\n component: OwnerPicker,\n name: 'OwnerPicker',\n },\n {\n component: OwnedEntityPicker,\n name: 'OwnedEntityPicker',\n },\n];\n","/*\n * Copyright 2020 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 {\n Content,\n ContentHeader,\n CreateButton,\n Header,\n Lifecycle,\n Page,\n SupportButton,\n} from '@backstage/core-components';\nimport { TemplateEntityV1beta2, Entity } from '@backstage/catalog-model';\nimport { useRouteRef } from '@backstage/core-plugin-api';\nimport {\n EntityKindPicker,\n EntityListProvider,\n EntitySearchBar,\n EntityTagPicker,\n UserListPicker,\n} from '@backstage/plugin-catalog-react';\nimport { makeStyles } from '@material-ui/core';\nimport React, { ComponentType } from 'react';\nimport { registerComponentRouteRef } from '../../routes';\nimport { TemplateList } from '../TemplateList';\nimport { TemplateTypePicker } from '../TemplateTypePicker';\nimport { catalogEntityCreatePermission } from '@backstage/plugin-catalog-common';\nimport { usePermission } from '@backstage/plugin-permission-react';\n\nconst useStyles = makeStyles(theme => ({\n contentWrapper: {\n display: 'grid',\n gridTemplateAreas: \"'filters' 'grid'\",\n gridTemplateColumns: '250px 1fr',\n gridColumnGap: theme.spacing(2),\n },\n}));\n\nexport type ScaffolderPageProps = {\n TemplateCardComponent?:\n | ComponentType<{ template: TemplateEntityV1beta2 }>\n | undefined;\n groups?: Array<{\n title?: string;\n titleComponent?: React.ReactNode;\n filter: (entity: Entity) => boolean;\n }>;\n};\n\nexport const ScaffolderPageContents = ({\n TemplateCardComponent,\n groups,\n}: ScaffolderPageProps) => {\n const styles = useStyles();\n const registerComponentLink = useRouteRef(registerComponentRouteRef);\n const otherTemplatesGroup = {\n title: groups ? 'Other Templates' : 'Templates',\n filter: (entity: Entity) => {\n const filtered = (groups ?? []).map(group => group.filter(entity));\n return !filtered.some(result => result === true);\n },\n };\n\n const { allowed } = usePermission(catalogEntityCreatePermission);\n\n return (\n <Page themeId=\"home\">\n <Header\n pageTitleOverride=\"Create a New Component\"\n title={\n <>\n Create a New Component <Lifecycle shorthand />\n </>\n }\n subtitle=\"Create new software components using standard templates\"\n />\n <Content>\n <ContentHeader title=\"Available Templates\">\n {allowed && (\n <CreateButton\n title=\"Register Existing Component\"\n to={registerComponentLink && registerComponentLink()}\n />\n )}\n <SupportButton>\n Create new software components using standard templates. Different\n templates create different kinds of components (services, websites,\n documentation, ...).\n </SupportButton>\n </ContentHeader>\n\n <div className={styles.contentWrapper}>\n <div>\n <EntitySearchBar />\n <EntityKindPicker initialFilter=\"template\" hidden />\n <UserListPicker\n initialFilter=\"all\"\n availableFilters={['all', 'starred']}\n />\n <TemplateTypePicker />\n <EntityTagPicker />\n </div>\n <div>\n {groups &&\n groups.map((group, index) => (\n <TemplateList\n key={index}\n TemplateCardComponent={TemplateCardComponent}\n group={group}\n />\n ))}\n <TemplateList\n key=\"other\"\n TemplateCardComponent={TemplateCardComponent}\n group={otherTemplatesGroup}\n />\n </div>\n </div>\n </Content>\n </Page>\n );\n};\n\nexport const ScaffolderPage = ({\n TemplateCardComponent,\n groups,\n}: ScaffolderPageProps) => (\n <EntityListProvider>\n <ScaffolderPageContents\n TemplateCardComponent={TemplateCardComponent}\n groups={groups}\n />\n </EntityListProvider>\n);\n","/*\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 { JsonObject } from '@backstage/types';\nimport { FormProps } from '@rjsf/core';\n\nfunction isObject(value: unknown): value is JsonObject {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction extractUiSchema(schema: JsonObject, uiSchema: JsonObject) {\n if (!isObject(schema)) {\n return;\n }\n\n const { properties, items, anyOf, oneOf, allOf, dependencies } = schema;\n\n for (const propName in schema) {\n if (!schema.hasOwnProperty(propName)) {\n continue;\n }\n\n if (propName.startsWith('ui:')) {\n uiSchema[propName] = schema[propName];\n delete schema[propName];\n }\n }\n\n if (isObject(properties)) {\n for (const propName in properties) {\n if (!properties.hasOwnProperty(propName)) {\n continue;\n }\n\n const schemaNode = properties[propName];\n if (!isObject(schemaNode)) {\n continue;\n }\n const innerUiSchema = {};\n uiSchema[propName] = innerUiSchema;\n extractUiSchema(schemaNode, innerUiSchema);\n }\n }\n\n if (isObject(items)) {\n const innerUiSchema = {};\n uiSchema.items = innerUiSchema;\n extractUiSchema(items, innerUiSchema);\n }\n\n if (Array.isArray(anyOf)) {\n for (const schemaNode of anyOf) {\n if (!isObject(schemaNode)) {\n continue;\n }\n extractUiSchema(schemaNode, uiSchema);\n }\n }\n\n if (Array.isArray(oneOf)) {\n for (const schemaNode of oneOf) {\n if (!isObject(schemaNode)) {\n continue;\n }\n extractUiSchema(schemaNode, uiSchema);\n }\n }\n\n if (Array.isArray(allOf)) {\n for (const schemaNode of allOf) {\n if (!isObject(schemaNode)) {\n continue;\n }\n extractUiSchema(schemaNode, uiSchema);\n }\n }\n\n if (isObject(dependencies)) {\n for (const depName of Object.keys(dependencies)) {\n const schemaNode = dependencies[depName];\n if (!isObject(schemaNode)) {\n continue;\n }\n extractUiSchema(schemaNode, uiSchema);\n }\n }\n}\n\nexport function transformSchemaToProps(inputSchema: JsonObject): {\n schema: FormProps<any>['schema'];\n uiSchema: FormProps<any>['uiSchema'];\n} {\n inputSchema.type = inputSchema.type || 'object';\n const schema = JSON.parse(JSON.stringify(inputSchema));\n delete schema.title; // Rendered separately\n const uiSchema = {};\n extractUiSchema(schema, uiSchema);\n return { schema, uiSchema };\n}\n","/*\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 React from 'react';\nimport { MarkdownContent } from '@backstage/core-components';\nimport { FieldProps } from '@rjsf/core';\n\nexport const DescriptionField = ({ description }: FieldProps) =>\n description && <MarkdownContent content={description} linkTarget=\"_blank\" />;\n","/*\n * Copyright 2020 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 { JsonObject } from '@backstage/types';\nimport {\n Box,\n Button,\n Paper,\n Step as StepUI,\n StepContent,\n StepLabel,\n Stepper,\n Typography,\n} from '@material-ui/core';\nimport { errorApiRef, useApi } from '@backstage/core-plugin-api';\nimport { FormProps, IChangeEvent, UiSchema, withTheme } from '@rjsf/core';\nimport { Theme as MuiTheme } from '@rjsf/material-ui';\nimport React, { useState } from 'react';\nimport { transformSchemaToProps } from './schema';\nimport { Content, StructuredMetadataTable } from '@backstage/core-components';\nimport * as fieldOverrides from './FieldOverrides';\n\nconst Form = withTheme(MuiTheme);\ntype Step = {\n schema: JsonObject;\n title: string;\n} & Partial<Omit<FormProps<any>, 'schema'>>;\n\ntype Props = {\n /**\n * Steps for the form, each contains title and form schema\n */\n steps: Step[];\n formData: Record<string, any>;\n onChange: (e: IChangeEvent) => void;\n onReset: () => void;\n onFinish: () => Promise<void>;\n widgets?: FormProps<any>['widgets'];\n fields?: FormProps<any>['fields'];\n};\n\nexport function getUiSchemasFromSteps(steps: Step[]): UiSchema[] {\n const uiSchemas: Array<UiSchema> = [];\n steps.forEach(step => {\n const schemaProps = step.schema.properties as JsonObject;\n for (const key in schemaProps) {\n if (schemaProps.hasOwnProperty(key)) {\n const uiSchema = schemaProps[key] as UiSchema;\n uiSchema.name = key;\n uiSchemas.push(uiSchema);\n }\n }\n });\n return uiSchemas;\n}\n\nexport function getReviewData(formData: Record<string, any>, steps: Step[]) {\n const uiSchemas = getUiSchemasFromSteps(steps);\n const reviewData: Record<string, any> = {};\n for (const key in formData) {\n if (formData.hasOwnProperty(key)) {\n const uiSchema = uiSchemas.find(us => us.name === key);\n\n if (!uiSchema) {\n reviewData[key] = formData[key];\n continue;\n }\n\n if (uiSchema['ui:widget'] === 'password') {\n reviewData[key] = '******';\n continue;\n }\n\n if (!uiSchema['ui:backstage'] || !uiSchema['ui:backstage'].review) {\n reviewData[key] = formData[key];\n continue;\n }\n\n const review = uiSchema['ui:backstage'].review as JsonObject;\n if (!review.show) {\n continue;\n }\n\n if (review.mask) {\n reviewData[key] = review.mask;\n continue;\n }\n reviewData[key] = formData[key];\n }\n }\n\n return reviewData;\n}\n\nexport const MultistepJsonForm = ({\n steps,\n formData,\n onChange,\n onReset,\n onFinish,\n fields,\n widgets,\n}: Props) => {\n const [activeStep, setActiveStep] = useState(0);\n const [disableButtons, setDisableButtons] = useState(false);\n const errorApi = useApi(errorApiRef);\n\n const handleReset = () => {\n setActiveStep(0);\n onReset();\n };\n const handleNext = () => {\n setActiveStep(Math.min(activeStep + 1, steps.length));\n };\n const handleBack = () => setActiveStep(Math.max(activeStep - 1, 0));\n const handleCreate = async () => {\n setDisableButtons(true);\n try {\n await onFinish();\n } catch (err) {\n setDisableButtons(false);\n errorApi.post(err);\n }\n };\n\n return (\n <>\n <Stepper activeStep={activeStep} orientation=\"vertical\">\n {steps.map(({ title, schema, ...formProps }, index) => {\n return (\n <StepUI key={title}>\n <StepLabel\n aria-label={`Step ${index + 1} ${title}`}\n aria-disabled=\"false\"\n tabIndex={0}\n >\n <Typography variant=\"h6\" component=\"h3\">\n {title}\n </Typography>\n </StepLabel>\n <StepContent key={title}>\n <Form\n showErrorList={false}\n fields={{ ...fieldOverrides, ...fields }}\n widgets={widgets}\n noHtml5Validate\n formData={formData}\n onChange={onChange}\n onSubmit={e => {\n if (e.errors.length === 0) handleNext();\n }}\n {...formProps}\n {...transformSchemaToProps(schema)}\n >\n <Button disabled={activeStep === 0} onClick={handleBack}>\n Back\n </Button>\n <Button variant=\"contained\" color=\"primary\" type=\"submit\">\n Next step\n </Button>\n </Form>\n </StepContent>\n </StepUI>\n );\n })}\n </Stepper>\n {activeStep === steps.length && (\n <Content>\n <Paper square elevation={0}>\n <Typography variant=\"h6\">Review and create</Typography>\n <StructuredMetadataTable\n dense\n metadata={getReviewData(formData, steps)}\n />\n <Box mb={4} />\n <Button onClick={handleBack} disabled={disableButtons}>\n Back\n </Button>\n <Button onClick={handleReset} disabled={disableButtons}>\n Reset\n </Button>\n <Button\n variant=\"contained\"\n color=\"primary\"\n onClick={handleCreate}\n disabled={disableButtons}\n >\n Create\n </Button>\n </Paper>\n </Content>\n )}\n </>\n );\n};\n","/*\n * Copyright 2020 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 { JsonObject, JsonValue } from '@backstage/types';\nimport { LinearProgress } from '@material-ui/core';\nimport { FormValidation, IChangeEvent } from '@rjsf/core';\nimport qs from 'qs';\nimport React, { useCallback, useContext, useState } from 'react';\nimport { generatePath, Navigate, useNavigate } from 'react-router';\nimport { useParams } from 'react-router-dom';\nimport useAsync from 'react-use/lib/useAsync';\nimport { scaffolderApiRef } from '../../api';\nimport { CustomFieldValidator, FieldExtensionOptions } from '../../extensions';\nimport { SecretsContext } from '../secrets/SecretsContext';\nimport { rootRouteRef } from '../../routes';\nimport { MultistepJsonForm } from '../MultistepJsonForm';\n\nimport {\n Content,\n Header,\n InfoCard,\n Lifecycle,\n Page,\n} from '@backstage/core-components';\nimport {\n ApiHolder,\n errorApiRef,\n useApi,\n useApiHolder,\n useRouteRef,\n} from '@backstage/core-plugin-api';\n\nconst useTemplateParameterSchema = (templateName: string) => {\n const scaffolderApi = useApi(scaffolderApiRef);\n const { value, loading, error } = useAsync(\n () =>\n scaffolderApi.getTemplateParameterSchema({\n name: templateName,\n kind: 'template',\n namespace: 'default',\n }),\n [scaffolderApi, templateName],\n );\n return { schema: value, loading, error };\n};\n\nfunction isObject(obj: unknown): obj is JsonObject {\n return typeof obj === 'object' && obj !== null && !Array.isArray(obj);\n}\n\nexport const createValidator = (\n rootSchema: JsonObject,\n validators: Record<string, undefined | CustomFieldValidator<unknown>>,\n context: {\n apiHolder: ApiHolder;\n },\n) => {\n function validate(\n schema: JsonObject,\n formData: JsonObject,\n errors: FormValidation,\n ) {\n const schemaProps = schema.properties;\n if (!isObject(schemaProps)) {\n return;\n }\n\n for (const [key, propData] of Object.entries(formData)) {\n const propValidation = errors[key];\n\n if (isObject(propData)) {\n const propSchemaProps = schemaProps[key];\n if (isObject(propSchemaProps)) {\n validate(\n propSchemaProps,\n propData as JsonObject,\n propValidation as FormValidation,\n );\n }\n } else {\n const propSchema = schemaProps[key];\n const fieldName =\n isObject(propSchema) && (propSchema['ui:field'] as string);\n if (fieldName && typeof validators[fieldName] === 'function') {\n validators[fieldName]!(\n propData as JsonValue,\n propValidation,\n context,\n );\n }\n }\n }\n }\n\n return (formData: JsonObject, errors: FormValidation) => {\n validate(rootSchema, formData, errors);\n return errors;\n };\n};\n\nexport const TemplatePage = ({\n customFieldExtensions = [],\n}: {\n customFieldExtensions?: FieldExtensionOptions[];\n}) => {\n const apiHolder = useApiHolder();\n const secretsContext = useContext(SecretsContext);\n const errorApi = useApi(errorApiRef);\n const scaffolderApi = useApi(scaffolderApiRef);\n const { templateName } = useParams();\n const navigate = useNavigate();\n const rootLink = useRouteRef(rootRouteRef);\n const { schema, loading, error } = useTemplateParameterSchema(templateName);\n const [formState, setFormState] = useState<Record<string, any>>(() => {\n const query = qs.parse(window.location.search, {\n ignoreQueryPrefix: true,\n });\n\n try {\n return JSON.parse(query.formData as string);\n } catch (e) {\n return query.formData ?? {};\n }\n });\n const handleFormReset = () => setFormState({});\n const handleChange = useCallback(\n (e: IChangeEvent) => setFormState(e.formData),\n [setFormState],\n );\n\n const handleCreate = async () => {\n const id = await scaffolderApi.scaffold(\n templateName,\n formState,\n secretsContext?.secrets,\n );\n\n const formParams = qs.stringify(\n { formData: formState },\n { addQueryPrefix: true },\n );\n const newUrl = `${window.location.pathname}${formParams}`;\n // We use direct history manipulation since useSearchParams and\n // useNavigate in react-router-dom cause unnecessary extra rerenders.\n // Also make sure to replace the state rather than pushing to avoid\n // extra back/forward slots.\n window.history?.replaceState(null, document.title, newUrl);\n\n navigate(generatePath(`${rootLink()}/tasks/:taskId`, { taskId: id }));\n };\n\n if (error) {\n errorApi.post(new Error(`Failed to load template, ${error}`));\n return <Navigate to={rootLink()} />;\n }\n if (!loading && !schema) {\n errorApi.post(new Error('Template was not found.'));\n return <Navigate to={rootLink()} />;\n }\n\n const customFieldComponents = Object.fromEntries(\n customFieldExtensions.map(({ name, component }) => [name, component]),\n );\n\n const customFieldValidators = Object.fromEntries(\n customFieldExtensions.map(({ name, validation }) => [name, validation]),\n );\n\n return (\n <Page themeId=\"home\">\n <Header\n pageTitleOverride=\"Create a New Component\"\n title={\n <>\n Create a New Component <Lifecycle shorthand />\n </>\n }\n subtitle=\"Create new software components using standard templates\"\n />\n <Content>\n {loading && <LinearProgress data-testid=\"loading-progress\" />}\n {schema && (\n <InfoCard\n title={schema.title}\n noPadding\n titleTypographyProps={{ component: 'h2' }}\n >\n <MultistepJsonForm\n formData={formState}\n fields={customFieldComponents}\n onChange={handleChange}\n onReset={handleFormReset}\n onFinish={handleCreate}\n steps={schema.steps.map(step => {\n return {\n ...step,\n validate: createValidator(\n step.schema,\n customFieldValidators,\n { apiHolder },\n ),\n };\n })}\n />\n </InfoCard>\n )}\n </Content>\n </Page>\n );\n};\n","/*\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 */\nimport React from 'react';\nimport useAsync from 'react-use/lib/useAsync';\nimport { scaffolderApiRef } from '../../api';\nimport {\n Typography,\n Paper,\n Table,\n TableBody,\n Box,\n TableCell,\n TableContainer,\n TableHead,\n TableRow,\n makeStyles,\n} from '@material-ui/core';\nimport { JSONSchema } from '@backstage/catalog-model';\nimport { JSONSchema7Definition } from 'json-schema';\nimport classNames from 'classnames';\n\nimport { useApi } from '@backstage/core-plugin-api';\nimport {\n Progress,\n Content,\n Header,\n Page,\n ErrorPage,\n} from '@backstage/core-components';\n\nconst useStyles = makeStyles(theme => ({\n code: {\n fontFamily: 'Menlo, monospace',\n padding: theme.spacing(1),\n backgroundColor:\n theme.palette.type === 'dark'\n ? theme.palette.grey[700]\n : theme.palette.grey[300],\n display: 'inline-block',\n borderRadius: 5,\n border: `1px solid ${theme.palette.grey[500]}`,\n position: 'relative',\n },\n\n codeRequired: {\n '&::after': {\n position: 'absolute',\n content: '\"*\"',\n top: 0,\n right: theme.spacing(0.5),\n fontWeight: 'bolder',\n color: theme.palette.error.light,\n },\n },\n}));\n\nexport const ActionsPage = () => {\n const api = useApi(scaffolderApiRef);\n const classes = useStyles();\n const { loading, value, error } = useAsync(async () => {\n return api.listActions();\n });\n\n if (loading) {\n return <Progress />;\n }\n\n if (error) {\n return (\n <ErrorPage\n statusMessage=\"Failed to load installed actions\"\n status=\"500\"\n />\n );\n }\n\n const formatRows = (input: JSONSchema) => {\n const properties = input.properties;\n if (!properties) {\n return undefined;\n }\n\n return Object.entries(properties).map(entry => {\n const [key] = entry;\n const props = entry[1] as unknown as JSONSchema;\n const codeClassname = classNames(classes.code, {\n [classes.codeRequired]: input.required?.includes(key),\n });\n\n return (\n <TableRow key={key}>\n <TableCell>\n <div className={codeClassname}>{key}</div>\n </TableCell>\n <TableCell>{props.title}</TableCell>\n <TableCell>{props.description}</TableCell>\n <TableCell>\n <span className={classes.code}>{props.type}</span>\n </TableCell>\n </TableRow>\n );\n });\n };\n\n const renderTable = (input: JSONSchema) => {\n if (!input.properties) {\n return undefined;\n }\n return (\n <TableContainer component={Paper}>\n <Table size=\"small\">\n <TableHead>\n <TableRow>\n <TableCell>Name</TableCell>\n <TableCell>Title</TableCell>\n <TableCell>Description</TableCell>\n <TableCell>Type</TableCell>\n </TableRow>\n </TableHead>\n <TableBody>{formatRows(input)}</TableBody>\n </Table>\n </TableContainer>\n );\n };\n\n const renderTables = (name: string, input?: JSONSchema7Definition[]) => {\n if (!input) {\n return undefined;\n }\n\n return (\n <>\n <Typography variant=\"h6\">{name}</Typography>\n {input.map((i, index) => (\n <div key={index}>{renderTable(i as unknown as JSONSchema)}</div>\n ))}\n </>\n );\n };\n\n const items = value?.map(action => {\n if (action.id.startsWith('legacy:')) {\n return undefined;\n }\n\n const oneOf = renderTables('oneOf', action.schema?.input?.oneOf);\n return (\n <Box pb={4} key={action.id}>\n <Typography variant=\"h4\" className={classes.code}>\n {action.id}\n </Typography>\n <Typography>{action.description}</Typography>\n {action.schema?.input && (\n <Box pb={2}>\n <Typography variant=\"h5\">Input</Typography>\n {renderTable(action.schema.input)}\n {oneOf}\n </Box>\n )}\n {action.schema?.output && (\n <Box pb={2}>\n <Typography variant=\"h5\">Output</Typography>\n {renderTable(action.schema.output)}\n </Box>\n )}\n </Box>\n );\n });\n\n return (\n <Page themeId=\"home\">\n <Header\n pageTitleOverride=\"Create a New Component\"\n title=\"Installed actions\"\n subtitle=\"This is the collection of all installed actions\"\n />\n <Content>{items}</Content>\n </Page>\n );\n};\n","/*\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 React, { ComponentType } from 'react';\nimport { Routes, Route, useOutlet } from 'react-router';\nimport { TemplateEntityV1beta2, Entity } from '@backstage/catalog-model';\nimport { ScaffolderPage } from './ScaffolderPage';\nimport { TemplatePage } from './TemplatePage';\nimport { TaskPage } from './TaskPage';\nimport { ActionsPage } from './ActionsPage';\nimport { SecretsContextProvider } from './secrets/SecretsContext';\n\nimport {\n FieldExtensionOptions,\n FIELD_EXTENSION_WRAPPER_KEY,\n FIELD_EXTENSION_KEY,\n DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS,\n} from '../extensions';\nimport { useElementFilter } from '@backstage/core-plugin-api';\n\ntype RouterProps = {\n TemplateCardComponent?:\n | ComponentType<{ template: TemplateEntityV1beta2 }>\n | undefined;\n TaskPageComponent?: ComponentType<{}>;\n groups?: Array<{\n title?: string;\n titleComponent?: React.ReactNode;\n filter: (entity: Entity) => boolean;\n }>;\n};\n\nexport const Router = ({\n TemplateCardComponent,\n TaskPageComponent,\n groups,\n}: RouterProps) => {\n const outlet = useOutlet();\n const TaskPageElement = TaskPageComponent || TaskPage;\n\n const customFieldExtensions = useElementFilter(outlet, elements =>\n elements\n .selectByComponentData({\n key: FIELD_EXTENSION_WRAPPER_KEY,\n })\n .findComponentData<FieldExtensionOptions>({\n key: FIELD_EXTENSION_KEY,\n }),\n );\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 ];\n\n return (\n <Routes>\n <Route\n path=\"/\"\n element={\n <ScaffolderPage\n TemplateCardComponent={TemplateCardComponent}\n groups={groups}\n />\n }\n />\n <Route\n path=\"/templates/:templateName\"\n element={\n <SecretsContextProvider>\n <TemplatePage customFieldExtensions={fieldExtensions} />\n </SecretsContextProvider>\n }\n />\n <Route path=\"/tasks/:taskId\" element={<TaskPageElement />} />\n <Route path=\"/actions\" element={<ActionsPage />} />\n </Routes>\n );\n};\n"],"names":["useStyles","isObject","MuiTheme","StepUI"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA6Ba,sCAA+D;AAAA,EAC1E;AAAA,IACE,WAAW;AAAA,IACX,MAAM;AAAA;AAAA,EAER;AAAA,IACE,WAAW;AAAA,IACX,MAAM;AAAA,IACN,YAAY;AAAA;AAAA,EAEd;AAAA,IACE,WAAW;AAAA,IACX,MAAM;AAAA;AAAA,EAER;AAAA,IACE,WAAW;AAAA,IACX,MAAM;AAAA,IACN,YAAY;AAAA;AAAA,EAEd;AAAA,IACE,WAAW;AAAA,IACX,MAAM;AAAA;AAAA,EAER;AAAA,IACE,WAAW;AAAA,IACX,MAAM;AAAA;AAAA;;ACZV,MAAMA,cAAY,WAAW;AAAU,EACrC,gBAAgB;AAAA,IACd,SAAS;AAAA,IACT,mBAAmB;AAAA,IACnB,qBAAqB;AAAA,IACrB,eAAe,MAAM,QAAQ;AAAA;AAAA;MAepB,yBAAyB,CAAC;AAAA,EACrC;AAAA,E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