@backstage/plugin-scaffolder 1.11.0-next.0 → 1.11.0-next.2
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 +48 -0
- package/alpha/package.json +1 -1
- package/dist/esm/ListTasksPage-6e377096.esm.js +192 -0
- package/dist/esm/ListTasksPage-6e377096.esm.js.map +1 -0
- package/dist/esm/{Router-73a659c0.esm.js → Router-e878e04f.esm.js} +92 -385
- package/dist/esm/Router-e878e04f.esm.js.map +1 -0
- package/dist/esm/{index-42d9f897.esm.js → index-02b0e824.esm.js} +656 -150
- package/dist/esm/index-02b0e824.esm.js.map +1 -0
- package/dist/esm/{index-88194b1f.esm.js → index-9bea2c47.esm.js} +64 -14
- package/dist/esm/index-9bea2c47.esm.js.map +1 -0
- package/dist/index.alpha.d.ts +11 -0
- package/dist/index.esm.js +26 -7
- package/dist/index.esm.js.map +1 -1
- package/package.json +15 -16
- package/dist/esm/Router-73a659c0.esm.js.map +0 -1
- package/dist/esm/default-35e63cd4.esm.js +0 -39
- package/dist/esm/default-35e63cd4.esm.js.map +0 -1
- package/dist/esm/index-42d9f897.esm.js.map +0 -1
- package/dist/esm/index-88194b1f.esm.js.map +0 -1
|
@@ -3,47 +3,66 @@ import { ResponseError } from '@backstage/errors';
|
|
|
3
3
|
import qs from 'qs';
|
|
4
4
|
import ObservableImpl from 'zen-observable';
|
|
5
5
|
import { scmIntegrationsApiRef, scmAuthApiRef } from '@backstage/integration-react';
|
|
6
|
-
import { scaffolderApiRef as scaffolderApiRef$1, useTemplateSecrets as useTemplateSecrets$1, createScaffolderFieldExtension as createScaffolderFieldExtension$1, ScaffolderFieldExtensions as ScaffolderFieldExtensions$1, createScaffolderLayout as createScaffolderLayout$1, ScaffolderLayouts as ScaffolderLayouts$1 } from '@backstage/plugin-scaffolder-react';
|
|
7
|
-
import { useApi, identityApiRef, createExternalRouteRef, createRouteRef, createSubRouteRef, createPlugin, createApiFactory, discoveryApiRef, fetchApiRef, createRoutableExtension, alertApiRef, useApp,
|
|
6
|
+
import { scaffolderApiRef as scaffolderApiRef$1, useTemplateSecrets as useTemplateSecrets$1, DefaultTemplateOutputs, createScaffolderFieldExtension as createScaffolderFieldExtension$1, ScaffolderFieldExtensions as ScaffolderFieldExtensions$1, createScaffolderLayout as createScaffolderLayout$1, ScaffolderLayouts as ScaffolderLayouts$1 } from '@backstage/plugin-scaffolder-react';
|
|
7
|
+
import { useApi, identityApiRef, createExternalRouteRef, createRouteRef, createSubRouteRef, useRouteRef, createPlugin, createApiFactory, discoveryApiRef, fetchApiRef, createRoutableExtension, alertApiRef, useApp, useRouteRefParams } from '@backstage/core-plugin-api';
|
|
8
8
|
import { catalogApiRef, humanizeEntityRef, useEntityTypeFilter, entityRouteRef } from '@backstage/plugin-catalog-react';
|
|
9
|
-
import { TextField, FormControl as FormControl$1,
|
|
9
|
+
import { TextField, FormControl as FormControl$1, makeStyles as makeStyles$1, CircularProgress, Typography, Stepper, Step, StepButton, StepLabel, Box, LinearProgress, IconButton as IconButton$1, Popover as Popover$1, MenuList as MenuList$1, MenuItem as MenuItem$1, ListItemIcon as ListItemIcon$1, ListItemText as ListItemText$1, Paper, Accordion, AccordionSummary, AccordionDetails, Grid, TableContainer, Table, TableHead, TableRow, TableCell, TableBody, Chip, Card, List as List$1, FormControlLabel, Checkbox, Button } from '@material-ui/core';
|
|
10
10
|
import FormControl from '@material-ui/core/FormControl';
|
|
11
11
|
import Autocomplete from '@material-ui/lab/Autocomplete';
|
|
12
|
-
import React, { useCallback, useEffect, useState, useMemo, useRef, memo } from 'react';
|
|
12
|
+
import React, { useCallback, useEffect, useState, useMemo, Fragment, useRef, memo } from 'react';
|
|
13
13
|
import useAsync from 'react-use/lib/useAsync';
|
|
14
14
|
import { z } from 'zod';
|
|
15
15
|
import zodToJsonSchema from 'zod-to-json-schema';
|
|
16
16
|
import FormHelperText from '@material-ui/core/FormHelperText';
|
|
17
17
|
import Input from '@material-ui/core/Input';
|
|
18
18
|
import InputLabel from '@material-ui/core/InputLabel';
|
|
19
|
-
import { Select, Progress,
|
|
19
|
+
import { Select, Progress, LogViewer, Page, Header, Content, ErrorPanel, ErrorPage, MarkdownContent, CodeSnippet, DismissableBanner, Link } from '@backstage/core-components';
|
|
20
20
|
import useDebounce from 'react-use/lib/useDebounce';
|
|
21
21
|
import useEffectOnce from 'react-use/lib/useEffectOnce';
|
|
22
22
|
import { Autocomplete as Autocomplete$1 } from '@material-ui/lab';
|
|
23
|
-
import { useNavigate } from 'react-router-dom';
|
|
23
|
+
import { useNavigate, useParams } from 'react-router-dom';
|
|
24
24
|
import capitalize from 'lodash/capitalize';
|
|
25
25
|
import CheckBoxIcon from '@material-ui/icons/CheckBox';
|
|
26
26
|
import CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';
|
|
27
27
|
import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
|
|
28
28
|
import '@material-ui/core/Button';
|
|
29
|
-
import '@material-ui/core/IconButton';
|
|
29
|
+
import IconButton from '@material-ui/core/IconButton';
|
|
30
30
|
import '@material-ui/core/useMediaQuery';
|
|
31
31
|
import '@material-ui/icons/AddCircleOutline';
|
|
32
32
|
import '@backstage/plugin-catalog-common';
|
|
33
33
|
import '@backstage/plugin-permission-react';
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
34
|
+
import ListItemIcon from '@material-ui/core/ListItemIcon';
|
|
35
|
+
import ListItemText from '@material-ui/core/ListItemText';
|
|
36
|
+
import MenuItem from '@material-ui/core/MenuItem';
|
|
37
|
+
import MenuList from '@material-ui/core/MenuList';
|
|
38
|
+
import Popover from '@material-ui/core/Popover';
|
|
39
|
+
import { makeStyles, createStyles } from '@material-ui/core/styles';
|
|
40
|
+
import Description from '@material-ui/icons/Description';
|
|
41
|
+
import Edit from '@material-ui/icons/Edit';
|
|
42
|
+
import List from '@material-ui/icons/List';
|
|
43
|
+
import MoreVert from '@material-ui/icons/MoreVert';
|
|
44
|
+
import { useImmerReducer } from 'use-immer';
|
|
45
|
+
import RemoveCircleOutline from '@material-ui/icons/RemoveCircleOutline';
|
|
46
|
+
import PanoramaFishEyeIcon from '@material-ui/icons/PanoramaFishEye';
|
|
47
|
+
import classNames from 'classnames';
|
|
48
|
+
import CheckCircleOutline from '@material-ui/icons/CheckCircleOutline';
|
|
49
|
+
import ErrorOutline from '@material-ui/icons/ErrorOutline';
|
|
50
|
+
import useInterval from 'react-use/lib/useInterval';
|
|
51
|
+
import { DateTime, Interval } from 'luxon';
|
|
52
|
+
import humanizeDuration$1 from 'humanize-duration';
|
|
53
|
+
import { useMountEffect } from '@react-hookz/web';
|
|
54
|
+
import Retry from '@material-ui/icons/Repeat';
|
|
55
|
+
import Toc from '@material-ui/icons/Toc';
|
|
56
|
+
import SettingsIcon from '@material-ui/icons/Settings';
|
|
57
|
+
import AllIcon from '@material-ui/icons/FontDownload';
|
|
39
58
|
import Typography$1 from '@material-ui/core/Typography';
|
|
59
|
+
import Grid$1 from '@material-ui/core/Grid';
|
|
60
|
+
import Step$1 from '@material-ui/core/Step';
|
|
61
|
+
import StepLabel$1 from '@material-ui/core/StepLabel';
|
|
62
|
+
import Stepper$1 from '@material-ui/core/Stepper';
|
|
40
63
|
import Cancel from '@material-ui/icons/Cancel';
|
|
41
64
|
import Check from '@material-ui/icons/Check';
|
|
42
65
|
import FiberManualRecordIcon from '@material-ui/icons/FiberManualRecord';
|
|
43
|
-
import classNames from 'classnames';
|
|
44
|
-
import { DateTime, Interval } from 'luxon';
|
|
45
|
-
import useInterval from 'react-use/lib/useInterval';
|
|
46
|
-
import { useImmerReducer } from 'use-immer';
|
|
47
66
|
import LanguageIcon from '@material-ui/icons/Language';
|
|
48
67
|
|
|
49
68
|
class ScaffolderClient {
|
|
@@ -1264,139 +1283,70 @@ const nextScaffolderTaskRouteRef = createSubRouteRef({
|
|
|
1264
1283
|
parent: nextRouteRef,
|
|
1265
1284
|
path: "/tasks/:taskId"
|
|
1266
1285
|
});
|
|
1286
|
+
const nextScaffolderListTaskRouteRef = createSubRouteRef({
|
|
1287
|
+
id: "scaffolder/next/list-tasks",
|
|
1288
|
+
parent: nextRouteRef,
|
|
1289
|
+
path: "/tasks"
|
|
1290
|
+
});
|
|
1291
|
+
const nextActionsRouteRef = createSubRouteRef({
|
|
1292
|
+
id: "scaffolder/next/actions",
|
|
1293
|
+
parent: nextRouteRef,
|
|
1294
|
+
path: "/actions"
|
|
1295
|
+
});
|
|
1296
|
+
const nextEditRouteRef = createSubRouteRef({
|
|
1297
|
+
id: "scaffolder/next/edit",
|
|
1298
|
+
parent: nextRouteRef,
|
|
1299
|
+
path: "/edit"
|
|
1300
|
+
});
|
|
1267
1301
|
|
|
1268
|
-
const
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
createApiFactory({
|
|
1272
|
-
api: scaffolderApiRef$1,
|
|
1273
|
-
deps: {
|
|
1274
|
-
discoveryApi: discoveryApiRef,
|
|
1275
|
-
scmIntegrationsApi: scmIntegrationsApiRef,
|
|
1276
|
-
fetchApi: fetchApiRef,
|
|
1277
|
-
identityApi: identityApiRef
|
|
1278
|
-
},
|
|
1279
|
-
factory: ({ discoveryApi, scmIntegrationsApi, fetchApi, identityApi }) => new ScaffolderClient({
|
|
1280
|
-
discoveryApi,
|
|
1281
|
-
scmIntegrationsApi,
|
|
1282
|
-
fetchApi,
|
|
1283
|
-
identityApi
|
|
1284
|
-
})
|
|
1285
|
-
})
|
|
1286
|
-
],
|
|
1287
|
-
routes: {
|
|
1288
|
-
root: rootRouteRef$1,
|
|
1289
|
-
selectedTemplate: selectedTemplateRouteRef,
|
|
1290
|
-
ongoingTask: scaffolderTaskRouteRef
|
|
1291
|
-
},
|
|
1292
|
-
externalRoutes: {
|
|
1293
|
-
registerComponent: registerComponentRouteRef,
|
|
1294
|
-
viewTechDoc: viewTechDocRouteRef
|
|
1302
|
+
const useStyles$8 = makeStyles({
|
|
1303
|
+
button: {
|
|
1304
|
+
color: "white"
|
|
1295
1305
|
}
|
|
1296
1306
|
});
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
);
|
|
1304
|
-
const
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
validation: entityNamePickerValidation,
|
|
1309
|
-
schema: EntityNamePickerSchema
|
|
1310
|
-
})
|
|
1311
|
-
);
|
|
1312
|
-
const RepoUrlPickerFieldExtension = scaffolderPlugin.provide(
|
|
1313
|
-
createScaffolderFieldExtension$1({
|
|
1314
|
-
component: RepoUrlPicker,
|
|
1315
|
-
name: "RepoUrlPicker",
|
|
1316
|
-
validation: repoPickerValidation,
|
|
1317
|
-
schema: RepoUrlPickerSchema
|
|
1318
|
-
})
|
|
1319
|
-
);
|
|
1320
|
-
const OwnerPickerFieldExtension = scaffolderPlugin.provide(
|
|
1321
|
-
createScaffolderFieldExtension$1({
|
|
1322
|
-
component: OwnerPicker,
|
|
1323
|
-
name: "OwnerPicker",
|
|
1324
|
-
schema: OwnerPickerSchema
|
|
1325
|
-
})
|
|
1326
|
-
);
|
|
1327
|
-
const ScaffolderPage = scaffolderPlugin.provide(
|
|
1328
|
-
createRoutableExtension({
|
|
1329
|
-
name: "ScaffolderPage",
|
|
1330
|
-
component: () => import('./Router-73a659c0.esm.js').then((m) => m.Router),
|
|
1331
|
-
mountPoint: rootRouteRef$1
|
|
1332
|
-
})
|
|
1333
|
-
);
|
|
1334
|
-
const OwnedEntityPickerFieldExtension = scaffolderPlugin.provide(
|
|
1335
|
-
createScaffolderFieldExtension$1({
|
|
1336
|
-
component: OwnedEntityPicker,
|
|
1337
|
-
name: "OwnedEntityPicker",
|
|
1338
|
-
schema: OwnedEntityPickerSchema
|
|
1339
|
-
})
|
|
1340
|
-
);
|
|
1341
|
-
const EntityTagsPickerFieldExtension = scaffolderPlugin.provide(
|
|
1342
|
-
createScaffolderFieldExtension$1({
|
|
1343
|
-
component: EntityTagsPicker,
|
|
1344
|
-
name: "EntityTagsPicker",
|
|
1345
|
-
schema: EntityTagsPickerSchema
|
|
1346
|
-
})
|
|
1347
|
-
);
|
|
1348
|
-
const NextScaffolderPage = scaffolderPlugin.provide(
|
|
1349
|
-
createRoutableExtension({
|
|
1350
|
-
name: "NextScaffolderPage",
|
|
1351
|
-
component: () => import('./index-88194b1f.esm.js').then((m) => m.Router),
|
|
1352
|
-
mountPoint: nextRouteRef
|
|
1353
|
-
})
|
|
1354
|
-
);
|
|
1355
|
-
|
|
1356
|
-
const icon = /* @__PURE__ */ React.createElement(CheckBoxOutlineBlankIcon, { fontSize: "small" });
|
|
1357
|
-
const checkedIcon = /* @__PURE__ */ React.createElement(CheckBoxIcon, { fontSize: "small" });
|
|
1358
|
-
const TemplateTypePicker = () => {
|
|
1359
|
-
const alertApi = useApi(alertApiRef);
|
|
1360
|
-
const { error, loading, availableTypes, selectedTypes, setSelectedTypes } = useEntityTypeFilter();
|
|
1361
|
-
if (loading)
|
|
1362
|
-
return /* @__PURE__ */ React.createElement(Progress, null);
|
|
1363
|
-
if (!availableTypes)
|
|
1364
|
-
return null;
|
|
1365
|
-
if (error) {
|
|
1366
|
-
alertApi.post({
|
|
1367
|
-
message: `Failed to load entity types`,
|
|
1368
|
-
severity: "error"
|
|
1369
|
-
});
|
|
1307
|
+
function ContextMenu$1(props) {
|
|
1308
|
+
const classes = useStyles$8();
|
|
1309
|
+
const [anchorEl, setAnchorEl] = useState();
|
|
1310
|
+
const editLink = useRouteRef(nextEditRouteRef);
|
|
1311
|
+
const actionsLink = useRouteRef(nextActionsRouteRef);
|
|
1312
|
+
const tasksLink = useRouteRef(nextScaffolderListTaskRouteRef);
|
|
1313
|
+
const navigate = useNavigate();
|
|
1314
|
+
const showEditor = props.editor !== false;
|
|
1315
|
+
const showActions = props.actions !== false;
|
|
1316
|
+
const showTasks = props.tasks !== false;
|
|
1317
|
+
if (!showEditor && !showActions) {
|
|
1370
1318
|
return null;
|
|
1371
1319
|
}
|
|
1372
|
-
|
|
1373
|
-
|
|
1320
|
+
const onOpen = (event) => {
|
|
1321
|
+
setAnchorEl(event.currentTarget);
|
|
1322
|
+
};
|
|
1323
|
+
const onClose = () => {
|
|
1324
|
+
setAnchorEl(void 0);
|
|
1325
|
+
};
|
|
1326
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
1327
|
+
IconButton,
|
|
1374
1328
|
{
|
|
1375
|
-
|
|
1376
|
-
"aria-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
size: "small",
|
|
1395
|
-
popupIcon: /* @__PURE__ */ React.createElement(ExpandMoreIcon, { "data-testid": "categories-picker-expand" }),
|
|
1396
|
-
renderInput: (params) => /* @__PURE__ */ React.createElement(TextField, { ...params, variant: "outlined" })
|
|
1397
|
-
}
|
|
1329
|
+
"aria-label": "more",
|
|
1330
|
+
"aria-controls": "long-menu",
|
|
1331
|
+
"aria-haspopup": "true",
|
|
1332
|
+
onClick: onOpen,
|
|
1333
|
+
"data-testid": "menu-button",
|
|
1334
|
+
color: "inherit",
|
|
1335
|
+
className: classes.button
|
|
1336
|
+
},
|
|
1337
|
+
/* @__PURE__ */ React.createElement(MoreVert, null)
|
|
1338
|
+
), /* @__PURE__ */ React.createElement(
|
|
1339
|
+
Popover,
|
|
1340
|
+
{
|
|
1341
|
+
open: Boolean(anchorEl),
|
|
1342
|
+
onClose,
|
|
1343
|
+
anchorEl,
|
|
1344
|
+
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
1345
|
+
transformOrigin: { vertical: "top", horizontal: "right" }
|
|
1346
|
+
},
|
|
1347
|
+
/* @__PURE__ */ React.createElement(MenuList, null, showEditor && /* @__PURE__ */ React.createElement(MenuItem, { onClick: () => navigate(editLink()) }, /* @__PURE__ */ React.createElement(ListItemIcon, null, /* @__PURE__ */ React.createElement(Edit, { fontSize: "small" })), /* @__PURE__ */ React.createElement(ListItemText, { primary: "Template Editor" })), showActions && /* @__PURE__ */ React.createElement(MenuItem, { onClick: () => navigate(actionsLink()) }, /* @__PURE__ */ React.createElement(ListItemIcon, null, /* @__PURE__ */ React.createElement(Description, { fontSize: "small" })), /* @__PURE__ */ React.createElement(ListItemText, { primary: "Installed Actions" })), showTasks && /* @__PURE__ */ React.createElement(MenuItem, { onClick: () => navigate(tasksLink()) }, /* @__PURE__ */ React.createElement(ListItemIcon, null, /* @__PURE__ */ React.createElement(List, { fontSize: "small" })), /* @__PURE__ */ React.createElement(ListItemText, { primary: "Task List" })))
|
|
1398
1348
|
));
|
|
1399
|
-
}
|
|
1349
|
+
}
|
|
1400
1350
|
|
|
1401
1351
|
function reducer(draft, action) {
|
|
1402
1352
|
var _a, _b, _c;
|
|
@@ -1524,6 +1474,562 @@ const useTaskEventStream = (taskId) => {
|
|
|
1524
1474
|
return state;
|
|
1525
1475
|
};
|
|
1526
1476
|
|
|
1477
|
+
const useStepIconStyles$1 = makeStyles$1((theme) => ({
|
|
1478
|
+
root: {
|
|
1479
|
+
color: theme.palette.text.disabled
|
|
1480
|
+
},
|
|
1481
|
+
completed: {
|
|
1482
|
+
color: theme.palette.status.ok
|
|
1483
|
+
},
|
|
1484
|
+
error: {
|
|
1485
|
+
color: theme.palette.status.error
|
|
1486
|
+
}
|
|
1487
|
+
}));
|
|
1488
|
+
const StepIcon = (props) => {
|
|
1489
|
+
const classes = useStepIconStyles$1();
|
|
1490
|
+
const { active, completed, error, skipped } = props;
|
|
1491
|
+
const getMiddle = () => {
|
|
1492
|
+
if (active) {
|
|
1493
|
+
return /* @__PURE__ */ React.createElement(CircularProgress, { size: "20px" });
|
|
1494
|
+
}
|
|
1495
|
+
if (completed) {
|
|
1496
|
+
return /* @__PURE__ */ React.createElement(CheckCircleOutline, null);
|
|
1497
|
+
}
|
|
1498
|
+
if (error) {
|
|
1499
|
+
return /* @__PURE__ */ React.createElement(ErrorOutline, null);
|
|
1500
|
+
}
|
|
1501
|
+
if (skipped) {
|
|
1502
|
+
return /* @__PURE__ */ React.createElement(RemoveCircleOutline, null);
|
|
1503
|
+
}
|
|
1504
|
+
return /* @__PURE__ */ React.createElement(PanoramaFishEyeIcon, null);
|
|
1505
|
+
};
|
|
1506
|
+
return /* @__PURE__ */ React.createElement(
|
|
1507
|
+
"div",
|
|
1508
|
+
{
|
|
1509
|
+
className: classNames(classes.root, {
|
|
1510
|
+
[classes.completed]: completed,
|
|
1511
|
+
[classes.error]: error
|
|
1512
|
+
})
|
|
1513
|
+
},
|
|
1514
|
+
getMiddle()
|
|
1515
|
+
);
|
|
1516
|
+
};
|
|
1517
|
+
|
|
1518
|
+
const StepTime = (props) => {
|
|
1519
|
+
const [time, setTime] = useState("");
|
|
1520
|
+
const { step } = props;
|
|
1521
|
+
const calculate = useCallback(() => {
|
|
1522
|
+
if (!step.startedAt) {
|
|
1523
|
+
setTime("");
|
|
1524
|
+
return;
|
|
1525
|
+
}
|
|
1526
|
+
const end = step.endedAt ? DateTime.fromISO(step.endedAt) : DateTime.local();
|
|
1527
|
+
const startedAt = DateTime.fromISO(step.startedAt);
|
|
1528
|
+
const formatted = Interval.fromDateTimes(startedAt, end).toDuration().valueOf();
|
|
1529
|
+
setTime(humanizeDuration$1(formatted, { round: true }));
|
|
1530
|
+
}, [step.endedAt, step.startedAt]);
|
|
1531
|
+
useMountEffect(() => calculate());
|
|
1532
|
+
useInterval(() => !step.endedAt && calculate(), 1e3);
|
|
1533
|
+
return /* @__PURE__ */ React.createElement(Typography, { variant: "caption" }, time);
|
|
1534
|
+
};
|
|
1535
|
+
|
|
1536
|
+
const TaskSteps = (props) => {
|
|
1537
|
+
return /* @__PURE__ */ React.createElement(
|
|
1538
|
+
Stepper,
|
|
1539
|
+
{
|
|
1540
|
+
activeStep: props.activeStep,
|
|
1541
|
+
alternativeLabel: true,
|
|
1542
|
+
variant: "elevation"
|
|
1543
|
+
},
|
|
1544
|
+
props.steps.map((step, index) => {
|
|
1545
|
+
const isCompleted = step.status === "completed";
|
|
1546
|
+
const isFailed = step.status === "failed";
|
|
1547
|
+
const isActive = step.status === "processing";
|
|
1548
|
+
const isSkipped = step.status === "skipped";
|
|
1549
|
+
const stepIconProps = {
|
|
1550
|
+
completed: isCompleted,
|
|
1551
|
+
error: isFailed,
|
|
1552
|
+
active: isActive,
|
|
1553
|
+
skipped: isSkipped
|
|
1554
|
+
};
|
|
1555
|
+
return /* @__PURE__ */ React.createElement(Step, { key: index }, /* @__PURE__ */ React.createElement(StepButton, null, /* @__PURE__ */ React.createElement(
|
|
1556
|
+
StepLabel,
|
|
1557
|
+
{
|
|
1558
|
+
StepIconProps: stepIconProps,
|
|
1559
|
+
StepIconComponent: StepIcon
|
|
1560
|
+
},
|
|
1561
|
+
/* @__PURE__ */ React.createElement(Box, null, step.name),
|
|
1562
|
+
/* @__PURE__ */ React.createElement(StepTime, { step })
|
|
1563
|
+
)));
|
|
1564
|
+
})
|
|
1565
|
+
);
|
|
1566
|
+
};
|
|
1567
|
+
|
|
1568
|
+
const useStyles$7 = makeStyles$1((theme) => ({
|
|
1569
|
+
failed: {
|
|
1570
|
+
backgroundColor: theme.palette.error.main
|
|
1571
|
+
},
|
|
1572
|
+
success: {
|
|
1573
|
+
backgroundColor: theme.palette.success.main
|
|
1574
|
+
}
|
|
1575
|
+
}));
|
|
1576
|
+
const TaskBorder = (props) => {
|
|
1577
|
+
const styles = useStyles$7();
|
|
1578
|
+
if (!props.isComplete) {
|
|
1579
|
+
return /* @__PURE__ */ React.createElement(LinearProgress, { variant: "indeterminate" });
|
|
1580
|
+
}
|
|
1581
|
+
return /* @__PURE__ */ React.createElement(
|
|
1582
|
+
LinearProgress,
|
|
1583
|
+
{
|
|
1584
|
+
variant: "determinate",
|
|
1585
|
+
classes: { bar: props.isError ? styles.failed : styles.success },
|
|
1586
|
+
value: 100
|
|
1587
|
+
}
|
|
1588
|
+
);
|
|
1589
|
+
};
|
|
1590
|
+
|
|
1591
|
+
const useStyles$6 = makeStyles({
|
|
1592
|
+
root: {
|
|
1593
|
+
width: "100%",
|
|
1594
|
+
height: "100%",
|
|
1595
|
+
position: "relative"
|
|
1596
|
+
}
|
|
1597
|
+
});
|
|
1598
|
+
const TaskLogStream = (props) => {
|
|
1599
|
+
const styles = useStyles$6();
|
|
1600
|
+
return /* @__PURE__ */ React.createElement("div", { className: styles.root }, /* @__PURE__ */ React.createElement(
|
|
1601
|
+
LogViewer,
|
|
1602
|
+
{
|
|
1603
|
+
text: Object.values(props.logs).map((l) => l.join("\n")).filter(Boolean).join("\n")
|
|
1604
|
+
}
|
|
1605
|
+
));
|
|
1606
|
+
};
|
|
1607
|
+
|
|
1608
|
+
const useStyles$5 = makeStyles$1((theme) => ({
|
|
1609
|
+
button: {
|
|
1610
|
+
color: theme.palette.common.white
|
|
1611
|
+
}
|
|
1612
|
+
}));
|
|
1613
|
+
const ContextMenu = (props) => {
|
|
1614
|
+
const { logsVisible, onToggleLogs, onStartOver } = props;
|
|
1615
|
+
const classes = useStyles$5();
|
|
1616
|
+
const [anchorEl, setAnchorEl] = useState();
|
|
1617
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
1618
|
+
IconButton$1,
|
|
1619
|
+
{
|
|
1620
|
+
"aria-label": "more",
|
|
1621
|
+
"aria-controls": "long-menu",
|
|
1622
|
+
"aria-haspopup": "true",
|
|
1623
|
+
onClick: (event) => {
|
|
1624
|
+
setAnchorEl(event.currentTarget);
|
|
1625
|
+
},
|
|
1626
|
+
"data-testid": "menu-button",
|
|
1627
|
+
color: "inherit",
|
|
1628
|
+
className: classes.button
|
|
1629
|
+
},
|
|
1630
|
+
/* @__PURE__ */ React.createElement(MoreVert, null)
|
|
1631
|
+
), /* @__PURE__ */ React.createElement(
|
|
1632
|
+
Popover$1,
|
|
1633
|
+
{
|
|
1634
|
+
open: Boolean(anchorEl),
|
|
1635
|
+
onClose: () => setAnchorEl(void 0),
|
|
1636
|
+
anchorEl,
|
|
1637
|
+
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
1638
|
+
transformOrigin: { vertical: "top", horizontal: "right" }
|
|
1639
|
+
},
|
|
1640
|
+
/* @__PURE__ */ React.createElement(MenuList$1, null, /* @__PURE__ */ React.createElement(MenuItem$1, { onClick: () => onToggleLogs == null ? void 0 : onToggleLogs(!logsVisible) }, /* @__PURE__ */ React.createElement(ListItemIcon$1, null, /* @__PURE__ */ React.createElement(Toc, { fontSize: "small" })), /* @__PURE__ */ React.createElement(ListItemText$1, { primary: logsVisible ? "Hide Logs" : "Show Logs" })), /* @__PURE__ */ React.createElement(MenuItem$1, { onClick: onStartOver }, /* @__PURE__ */ React.createElement(ListItemIcon$1, null, /* @__PURE__ */ React.createElement(Retry, { fontSize: "small" })), /* @__PURE__ */ React.createElement(ListItemText$1, { primary: "Start Over" })))
|
|
1641
|
+
));
|
|
1642
|
+
};
|
|
1643
|
+
|
|
1644
|
+
const useStyles$4 = makeStyles$1({
|
|
1645
|
+
contentWrapper: {
|
|
1646
|
+
display: "flex",
|
|
1647
|
+
flexDirection: "column"
|
|
1648
|
+
}
|
|
1649
|
+
});
|
|
1650
|
+
const OngoingTask = (props) => {
|
|
1651
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1652
|
+
const { taskId } = useParams();
|
|
1653
|
+
const templateRouteRef = useRouteRef(nextSelectedTemplateRouteRef);
|
|
1654
|
+
const navigate = useNavigate();
|
|
1655
|
+
const taskStream = useTaskEventStream(taskId);
|
|
1656
|
+
const classes = useStyles$4();
|
|
1657
|
+
const steps = useMemo(
|
|
1658
|
+
() => {
|
|
1659
|
+
var _a2, _b2;
|
|
1660
|
+
return (_b2 = (_a2 = taskStream.task) == null ? void 0 : _a2.spec.steps.map((step) => {
|
|
1661
|
+
var _a3;
|
|
1662
|
+
return {
|
|
1663
|
+
...step,
|
|
1664
|
+
...(_a3 = taskStream == null ? void 0 : taskStream.steps) == null ? void 0 : _a3[step.id]
|
|
1665
|
+
};
|
|
1666
|
+
})) != null ? _b2 : [];
|
|
1667
|
+
},
|
|
1668
|
+
[taskStream]
|
|
1669
|
+
);
|
|
1670
|
+
const [logsVisible, setLogVisibleState] = useState(false);
|
|
1671
|
+
useEffect(() => {
|
|
1672
|
+
if (taskStream.error) {
|
|
1673
|
+
setLogVisibleState(true);
|
|
1674
|
+
}
|
|
1675
|
+
}, [taskStream.error]);
|
|
1676
|
+
const activeStep = useMemo(() => {
|
|
1677
|
+
for (let i = steps.length - 1; i >= 0; i--) {
|
|
1678
|
+
if (steps[i].status !== "open") {
|
|
1679
|
+
return i;
|
|
1680
|
+
}
|
|
1681
|
+
}
|
|
1682
|
+
return 0;
|
|
1683
|
+
}, [steps]);
|
|
1684
|
+
const startOver = useCallback(() => {
|
|
1685
|
+
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
1686
|
+
const { namespace, name } = (_d2 = (_c2 = (_b2 = (_a2 = taskStream.task) == null ? void 0 : _a2.spec.templateInfo) == null ? void 0 : _b2.entity) == null ? void 0 : _c2.metadata) != null ? _d2 : {};
|
|
1687
|
+
const formData = (_f2 = (_e2 = taskStream.task) == null ? void 0 : _e2.spec.parameters) != null ? _f2 : {};
|
|
1688
|
+
if (!namespace || !name) {
|
|
1689
|
+
return;
|
|
1690
|
+
}
|
|
1691
|
+
navigate({
|
|
1692
|
+
pathname: templateRouteRef({
|
|
1693
|
+
namespace,
|
|
1694
|
+
templateName: name
|
|
1695
|
+
}),
|
|
1696
|
+
search: `?${qs.stringify({ formData: JSON.stringify(formData) })}`
|
|
1697
|
+
});
|
|
1698
|
+
}, [
|
|
1699
|
+
navigate,
|
|
1700
|
+
(_a = taskStream.task) == null ? void 0 : _a.spec.parameters,
|
|
1701
|
+
(_d = (_c = (_b = taskStream.task) == null ? void 0 : _b.spec.templateInfo) == null ? void 0 : _c.entity) == null ? void 0 : _d.metadata,
|
|
1702
|
+
templateRouteRef
|
|
1703
|
+
]);
|
|
1704
|
+
const Outputs = (_e = props.TemplateOutputsComponent) != null ? _e : DefaultTemplateOutputs;
|
|
1705
|
+
const templateName = (_h = (_g = (_f = taskStream.task) == null ? void 0 : _f.spec.templateInfo) == null ? void 0 : _g.entity) == null ? void 0 : _h.metadata.name;
|
|
1706
|
+
return /* @__PURE__ */ React.createElement(Page, { themeId: "website" }, /* @__PURE__ */ React.createElement(
|
|
1707
|
+
Header,
|
|
1708
|
+
{
|
|
1709
|
+
pageTitleOverride: `Run of ${templateName}`,
|
|
1710
|
+
title: /* @__PURE__ */ React.createElement("div", null, "Run of ", /* @__PURE__ */ React.createElement("code", null, templateName)),
|
|
1711
|
+
subtitle: `Task ${taskId}`
|
|
1712
|
+
},
|
|
1713
|
+
/* @__PURE__ */ React.createElement(
|
|
1714
|
+
ContextMenu,
|
|
1715
|
+
{
|
|
1716
|
+
onToggleLogs: setLogVisibleState,
|
|
1717
|
+
onStartOver: startOver,
|
|
1718
|
+
logsVisible
|
|
1719
|
+
}
|
|
1720
|
+
)
|
|
1721
|
+
), /* @__PURE__ */ React.createElement(Content, { className: classes.contentWrapper }, taskStream.error ? /* @__PURE__ */ React.createElement(Box, { paddingBottom: 2 }, /* @__PURE__ */ React.createElement(
|
|
1722
|
+
ErrorPanel,
|
|
1723
|
+
{
|
|
1724
|
+
error: taskStream.error,
|
|
1725
|
+
title: taskStream.error.message
|
|
1726
|
+
}
|
|
1727
|
+
)) : null, /* @__PURE__ */ React.createElement(Box, { paddingBottom: 2 }, /* @__PURE__ */ React.createElement(Paper, { style: { position: "relative", overflow: "hidden" } }, /* @__PURE__ */ React.createElement(
|
|
1728
|
+
TaskBorder,
|
|
1729
|
+
{
|
|
1730
|
+
isComplete: taskStream.completed,
|
|
1731
|
+
isError: Boolean(taskStream.error)
|
|
1732
|
+
}
|
|
1733
|
+
), /* @__PURE__ */ React.createElement(Box, { padding: 2 }, /* @__PURE__ */ React.createElement(TaskSteps, { steps, activeStep })))), /* @__PURE__ */ React.createElement(Outputs, { output: taskStream.output }), logsVisible ? /* @__PURE__ */ React.createElement(Box, { paddingBottom: 2, height: "100%" }, /* @__PURE__ */ React.createElement(Paper, { style: { height: "100%" } }, /* @__PURE__ */ React.createElement(Box, { padding: 2, height: "100%" }, /* @__PURE__ */ React.createElement(TaskLogStream, { logs: taskStream.stepLogs })))) : null));
|
|
1734
|
+
};
|
|
1735
|
+
|
|
1736
|
+
const useStyles$3 = makeStyles$1((theme) => ({
|
|
1737
|
+
code: {
|
|
1738
|
+
fontFamily: "Menlo, monospace",
|
|
1739
|
+
padding: theme.spacing(1),
|
|
1740
|
+
backgroundColor: theme.palette.type === "dark" ? theme.palette.grey[700] : theme.palette.grey[300],
|
|
1741
|
+
display: "inline-block",
|
|
1742
|
+
borderRadius: 5,
|
|
1743
|
+
border: `1px solid ${theme.palette.grey[500]}`,
|
|
1744
|
+
position: "relative"
|
|
1745
|
+
},
|
|
1746
|
+
codeRequired: {
|
|
1747
|
+
"&::after": {
|
|
1748
|
+
position: "absolute",
|
|
1749
|
+
content: '"*"',
|
|
1750
|
+
top: 0,
|
|
1751
|
+
right: theme.spacing(0.5),
|
|
1752
|
+
fontWeight: "bolder",
|
|
1753
|
+
color: theme.palette.error.light
|
|
1754
|
+
}
|
|
1755
|
+
}
|
|
1756
|
+
}));
|
|
1757
|
+
const ExamplesTable = (props) => {
|
|
1758
|
+
return /* @__PURE__ */ React.createElement(Grid, { container: true }, props.examples.map((example, index) => {
|
|
1759
|
+
return /* @__PURE__ */ React.createElement(Fragment, { key: `example-${index}` }, /* @__PURE__ */ React.createElement(Grid, { item: true, lg: 3 }, /* @__PURE__ */ React.createElement(Box, { padding: 4 }, /* @__PURE__ */ React.createElement(Typography, null, example.description))), /* @__PURE__ */ React.createElement(Grid, { item: true, lg: 9 }, /* @__PURE__ */ React.createElement(Box, { padding: 1 }, /* @__PURE__ */ React.createElement(
|
|
1760
|
+
CodeSnippet,
|
|
1761
|
+
{
|
|
1762
|
+
text: example.example,
|
|
1763
|
+
showLineNumbers: true,
|
|
1764
|
+
showCopyCodeButton: true,
|
|
1765
|
+
language: "yaml"
|
|
1766
|
+
}
|
|
1767
|
+
))));
|
|
1768
|
+
}));
|
|
1769
|
+
};
|
|
1770
|
+
const ActionsPage = () => {
|
|
1771
|
+
const api = useApi(scaffolderApiRef$1);
|
|
1772
|
+
const classes = useStyles$3();
|
|
1773
|
+
const { loading, value, error } = useAsync(async () => {
|
|
1774
|
+
return api.listActions();
|
|
1775
|
+
});
|
|
1776
|
+
if (loading) {
|
|
1777
|
+
return /* @__PURE__ */ React.createElement(Progress, null);
|
|
1778
|
+
}
|
|
1779
|
+
if (error) {
|
|
1780
|
+
return /* @__PURE__ */ React.createElement(
|
|
1781
|
+
ErrorPage,
|
|
1782
|
+
{
|
|
1783
|
+
statusMessage: "Failed to load installed actions",
|
|
1784
|
+
status: "500"
|
|
1785
|
+
}
|
|
1786
|
+
);
|
|
1787
|
+
}
|
|
1788
|
+
const formatRows = (input) => {
|
|
1789
|
+
const properties = input.properties;
|
|
1790
|
+
if (!properties) {
|
|
1791
|
+
return void 0;
|
|
1792
|
+
}
|
|
1793
|
+
return Object.entries(properties).map((entry) => {
|
|
1794
|
+
var _a;
|
|
1795
|
+
const [key] = entry;
|
|
1796
|
+
const props = entry[1];
|
|
1797
|
+
const codeClassname = classNames(classes.code, {
|
|
1798
|
+
[classes.codeRequired]: (_a = input.required) == null ? void 0 : _a.includes(key)
|
|
1799
|
+
});
|
|
1800
|
+
return /* @__PURE__ */ React.createElement(TableRow, { key }, /* @__PURE__ */ React.createElement(TableCell, null, /* @__PURE__ */ React.createElement("div", { className: codeClassname }, key)), /* @__PURE__ */ React.createElement(TableCell, null, props.title), /* @__PURE__ */ React.createElement(TableCell, null, props.description), /* @__PURE__ */ React.createElement(TableCell, null, /* @__PURE__ */ React.createElement(React.Fragment, null, [props.type].flat().map((type) => /* @__PURE__ */ React.createElement(Chip, { label: type, key: type })))));
|
|
1801
|
+
});
|
|
1802
|
+
};
|
|
1803
|
+
const renderTable = (input) => {
|
|
1804
|
+
if (!input.properties) {
|
|
1805
|
+
return void 0;
|
|
1806
|
+
}
|
|
1807
|
+
return /* @__PURE__ */ React.createElement(TableContainer, { component: Paper }, /* @__PURE__ */ React.createElement(Table, { size: "small" }, /* @__PURE__ */ React.createElement(TableHead, null, /* @__PURE__ */ React.createElement(TableRow, null, /* @__PURE__ */ React.createElement(TableCell, null, "Name"), /* @__PURE__ */ React.createElement(TableCell, null, "Title"), /* @__PURE__ */ React.createElement(TableCell, null, "Description"), /* @__PURE__ */ React.createElement(TableCell, null, "Type"))), /* @__PURE__ */ React.createElement(TableBody, null, formatRows(input))));
|
|
1808
|
+
};
|
|
1809
|
+
const renderTables = (name, input) => {
|
|
1810
|
+
if (!input) {
|
|
1811
|
+
return void 0;
|
|
1812
|
+
}
|
|
1813
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Typography, { variant: "h6" }, name), input.map((i, index) => /* @__PURE__ */ React.createElement("div", { key: index }, renderTable(i))));
|
|
1814
|
+
};
|
|
1815
|
+
const items = value == null ? void 0 : value.map((action) => {
|
|
1816
|
+
var _a, _b, _c, _d;
|
|
1817
|
+
if (action.id.startsWith("legacy:")) {
|
|
1818
|
+
return void 0;
|
|
1819
|
+
}
|
|
1820
|
+
const oneOf = renderTables("oneOf", (_b = (_a = action.schema) == null ? void 0 : _a.input) == null ? void 0 : _b.oneOf);
|
|
1821
|
+
return /* @__PURE__ */ React.createElement(Box, { pb: 4, key: action.id }, /* @__PURE__ */ React.createElement(Typography, { variant: "h4", className: classes.code }, action.id), action.description && /* @__PURE__ */ React.createElement(MarkdownContent, { content: action.description }), ((_c = action.schema) == null ? void 0 : _c.input) && /* @__PURE__ */ React.createElement(Box, { pb: 2 }, /* @__PURE__ */ React.createElement(Typography, { variant: "h5" }, "Input"), renderTable(action.schema.input), oneOf), ((_d = action.schema) == null ? void 0 : _d.output) && /* @__PURE__ */ React.createElement(Box, { pb: 2 }, /* @__PURE__ */ React.createElement(Typography, { variant: "h5" }, "Output"), renderTable(action.schema.output)), action.examples && /* @__PURE__ */ React.createElement(Accordion, null, /* @__PURE__ */ React.createElement(AccordionSummary, { expandIcon: /* @__PURE__ */ React.createElement(ExpandMoreIcon, null) }, /* @__PURE__ */ React.createElement(Typography, { variant: "h5" }, "Examples")), /* @__PURE__ */ React.createElement(AccordionDetails, null, /* @__PURE__ */ React.createElement(Box, { pb: 2 }, /* @__PURE__ */ React.createElement(ExamplesTable, { examples: action.examples })))));
|
|
1822
|
+
});
|
|
1823
|
+
return /* @__PURE__ */ React.createElement(Page, { themeId: "home" }, /* @__PURE__ */ React.createElement(
|
|
1824
|
+
Header,
|
|
1825
|
+
{
|
|
1826
|
+
pageTitleOverride: "Create a New Component",
|
|
1827
|
+
title: "Installed actions",
|
|
1828
|
+
subtitle: "This is the collection of all installed actions"
|
|
1829
|
+
}
|
|
1830
|
+
), /* @__PURE__ */ React.createElement(Content, null, items));
|
|
1831
|
+
};
|
|
1832
|
+
|
|
1833
|
+
const useStyles$2 = makeStyles$1(
|
|
1834
|
+
(theme) => ({
|
|
1835
|
+
root: {
|
|
1836
|
+
backgroundColor: "rgba(0, 0, 0, .11)",
|
|
1837
|
+
boxShadow: "none",
|
|
1838
|
+
margin: theme.spacing(1, 0, 1, 0)
|
|
1839
|
+
},
|
|
1840
|
+
title: {
|
|
1841
|
+
margin: theme.spacing(1, 0, 0, 1),
|
|
1842
|
+
textTransform: "uppercase",
|
|
1843
|
+
fontSize: 12,
|
|
1844
|
+
fontWeight: "bold"
|
|
1845
|
+
},
|
|
1846
|
+
listIcon: {
|
|
1847
|
+
minWidth: 30,
|
|
1848
|
+
color: theme.palette.text.primary
|
|
1849
|
+
},
|
|
1850
|
+
menuItem: {
|
|
1851
|
+
minHeight: theme.spacing(6)
|
|
1852
|
+
},
|
|
1853
|
+
groupWrapper: {
|
|
1854
|
+
margin: theme.spacing(1, 1, 2, 1)
|
|
1855
|
+
}
|
|
1856
|
+
}),
|
|
1857
|
+
{
|
|
1858
|
+
name: "ScaffolderReactOwnerListPicker"
|
|
1859
|
+
}
|
|
1860
|
+
);
|
|
1861
|
+
function getFilterGroups() {
|
|
1862
|
+
return [
|
|
1863
|
+
{
|
|
1864
|
+
name: "Task Owner",
|
|
1865
|
+
items: [
|
|
1866
|
+
{
|
|
1867
|
+
id: "owned",
|
|
1868
|
+
label: "Owned",
|
|
1869
|
+
icon: SettingsIcon
|
|
1870
|
+
},
|
|
1871
|
+
{
|
|
1872
|
+
id: "all",
|
|
1873
|
+
label: "All",
|
|
1874
|
+
icon: AllIcon
|
|
1875
|
+
}
|
|
1876
|
+
]
|
|
1877
|
+
}
|
|
1878
|
+
];
|
|
1879
|
+
}
|
|
1880
|
+
const OwnerListPicker = (props) => {
|
|
1881
|
+
const { filter, onSelectOwner } = props;
|
|
1882
|
+
const classes = useStyles$2();
|
|
1883
|
+
const filterGroups = getFilterGroups();
|
|
1884
|
+
return /* @__PURE__ */ React.createElement(Card, { className: classes.root }, filterGroups.map((group) => /* @__PURE__ */ React.createElement(Fragment, { key: group.name }, /* @__PURE__ */ React.createElement(Typography, { variant: "subtitle2", className: classes.title }, group.name), /* @__PURE__ */ React.createElement(Card, { className: classes.groupWrapper }, /* @__PURE__ */ React.createElement(List$1, { disablePadding: true, dense: true }, group.items.map((item) => /* @__PURE__ */ React.createElement(
|
|
1885
|
+
MenuItem$1,
|
|
1886
|
+
{
|
|
1887
|
+
key: item.id,
|
|
1888
|
+
button: true,
|
|
1889
|
+
divider: true,
|
|
1890
|
+
onClick: () => onSelectOwner(item.id),
|
|
1891
|
+
selected: item.id === filter,
|
|
1892
|
+
className: classes.menuItem,
|
|
1893
|
+
"data-testid": `owner-picker-${item.id}`
|
|
1894
|
+
},
|
|
1895
|
+
item.icon && /* @__PURE__ */ React.createElement(ListItemIcon$1, { className: classes.listIcon }, /* @__PURE__ */ React.createElement(item.icon, { fontSize: "small" })),
|
|
1896
|
+
/* @__PURE__ */ React.createElement(ListItemText$1, null, /* @__PURE__ */ React.createElement(Typography, { variant: "body1" }, item.label))
|
|
1897
|
+
)))))));
|
|
1898
|
+
};
|
|
1899
|
+
|
|
1900
|
+
const scaffolderPlugin = createPlugin({
|
|
1901
|
+
id: "scaffolder",
|
|
1902
|
+
apis: [
|
|
1903
|
+
createApiFactory({
|
|
1904
|
+
api: scaffolderApiRef$1,
|
|
1905
|
+
deps: {
|
|
1906
|
+
discoveryApi: discoveryApiRef,
|
|
1907
|
+
scmIntegrationsApi: scmIntegrationsApiRef,
|
|
1908
|
+
fetchApi: fetchApiRef,
|
|
1909
|
+
identityApi: identityApiRef
|
|
1910
|
+
},
|
|
1911
|
+
factory: ({ discoveryApi, scmIntegrationsApi, fetchApi, identityApi }) => new ScaffolderClient({
|
|
1912
|
+
discoveryApi,
|
|
1913
|
+
scmIntegrationsApi,
|
|
1914
|
+
fetchApi,
|
|
1915
|
+
identityApi
|
|
1916
|
+
})
|
|
1917
|
+
})
|
|
1918
|
+
],
|
|
1919
|
+
routes: {
|
|
1920
|
+
root: rootRouteRef$1,
|
|
1921
|
+
selectedTemplate: selectedTemplateRouteRef,
|
|
1922
|
+
ongoingTask: scaffolderTaskRouteRef
|
|
1923
|
+
},
|
|
1924
|
+
externalRoutes: {
|
|
1925
|
+
registerComponent: registerComponentRouteRef,
|
|
1926
|
+
viewTechDoc: viewTechDocRouteRef
|
|
1927
|
+
}
|
|
1928
|
+
});
|
|
1929
|
+
const EntityPickerFieldExtension = scaffolderPlugin.provide(
|
|
1930
|
+
createScaffolderFieldExtension$1({
|
|
1931
|
+
component: EntityPicker,
|
|
1932
|
+
name: "EntityPicker",
|
|
1933
|
+
schema: EntityPickerSchema
|
|
1934
|
+
})
|
|
1935
|
+
);
|
|
1936
|
+
const EntityNamePickerFieldExtension = scaffolderPlugin.provide(
|
|
1937
|
+
createScaffolderFieldExtension$1({
|
|
1938
|
+
component: EntityNamePicker,
|
|
1939
|
+
name: "EntityNamePicker",
|
|
1940
|
+
validation: entityNamePickerValidation,
|
|
1941
|
+
schema: EntityNamePickerSchema
|
|
1942
|
+
})
|
|
1943
|
+
);
|
|
1944
|
+
const RepoUrlPickerFieldExtension = scaffolderPlugin.provide(
|
|
1945
|
+
createScaffolderFieldExtension$1({
|
|
1946
|
+
component: RepoUrlPicker,
|
|
1947
|
+
name: "RepoUrlPicker",
|
|
1948
|
+
validation: repoPickerValidation,
|
|
1949
|
+
schema: RepoUrlPickerSchema
|
|
1950
|
+
})
|
|
1951
|
+
);
|
|
1952
|
+
const OwnerPickerFieldExtension = scaffolderPlugin.provide(
|
|
1953
|
+
createScaffolderFieldExtension$1({
|
|
1954
|
+
component: OwnerPicker,
|
|
1955
|
+
name: "OwnerPicker",
|
|
1956
|
+
schema: OwnerPickerSchema
|
|
1957
|
+
})
|
|
1958
|
+
);
|
|
1959
|
+
const ScaffolderPage = scaffolderPlugin.provide(
|
|
1960
|
+
createRoutableExtension({
|
|
1961
|
+
name: "ScaffolderPage",
|
|
1962
|
+
component: () => import('./Router-e878e04f.esm.js').then((m) => m.Router),
|
|
1963
|
+
mountPoint: rootRouteRef$1
|
|
1964
|
+
})
|
|
1965
|
+
);
|
|
1966
|
+
const OwnedEntityPickerFieldExtension = scaffolderPlugin.provide(
|
|
1967
|
+
createScaffolderFieldExtension$1({
|
|
1968
|
+
component: OwnedEntityPicker,
|
|
1969
|
+
name: "OwnedEntityPicker",
|
|
1970
|
+
schema: OwnedEntityPickerSchema
|
|
1971
|
+
})
|
|
1972
|
+
);
|
|
1973
|
+
const EntityTagsPickerFieldExtension = scaffolderPlugin.provide(
|
|
1974
|
+
createScaffolderFieldExtension$1({
|
|
1975
|
+
component: EntityTagsPicker,
|
|
1976
|
+
name: "EntityTagsPicker",
|
|
1977
|
+
schema: EntityTagsPickerSchema
|
|
1978
|
+
})
|
|
1979
|
+
);
|
|
1980
|
+
const NextScaffolderPage = scaffolderPlugin.provide(
|
|
1981
|
+
createRoutableExtension({
|
|
1982
|
+
name: "NextScaffolderPage",
|
|
1983
|
+
component: () => import('./index-9bea2c47.esm.js').then((m) => m.Router),
|
|
1984
|
+
mountPoint: nextRouteRef
|
|
1985
|
+
})
|
|
1986
|
+
);
|
|
1987
|
+
|
|
1988
|
+
const icon = /* @__PURE__ */ React.createElement(CheckBoxOutlineBlankIcon, { fontSize: "small" });
|
|
1989
|
+
const checkedIcon = /* @__PURE__ */ React.createElement(CheckBoxIcon, { fontSize: "small" });
|
|
1990
|
+
const TemplateTypePicker = () => {
|
|
1991
|
+
const alertApi = useApi(alertApiRef);
|
|
1992
|
+
const { error, loading, availableTypes, selectedTypes, setSelectedTypes } = useEntityTypeFilter();
|
|
1993
|
+
if (loading)
|
|
1994
|
+
return /* @__PURE__ */ React.createElement(Progress, null);
|
|
1995
|
+
if (!availableTypes)
|
|
1996
|
+
return null;
|
|
1997
|
+
if (error) {
|
|
1998
|
+
alertApi.post({
|
|
1999
|
+
message: `Failed to load entity types`,
|
|
2000
|
+
severity: "error"
|
|
2001
|
+
});
|
|
2002
|
+
return null;
|
|
2003
|
+
}
|
|
2004
|
+
return /* @__PURE__ */ React.createElement(Box, { pb: 1, pt: 1 }, /* @__PURE__ */ React.createElement(Typography, { variant: "button" }, "Categories"), /* @__PURE__ */ React.createElement(
|
|
2005
|
+
Autocomplete$1,
|
|
2006
|
+
{
|
|
2007
|
+
multiple: true,
|
|
2008
|
+
"aria-label": "Categories",
|
|
2009
|
+
options: availableTypes,
|
|
2010
|
+
value: selectedTypes,
|
|
2011
|
+
onChange: (_, value) => setSelectedTypes(value),
|
|
2012
|
+
renderOption: (option, { selected }) => /* @__PURE__ */ React.createElement(
|
|
2013
|
+
FormControlLabel,
|
|
2014
|
+
{
|
|
2015
|
+
control: /* @__PURE__ */ React.createElement(
|
|
2016
|
+
Checkbox,
|
|
2017
|
+
{
|
|
2018
|
+
icon,
|
|
2019
|
+
checkedIcon,
|
|
2020
|
+
checked: selected
|
|
2021
|
+
}
|
|
2022
|
+
),
|
|
2023
|
+
label: capitalize(option)
|
|
2024
|
+
}
|
|
2025
|
+
),
|
|
2026
|
+
size: "small",
|
|
2027
|
+
popupIcon: /* @__PURE__ */ React.createElement(ExpandMoreIcon, { "data-testid": "categories-picker-expand" }),
|
|
2028
|
+
renderInput: (params) => /* @__PURE__ */ React.createElement(TextField, { ...params, variant: "outlined" })
|
|
2029
|
+
}
|
|
2030
|
+
));
|
|
2031
|
+
};
|
|
2032
|
+
|
|
1527
2033
|
const TaskErrors = ({ error }) => {
|
|
1528
2034
|
const id = useRef("");
|
|
1529
2035
|
useEffect(() => {
|
|
@@ -1539,7 +2045,7 @@ const TaskErrors = ({ error }) => {
|
|
|
1539
2045
|
)) : null;
|
|
1540
2046
|
};
|
|
1541
2047
|
|
|
1542
|
-
const useStyles$1 = makeStyles({
|
|
2048
|
+
const useStyles$1 = makeStyles$1({
|
|
1543
2049
|
svgIcon: {
|
|
1544
2050
|
display: "inline-block",
|
|
1545
2051
|
"& svg": {
|
|
@@ -1586,7 +2092,7 @@ const TaskPageLinks = ({ output }) => {
|
|
|
1586
2092
|
};
|
|
1587
2093
|
|
|
1588
2094
|
const humanizeDuration = require("humanize-duration");
|
|
1589
|
-
const useStyles = makeStyles
|
|
2095
|
+
const useStyles = makeStyles(
|
|
1590
2096
|
(theme) => createStyles({
|
|
1591
2097
|
root: {
|
|
1592
2098
|
width: "100%"
|
|
@@ -1626,7 +2132,7 @@ const StepTimeTicker = ({ step }) => {
|
|
|
1626
2132
|
}, 1e3);
|
|
1627
2133
|
return /* @__PURE__ */ React.createElement(Typography$1, { variant: "caption" }, time);
|
|
1628
2134
|
};
|
|
1629
|
-
const useStepIconStyles = makeStyles
|
|
2135
|
+
const useStepIconStyles = makeStyles(
|
|
1630
2136
|
(theme) => createStyles({
|
|
1631
2137
|
root: {
|
|
1632
2138
|
color: theme.palette.text.disabled,
|
|
@@ -1673,7 +2179,7 @@ const TaskStatusStepper = memo(
|
|
|
1673
2179
|
const { steps, currentStepId, onUserStepChange } = props;
|
|
1674
2180
|
const classes = useStyles(props);
|
|
1675
2181
|
return /* @__PURE__ */ React.createElement("div", { className: classes.root }, /* @__PURE__ */ React.createElement(
|
|
1676
|
-
Stepper,
|
|
2182
|
+
Stepper$1,
|
|
1677
2183
|
{
|
|
1678
2184
|
activeStep: steps.findIndex((s) => s.id === currentStepId),
|
|
1679
2185
|
orientation: "vertical",
|
|
@@ -1684,8 +2190,8 @@ const TaskStatusStepper = memo(
|
|
|
1684
2190
|
const isFailed = step.status === "failed";
|
|
1685
2191
|
const isActive = step.status === "processing";
|
|
1686
2192
|
const isSkipped = step.status === "skipped";
|
|
1687
|
-
return /* @__PURE__ */ React.createElement(Step, { key: String(index), expanded: true }, /* @__PURE__ */ React.createElement(StepButton, { onClick: () => onUserStepChange(step.id) }, /* @__PURE__ */ React.createElement(
|
|
1688
|
-
StepLabel,
|
|
2193
|
+
return /* @__PURE__ */ React.createElement(Step$1, { key: String(index), expanded: true }, /* @__PURE__ */ React.createElement(StepButton, { onClick: () => onUserStepChange(step.id) }, /* @__PURE__ */ React.createElement(
|
|
2194
|
+
StepLabel$1,
|
|
1689
2195
|
{
|
|
1690
2196
|
StepIconProps: {
|
|
1691
2197
|
completed: isCompleted,
|
|
@@ -1809,5 +2315,5 @@ const scaffolderApiRef = scaffolderApiRef$1;
|
|
|
1809
2315
|
const createScaffolderLayout = createScaffolderLayout$1;
|
|
1810
2316
|
const ScaffolderLayouts = ScaffolderLayouts$1;
|
|
1811
2317
|
|
|
1812
|
-
export {
|
|
1813
|
-
//# sourceMappingURL=index-
|
|
2318
|
+
export { createScaffolderFieldExtension as $, ActionsPage as A, nextScaffolderTaskRouteRef as B, ContextMenu$1 as C, nextActionsRouteRef as D, EntityPicker as E, nextScaffolderListTaskRouteRef as F, OngoingTask as G, EntityPickerFieldExtension as H, EntityNamePickerFieldExtension as I, EntityTagsPickerFieldExtension as J, OwnerPickerFieldExtension as K, OwnedEntityPickerFieldExtension as L, RepoUrlPickerFieldExtension as M, ScaffolderPage as N, OwnerPicker as O, scaffolderPlugin as P, NextScaffolderPage as Q, RepoUrlPicker as R, ScaffolderClient as S, TemplateTypePicker as T, makeFieldSchemaFromZod as U, EntityPickerFieldSchema as V, OwnerPickerFieldSchema as W, RepoUrlPickerFieldSchema as X, OwnedEntityPickerFieldSchema as Y, EntityTagsPickerFieldSchema as Z, rootRouteRef as _, actionsRouteRef as a, ScaffolderFieldExtensions as a0, useTemplateSecrets as a1, scaffolderApiRef as a2, createScaffolderLayout as a3, ScaffolderLayouts as a4, scaffolderListTaskRouteRef as b, scaffolderTaskRouteRef as c, rootRouteRef$1 as d, editRouteRef as e, TaskStatusStepper as f, TaskPageLinks as g, TaskPage as h, EntityPickerSchema as i, EntityNamePicker as j, entityNamePickerValidation as k, legacySelectedTemplateRouteRef as l, EntityNamePickerSchema as m, EntityTagsPicker as n, EntityTagsPickerSchema as o, repoPickerValidation as p, RepoUrlPickerSchema as q, registerComponentRouteRef as r, selectedTemplateRouteRef as s, OwnerPickerSchema as t, OwnedEntityPicker as u, viewTechDocRouteRef as v, OwnedEntityPickerSchema as w, OwnerListPicker as x, nextSelectedTemplateRouteRef as y, nextRouteRef as z };
|
|
2319
|
+
//# sourceMappingURL=index-02b0e824.esm.js.map
|