@backstage/plugin-scaffolder 1.12.0-next.2 → 1.13.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/alpha/package.json +1 -1
  3. package/dist/alpha.d.ts +32 -21
  4. package/dist/alpha.esm.js +13 -21
  5. package/dist/alpha.esm.js.map +1 -1
  6. package/dist/esm/alpha/{ListTasksPage-2e8f4176.esm.js → ListTasksPage-a9fab591.esm.js} +2 -2
  7. package/dist/esm/alpha/{ListTasksPage-2e8f4176.esm.js.map → ListTasksPage-a9fab591.esm.js.map} +1 -1
  8. package/dist/esm/alpha/{Router-2826a2b8.esm.js → Router-ea3122d2.esm.js} +24 -9
  9. package/dist/esm/alpha/Router-ea3122d2.esm.js.map +1 -0
  10. package/dist/esm/alpha/{alpha-714dad1b.esm.js → alpha-0764fae7.esm.js} +243 -255
  11. package/dist/esm/alpha/alpha-0764fae7.esm.js.map +1 -0
  12. package/dist/esm/alpha/{index-2131f4a0.esm.js → index-d45f106a.esm.js} +79 -142
  13. package/dist/esm/alpha/index-d45f106a.esm.js.map +1 -0
  14. package/dist/esm/index/ListTasksPage-64779a2d.esm.js +1310 -0
  15. package/dist/esm/index/ListTasksPage-64779a2d.esm.js.map +1 -0
  16. package/dist/esm/index/{Router-6fd61bff.esm.js → Router-f32000f9.esm.js} +42 -33
  17. package/dist/esm/index/Router-f32000f9.esm.js.map +1 -0
  18. package/dist/esm/index/index-8321766a.esm.js +1741 -0
  19. package/dist/esm/index/index-8321766a.esm.js.map +1 -0
  20. package/dist/esm/index/index-e3edaa49.esm.js +991 -0
  21. package/dist/esm/index/index-e3edaa49.esm.js.map +1 -0
  22. package/dist/index.d.ts +25 -5
  23. package/dist/index.esm.js +9 -59
  24. package/dist/index.esm.js.map +1 -1
  25. package/package.json +23 -23
  26. package/dist/esm/alpha/Router-2826a2b8.esm.js.map +0 -1
  27. package/dist/esm/alpha/alpha-714dad1b.esm.js.map +0 -1
  28. package/dist/esm/alpha/index-2131f4a0.esm.js.map +0 -1
  29. package/dist/esm/index/ListTasksPage-fa403ee3.esm.js +0 -192
  30. package/dist/esm/index/ListTasksPage-fa403ee3.esm.js.map +0 -1
  31. package/dist/esm/index/Router-6fd61bff.esm.js.map +0 -1
  32. package/dist/esm/index/index-0b6cdf44.esm.js +0 -3475
  33. package/dist/esm/index/index-0b6cdf44.esm.js.map +0 -1
  34. package/dist/esm/index/index-f404fb0b.esm.js +0 -449
  35. package/dist/esm/index/index-f404fb0b.esm.js.map +0 -1
@@ -1,12 +1,13 @@
1
1
  import { scmIntegrationsApiRef, scmAuthApiRef } from '@backstage/integration-react';
2
- import { scaffolderApiRef, useTemplateSecrets, useTaskEventStream, createScaffolderFieldExtension } from '@backstage/plugin-scaffolder-react';
2
+ import { scaffolderApiRef, useTemplateSecrets, createScaffolderFieldExtension, useTaskEventStream } from '@backstage/plugin-scaffolder-react';
3
3
  import { parseEntityRef, stringifyEntityRef, KubernetesValidatorFunctions, RELATION_OWNED_BY, makeValidator } from '@backstage/catalog-model';
4
4
  import { ResponseError } from '@backstage/errors';
5
5
  import qs from 'qs';
6
6
  import ObservableImpl from 'zen-observable';
7
- import { useApi, identityApiRef, createExternalRouteRef, createRouteRef, createSubRouteRef, useRouteRef, useApiHolder, useApp, useRouteRefParams, alertApiRef, createPlugin, createApiFactory, discoveryApiRef, fetchApiRef, createRoutableExtension } from '@backstage/core-plugin-api';
7
+ import { CATALOG_FILTER_EXISTS } from '@backstage/catalog-client';
8
+ import { useApi, identityApiRef, createExternalRouteRef, createRouteRef, createSubRouteRef, createPlugin, createApiFactory, discoveryApiRef, fetchApiRef, createRoutableExtension, useRouteRef, useApiHolder, useApp, useRouteRefParams, alertApiRef } from '@backstage/core-plugin-api';
8
9
  import { catalogApiRef, humanizeEntityRef, entityRouteRef } from '@backstage/plugin-catalog-react';
9
- import { TextField, FormControl as FormControl$1, makeStyles as makeStyles$1, IconButton as IconButton$1, Popover as Popover$1, MenuList as MenuList$1, MenuItem as MenuItem$1, ListItemIcon as ListItemIcon$1, ListItemText as ListItemText$1, Box, Paper, Typography, Accordion, AccordionSummary, AccordionDetails, Grid, TableContainer, Table, TableHead, TableRow, TableCell, TableBody, Chip, Card, List as List$1, InputLabel as InputLabel$1, Select as Select$1, CardHeader, CardContent, Button, StepButton, CircularProgress, Tooltip, Divider as Divider$1, LinearProgress } from '@material-ui/core';
10
+ import { TextField, FormControl as FormControl$1, makeStyles, IconButton, Popover, MenuList, MenuItem, ListItemIcon, ListItemText, Box, Paper, Typography, Accordion, AccordionSummary, AccordionDetails, Grid, TableContainer, Table, TableHead, TableRow, TableCell, TableBody, Chip, Card, List, InputLabel as InputLabel$1, Select as Select$1, CardHeader, CardContent, Button, StepButton, CircularProgress, Tooltip, Divider as Divider$1, LinearProgress } from '@material-ui/core';
10
11
  import FormControl from '@material-ui/core/FormControl';
11
12
  import Autocomplete from '@material-ui/lab/Autocomplete';
12
13
  import React, { useCallback, useEffect, useState, useMemo, Fragment, createContext, useRef, useContext, Component, memo, Children } from 'react';
