@backstage/plugin-scaffolder-react 1.15.0-next.1 → 1.15.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 +21 -0
- package/dist/alpha.d.ts +22 -21
- package/dist/hooks/useCustomFieldExtensions.esm.js +2 -1
- package/dist/hooks/useCustomFieldExtensions.esm.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/layouts/createScaffolderLayout.esm.js.map +1 -1
- package/dist/next/components/Form/DescriptionFieldTemplate.esm.js +3 -3
- package/dist/next/components/Form/DescriptionFieldTemplate.esm.js.map +1 -1
- package/dist/next/components/Form/FieldTemplate.esm.js +18 -18
- package/dist/next/components/Form/FieldTemplate.esm.js.map +1 -1
- package/dist/next/components/Form/Form.esm.js +6 -5
- package/dist/next/components/Form/Form.esm.js.map +1 -1
- package/dist/next/components/PasswordWidget/PasswordWidget.esm.js +17 -14
- package/dist/next/components/PasswordWidget/PasswordWidget.esm.js.map +1 -1
- package/dist/next/components/ReviewState/ReviewState.esm.js +2 -2
- package/dist/next/components/ReviewState/ReviewState.esm.js.map +1 -1
- package/dist/next/components/ScaffolderField/ScaffolderField.esm.js +17 -15
- package/dist/next/components/ScaffolderField/ScaffolderField.esm.js.map +1 -1
- package/dist/next/components/ScaffolderPageContextMenu/ScaffolderPageContextMenu.esm.js +65 -44
- package/dist/next/components/ScaffolderPageContextMenu/ScaffolderPageContextMenu.esm.js.map +1 -1
- package/dist/next/components/SecretWidget/SecretWidget.esm.js +3 -2
- package/dist/next/components/SecretWidget/SecretWidget.esm.js.map +1 -1
- package/dist/next/components/Stepper/ErrorListTemplate/errorListTemplate.esm.js +11 -8
- package/dist/next/components/Stepper/ErrorListTemplate/errorListTemplate.esm.js.map +1 -1
- package/dist/next/components/Stepper/FieldOverrides/DescriptionField.esm.js +2 -2
- package/dist/next/components/Stepper/FieldOverrides/DescriptionField.esm.js.map +1 -1
- package/dist/next/components/Stepper/Stepper.esm.js +106 -90
- package/dist/next/components/Stepper/Stepper.esm.js.map +1 -1
- package/dist/next/components/TaskLogStream/TaskLogStream.esm.js +3 -3
- package/dist/next/components/TaskLogStream/TaskLogStream.esm.js.map +1 -1
- package/dist/next/components/TaskSteps/StepIcon.esm.js +10 -10
- package/dist/next/components/TaskSteps/StepIcon.esm.js.map +1 -1
- package/dist/next/components/TaskSteps/StepTime.esm.js +3 -2
- package/dist/next/components/TaskSteps/StepTime.esm.js.map +1 -1
- package/dist/next/components/TaskSteps/TaskBorder.esm.js +3 -3
- package/dist/next/components/TaskSteps/TaskBorder.esm.js.map +1 -1
- package/dist/next/components/TaskSteps/TaskSteps.esm.js +43 -38
- package/dist/next/components/TaskSteps/TaskSteps.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/CardHeader.esm.js +15 -9
- package/dist/next/components/TemplateCard/CardHeader.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/CardLink.esm.js +5 -2
- package/dist/next/components/TemplateCard/CardLink.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/TemplateCard.esm.js +29 -19
- package/dist/next/components/TemplateCard/TemplateCard.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/TemplateCardActions.esm.js +31 -25
- package/dist/next/components/TemplateCard/TemplateCardActions.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/TemplateCardContent.esm.js +3 -3
- package/dist/next/components/TemplateCard/TemplateCardContent.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/TemplateCardLinks.esm.js +35 -29
- package/dist/next/components/TemplateCard/TemplateCardLinks.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/TemplateCardTags.esm.js +21 -18
- package/dist/next/components/TemplateCard/TemplateCardTags.esm.js.map +1 -1
- package/dist/next/components/TemplateCard/TemplateDetailButton.esm.js +13 -13
- package/dist/next/components/TemplateCard/TemplateDetailButton.esm.js.map +1 -1
- package/dist/next/components/TemplateCategoryPicker/TemplateCategoryPicker.esm.js +44 -41
- package/dist/next/components/TemplateCategoryPicker/TemplateCategoryPicker.esm.js.map +1 -1
- package/dist/next/components/TemplateGroup/TemplateGroup.esm.js +14 -11
- package/dist/next/components/TemplateGroup/TemplateGroup.esm.js.map +1 -1
- package/dist/next/components/TemplateGroups/TemplateGroups.esm.js +14 -8
- package/dist/next/components/TemplateGroups/TemplateGroups.esm.js.map +1 -1
- package/dist/next/components/TemplateOutputs/DefaultTemplateOutputs.esm.js +33 -27
- package/dist/next/components/TemplateOutputs/DefaultTemplateOutputs.esm.js.map +1 -1
- package/dist/next/components/TemplateOutputs/LinkOutputs.esm.js +4 -4
- package/dist/next/components/TemplateOutputs/LinkOutputs.esm.js.map +1 -1
- package/dist/next/components/TemplateOutputs/TextOutputs.esm.js +8 -8
- package/dist/next/components/TemplateOutputs/TextOutputs.esm.js.map +1 -1
- package/dist/next/components/Workflow/Workflow.esm.js +27 -23
- package/dist/next/components/Workflow/Workflow.esm.js.map +1 -1
- package/dist/secrets/SecretsContext.esm.js +6 -5
- package/dist/secrets/SecretsContext.esm.js.map +1 -1
- package/package.json +14 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScaffolderField.esm.js","sources":["../../../../src/next/components/ScaffolderField/ScaffolderField.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport
|
|
1
|
+
{"version":3,"file":"ScaffolderField.esm.js","sources":["../../../../src/next/components/ScaffolderField/ScaffolderField.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { PropsWithChildren, ReactElement } from 'react';\n\nimport { MarkdownContent } from '@backstage/core-components';\nimport FormControl from '@material-ui/core/FormControl';\nimport { makeStyles } from '@material-ui/core/styles';\n\nconst useStyles = makeStyles(theme => ({\n markdownDescription: {\n fontSize: theme.typography.caption.fontSize,\n margin: 0,\n color: theme.palette.text.secondary,\n '& :first-child': {\n margin: 0,\n marginTop: '3px', // to keep the standard browser padding\n },\n },\n}));\n\n/**\n * Props for the {@link ScaffolderField} component\n * @alpha\n */\nexport interface ScaffolderFieldProps {\n rawDescription?: string;\n errors?: ReactElement;\n rawErrors?: string[];\n help?: ReactElement;\n rawHelp?: string;\n required?: boolean;\n disabled?: boolean;\n displayLabel?: boolean;\n}\n\n/**\n * A component to wrap up a input field which helps with formatting and supporting markdown\n * on the field types\n * @alpha\n */\nexport const ScaffolderField = (\n props: PropsWithChildren<ScaffolderFieldProps>,\n) => {\n const {\n children,\n displayLabel = true,\n rawErrors = [],\n errors,\n help,\n rawDescription,\n required,\n disabled,\n } = props;\n const classes = useStyles();\n return (\n <FormControl\n fullWidth\n error={rawErrors.length ? true : false}\n required={required}\n disabled={disabled}\n >\n {children}\n {displayLabel && rawDescription ? (\n <MarkdownContent\n content={rawDescription}\n linkTarget=\"_blank\"\n className={classes.markdownDescription}\n />\n ) : null}\n {errors}\n {help}\n </FormControl>\n );\n};\n"],"names":[],"mappings":";;;;;AAqBA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,mBAAqB,EAAA;AAAA,IACnB,QAAA,EAAU,KAAM,CAAA,UAAA,CAAW,OAAQ,CAAA,QAAA;AAAA,IACnC,MAAQ,EAAA,CAAA;AAAA,IACR,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,IAAK,CAAA,SAAA;AAAA,IAC1B,gBAAkB,EAAA;AAAA,MAChB,MAAQ,EAAA,CAAA;AAAA,MACR,SAAW,EAAA;AAAA;AAAA;AACb;AAEJ,CAAE,CAAA,CAAA;AAsBW,MAAA,eAAA,GAAkB,CAC7B,KACG,KAAA;AACH,EAAM,MAAA;AAAA,IACJ,QAAA;AAAA,IACA,YAAe,GAAA,IAAA;AAAA,IACf,YAAY,EAAC;AAAA,IACb,MAAA;AAAA,IACA,IAAA;AAAA,IACA,cAAA;AAAA,IACA,QAAA;AAAA,IACA;AAAA,GACE,GAAA,KAAA;AACJ,EAAA,MAAM,UAAU,SAAU,EAAA;AAC1B,EACE,uBAAA,IAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACC,SAAS,EAAA,IAAA;AAAA,MACT,KAAA,EAAO,SAAU,CAAA,MAAA,GAAS,IAAO,GAAA,KAAA;AAAA,MACjC,QAAA;AAAA,MACA,QAAA;AAAA,MAEC,QAAA,EAAA;AAAA,QAAA,QAAA;AAAA,QACA,gBAAgB,cACf,mBAAA,GAAA;AAAA,UAAC,eAAA;AAAA,UAAA;AAAA,YACC,OAAS,EAAA,cAAA;AAAA,YACT,UAAW,EAAA,QAAA;AAAA,YACX,WAAW,OAAQ,CAAA;AAAA;AAAA,SAEnB,GAAA,IAAA;AAAA,QACH,MAAA;AAAA,QACA;AAAA;AAAA;AAAA,GACH;AAEJ;;;;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
1
2
|
import { useTranslationRef } from '@backstage/frontend-plugin-api';
|
|
2
3
|
import IconButton from '@material-ui/core/IconButton';
|
|
3
4
|
import ListItemIcon from '@material-ui/core/ListItemIcon';
|
|
@@ -11,7 +12,7 @@ import DescriptionIcon from '@material-ui/icons/Description';
|
|
|
11
12
|
import Edit from '@material-ui/icons/Edit';
|
|
12
13
|
import List from '@material-ui/icons/List';
|
|
13
14
|
import MoreVert from '@material-ui/icons/MoreVert';
|
|
14
|
-
import
|
|
15
|
+
import { useState } from 'react';
|
|
15
16
|
import { usePermission } from '@backstage/plugin-permission-react';
|
|
16
17
|
import { taskReadPermission, templateManagementPermission } from '@backstage/plugin-scaffolder-common/alpha';
|
|
17
18
|
import { scaffolderReactTranslationRef } from '../../../translation.esm.js';
|
|
@@ -41,53 +42,73 @@ function ScaffolderPageContextMenu(props) {
|
|
|
41
42
|
const onClose = () => {
|
|
42
43
|
setAnchorEl(void 0);
|
|
43
44
|
};
|
|
44
|
-
return /* @__PURE__ */
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
id: "long-menu",
|
|
48
|
-
"aria-label": t("scaffolderPageContextMenu.moreLabel"),
|
|
49
|
-
"aria-controls": "long-menu",
|
|
50
|
-
"aria-expanded": !!anchorEl,
|
|
51
|
-
"aria-haspopup": "true",
|
|
52
|
-
role: "button",
|
|
53
|
-
onClick: onOpen,
|
|
54
|
-
"data-testid": "menu-button",
|
|
55
|
-
color: "inherit",
|
|
56
|
-
className: classes.button
|
|
57
|
-
},
|
|
58
|
-
/* @__PURE__ */ React.createElement(MoreVert, null)
|
|
59
|
-
), /* @__PURE__ */ React.createElement(
|
|
60
|
-
Popover,
|
|
61
|
-
{
|
|
62
|
-
"aria-labelledby": "long-menu",
|
|
63
|
-
open: Boolean(anchorEl),
|
|
64
|
-
onClose,
|
|
65
|
-
anchorEl,
|
|
66
|
-
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
67
|
-
transformOrigin: { vertical: "top", horizontal: "right" }
|
|
68
|
-
},
|
|
69
|
-
/* @__PURE__ */ React.createElement(MenuList, null, onCreateClicked && /* @__PURE__ */ React.createElement(MenuItem, { onClick: onCreateClicked }, /* @__PURE__ */ React.createElement(ListItemIcon, null, /* @__PURE__ */ React.createElement(CreateComponentIcon, { fontSize: "small" })), /* @__PURE__ */ React.createElement(
|
|
70
|
-
ListItemText,
|
|
45
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
46
|
+
/* @__PURE__ */ jsx(
|
|
47
|
+
IconButton,
|
|
71
48
|
{
|
|
72
|
-
|
|
49
|
+
id: "long-menu",
|
|
50
|
+
"aria-label": t("scaffolderPageContextMenu.moreLabel"),
|
|
51
|
+
"aria-controls": "long-menu",
|
|
52
|
+
"aria-expanded": !!anchorEl,
|
|
53
|
+
"aria-haspopup": "true",
|
|
54
|
+
role: "button",
|
|
55
|
+
onClick: onOpen,
|
|
56
|
+
"data-testid": "menu-button",
|
|
57
|
+
color: "inherit",
|
|
58
|
+
className: classes.button,
|
|
59
|
+
children: /* @__PURE__ */ jsx(MoreVert, {})
|
|
73
60
|
}
|
|
74
|
-
)
|
|
75
|
-
|
|
61
|
+
),
|
|
62
|
+
/* @__PURE__ */ jsx(
|
|
63
|
+
Popover,
|
|
76
64
|
{
|
|
77
|
-
|
|
65
|
+
"aria-labelledby": "long-menu",
|
|
66
|
+
open: Boolean(anchorEl),
|
|
67
|
+
onClose,
|
|
68
|
+
anchorEl,
|
|
69
|
+
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
70
|
+
transformOrigin: { vertical: "top", horizontal: "right" },
|
|
71
|
+
children: /* @__PURE__ */ jsxs(MenuList, { children: [
|
|
72
|
+
onCreateClicked && /* @__PURE__ */ jsxs(MenuItem, { onClick: onCreateClicked, children: [
|
|
73
|
+
/* @__PURE__ */ jsx(ListItemIcon, { children: /* @__PURE__ */ jsx(CreateComponentIcon, { fontSize: "small" }) }),
|
|
74
|
+
/* @__PURE__ */ jsx(
|
|
75
|
+
ListItemText,
|
|
76
|
+
{
|
|
77
|
+
primary: t("scaffolderPageContextMenu.createLabel")
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
] }),
|
|
81
|
+
onEditorClicked && canManageTemplates && /* @__PURE__ */ jsxs(MenuItem, { onClick: onEditorClicked, children: [
|
|
82
|
+
/* @__PURE__ */ jsx(ListItemIcon, { children: /* @__PURE__ */ jsx(Edit, { fontSize: "small" }) }),
|
|
83
|
+
/* @__PURE__ */ jsx(
|
|
84
|
+
ListItemText,
|
|
85
|
+
{
|
|
86
|
+
primary: t("scaffolderPageContextMenu.editorLabel")
|
|
87
|
+
}
|
|
88
|
+
)
|
|
89
|
+
] }),
|
|
90
|
+
onActionsClicked && /* @__PURE__ */ jsxs(MenuItem, { onClick: onActionsClicked, children: [
|
|
91
|
+
/* @__PURE__ */ jsx(ListItemIcon, { children: /* @__PURE__ */ jsx(DescriptionIcon, { fontSize: "small" }) }),
|
|
92
|
+
/* @__PURE__ */ jsx(
|
|
93
|
+
ListItemText,
|
|
94
|
+
{
|
|
95
|
+
primary: t("scaffolderPageContextMenu.actionsLabel")
|
|
96
|
+
}
|
|
97
|
+
)
|
|
98
|
+
] }),
|
|
99
|
+
onTasksClicked && canReadTasks && /* @__PURE__ */ jsxs(MenuItem, { onClick: onTasksClicked, children: [
|
|
100
|
+
/* @__PURE__ */ jsx(ListItemIcon, { children: /* @__PURE__ */ jsx(List, { fontSize: "small" }) }),
|
|
101
|
+
/* @__PURE__ */ jsx(
|
|
102
|
+
ListItemText,
|
|
103
|
+
{
|
|
104
|
+
primary: t("scaffolderPageContextMenu.tasksLabel")
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
] })
|
|
108
|
+
] })
|
|
78
109
|
}
|
|
79
|
-
)
|
|
80
|
-
|
|
81
|
-
{
|
|
82
|
-
primary: t("scaffolderPageContextMenu.actionsLabel")
|
|
83
|
-
}
|
|
84
|
-
)), onTasksClicked && canReadTasks && /* @__PURE__ */ React.createElement(MenuItem, { onClick: onTasksClicked }, /* @__PURE__ */ React.createElement(ListItemIcon, null, /* @__PURE__ */ React.createElement(List, { fontSize: "small" })), /* @__PURE__ */ React.createElement(
|
|
85
|
-
ListItemText,
|
|
86
|
-
{
|
|
87
|
-
primary: t("scaffolderPageContextMenu.tasksLabel")
|
|
88
|
-
}
|
|
89
|
-
)))
|
|
90
|
-
));
|
|
110
|
+
)
|
|
111
|
+
] });
|
|
91
112
|
}
|
|
92
113
|
|
|
93
114
|
export { ScaffolderPageContextMenu };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScaffolderPageContextMenu.esm.js","sources":["../../../../src/next/components/ScaffolderPageContextMenu/ScaffolderPageContextMenu.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport IconButton from '@material-ui/core/IconButton';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport MenuList from '@material-ui/core/MenuList';\nimport Popover from '@material-ui/core/Popover';\nimport { makeStyles } from '@material-ui/core/styles';\nimport CreateComponentIcon from '@material-ui/icons/AddCircleOutline';\nimport Description from '@material-ui/icons/Description';\nimport Edit from '@material-ui/icons/Edit';\nimport List from '@material-ui/icons/List';\nimport MoreVert from '@material-ui/icons/MoreVert';\nimport
|
|
1
|
+
{"version":3,"file":"ScaffolderPageContextMenu.esm.js","sources":["../../../../src/next/components/ScaffolderPageContextMenu/ScaffolderPageContextMenu.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport IconButton from '@material-ui/core/IconButton';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport MenuList from '@material-ui/core/MenuList';\nimport Popover from '@material-ui/core/Popover';\nimport { makeStyles } from '@material-ui/core/styles';\nimport CreateComponentIcon from '@material-ui/icons/AddCircleOutline';\nimport Description from '@material-ui/icons/Description';\nimport Edit from '@material-ui/icons/Edit';\nimport List from '@material-ui/icons/List';\nimport MoreVert from '@material-ui/icons/MoreVert';\nimport { SyntheticEvent, useState } from 'react';\nimport { usePermission } from '@backstage/plugin-permission-react';\nimport { taskReadPermission } from '@backstage/plugin-scaffolder-common/alpha';\nimport { templateManagementPermission } from '@backstage/plugin-scaffolder-common/alpha';\n\nimport { scaffolderReactTranslationRef } from '../../../translation';\n\nconst useStyles = makeStyles(theme => ({\n button: {\n color: theme.page.fontColor,\n },\n}));\n\n/**\n * @alpha\n */\nexport type ScaffolderPageContextMenuProps = {\n onEditorClicked?: () => void;\n onActionsClicked?: () => void;\n onTasksClicked?: () => void;\n onCreateClicked?: () => void;\n};\n\n/**\n * @alpha\n */\nexport function ScaffolderPageContextMenu(\n props: ScaffolderPageContextMenuProps,\n) {\n const { t } = useTranslationRef(scaffolderReactTranslationRef);\n const { onEditorClicked, onActionsClicked, onTasksClicked, onCreateClicked } =\n props;\n const classes = useStyles();\n const [anchorEl, setAnchorEl] = useState<HTMLButtonElement>();\n\n const { allowed: canReadTasks } = usePermission({\n permission: taskReadPermission,\n });\n\n const { allowed: canManageTemplates } = usePermission({\n permission: templateManagementPermission,\n });\n\n if (\n !onEditorClicked &&\n !onActionsClicked &&\n !onTasksClicked &&\n !onCreateClicked\n ) {\n return null;\n }\n\n const onOpen = (event: SyntheticEvent<HTMLButtonElement>) => {\n setAnchorEl(event.currentTarget);\n };\n\n const onClose = () => {\n setAnchorEl(undefined);\n };\n\n return (\n <>\n <IconButton\n id=\"long-menu\"\n aria-label={t('scaffolderPageContextMenu.moreLabel')}\n aria-controls=\"long-menu\"\n aria-expanded={!!anchorEl}\n aria-haspopup=\"true\"\n role=\"button\"\n onClick={onOpen}\n data-testid=\"menu-button\"\n color=\"inherit\"\n className={classes.button}\n >\n <MoreVert />\n </IconButton>\n <Popover\n aria-labelledby=\"long-menu\"\n open={Boolean(anchorEl)}\n onClose={onClose}\n anchorEl={anchorEl}\n anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}\n transformOrigin={{ vertical: 'top', horizontal: 'right' }}\n >\n <MenuList>\n {onCreateClicked && (\n <MenuItem onClick={onCreateClicked}>\n <ListItemIcon>\n <CreateComponentIcon fontSize=\"small\" />\n </ListItemIcon>\n <ListItemText\n primary={t('scaffolderPageContextMenu.createLabel')}\n />\n </MenuItem>\n )}\n {onEditorClicked && canManageTemplates && (\n <MenuItem onClick={onEditorClicked}>\n <ListItemIcon>\n <Edit fontSize=\"small\" />\n </ListItemIcon>\n <ListItemText\n primary={t('scaffolderPageContextMenu.editorLabel')}\n />\n </MenuItem>\n )}\n {onActionsClicked && (\n <MenuItem onClick={onActionsClicked}>\n <ListItemIcon>\n <Description fontSize=\"small\" />\n </ListItemIcon>\n <ListItemText\n primary={t('scaffolderPageContextMenu.actionsLabel')}\n />\n </MenuItem>\n )}\n {onTasksClicked && canReadTasks && (\n <MenuItem onClick={onTasksClicked}>\n <ListItemIcon>\n <List fontSize=\"small\" />\n </ListItemIcon>\n <ListItemText\n primary={t('scaffolderPageContextMenu.tasksLabel')}\n />\n </MenuItem>\n )}\n </MenuList>\n </Popover>\n </>\n );\n}\n"],"names":["Description"],"mappings":"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"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
1
2
|
import { useTemplateSecrets } from '@backstage/plugin-scaffolder-react';
|
|
2
3
|
import TextField from '@material-ui/core/TextField';
|
|
3
|
-
import
|
|
4
|
+
import { useState, useMemo } from 'react';
|
|
4
5
|
import debounce from 'lodash/debounce';
|
|
5
6
|
|
|
6
7
|
const SecretWidget = (props) => {
|
|
@@ -25,7 +26,7 @@ const SecretWidget = (props) => {
|
|
|
25
26
|
onChange(Array(newValue.length).fill("*").join(""));
|
|
26
27
|
debouncedSetSecrets(newValue);
|
|
27
28
|
};
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
+
return /* @__PURE__ */ jsx(
|
|
29
30
|
TextField,
|
|
30
31
|
{
|
|
31
32
|
id: title,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecretWidget.esm.js","sources":["../../../../src/next/components/SecretWidget/SecretWidget.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { WidgetProps } from '@rjsf/utils';\nimport { useTemplateSecrets } from '@backstage/plugin-scaffolder-react';\nimport TextField from '@material-ui/core/TextField';\nimport
|
|
1
|
+
{"version":3,"file":"SecretWidget.esm.js","sources":["../../../../src/next/components/SecretWidget/SecretWidget.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { WidgetProps } from '@rjsf/utils';\nimport { useTemplateSecrets } from '@backstage/plugin-scaffolder-react';\nimport TextField from '@material-ui/core/TextField';\nimport { ChangeEvent, useMemo, useState } from 'react';\nimport debounce from 'lodash/debounce';\n\n/**\n * Secret Widget for overriding the default password input widget\n * @alpha\n */\nexport const SecretWidget = (\n props: Pick<\n WidgetProps,\n 'name' | 'onChange' | 'schema' | 'required' | 'disabled'\n >,\n) => {\n const { setSecrets, secrets } = useTemplateSecrets();\n const {\n name,\n onChange,\n schema: { title, minLength, maxLength },\n required,\n disabled,\n } = props;\n\n const [localValue, setLocalValue] = useState(secrets[name] ?? '');\n\n // Memoize the debounced function so it persists across re-renders\n const debouncedSetSecrets = useMemo(\n () =>\n debounce((value: string) => {\n setSecrets({ [name]: value });\n }, 300),\n [setSecrets, name],\n );\n\n const handleChange = (e: ChangeEvent<HTMLInputElement>) => {\n const newValue = e.target.value;\n setLocalValue(newValue);\n onChange(Array(newValue.length).fill('*').join(''));\n debouncedSetSecrets(newValue);\n };\n\n return (\n <TextField\n id={title}\n label={title}\n aria-describedby={title}\n onChange={handleChange}\n value={localValue}\n type=\"password\"\n autoComplete=\"off\"\n required={required}\n disabled={disabled}\n inputProps={{\n minLength,\n maxLength,\n }}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;AA0Ba,MAAA,YAAA,GAAe,CAC1B,KAIG,KAAA;AACH,EAAA,MAAM,EAAE,UAAA,EAAY,OAAQ,EAAA,GAAI,kBAAmB,EAAA;AACnD,EAAM,MAAA;AAAA,IACJ,IAAA;AAAA,IACA,QAAA;AAAA,IACA,MAAQ,EAAA,EAAE,KAAO,EAAA,SAAA,EAAW,SAAU,EAAA;AAAA,IACtC,QAAA;AAAA,IACA;AAAA,GACE,GAAA,KAAA;AAEJ,EAAM,MAAA,CAAC,YAAY,aAAa,CAAA,GAAI,SAAS,OAAQ,CAAA,IAAI,KAAK,EAAE,CAAA;AAGhE,EAAA,MAAM,mBAAsB,GAAA,OAAA;AAAA,IAC1B,MACE,QAAS,CAAA,CAAC,KAAkB,KAAA;AAC1B,MAAA,UAAA,CAAW,EAAE,CAAC,IAAI,GAAG,OAAO,CAAA;AAAA,OAC3B,GAAG,CAAA;AAAA,IACR,CAAC,YAAY,IAAI;AAAA,GACnB;AAEA,EAAM,MAAA,YAAA,GAAe,CAAC,CAAqC,KAAA;AACzD,IAAM,MAAA,QAAA,GAAW,EAAE,MAAO,CAAA,KAAA;AAC1B,IAAA,aAAA,CAAc,QAAQ,CAAA;AACtB,IAAS,QAAA,CAAA,KAAA,CAAM,SAAS,MAAM,CAAA,CAAE,KAAK,GAAG,CAAA,CAAE,IAAK,CAAA,EAAE,CAAC,CAAA;AAClD,IAAA,mBAAA,CAAoB,QAAQ,CAAA;AAAA,GAC9B;AAEA,EACE,uBAAA,GAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAAA,MACC,EAAI,EAAA,KAAA;AAAA,MACJ,KAAO,EAAA,KAAA;AAAA,MACP,kBAAkB,EAAA,KAAA;AAAA,MAClB,QAAU,EAAA,YAAA;AAAA,MACV,KAAO,EAAA,UAAA;AAAA,MACP,IAAK,EAAA,UAAA;AAAA,MACL,YAAa,EAAA,KAAA;AAAA,MACb,QAAA;AAAA,MACA,QAAA;AAAA,MACA,UAAY,EAAA;AAAA,QACV,SAAA;AAAA,QACA;AAAA;AACF;AAAA,GACF;AAEJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import List from '@material-ui/core/List';
|
|
3
3
|
import ListItem from '@material-ui/core/ListItem';
|
|
4
4
|
import ListItemIcon from '@material-ui/core/ListItemIcon';
|
|
@@ -33,13 +33,16 @@ const ErrorListTemplate = ({ errors, schema }) => {
|
|
|
33
33
|
}
|
|
34
34
|
return error.stack;
|
|
35
35
|
}
|
|
36
|
-
return /* @__PURE__ */
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
return /* @__PURE__ */ jsx(Paper, { children: /* @__PURE__ */ jsx(List, { dense: true, className: classes.list, children: errors.map((error, index) => /* @__PURE__ */ jsxs(ListItem, { children: [
|
|
37
|
+
/* @__PURE__ */ jsx(ListItemIcon, { children: /* @__PURE__ */ jsx(ErrorIcon, { color: "error" }) }),
|
|
38
|
+
/* @__PURE__ */ jsx(
|
|
39
|
+
ListItemText,
|
|
40
|
+
{
|
|
41
|
+
classes: { primary: classes.text },
|
|
42
|
+
primary: formatErrorMessage(error)
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
] }, index)) }) });
|
|
43
46
|
};
|
|
44
47
|
|
|
45
48
|
export { ErrorListTemplate };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errorListTemplate.esm.js","sources":["../../../../../src/next/components/Stepper/ErrorListTemplate/errorListTemplate.tsx"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport
|
|
1
|
+
{"version":3,"file":"errorListTemplate.esm.js","sources":["../../../../../src/next/components/Stepper/ErrorListTemplate/errorListTemplate.tsx"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ErrorListProps, RJSFValidationError } from '@rjsf/utils';\nimport List from '@material-ui/core/List';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport Paper from '@material-ui/core/Paper';\nimport { Theme, createStyles, makeStyles } from '@material-ui/core/styles';\nimport ErrorIcon from '@material-ui/icons/Error';\nimport startCase from 'lodash/startCase';\n\nconst useStyles = makeStyles((_theme: Theme) =>\n createStyles({\n list: {\n width: '100%',\n },\n text: {\n textWrap: 'wrap',\n },\n }),\n);\n\n/**\n * Shows a list of errors found in the form\n *\n * @public\n */\nexport const ErrorListTemplate = ({ errors, schema }: ErrorListProps) => {\n const classes = useStyles();\n\n function formatErrorMessage(error: RJSFValidationError) {\n if (error.property && error.message) {\n const propertyName = error.property.startsWith('.')\n ? error.property.substring(1)\n : error.property;\n if (schema.properties && propertyName in schema.properties) {\n const property = schema.properties[propertyName];\n\n if (typeof property === 'object' && 'title' in property) {\n return `'${property.title}' ${error.message}`;\n }\n }\n // fall back to property name\n return `'${startCase(propertyName)}' ${error.message}`;\n }\n // fall back if property does not exist\n return error.stack;\n }\n\n return (\n <Paper>\n <List dense className={classes.list}>\n {errors.map((error, index) => (\n <ListItem key={index}>\n <ListItemIcon>\n <ErrorIcon color=\"error\" />\n </ListItemIcon>\n <ListItemText\n classes={{ primary: classes.text }}\n primary={formatErrorMessage(error)}\n />\n </ListItem>\n ))}\n </List>\n </Paper>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AAyBA,MAAM,SAAY,GAAA,UAAA;AAAA,EAAW,CAAC,WAC5B,YAAa,CAAA;AAAA,IACX,IAAM,EAAA;AAAA,MACJ,KAAO,EAAA;AAAA,KACT;AAAA,IACA,IAAM,EAAA;AAAA,MACJ,QAAU,EAAA;AAAA;AACZ,GACD;AACH,CAAA;AAOO,MAAM,iBAAoB,GAAA,CAAC,EAAE,MAAA,EAAQ,QAA6B,KAAA;AACvE,EAAA,MAAM,UAAU,SAAU,EAAA;AAE1B,EAAA,SAAS,mBAAmB,KAA4B,EAAA;AACtD,IAAI,IAAA,KAAA,CAAM,QAAY,IAAA,KAAA,CAAM,OAAS,EAAA;AACnC,MAAM,MAAA,YAAA,GAAe,KAAM,CAAA,QAAA,CAAS,UAAW,CAAA,GAAG,CAC9C,GAAA,KAAA,CAAM,QAAS,CAAA,SAAA,CAAU,CAAC,CAAA,GAC1B,KAAM,CAAA,QAAA;AACV,MAAA,IAAI,MAAO,CAAA,UAAA,IAAc,YAAgB,IAAA,MAAA,CAAO,UAAY,EAAA;AAC1D,QAAM,MAAA,QAAA,GAAW,MAAO,CAAA,UAAA,CAAW,YAAY,CAAA;AAE/C,QAAA,IAAI,OAAO,QAAA,KAAa,QAAY,IAAA,OAAA,IAAW,QAAU,EAAA;AACvD,UAAA,OAAO,CAAI,CAAA,EAAA,QAAA,CAAS,KAAK,CAAA,EAAA,EAAK,MAAM,OAAO,CAAA,CAAA;AAAA;AAC7C;AAGF,MAAA,OAAO,IAAI,SAAU,CAAA,YAAY,CAAC,CAAA,EAAA,EAAK,MAAM,OAAO,CAAA,CAAA;AAAA;AAGtD,IAAA,OAAO,KAAM,CAAA,KAAA;AAAA;AAGf,EAAA,uBACG,GAAA,CAAA,KAAA,EAAA,EACC,QAAC,kBAAA,GAAA,CAAA,IAAA,EAAA,EAAK,OAAK,IAAC,EAAA,SAAA,EAAW,OAAQ,CAAA,IAAA,EAC5B,iBAAO,GAAI,CAAA,CAAC,KAAO,EAAA,KAAA,0BACjB,QACC,EAAA,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,YACC,EAAA,EAAA,QAAA,kBAAA,GAAA,CAAC,SAAU,EAAA,EAAA,KAAA,EAAM,SAAQ,CAC3B,EAAA,CAAA;AAAA,oBACA,GAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACC,OAAS,EAAA,EAAE,OAAS,EAAA,OAAA,CAAQ,IAAK,EAAA;AAAA,QACjC,OAAA,EAAS,mBAAmB,KAAK;AAAA;AAAA;AACnC,GAPa,EAAA,EAAA,KAQf,CACD,CAAA,EACH,CACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { MarkdownContent } from '@backstage/core-components';
|
|
3
3
|
|
|
4
|
-
const DescriptionField = ({ description }) => description && /* @__PURE__ */
|
|
4
|
+
const DescriptionField = ({ description }) => description && /* @__PURE__ */ jsx(MarkdownContent, { content: description, linkTarget: "_blank" });
|
|
5
5
|
|
|
6
6
|
export { DescriptionField };
|
|
7
7
|
//# sourceMappingURL=DescriptionField.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DescriptionField.esm.js","sources":["../../../../../src/next/components/Stepper/FieldOverrides/DescriptionField.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport
|
|
1
|
+
{"version":3,"file":"DescriptionField.esm.js","sources":["../../../../../src/next/components/Stepper/FieldOverrides/DescriptionField.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { MarkdownContent } from '@backstage/core-components';\nimport { FieldProps } from '@rjsf/utils';\n\nexport const DescriptionField = ({ description }: FieldProps) =>\n description && <MarkdownContent content={description} linkTarget=\"_blank\" />;\n"],"names":[],"mappings":";;;AAmBa,MAAA,gBAAA,GAAmB,CAAC,EAAE,WAAY,EAAA,KAC7C,WAAe,oBAAA,GAAA,CAAC,eAAgB,EAAA,EAAA,OAAA,EAAS,WAAa,EAAA,UAAA,EAAW,QAAS,EAAA;;;;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
1
2
|
import { useAnalytics, useApiHolder } from '@backstage/core-plugin-api';
|
|
2
3
|
import { useTranslationRef } from '@backstage/frontend-plugin-api';
|
|
3
4
|
import Button from '@material-ui/core/Button';
|
|
@@ -9,7 +10,7 @@ import { makeStyles } from '@material-ui/core/styles';
|
|
|
9
10
|
import { customizeValidator } from '@rjsf/validator-ajv8';
|
|
10
11
|
import ajvErrors from 'ajv-errors';
|
|
11
12
|
import { merge } from 'lodash';
|
|
12
|
-
import
|
|
13
|
+
import { useState, useMemo, useCallback } from 'react';
|
|
13
14
|
import { scaffolderReactTranslationRef } from '../../../translation.esm.js';
|
|
14
15
|
import { useFormDataFromQuery } from '../../hooks/useFormDataFromQuery.esm.js';
|
|
15
16
|
import { useTemplateSchema } from '../../hooks/useTemplateSchema.esm.js';
|
|
@@ -138,100 +139,115 @@ const Stepper = (stepperProps) => {
|
|
|
138
139
|
setIsCreating(false);
|
|
139
140
|
}
|
|
140
141
|
}, [analytics, createLabel, onCreate, stepsState]);
|
|
141
|
-
return /* @__PURE__ */
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
alternativeLabel: true,
|
|
146
|
-
variant: "elevation",
|
|
147
|
-
style: { overflowX: "auto" }
|
|
148
|
-
},
|
|
149
|
-
steps.map((step, index) => {
|
|
150
|
-
const isAllowedLabelClick = activeStep > index;
|
|
151
|
-
return /* @__PURE__ */ React.createElement(MuiStep, { key: index }, /* @__PURE__ */ React.createElement(
|
|
152
|
-
MuiStepLabel,
|
|
153
|
-
{
|
|
154
|
-
"aria-label": t("stepper.stepIndexLabel", { index: index + 1 }),
|
|
155
|
-
style: { cursor: isAllowedLabelClick ? "pointer" : "default" },
|
|
156
|
-
onClick: () => {
|
|
157
|
-
if (isAllowedLabelClick) setActiveStep(index);
|
|
158
|
-
}
|
|
159
|
-
},
|
|
160
|
-
step.title
|
|
161
|
-
));
|
|
162
|
-
}),
|
|
163
|
-
/* @__PURE__ */ React.createElement(MuiStep, null, /* @__PURE__ */ React.createElement(MuiStepLabel, null, reviewLabel))
|
|
164
|
-
), /* @__PURE__ */ React.createElement("div", { className: styles.formWrapper }, activeStep < steps.length ? /* @__PURE__ */ React.createElement(
|
|
165
|
-
Form,
|
|
166
|
-
{
|
|
167
|
-
key: activeStep,
|
|
168
|
-
validator,
|
|
169
|
-
extraErrors: errors,
|
|
170
|
-
formData: stepsState,
|
|
171
|
-
formContext: { ...propFormContext, formData: stepsState },
|
|
172
|
-
schema: currentStep.schema,
|
|
173
|
-
uiSchema: mergedUiSchema,
|
|
174
|
-
onSubmit: handleNext,
|
|
175
|
-
fields,
|
|
176
|
-
showErrorList: "top",
|
|
177
|
-
templates: { ErrorListTemplate },
|
|
178
|
-
onChange: handleChange,
|
|
179
|
-
widgets: { password: PasswordWidget },
|
|
180
|
-
experimental_defaultFormStateBehavior: {
|
|
181
|
-
allOf: "populateDefaults"
|
|
182
|
-
},
|
|
183
|
-
...restFormProps
|
|
184
|
-
},
|
|
185
|
-
/* @__PURE__ */ React.createElement("div", { className: styles.footer }, /* @__PURE__ */ React.createElement(
|
|
186
|
-
Button,
|
|
187
|
-
{
|
|
188
|
-
onClick: handleBack,
|
|
189
|
-
className: styles.backButton,
|
|
190
|
-
disabled: activeStep < 1 || isValidating
|
|
191
|
-
},
|
|
192
|
-
backLabel
|
|
193
|
-
), /* @__PURE__ */ React.createElement(
|
|
194
|
-
Button,
|
|
142
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
143
|
+
isValidating && /* @__PURE__ */ jsx(LinearProgress, { variant: "indeterminate" }),
|
|
144
|
+
/* @__PURE__ */ jsxs(
|
|
145
|
+
MuiStepper,
|
|
195
146
|
{
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
147
|
+
activeStep,
|
|
148
|
+
alternativeLabel: true,
|
|
149
|
+
variant: "elevation",
|
|
150
|
+
style: { overflowX: "auto" },
|
|
151
|
+
children: [
|
|
152
|
+
steps.map((step, index) => {
|
|
153
|
+
const isAllowedLabelClick = activeStep > index;
|
|
154
|
+
return /* @__PURE__ */ jsx(MuiStep, { children: /* @__PURE__ */ jsx(
|
|
155
|
+
MuiStepLabel,
|
|
156
|
+
{
|
|
157
|
+
"aria-label": t("stepper.stepIndexLabel", { index: index + 1 }),
|
|
158
|
+
style: { cursor: isAllowedLabelClick ? "pointer" : "default" },
|
|
159
|
+
onClick: () => {
|
|
160
|
+
if (isAllowedLabelClick) setActiveStep(index);
|
|
161
|
+
},
|
|
162
|
+
children: step.title
|
|
163
|
+
}
|
|
164
|
+
) }, index);
|
|
165
|
+
}),
|
|
166
|
+
/* @__PURE__ */ jsx(MuiStep, { children: /* @__PURE__ */ jsx(MuiStepLabel, { children: reviewLabel }) })
|
|
167
|
+
]
|
|
168
|
+
}
|
|
169
|
+
),
|
|
170
|
+
/* @__PURE__ */ jsx("div", { className: styles.formWrapper, children: activeStep < steps.length ? /* @__PURE__ */ jsx(
|
|
171
|
+
Form,
|
|
207
172
|
{
|
|
208
|
-
|
|
173
|
+
validator,
|
|
174
|
+
extraErrors: errors,
|
|
209
175
|
formData: stepsState,
|
|
210
|
-
|
|
211
|
-
|
|
176
|
+
formContext: { ...propFormContext, formData: stepsState },
|
|
177
|
+
schema: currentStep.schema,
|
|
178
|
+
uiSchema: mergedUiSchema,
|
|
179
|
+
onSubmit: handleNext,
|
|
180
|
+
fields,
|
|
181
|
+
showErrorList: "top",
|
|
182
|
+
templates: { ErrorListTemplate },
|
|
183
|
+
onChange: handleChange,
|
|
184
|
+
widgets: { password: PasswordWidget },
|
|
185
|
+
experimental_defaultFormStateBehavior: {
|
|
186
|
+
allOf: "populateDefaults"
|
|
212
187
|
},
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
188
|
+
...restFormProps,
|
|
189
|
+
children: /* @__PURE__ */ jsxs("div", { className: styles.footer, children: [
|
|
190
|
+
/* @__PURE__ */ jsx(
|
|
191
|
+
Button,
|
|
192
|
+
{
|
|
193
|
+
onClick: handleBack,
|
|
194
|
+
className: styles.backButton,
|
|
195
|
+
disabled: activeStep < 1 || isValidating,
|
|
196
|
+
children: backLabel
|
|
197
|
+
}
|
|
198
|
+
),
|
|
199
|
+
/* @__PURE__ */ jsx(
|
|
200
|
+
Button,
|
|
201
|
+
{
|
|
202
|
+
variant: "contained",
|
|
203
|
+
color: "primary",
|
|
204
|
+
type: "submit",
|
|
205
|
+
disabled: isValidating,
|
|
206
|
+
children: activeStep === steps.length - 1 ? reviewLabel : t("stepper.nextButtonText")
|
|
207
|
+
}
|
|
208
|
+
)
|
|
209
|
+
] })
|
|
222
210
|
},
|
|
223
|
-
|
|
224
|
-
)
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
211
|
+
activeStep
|
|
212
|
+
) : (
|
|
213
|
+
// TODO: potentially move away from this pattern, deprecate?
|
|
214
|
+
ReviewStepComponent ? /* @__PURE__ */ jsx(
|
|
215
|
+
ReviewStepComponent,
|
|
216
|
+
{
|
|
217
|
+
disableButtons: isValidating,
|
|
218
|
+
formData: stepsState,
|
|
219
|
+
handleBack,
|
|
220
|
+
handleReset: () => {
|
|
221
|
+
},
|
|
222
|
+
steps,
|
|
223
|
+
handleCreate
|
|
224
|
+
}
|
|
225
|
+
) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
226
|
+
/* @__PURE__ */ jsx(ReviewStateComponent, { formState: stepsState, schemas: steps }),
|
|
227
|
+
/* @__PURE__ */ jsxs("div", { className: styles.footer, children: [
|
|
228
|
+
/* @__PURE__ */ jsx(
|
|
229
|
+
Button,
|
|
230
|
+
{
|
|
231
|
+
onClick: handleBack,
|
|
232
|
+
className: styles.backButton,
|
|
233
|
+
disabled: activeStep < 1,
|
|
234
|
+
children: backLabel
|
|
235
|
+
}
|
|
236
|
+
),
|
|
237
|
+
/* @__PURE__ */ jsx(
|
|
238
|
+
Button,
|
|
239
|
+
{
|
|
240
|
+
disabled: isCreating,
|
|
241
|
+
variant: "contained",
|
|
242
|
+
color: "primary",
|
|
243
|
+
onClick: handleCreate,
|
|
244
|
+
children: createLabel
|
|
245
|
+
}
|
|
246
|
+
)
|
|
247
|
+
] })
|
|
248
|
+
] })
|
|
249
|
+
) })
|
|
250
|
+
] });
|
|
235
251
|
};
|
|
236
252
|
|
|
237
253
|
export { Stepper };
|