@@ -20,31 +21,21 @@ import { Select, Progress, Page, Header, Content, ErrorPanel, ErrorPage, Markdow
20
21
  import useDebounce from 'react-use/lib/useDebounce';
21
22
  import useEffectOnce from 'react-use/lib/useEffectOnce';
22
23
  import { Autocomplete as Autocomplete$1 } from '@material-ui/lab';
23
- import { useNavigate, useParams } from 'react-router-dom';
24
- import 'lodash/capitalize';
25
- import '@material-ui/icons/CheckBox';
26
- import '@material-ui/icons/CheckBoxOutlineBlank';
27
- import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
24
+ import { useParams, useNavigate } from 'react-router-dom';
25
+ import { DefaultTemplateOutputs, TaskSteps, TaskLogStream, Stepper, Form } from '@backstage/plugin-scaffolder-react/alpha';
28
26
  import '@material-ui/core/Button';
29
- import IconButton from '@material-ui/core/IconButton';
27
+ import IconButton$1 from '@material-ui/core/IconButton';
30
28
  import '@material-ui/core/useMediaQuery';
31
29
  import '@material-ui/icons/AddCircleOutline';
32
30
  import '@backstage/plugin-catalog-common/alpha';
33
31
  import '@backstage/plugin-permission-react';
34
- import { DefaultTemplateOutputs, TaskSteps, TaskLogStream, Stepper, Form } from '@backstage/plugin-scaffolder-react/alpha';
35
- import ListItemIcon from '@material-ui/core/ListItemIcon';
36
- import ListItemText from '@material-ui/core/ListItemText';
37
- import MenuItem from '@material-ui/core/MenuItem';
38
- import MenuList from '@material-ui/core/MenuList';
39
- import Popover from '@material-ui/core/Popover';
40
- import { makeStyles, createStyles } from '@material-ui/core/styles';
41
- import Description from '@material-ui/icons/Description';
42
- import Edit from '@material-ui/icons/Edit';
43
- import List from '@material-ui/icons/List';
44
- import MoreVert from '@material-ui/icons/MoreVert';
32
+ import { useAsync as useAsync$1, useRerender, usePrevious, useKeyboardEvent } from '@react-hookz/web';
33
+ import Cancel from '@material-ui/icons/Cancel';
45
34
  import Retry from '@material-ui/icons/Repeat';
46
35
  import Toc from '@material-ui/icons/Toc';
36
+ import MoreVert from '@material-ui/icons/MoreVert';
47
37
  import classNames from 'classnames';
38
+ import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
48
39
  import SettingsIcon from '@material-ui/icons/Settings';
49
40
  import AllIcon from '@material-ui/icons/FontDownload';
50
41
  import { DateTime, Interval } from 'luxon';
@@ -55,17 +46,18 @@ import { yaml as yaml$1 } from '@codemirror/legacy-modes/mode/yaml';
55
46
  import CloseIcon from '@material-ui/icons/Close';
56
47
  import CodeMirror from '@uiw/react-codemirror';
57
48
  import yaml from 'yaml';
58
- import { useAsync as useAsync$1, useRerender, usePrevious, useKeyboardEvent } from '@react-hookz/web';
49
+ import { makeStyles as makeStyles$1, createStyles } from '@material-ui/core/styles';
59
50
  import validator from '@rjsf/validator-ajv8';
60
51
  import Accordion$1 from '@material-ui/core/Accordion';
61
52
  import AccordionDetails$1 from '@material-ui/core/AccordionDetails';
62
53
  import AccordionSummary$1 from '@material-ui/core/AccordionSummary';
63
54
  import Divider from '@material-ui/core/Divider';
64
55
  import ExpandMoreIcon$1 from '@material-ui/icons/ExpandLess';
65
- import List$2 from '@material-ui/core/List';
56
+ import List$1 from '@material-ui/core/List';
66
57
  import ListItem from '@material-ui/core/ListItem';
58
+ import ListItemIcon$1 from '@material-ui/core/ListItemIcon';
67
59
  import ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction';
68
- import CancelIcon from '@material-ui/icons/Cancel';
60
+ import ListItemText$1 from '@material-ui/core/ListItemText';
69
61
  import CheckIcon from '@material-ui/icons/Check';
70
62
  import DeleteIcon from '@material-ui/icons/Delete';
71
63
  import Box$1 from '@material-ui/core/Box';
@@ -216,8 +208,7 @@ class ScaffolderClient {
216
208
  const url = `${baseUrl}/v2/tasks/${encodeURIComponent(
217
209
  taskId
218
210
  )}/eventstream`;
219
- const eventSource = new EventSource(url, { withCredentials: true });
220
- eventSource.addEventListener("log", (event) => {
211
+ const processEvent = (event) => {
221
212
  if (event.data) {
222
213
  try {
223
214
  subscriber.next(JSON.parse(event.data));
@@ -225,15 +216,12 @@ class ScaffolderClient {
225
216
  subscriber.error(ex);
226
217
  }
227
218
  }
228
- });
219
+ };
220
+ const eventSource = new EventSource(url, { withCredentials: true });
221
+ eventSource.addEventListener("log", processEvent);
222
+ eventSource.addEventListener("cancelled", processEvent);
229
223
  eventSource.addEventListener("completion", (event) => {
230
- if (event.data) {
231
- try {
232
- subscriber.next(JSON.parse(event.data));
233
- } catch (ex) {
234
- subscriber.error(ex);
235
- }
236
- }
224
+ processEvent(event);
237
225
  eventSource.close();
238
226
  subscriber.complete();
239
227
  });
@@ -284,6 +272,17 @@ class ScaffolderClient {
284
272
  }
285
273
  return await response.json();
286
274
  }
275
+ async cancelTask(taskId) {
276
+ const baseUrl = await this.discoveryApi.getBaseUrl("scaffolder");
277
+ const url = `${baseUrl}/v2/tasks/${encodeURIComponent(taskId)}/cancel`;
278
+ const response = await this.fetchApi.fetch(url, {
279
+ method: "POST"
280
+ });
281
+ if (!response.ok) {
282
+ throw await ResponseError.fromResponse(response);
283
+ }
284
+ return await response.json();
285
+ }
287
286
  }
288
287
 
289
288
  function makeFieldSchemaFromZod(returnSchema, uiOptionsSchema) {
@@ -298,7 +297,7 @@ function makeFieldSchemaFromZod(returnSchema, uiOptionsSchema) {
298
297
  }
299
298
 
300
299
  const entityQueryFilterExpressionSchema = z.record(
301
- z.string().or(z.array(z.string()))
300
+ z.string().or(z.object({ exists: z.boolean().optional() })).or(z.array(z.string()))
302
301
  );
303
302
  const EntityPickerFieldSchema = makeFieldSchemaFromZod(
304
303
  z.string(),
@@ -322,7 +321,7 @@ const EntityPickerFieldSchema = makeFieldSchemaFromZod(
322
321
  const EntityPickerSchema = EntityPickerFieldSchema.schema;
323
322
 
324
323
  const EntityPicker = (props) => {
325
- var _a, _b, _c, _d, _e, _f, _g;
324
+ var _a, _b, _c, _d, _e;
326
325
  const {
327
326
  onChange,
328
327
  schema: { title = "Entity", description = "An entity from the catalog" },
@@ -332,10 +331,9 @@ const EntityPicker = (props) => {
332
331
  formData,
333
332
  idSchema
334
333
  } = props;
335
- const allowedKinds = (_a = uiSchema["ui:options"]) == null ? void 0 : _a.allowedKinds;
336
- const catalogFilter = ((_b = uiSchema["ui:options"]) == null ? void 0 : _b.catalogFilter) || allowedKinds && { kind: allowedKinds };
337
- const defaultKind = (_c = uiSchema["ui:options"]) == null ? void 0 : _c.defaultKind;
338
- const defaultNamespace = ((_d = uiSchema["ui:options"]) == null ? void 0 : _d.defaultNamespace) || void 0;
334
+ const catalogFilter = buildCatalogFilter(uiSchema);
335
+ const defaultKind = (_a = uiSchema["ui:options"]) == null ? void 0 : _a.defaultKind;
336
+ const defaultNamespace = ((_b = uiSchema["ui:options"]) == null ? void 0 : _b.defaultNamespace) || void 0;
339
337
  const catalogApi = useApi(catalogApiRef);
340
338
  const { value: entities, loading } = useAsync(async () => {
341
339
  const { items } = await catalogApi.getEntities(
@@ -343,7 +341,7 @@ const EntityPicker = (props) => {
343
341
  );
344
342
  return items;
345
343
  });
346
- const allowArbitraryValues = (_f = (_e = uiSchema["ui:options"]) == null ? void 0 : _e.allowArbitraryValues) != null ? _f : true;
344
+ const allowArbitraryValues = (_d = (_c = uiSchema["ui:options"]) == null ? void 0 : _c.allowArbitraryValues) != null ? _d : true;
347
345
  const getLabel = useCallback(
348
346
  (ref) => {
349
347
  try {
@@ -404,7 +402,7 @@ const EntityPicker = (props) => {
404
402
  value: (
405
403
  // Since free solo can be enabled, attempt to parse as a full entity ref first, then fall
406
404
  // back to the given value.
407
- (_g = entities == null ? void 0 : entities.find((e) => stringifyEntityRef(e) === formData)) != null ? _g : allowArbitraryValues && formData ? getLabel(formData) : ""
405
+ (_e = entities == null ? void 0 : entities.find((e) => stringifyEntityRef(e) === formData)) != null ? _e : allowArbitraryValues && formData ? getLabel(formData) : ""
408
406
  ),
409
407
  loading,
410
408
  onChange: onSelect,
@@ -432,6 +430,35 @@ const EntityPicker = (props) => {
432
430
  )
433
431
  );
434
432
  };
433
+ function convertOpsValues(value) {
434
+ if (typeof value === "object" && value.exists) {
435
+ return CATALOG_FILTER_EXISTS;
436
+ }
437
+ return value == null ? void 0 : value.toString();
438
+ }
439
+ function convertSchemaFiltersToQuery(schemaFilters) {
440
+ const query = {};
441
+ for (const [key, value] of Object.entries(schemaFilters)) {
442
+ if (Array.isArray(value)) {
443
+ query[key] = value;
444
+ } else {
445
+ query[key] = convertOpsValues(value);
446
+ }
447
+ }
448
+ return query;
449
+ }
450
+ function buildCatalogFilter(uiSchema) {
451
+ var _a, _b;
452
+ const allowedKinds = (_a = uiSchema["ui:options"]) == null ? void 0 : _a.allowedKinds;
453
+ const catalogFilter = ((_b = uiSchema["ui:options"]) == null ? void 0 : _b.catalogFilter) || allowedKinds && { kind: allowedKinds };
454
+ if (!catalogFilter) {
455
+ return void 0;
456
+ }
457
+ if (Array.isArray(catalogFilter)) {
458
+ return catalogFilter.map(convertSchemaFiltersToQuery);
459
+ }
460
+ return convertSchemaFiltersToQuery(catalogFilter);
461
+ }
435
462
 
436
463
  const entityNamePickerValidation = (value, validation) => {
437
464
  if (!KubernetesValidatorFunctions.isValidObjectName(value)) {
@@ -1312,95 +1339,114 @@ const editRouteRef = createSubRouteRef({
1312
1339
  path: "/edit"
1313
1340
  });
1314
1341
 
1315
- const nextRouteRef = createRouteRef({
1316
- id: "scaffolder/next"
1317
- });
1318
- const nextSelectedTemplateRouteRef = createSubRouteRef({
1319
- id: "scaffolder/next/selected-template",
1320
- parent: nextRouteRef,
1321
- path: "/templates/:namespace/:templateName"
1322
- });
1323
- const nextScaffolderTaskRouteRef = createSubRouteRef({
1324
- id: "scaffolder/next/task",
1325
- parent: nextRouteRef,
1326
- path: "/tasks/:taskId"
1327
- });
1328
- const nextScaffolderListTaskRouteRef = createSubRouteRef({
1329
- id: "scaffolder/next/list-tasks",
1330
- parent: nextRouteRef,
1331
- path: "/tasks"
1332
- });
1333
- const nextActionsRouteRef = createSubRouteRef({
1334
- id: "scaffolder/next/actions",
1335
- parent: nextRouteRef,
1336
- path: "/actions"
1337
- });
1338
- const nextEditRouteRef = createSubRouteRef({
1339
- id: "scaffolder/next/edit",
1340
- parent: nextRouteRef,
1341
- path: "/edit"
1342
- });
1343
-
1344
- const useStyles$i = makeStyles((theme) => ({
1345
- button: {
1346
- color: theme.page.fontColor
1347
- }
1348
- }));
1349
- function ContextMenu$1(props) {
1350
- const classes = useStyles$i();
1351
- const [anchorEl, setAnchorEl] = useState();
1352
- const editLink = useRouteRef(nextEditRouteRef);
1353
- const actionsLink = useRouteRef(nextActionsRouteRef);
1354
- const tasksLink = useRouteRef(nextScaffolderListTaskRouteRef);
1355
- const navigate = useNavigate();
1356
- const showEditor = props.editor !== false;
1357
- const showActions = props.actions !== false;
1358
- const showTasks = props.tasks !== false;
1359
- if (!showEditor && !showActions) {
1360
- return null;
1342
+ const scaffolderPlugin = createPlugin({
1343
+ id: "scaffolder",
1344
+ apis: [
1345
+ createApiFactory({
1346
+ api: scaffolderApiRef,
1347
+ deps: {
1348
+ discoveryApi: discoveryApiRef,
1349
+ scmIntegrationsApi: scmIntegrationsApiRef,
1350
+ fetchApi: fetchApiRef,
1351
+ identityApi: identityApiRef
1352
+ },
1353
+ factory: ({ discoveryApi, scmIntegrationsApi, fetchApi, identityApi }) => new ScaffolderClient({
1354
+ discoveryApi,
1355
+ scmIntegrationsApi,
1356
+ fetchApi,
1357
+ identityApi
1358
+ })
1359
+ })
1360
+ ],
1361
+ routes: {
1362
+ root: rootRouteRef,
1363
+ selectedTemplate: selectedTemplateRouteRef,
1364
+ ongoingTask: scaffolderTaskRouteRef,
1365
+ actions: actionsRouteRef,
1366
+ listTasks: scaffolderListTaskRouteRef,
1367
+ edit: editRouteRef
1368
+ },
1369
+ externalRoutes: {
1370
+ registerComponent: registerComponentRouteRef,
1371
+ viewTechDoc: viewTechDocRouteRef
1361
1372
  }
1362
- const onOpen = (event) => {
1363
- setAnchorEl(event.currentTarget);
1364
- };
1365
- const onClose = () => {
1366
- setAnchorEl(void 0);
1367
- };
1368
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
1369
- IconButton,
1370
- {
1371
- "aria-label": "more",
1372
- "aria-controls": "long-menu",
1373
- "aria-haspopup": "true",
1374
- onClick: onOpen,
1375
- "data-testid": "menu-button",
1376
- color: "inherit",
1377
- className: classes.button
1378
- },
1379
- /* @__PURE__ */ React.createElement(MoreVert, null)
1380
- ), /* @__PURE__ */ React.createElement(
1381
- Popover,
1382
- {
1383
- open: Boolean(anchorEl),
1384
- onClose,
1385
- anchorEl,
1386
- anchorOrigin: { vertical: "bottom", horizontal: "right" },
1387
- transformOrigin: { vertical: "top", horizontal: "right" }
1388
- },
1389
- /* @__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" })))
1390
- ));
1391
- }
1373
+ });
1374
+ scaffolderPlugin.provide(
1375
+ createScaffolderFieldExtension({
1376
+ component: EntityPicker,
1377
+ name: "EntityPicker",
1378
+ schema: EntityPickerSchema
1379
+ })
1380
+ );
1381
+ scaffolderPlugin.provide(
1382
+ createScaffolderFieldExtension({
1383
+ component: EntityNamePicker,
1384
+ name: "EntityNamePicker",
1385
+ validation: entityNamePickerValidation,
1386
+ schema: EntityNamePickerSchema
1387
+ })
1388
+ );
1389
+ scaffolderPlugin.provide(
1390
+ createScaffolderFieldExtension({
1391
+ component: RepoUrlPicker,
1392
+ name: "RepoUrlPicker",
1393
+ validation: repoPickerValidation,
1394
+ schema: RepoUrlPickerSchema
1395
+ })
1396
+ );
1397
+ scaffolderPlugin.provide(
1398
+ createScaffolderFieldExtension({
1399
+ component: OwnerPicker,
1400
+ name: "OwnerPicker",
1401
+ schema: OwnerPickerSchema
1402
+ })
1403
+ );
1404
+ scaffolderPlugin.provide(
1405
+ createRoutableExtension({
1406
+ name: "ScaffolderPage",
1407
+ component: () => import('./Router-ea3122d2.esm.js').then((m) => m.Router),
1408
+ mountPoint: rootRouteRef
1409
+ })
1410
+ );
1411
+ scaffolderPlugin.provide(
1412
+ createScaffolderFieldExtension({
1413
+ component: OwnedEntityPicker,
1414
+ name: "OwnedEntityPicker",
1415
+ schema: OwnedEntityPickerSchema
1416
+ })
1417
+ );
1418
+ scaffolderPlugin.provide(
1419
+ createScaffolderFieldExtension({
1420
+ component: EntityTagsPicker,
1421
+ name: "EntityTagsPicker",
1422
+ schema: EntityTagsPickerSchema
1423
+ })
1424
+ );
1425
+ const NextScaffolderPage = scaffolderPlugin.provide(
1426
+ createRoutableExtension({
1427
+ name: "NextScaffolderPage",
1428
+ component: () => import('./index-d45f106a.esm.js').then((m) => m.Router),
1429
+ mountPoint: rootRouteRef
1430
+ })
1431
+ );
1392
1432
 
1393
- const useStyles$h = makeStyles$1((theme) => ({
1433
+ const useStyles$h = makeStyles((theme) => ({
1394
1434
  button: {
1395
1435
  color: theme.palette.common.white
1396
1436
  }
1397
1437
  }));
1398
1438
  const ContextMenu = (props) => {
1399
- const { logsVisible, onToggleLogs, onStartOver } = props;
1439
+ const { cancelEnabled, logsVisible, onStartOver, onToggleLogs, taskId } = props;
1400
1440
  const classes = useStyles$h();
1441
+ const scaffolderApi = useApi(scaffolderApiRef);
1401
1442
  const [anchorEl, setAnchorEl] = useState();
1443
+ const [{ status: cancelStatus }, { execute: cancel }] = useAsync$1(async () => {
1444
+ if (taskId) {
1445
+ await scaffolderApi.cancelTask(taskId);
1446
+ }
1447
+ });
1402
1448
  return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
1403
- IconButton$1,
1449
+ IconButton,
1404
1450
  {
1405
1451
  "aria-label": "more",
1406
1452
  "aria-controls": "long-menu",
@@ -1414,7 +1460,7 @@ const ContextMenu = (props) => {
1414
1460
  },
1415
1461
  /* @__PURE__ */ React.createElement(MoreVert, null)
1416
1462
  ), /* @__PURE__ */ React.createElement(
1417
- Popover$1,
1463
+ Popover,
1418
1464
  {
1419
1465
  open: Boolean(anchorEl),
1420
1466
  onClose: () => setAnchorEl(void 0),
@@ -1422,11 +1468,20 @@ const ContextMenu = (props) => {
1422
1468
  anchorOrigin: { vertical: "bottom", horizontal: "right" },
1423
1469
  transformOrigin: { vertical: "top", horizontal: "right" }
1424
1470
  },
1425
- /* @__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" })))
1471
+ /* @__PURE__ */ React.createElement(MenuList, null, /* @__PURE__ */ React.createElement(MenuItem, { onClick: () => onToggleLogs == null ? void 0 : onToggleLogs(!logsVisible) }, /* @__PURE__ */ React.createElement(ListItemIcon, null, /* @__PURE__ */ React.createElement(Toc, { fontSize: "small" })), /* @__PURE__ */ React.createElement(ListItemText, { primary: logsVisible ? "Hide Logs" : "Show Logs" })), /* @__PURE__ */ React.createElement(MenuItem, { onClick: onStartOver }, /* @__PURE__ */ React.createElement(ListItemIcon, null, /* @__PURE__ */ React.createElement(Retry, { fontSize: "small" })), /* @__PURE__ */ React.createElement(ListItemText, { primary: "Start Over" })), /* @__PURE__ */ React.createElement(
1472
+ MenuItem,
1473
+ {
1474
+ onClick: cancel,
1475
+ disabled: !cancelEnabled || cancelStatus !== "not-executed",
1476
+ "data-testid": "cancel-task"
1477
+ },
1478
+ /* @__PURE__ */ React.createElement(ListItemIcon, null, /* @__PURE__ */ React.createElement(Cancel, { fontSize: "small" })),
1479
+ /* @__PURE__ */ React.createElement(ListItemText, { primary: "Cancel" })
1480
+ ))
1426
1481
  ));
1427
1482
  };
1428
1483
 
1429
- const useStyles$g = makeStyles$1({
1484
+ const useStyles$g = makeStyles({
1430
1485
  contentWrapper: {
1431
1486
  display: "flex",
1432
1487
  flexDirection: "column"
@@ -1435,7 +1490,7 @@ const useStyles$g = makeStyles$1({
1435
1490
  const OngoingTask = (props) => {
1436
1491
  var _a, _b, _c, _d, _e, _f, _g, _h;
1437
1492
  const { taskId } = useParams();
1438
- const templateRouteRef = useRouteRef(nextSelectedTemplateRouteRef);
1493
+ const templateRouteRef = useRouteRef(selectedTemplateRouteRef);
1439
1494
  const navigate = useNavigate();
1440
1495
  const taskStream = useTaskEventStream(taskId);
1441
1496
  const classes = useStyles$g();
@@ -1488,6 +1543,7 @@ const OngoingTask = (props) => {
1488
1543
  ]);
1489
1544
  const Outputs = (_e = props.TemplateOutputsComponent) != null ? _e : DefaultTemplateOutputs;
1490
1545
  const templateName = (_h = (_g = (_f = taskStream.task) == null ? void 0 : _f.spec.templateInfo) == null ? void 0 : _g.entity) == null ? void 0 : _h.metadata.name;
1546
+ const cancelEnabled = !(taskStream.cancelled || taskStream.completed);
1491
1547
  return /* @__PURE__ */ React.createElement(Page, { themeId: "website" }, /* @__PURE__ */ React.createElement(
1492
1548
  Header,
1493
1549
  {
@@ -1498,9 +1554,11 @@ const OngoingTask = (props) => {
1498
1554
  /* @__PURE__ */ React.createElement(
1499
1555
  ContextMenu,
1500
1556
  {
1501
- onToggleLogs: setLogVisibleState,
1557
+ cancelEnabled,
1558
+ logsVisible,
1502
1559
  onStartOver: startOver,
1503
- logsVisible
1560
+ onToggleLogs: setLogVisibleState,
1561
+ taskId
1504
1562
  }
1505
1563
  )
1506
1564
  ), /* @__PURE__ */ React.createElement(Content, { className: classes.contentWrapper }, taskStream.error ? /* @__PURE__ */ React.createElement(Box, { paddingBottom: 2 }, /* @__PURE__ */ React.createElement(
@@ -1520,7 +1578,7 @@ const OngoingTask = (props) => {
1520
1578
  )), /* @__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));
1521
1579
  };
1522
1580
 
1523
- const useStyles$f = makeStyles$1((theme) => ({
1581
+ const useStyles$f = makeStyles((theme) => ({
1524
1582
  code: {
1525
1583
  fontFamily: "Menlo, monospace",
1526
1584
  padding: theme.spacing(1),
@@ -1617,7 +1675,7 @@ const ActionsPage = () => {
1617
1675
  ), /* @__PURE__ */ React.createElement(Content, null, items));
1618
1676
  };
1619
1677
 
1620
- const useStyles$e = makeStyles$1(
1678
+ const useStyles$e = makeStyles(
1621
1679
  (theme) => ({
1622
1680
  root: {
1623
1681
  backgroundColor: "rgba(0, 0, 0, .11)",
@@ -1668,8 +1726,8 @@ const OwnerListPicker = (props) => {
1668
1726
  const { filter, onSelectOwner } = props;
1669
1727
  const classes = useStyles$e();
1670
1728
  const filterGroups = getFilterGroups();
1671
- 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(
1672
- MenuItem$1,
1729
+ 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, { disablePadding: true, dense: true }, group.items.map((item) => /* @__PURE__ */ React.createElement(
1730
+ MenuItem,
1673
1731
  {
1674
1732
  key: item.id,
1675
1733
  button: true,
@@ -1679,8 +1737,8 @@ const OwnerListPicker = (props) => {
1679
1737
  className: classes.menuItem,
1680
1738
  "data-testid": `owner-picker-${item.id}`
1681
1739
  },
1682
- item.icon && /* @__PURE__ */ React.createElement(ListItemIcon$1, { className: classes.listIcon }, /* @__PURE__ */ React.createElement(item.icon, { fontSize: "small" })),
1683
- /* @__PURE__ */ React.createElement(ListItemText$1, null, /* @__PURE__ */ React.createElement(Typography, { variant: "body1" }, item.label))
1740
+ item.icon && /* @__PURE__ */ React.createElement(ListItemIcon, { className: classes.listIcon }, /* @__PURE__ */ React.createElement(item.icon, { fontSize: "small" })),
1741
+ /* @__PURE__ */ React.createElement(ListItemText, null, /* @__PURE__ */ React.createElement(Typography, { variant: "body1" }, item.label))
1684
1742
  )))))));
1685
1743
  };
1686
1744
 
@@ -2015,7 +2073,7 @@ function DirectoryEditorProvider(props) {
2015
2073
  return /* @__PURE__ */ React.createElement(DirectoryEditorContext.Provider, { value: result }, props.children);
2016
2074
  }
2017
2075
 
2018
- const useStyles$d = makeStyles({
2076
+ const useStyles$d = makeStyles$1({
2019
2077
  containerWrapper: {
2020
2078
  position: "relative",
2021
2079
  width: "100%",
@@ -2161,7 +2219,7 @@ function TemplateEditorFormDirectoryEditorDryRun(props) {
2161
2219
  }
2162
2220
  TemplateEditorForm.DirectoryEditorDryRun = TemplateEditorFormDirectoryEditorDryRun;
2163
2221
 
2164
- const useStyles$c = makeStyles$1((theme) => ({
2222
+ const useStyles$c = makeStyles((theme) => ({
2165
2223
  root: {
2166
2224
  gridArea: "pageContent",
2167
2225
  display: "grid",
@@ -2243,8 +2301,8 @@ const CustomFieldExplorer = ({
2243
2301
  labelId: "select-field-label",
2244
2302
  onChange: (e) => handleSelectionChange(e.target.value)
2245
2303
  },
2246
- fieldOptions.map((option, idx) => /* @__PURE__ */ React.createElement(MenuItem$1, { key: idx, value: option }, option.name))
2247
- )), /* @__PURE__ */ React.createElement(IconButton$1, { size: "medium", onClick: onClose }, /* @__PURE__ */ React.createElement(CloseIcon, null))), /* @__PURE__ */ React.createElement("div", { className: classes.fieldForm }, /* @__PURE__ */ React.createElement(Card, null, /* @__PURE__ */ React.createElement(CardHeader, { title: "Field Options" }), /* @__PURE__ */ React.createElement(CardContent, null, /* @__PURE__ */ React.createElement(
2304
+ fieldOptions.map((option, idx) => /* @__PURE__ */ React.createElement(MenuItem, { key: idx, value: option }, option.name))
2305
+ )), /* @__PURE__ */ React.createElement(IconButton, { size: "medium", onClick: onClose }, /* @__PURE__ */ React.createElement(CloseIcon, null))), /* @__PURE__ */ React.createElement("div", { className: classes.fieldForm }, /* @__PURE__ */ React.createElement(Card, null, /* @__PURE__ */ React.createElement(CardHeader, { title: "Field Options" }), /* @__PURE__ */ React.createElement(CardContent, null, /* @__PURE__ */ React.createElement(
2248
2306
  Form,
2249
2307
  {
2250
2308
  showErrorList: false,
@@ -2287,7 +2345,7 @@ const CustomFieldExplorer = ({
2287
2345
  )));
2288
2346
  };
2289
2347
 
2290
- const useStyles$b = makeStyles((theme) => ({
2348
+ const useStyles$b = makeStyles$1((theme) => ({
2291
2349
  root: {
2292
2350
  overflowY: "auto",
2293
2351
  background: theme.palette.background.default
@@ -2306,7 +2364,7 @@ const useStyles$b = makeStyles((theme) => ({
2306
2364
  function DryRunResultsList() {
2307
2365
  const classes = useStyles$b();
2308
2366
  const dryRun = useDryRun();
2309
- return /* @__PURE__ */ React.createElement(List$2, { className: classes.root, dense: true }, dryRun.results.map((result) => {
2367
+ return /* @__PURE__ */ React.createElement(List$1, { className: classes.root, dense: true }, dryRun.results.map((result) => {
2310
2368
  var _a;
2311
2369
  const failed = result.log.some((l) => l.body.status === "failed");
2312
2370
  return /* @__PURE__ */ React.createElement(
@@ -2318,15 +2376,15 @@ function DryRunResultsList() {
2318
2376
  onClick: () => dryRun.selectResult(result.id)
2319
2377
  },
2320
2378
  /* @__PURE__ */ React.createElement(
2321
- ListItemIcon,
2379
+ ListItemIcon$1,
2322
2380
  {
2323
2381
  className: failed ? classes.iconFailure : classes.iconSuccess
2324
2382
  },
2325
- failed ? /* @__PURE__ */ React.createElement(CancelIcon, null) : /* @__PURE__ */ React.createElement(CheckIcon, null)
2383
+ failed ? /* @__PURE__ */ React.createElement(Cancel, null) : /* @__PURE__ */ React.createElement(CheckIcon, null)
2326
2384
  ),
2327
- /* @__PURE__ */ React.createElement(ListItemText, { primary: `Result ${result.id}` }),
2385
+ /* @__PURE__ */ React.createElement(ListItemText$1, { primary: `Result ${result.id}` }),
2328
2386
  /* @__PURE__ */ React.createElement(ListItemSecondaryAction, null, /* @__PURE__ */ React.createElement(
2329
- IconButton,
2387
+ IconButton$1,
2330
2388
  {
2331
2389
  edge: "end",
2332
2390
  "aria-label": "delete",
@@ -2353,7 +2411,7 @@ const TaskErrors = ({ error }) => {
2353
2411
  )) : null;
2354
2412
  };
2355
2413
 
2356
- const useStyles$a = makeStyles$1({
2414
+ const useStyles$a = makeStyles({
2357
2415
  svgIcon: {
2358
2416
  display: "inline-block",
2359
2417
  "& svg": {
@@ -2400,7 +2458,7 @@ const TaskPageLinks = ({ output }) => {
2400
2458
  };
2401
2459
 
2402
2460
  const humanizeDuration = require("humanize-duration");
2403
- const useStyles$9 = makeStyles(
2461
+ const useStyles$9 = makeStyles$1(
2404
2462
  (theme) => createStyles({
2405
2463
  root: {
2406
2464
  width: "100%"
@@ -2440,7 +2498,7 @@ const StepTimeTicker = ({ step }) => {
2440
2498
  }, 1e3);
2441
2499
  return /* @__PURE__ */ React.createElement(Typography$1, { variant: "caption" }, time);
2442
2500
  };
2443
- const useStepIconStyles = makeStyles(
2501
+ const useStepIconStyles = makeStyles$1(
2444
2502
  (theme) => createStyles({
2445
2503
  root: {
2446
2504
  color: theme.palette.text.disabled,
@@ -2467,7 +2525,7 @@ function TaskStepIconComponent(props) {
2467
2525
  return /* @__PURE__ */ React.createElement(CheckIcon, null);
2468
2526
  }
2469
2527
  if (error) {
2470
- return /* @__PURE__ */ React.createElement(CancelIcon, null);
2528
+ return /* @__PURE__ */ React.createElement(Cancel, null);
2471
2529
  }
2472
2530
  return /* @__PURE__ */ React.createElement(FiberManualRecordIcon, null);
2473
2531
  };
@@ -2494,16 +2552,17 @@ const TaskStatusStepper = memo(
2494
2552
  nonLinear: true
2495
2553
  },
2496
2554
  steps.map((step, index) => {
2555
+ const isCancelled = step.status === "cancelled";
2556
+ const isActive = step.status === "processing";
2497
2557
  const isCompleted = step.status === "completed";
2498
2558
  const isFailed = step.status === "failed";
2499
- const isActive = step.status === "processing";
2500
2559
  const isSkipped = step.status === "skipped";
2501
2560
  return /* @__PURE__ */ React.createElement(Step, { key: String(index), expanded: true }, /* @__PURE__ */ React.createElement(StepButton, { onClick: () => onUserStepChange(step.id) }, /* @__PURE__ */ React.createElement(
2502
2561
  StepLabel,
2503
2562
  {
2504
2563
  StepIconProps: {
2505
2564
  completed: isCompleted,
2506
- error: isFailed,
2565
+ error: isFailed || isCancelled,
2507
2566
  active: isActive
2508
2567
  },
2509
2568
  StepIconComponent: TaskStepIconComponent,
@@ -2521,14 +2580,17 @@ const TaskPage = (props) => {
2521
2580
  const classes = useStyles$9();
2522
2581
  const navigate = useNavigate();
2523
2582
  const rootPath = useRouteRef(rootRouteRef);
2583
+ const scaffolderApi = useApi(scaffolderApiRef);
2524
2584
  const templateRoute = useRouteRef(selectedTemplateRouteRef);
2525
2585
  const [userSelectedStepId, setUserSelectedStepId] = useState(void 0);
2586
+ const [clickedToCancel, setClickedToCancel] = useState(false);
2526
2587
  const [lastActiveStepId, setLastActiveStepId] = useState(
2527
2588
  void 0
2528
2589
  );
2529
2590
  const { taskId } = useRouteRefParams(scaffolderTaskRouteRef);
2530
2591
  const taskStream = useTaskEventStream(taskId);
2531
2592
  const completed = taskStream.completed;
2593
+ const taskCancelled = taskStream.cancelled;
2532
2594
  const steps = useMemo(
2533
2595
  () => {
2534
2596
  var _a, _b;
@@ -2564,7 +2626,7 @@ const TaskPage = (props) => {
2564
2626
  }
2565
2627
  return log.join("\n");
2566
2628
  }, [taskStream.stepLogs, currentStepId, loadingText]);
2567
- const taskNotFound = taskStream.completed === true && taskStream.loading === false && !taskStream.task;
2629
+ const taskNotFound = taskStream.completed && !taskStream.loading && !taskStream.task;
2568
2630
  const { output } = taskStream;
2569
2631
  const handleStartOver = () => {
2570
2632
  var _a, _b, _c;
@@ -2582,6 +2644,10 @@ const TaskPage = (props) => {
2582
2644
  })}`
2583
2645
  );
2584
2646
  };
2647
+ const handleCancel = async () => {
2648
+ setClickedToCancel(true);
2649
+ await scaffolderApi.cancelTask(taskId);
2650
+ };
2585
2651
  return /* @__PURE__ */ React.createElement(Page, { themeId: "home" }, /* @__PURE__ */ React.createElement(
2586
2652
  Header,
2587
2653
  {
@@ -2613,10 +2679,20 @@ const TaskPage = (props) => {
2613
2679
  color: "primary"
2614
2680
  },
2615
2681
  "Start Over"
2682
+ ), /* @__PURE__ */ React.createElement(
2683
+ Button,
2684
+ {
2685
+ className: classes.button,
2686
+ onClick: handleCancel,
2687
+ disabled: completed || taskCancelled || clickedToCancel,
2688
+ variant: "outlined",
2689
+ color: "secondary"
2690
+ },
2691
+ (taskCancelled || clickedToCancel) && !completed ? "Cancelling..." : "Cancel"
2616
2692
  ))), /* @__PURE__ */ React.createElement(Grid$1, { item: true, xs: 9 }, !currentStepId && /* @__PURE__ */ React.createElement(Progress, null), /* @__PURE__ */ React.createElement("div", { style: { height: "80vh" } }, /* @__PURE__ */ React.createElement(TaskErrors, { error: taskStream.error }), /* @__PURE__ */ React.createElement(LogViewer, { text: logAsString })))))));
2617
2693
  };
2618
2694
 
2619
- const useStyles$8 = makeStyles({
2695
+ const useStyles$8 = makeStyles$1({
2620
2696
  root: {
2621
2697
  whiteSpace: "nowrap",
2622
2698
  overflowY: "auto"
@@ -2697,7 +2773,7 @@ function FileBrowser(props) {
2697
2773
  );
2698
2774
  }
2699
2775
 
2700
- const useStyles$7 = makeStyles((theme) => ({
2776
+ const useStyles$7 = makeStyles$1((theme) => ({
2701
2777
  root: {
2702
2778
  display: "grid",
2703
2779
  gridTemplateColumns: "280px auto 3fr",
@@ -2721,7 +2797,7 @@ function DryRunResultsSplitView(props) {
2721
2797
  return /* @__PURE__ */ React.createElement("div", { className: classes.root }, /* @__PURE__ */ React.createElement("div", { className: classNames(classes.child, classes.firstChild) }, childArray[0]), /* @__PURE__ */ React.createElement(Divider, { orientation: "horizontal" }), /* @__PURE__ */ React.createElement("div", { className: classes.child }, childArray[1]));
2722
2798
  }
2723
2799
 
2724
- const useStyles$6 = makeStyles({
2800
+ const useStyles$6 = makeStyles$1({
2725
2801
  root: {
2726
2802
  display: "flex",
2727
2803
  flexFlow: "column nowrap"
@@ -2848,7 +2924,7 @@ function DryRunResultsView() {
2848
2924
  return /* @__PURE__ */ React.createElement("div", { className: classes.root }, /* @__PURE__ */ React.createElement(Tabs, { value: selectedTab, onChange: (_, v) => setSelectedTab(v) }, /* @__PURE__ */ React.createElement(Tab, { value: "files", label: "Files" }), /* @__PURE__ */ React.createElement(Tab, { value: "log", label: "Log" }), /* @__PURE__ */ React.createElement(Tab, { value: "output", label: "Output" })), /* @__PURE__ */ React.createElement(Divider, null), /* @__PURE__ */ React.createElement("div", { className: classes.contentWrapper }, /* @__PURE__ */ React.createElement("div", { className: classes.content }, selectedTab === "files" && /* @__PURE__ */ React.createElement(FilesContent, null), selectedTab === "log" && /* @__PURE__ */ React.createElement(LogContent, null), selectedTab === "output" && /* @__PURE__ */ React.createElement(OutputContent, null))));
2849
2925
  }
2850
2926
 
2851
- const useStyles$5 = makeStyles((theme) => ({
2927
+ const useStyles$5 = makeStyles$1((theme) => ({
2852
2928
  header: {
2853
2929
  height: 48,
2854
2930
  minHeight: 0,
@@ -2903,7 +2979,7 @@ function DryRunResults() {
2903
2979
  ));
2904
2980
  }
2905
2981
 
2906
- const useStyles$4 = makeStyles$1((theme) => ({
2982
+ const useStyles$4 = makeStyles((theme) => ({
2907
2983
  button: {
2908
2984
  padding: theme.spacing(1)
2909
2985
  },
@@ -2940,7 +3016,7 @@ function TemplateEditorBrowser(props) {
2940
3016
  props.onClose();
2941
3017
  };
2942
3018
  return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: classes.buttons }, /* @__PURE__ */ React.createElement(Tooltip, { title: "Save all files" }, /* @__PURE__ */ React.createElement(
2943
- IconButton$1,
3019
+ IconButton,
2944
3020
  {
2945
3021
  className: classes.button,
2946
3022
  disabled: directoryEditor.files.every((file) => !file.dirty),
@@ -2948,13 +3024,13 @@ function TemplateEditorBrowser(props) {
2948
3024
  },
2949
3025
  /* @__PURE__ */ React.createElement(SaveIcon, null)
2950
3026
  )), /* @__PURE__ */ React.createElement(Tooltip, { title: "Reload directory" }, /* @__PURE__ */ React.createElement(
2951
- IconButton$1,
3027
+ IconButton,
2952
3028
  {
2953
3029
  className: classes.button,
2954
3030
  onClick: () => directoryEditor.reload()
2955
3031
  },
2956
3032
  /* @__PURE__ */ React.createElement(RefreshIcon, null)
2957
- )), /* @__PURE__ */ React.createElement("div", { className: classes.buttonsGap }), /* @__PURE__ */ React.createElement(Tooltip, { title: "Close directory" }, /* @__PURE__ */ React.createElement(IconButton$1, { className: classes.button, onClick: handleClose }, /* @__PURE__ */ React.createElement(CloseIcon, null)))), /* @__PURE__ */ React.createElement(Divider$1, { className: classes.buttonsDivider }), /* @__PURE__ */ React.createElement(
3033
+ )), /* @__PURE__ */ React.createElement("div", { className: classes.buttonsGap }), /* @__PURE__ */ React.createElement(Tooltip, { title: "Close directory" }, /* @__PURE__ */ React.createElement(IconButton, { className: classes.button, onClick: handleClose }, /* @__PURE__ */ React.createElement(CloseIcon, null)))), /* @__PURE__ */ React.createElement(Divider$1, { className: classes.buttonsDivider }), /* @__PURE__ */ React.createElement(
2958
3034
  FileBrowser,
2959
3035
  {
2960
3036
  selected: (_b = (_a = directoryEditor.selectedFile) == null ? void 0 : _a.path) != null ? _b : "",
@@ -2964,7 +3040,7 @@ function TemplateEditorBrowser(props) {
2964
3040
  ));
2965
3041
  }
2966
3042
 
2967
- const useStyles$3 = makeStyles$1((theme) => ({
3043
+ const useStyles$3 = makeStyles((theme) => ({
2968
3044
  container: {
2969
3045
  position: "relative",
2970
3046
  width: "100%",
@@ -3023,7 +3099,7 @@ function TemplateEditorTextArea(props) {
3023
3099
  onChange: props.onUpdate
3024
3100
  }
3025
3101
  ), (props.onSave || props.onReload) && /* @__PURE__ */ React.createElement("div", { className: classes.floatingButtons }, /* @__PURE__ */ React.createElement(Paper, null, props.onSave && /* @__PURE__ */ React.createElement(Tooltip, { title: "Save file" }, /* @__PURE__ */ React.createElement(
3026
- IconButton$1,
3102
+ IconButton,
3027
3103
  {
3028
3104
  className: classes.floatingButton,
3029
3105
  onClick: () => {
@@ -3033,7 +3109,7 @@ function TemplateEditorTextArea(props) {
3033
3109
  },
3034
3110
  /* @__PURE__ */ React.createElement(SaveIcon, null)
3035
3111
  )), props.onReload && /* @__PURE__ */ React.createElement(Tooltip, { title: "Reload file" }, /* @__PURE__ */ React.createElement(
3036
- IconButton$1,
3112
+ IconButton,
3037
3113
  {
3038
3114
  className: classes.floatingButton,
3039
3115
  onClick: () => {
@@ -3068,7 +3144,7 @@ function TemplateEditorDirectoryEditorTextArea(props) {
3068
3144
  }
3069
3145
  TemplateEditorTextArea.DirectoryEditor = TemplateEditorDirectoryEditorTextArea;
3070
3146
 
3071
- const useStyles$2 = makeStyles$1({
3147
+ const useStyles$2 = makeStyles({
3072
3148
  // Reset and fix sizing to make sure scrolling behaves correctly
3073
3149
  root: {
3074
3150
  gridArea: "pageContent",
@@ -3147,7 +3223,7 @@ steps:
3147
3223
  values:
3148
3224
  name: \${{parameters.name}}
3149
3225
  `;
3150
- const useStyles$1 = makeStyles$1((theme) => ({
3226
+ const useStyles$1 = makeStyles((theme) => ({
3151
3227
  root: {
3152
3228
  gridArea: "pageContent",
3153
3229
  display: "grid",
@@ -3230,8 +3306,8 @@ const TemplateFormPreviewer = ({
3230
3306
  labelId: "select-template-label",
3231
3307
  onChange: (e) => handleSelectChange(e.target.value)
3232
3308
  },
3233
- templateOptions.map((option, idx) => /* @__PURE__ */ React.createElement(MenuItem$1, { key: idx, value: option.value }, option.label))
3234
- )), /* @__PURE__ */ React.createElement(IconButton$1, { size: "medium", onClick: onClose }, /* @__PURE__ */ React.createElement(CloseIcon, null))), /* @__PURE__ */ React.createElement("div", { className: classes.textArea }, /* @__PURE__ */ React.createElement(
3309
+ templateOptions.map((option, idx) => /* @__PURE__ */ React.createElement(MenuItem, { key: idx, value: option.value }, option.label))
3310
+ )), /* @__PURE__ */ React.createElement(IconButton, { size: "medium", onClick: onClose }, /* @__PURE__ */ React.createElement(CloseIcon, null))), /* @__PURE__ */ React.createElement("div", { className: classes.textArea }, /* @__PURE__ */ React.createElement(
3235
3311
  TemplateEditorTextArea,
3236
3312
  {
3237
3313
  content: templateYaml,
@@ -3250,7 +3326,7 @@ const TemplateFormPreviewer = ({
3250
3326
  ))));
3251
3327
  };
3252
3328
 
3253
- const useStyles = makeStyles((theme) => ({
3329
+ const useStyles = makeStyles$1((theme) => ({
3254
3330
  introText: {
3255
3331
  textAlign: "center",
3256
3332
  marginTop: theme.spacing(2)
@@ -3330,93 +3406,5 @@ function TemplateEditorIntro(props) {
3330
3406
  ));
3331
3407
  }
3332
3408
 
3333
- const scaffolderPlugin = createPlugin({
3334
- id: "scaffolder",
3335
- apis: [
3336
- createApiFactory({
3337
- api: scaffolderApiRef,
3338
- deps: {
3339
- discoveryApi: discoveryApiRef,
3340
- scmIntegrationsApi: scmIntegrationsApiRef,
3341
- fetchApi: fetchApiRef,
3342
- identityApi: identityApiRef
3343
- },
3344
- factory: ({ discoveryApi, scmIntegrationsApi, fetchApi, identityApi }) => new ScaffolderClient({
3345
- discoveryApi,
3346
- scmIntegrationsApi,
3347
- fetchApi,
3348
- identityApi
3349
- })
3350
- })
3351
- ],
3352
- routes: {
3353
- root: rootRouteRef,
3354
- selectedTemplate: selectedTemplateRouteRef,
3355
- ongoingTask: scaffolderTaskRouteRef
3356
- },
3357
- externalRoutes: {
3358
- registerComponent: registerComponentRouteRef,
3359
- viewTechDoc: viewTechDocRouteRef
3360
- }
3361
- });
3362
- scaffolderPlugin.provide(
3363
- createScaffolderFieldExtension({
3364
- component: EntityPicker,
3365
- name: "EntityPicker",
3366
- schema: EntityPickerSchema
3367
- })
3368
- );
3369
- scaffolderPlugin.provide(
3370
- createScaffolderFieldExtension({
3371
- component: EntityNamePicker,
3372
- name: "EntityNamePicker",
3373
- validation: entityNamePickerValidation,
3374
- schema: EntityNamePickerSchema
3375
- })
3376
- );
3377
- scaffolderPlugin.provide(
3378
- createScaffolderFieldExtension({
3379
- component: RepoUrlPicker,
3380
- name: "RepoUrlPicker",
3381
- validation: repoPickerValidation,
3382
- schema: RepoUrlPickerSchema
3383
- })
3384
- );
3385
- scaffolderPlugin.provide(
3386
- createScaffolderFieldExtension({
3387
- component: OwnerPicker,
3388
- name: "OwnerPicker",
3389
- schema: OwnerPickerSchema
3390
- })
3391
- );
3392
- scaffolderPlugin.provide(
3393
- createRoutableExtension({
3394
- name: "ScaffolderPage",
3395
- component: () => import('./Router-2826a2b8.esm.js').then((m) => m.Router),
3396
- mountPoint: rootRouteRef
3397
- })
3398
- );
3399
- scaffolderPlugin.provide(
3400
- createScaffolderFieldExtension({
3401
- component: OwnedEntityPicker,
3402
- name: "OwnedEntityPicker",
3403
- schema: OwnedEntityPickerSchema
3404
- })
3405
- );
3406
- scaffolderPlugin.provide(
3407
- createScaffolderFieldExtension({
3408
- component: EntityTagsPicker,
3409
- name: "EntityTagsPicker",
3410
- schema: EntityTagsPickerSchema
3411
- })
3412
- );
3413
- const NextScaffolderPage = scaffolderPlugin.provide(
3414
- createRoutableExtension({
3415
- name: "NextScaffolderPage",
3416
- component: () => import('./index-2131f4a0.esm.js').then((m) => m.Router),
3417
- mountPoint: nextRouteRef
3418
- })
3419
- );
3420
-
3421
- export { ActionsPage as A, OwnedEntityPickerSchema as B, OwnerListPicker as C, DirectoryEditorProvider as D, EntityPicker as E, nextSelectedTemplateRouteRef as F, ContextMenu$1 as G, nextRouteRef as H, nextScaffolderTaskRouteRef as I, TemplateEditor as J, TemplateFormPreviewer as K, CustomFieldExplorer as L, nextEditRouteRef as M, nextActionsRouteRef as N, OwnerPicker as O, nextScaffolderListTaskRouteRef as P, OngoingTask as Q, RepoUrlPicker as R, NextScaffolderPage as S, TemplateEditorBrowser as T, WebFileSystemAccess as W, actionsRouteRef as a, scaffolderListTaskRouteRef as b, scaffolderTaskRouteRef as c, rootRouteRef as d, editRouteRef as e, useDirectoryEditor as f, DryRunProvider as g, TemplateEditorTextArea as h, DryRunResults as i, TemplateEditorIntro as j, TaskPage as k, legacySelectedTemplateRouteRef as l, EntityPickerSchema as m, EntityNamePicker as n, entityNamePickerValidation as o, EntityNamePickerSchema as p, EntityTagsPicker as q, registerComponentRouteRef as r, selectedTemplateRouteRef as s, EntityTagsPickerSchema as t, useDryRun as u, viewTechDocRouteRef as v, repoPickerValidation as w, RepoUrlPickerSchema as x, OwnerPickerSchema as y, OwnedEntityPicker as z };
3422
- //# sourceMappingURL=alpha-714dad1b.esm.js.map
3409
+ export { ActionsPage as A, OwnedEntityPickerSchema as B, OwnerListPicker as C, DirectoryEditorProvider as D, EntityPicker as E, TemplateEditor as F, TemplateFormPreviewer as G, CustomFieldExplorer as H, OngoingTask as I, NextScaffolderPage as N, OwnerPicker as O, RepoUrlPicker as R, TemplateEditorBrowser as T, WebFileSystemAccess as W, actionsRouteRef as a, scaffolderListTaskRouteRef as b, scaffolderTaskRouteRef as c, rootRouteRef as d, editRouteRef as e, useDirectoryEditor as f, DryRunProvider as g, TemplateEditorTextArea as h, DryRunResults as i, TemplateEditorIntro as j, TaskPage as k, legacySelectedTemplateRouteRef as l, EntityPickerSchema as m, EntityNamePicker as n, entityNamePickerValidation as o, EntityNamePickerSchema as p, EntityTagsPicker as q, registerComponentRouteRef as r, selectedTemplateRouteRef as s, EntityTagsPickerSchema as t, useDryRun as u, viewTechDocRouteRef as v, repoPickerValidation as w, RepoUrlPickerSchema as x, OwnerPickerSchema as y, OwnedEntityPicker as z };
3410
+ //# sourceMappingURL=alpha-0764fae7.esm.js.map