@backstage/plugin-scaffolder 1.30.0-next.0 → 1.30.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 +72 -0
- package/dist/alpha/components/TemplateEditorPage/CustomFieldExplorer.esm.js +98 -84
- package/dist/alpha/components/TemplateEditorPage/CustomFieldExplorer.esm.js.map +1 -1
- package/dist/alpha/components/TemplateEditorPage/CustomFieldPlaygroud.esm.js +119 -102
- package/dist/alpha/components/TemplateEditorPage/CustomFieldPlaygroud.esm.js.map +1 -1
- package/dist/alpha/components/TemplateEditorPage/CustomFieldsPage.esm.js +13 -10
- package/dist/alpha/components/TemplateEditorPage/CustomFieldsPage.esm.js.map +1 -1
- package/dist/alpha/components/TemplateEditorPage/DirectoryEditorContext.esm.js +4 -3
- package/dist/alpha/components/TemplateEditorPage/DirectoryEditorContext.esm.js.map +1 -1
- package/dist/alpha/components/TemplateEditorPage/DryRunContext.esm.js +3 -2
- package/dist/alpha/components/TemplateEditorPage/DryRunContext.esm.js.map +1 -1
- package/dist/alpha/components/TemplateEditorPage/DryRunResults/DryRunResults.esm.js +22 -15
- package/dist/alpha/components/TemplateEditorPage/DryRunResults/DryRunResults.esm.js.map +1 -1
- package/dist/alpha/components/TemplateEditorPage/DryRunResults/DryRunResultsList.esm.js +49 -44
- package/dist/alpha/components/TemplateEditorPage/DryRunResults/DryRunResultsList.esm.js.map +1 -1
- package/dist/alpha/components/TemplateEditorPage/DryRunResults/DryRunResultsSplitView.esm.js +7 -2
- package/dist/alpha/components/TemplateEditorPage/DryRunResults/DryRunResultsSplitView.esm.js.map +1 -1
- package/dist/alpha/components/TemplateEditorPage/DryRunResults/DryRunResultsView.esm.js +79 -57
- package/dist/alpha/components/TemplateEditorPage/DryRunResults/DryRunResultsView.esm.js.map +1 -1
- package/dist/alpha/components/TemplateEditorPage/DryRunResults/IconLink.esm.js +5 -2
- package/dist/alpha/components/TemplateEditorPage/DryRunResults/IconLink.esm.js.map +1 -1
- package/dist/alpha/components/TemplateEditorPage/DryRunResults/TaskPageLinks.esm.js +6 -6
- package/dist/alpha/components/TemplateEditorPage/DryRunResults/TaskPageLinks.esm.js.map +1 -1
- package/dist/alpha/components/TemplateEditorPage/DryRunResults/TaskStatusStepper.esm.js +40 -36
- package/dist/alpha/components/TemplateEditorPage/DryRunResults/TaskStatusStepper.esm.js.map +1 -1
- package/dist/alpha/components/TemplateEditorPage/TemplateEditor.esm.js +24 -17
- package/dist/alpha/components/TemplateEditorPage/TemplateEditor.esm.js.map +1 -1
- package/dist/alpha/components/TemplateEditorPage/TemplateEditorBrowser.esm.js +50 -42
- package/dist/alpha/components/TemplateEditorPage/TemplateEditorBrowser.esm.js.map +1 -1
- package/dist/alpha/components/TemplateEditorPage/TemplateEditorForm.esm.js +5 -4
- package/dist/alpha/components/TemplateEditorPage/TemplateEditorForm.esm.js.map +1 -1
- package/dist/alpha/components/TemplateEditorPage/TemplateEditorIntro.esm.js +87 -70
- package/dist/alpha/components/TemplateEditorPage/TemplateEditorIntro.esm.js.map +1 -1
- package/dist/alpha/components/TemplateEditorPage/TemplateEditorLayout.esm.js +7 -7
- package/dist/alpha/components/TemplateEditorPage/TemplateEditorLayout.esm.js.map +1 -1
- package/dist/alpha/components/TemplateEditorPage/TemplateEditorPage.esm.js +20 -17
- package/dist/alpha/components/TemplateEditorPage/TemplateEditorPage.esm.js.map +1 -1
- package/dist/alpha/components/TemplateEditorPage/TemplateEditorTextArea.esm.js +52 -45
- package/dist/alpha/components/TemplateEditorPage/TemplateEditorTextArea.esm.js.map +1 -1
- package/dist/alpha/components/TemplateEditorPage/TemplateEditorToolbar.esm.js +76 -60
- package/dist/alpha/components/TemplateEditorPage/TemplateEditorToolbar.esm.js.map +1 -1
- package/dist/alpha/components/TemplateEditorPage/TemplateEditorToolbarFileMenu.esm.js +42 -36
- package/dist/alpha/components/TemplateEditorPage/TemplateEditorToolbarFileMenu.esm.js.map +1 -1
- package/dist/alpha/components/TemplateEditorPage/TemplateEditorToolbarTemplatesMenu.esm.js +42 -38
- package/dist/alpha/components/TemplateEditorPage/TemplateEditorToolbarTemplatesMenu.esm.js.map +1 -1
- package/dist/alpha/components/TemplateEditorPage/TemplateFormPage.esm.js +23 -19
- package/dist/alpha/components/TemplateEditorPage/TemplateFormPage.esm.js.map +1 -1
- package/dist/alpha/components/TemplateEditorPage/TemplateFormPreviewer.esm.js +39 -31
- package/dist/alpha/components/TemplateEditorPage/TemplateFormPreviewer.esm.js.map +1 -1
- package/dist/alpha/components/TemplateEditorPage/TemplateIntroPage.esm.js +14 -10
- package/dist/alpha/components/TemplateEditorPage/TemplateIntroPage.esm.js.map +1 -1
- package/dist/alpha/components/TemplateListPage/RegisterExistingButton.esm.js +6 -6
- package/dist/alpha/components/TemplateListPage/RegisterExistingButton.esm.js.map +1 -1
- package/dist/alpha/components/TemplateListPage/TemplateListPage.esm.js +54 -34
- package/dist/alpha/components/TemplateListPage/TemplateListPage.esm.js.map +1 -1
- package/dist/alpha/components/TemplateWizardPage/TemplateWizardPage.esm.js +29 -24
- package/dist/alpha/components/TemplateWizardPage/TemplateWizardPage.esm.js.map +1 -1
- package/dist/alpha/components/TemplateWizardPage/TemplateWizardPageContextMenu.esm.js +40 -33
- package/dist/alpha/components/TemplateWizardPage/TemplateWizardPageContextMenu.esm.js.map +1 -1
- package/dist/alpha/extensions.esm.js +2 -2
- package/dist/alpha/extensions.esm.js.map +1 -1
- package/dist/alpha/fields/RepoUrlPicker.esm.js +1 -1
- package/dist/alpha.d.ts +12 -12
- package/dist/components/ActionsPage/ActionsPage.esm.js +120 -167
- package/dist/components/ActionsPage/ActionsPage.esm.js.map +1 -1
- package/dist/components/FileBrowser/FileBrowser.esm.js +10 -9
- package/dist/components/FileBrowser/FileBrowser.esm.js.map +1 -1
- package/dist/components/ListTasksPage/ListTasksPage.esm.js +80 -70
- package/dist/components/ListTasksPage/ListTasksPage.esm.js.map +1 -1
- package/dist/components/ListTasksPage/OwnerListPicker.esm.js +29 -23
- package/dist/components/ListTasksPage/OwnerListPicker.esm.js.map +1 -1
- package/dist/components/ListTasksPage/columns/CreatedAtColumn.esm.js +2 -2
- package/dist/components/ListTasksPage/columns/CreatedAtColumn.esm.js.map +1 -1
- package/dist/components/ListTasksPage/columns/OwnerEntityColumn.esm.js +3 -3
- package/dist/components/ListTasksPage/columns/OwnerEntityColumn.esm.js.map +1 -1
- package/dist/components/ListTasksPage/columns/TaskStatusColumn.esm.js +4 -4
- package/dist/components/ListTasksPage/columns/TaskStatusColumn.esm.js.map +1 -1
- package/dist/components/ListTasksPage/columns/TemplateTitleColumn.esm.js +2 -2
- package/dist/components/ListTasksPage/columns/TemplateTitleColumn.esm.js.map +1 -1
- package/dist/components/OngoingTask/ContextMenu.esm.js +80 -58
- package/dist/components/OngoingTask/ContextMenu.esm.js.map +1 -1
- package/dist/components/OngoingTask/OngoingTask.esm.js +95 -76
- package/dist/components/OngoingTask/OngoingTask.esm.js.map +1 -1
- package/dist/components/RenderSchema/RenderSchema.esm.js +379 -0
- package/dist/components/RenderSchema/RenderSchema.esm.js.map +1 -0
- package/dist/components/Router/Router.esm.js +105 -94
- package/dist/components/Router/Router.esm.js.map +1 -1
- package/dist/components/ScaffolderUsageExamplesTable/ScaffolderUsageExamplesTable.esm.js +28 -0
- package/dist/components/ScaffolderUsageExamplesTable/ScaffolderUsageExamplesTable.esm.js.map +1 -0
- package/dist/components/TemplateTypePicker/TemplateTypePicker.esm.js +42 -39
- package/dist/components/TemplateTypePicker/TemplateTypePicker.esm.js.map +1 -1
- package/dist/components/fields/EntityNamePicker/EntityNamePicker.esm.js +2 -2
- package/dist/components/fields/EntityNamePicker/EntityNamePicker.esm.js.map +1 -1
- package/dist/components/fields/EntityPicker/EntityPicker.esm.js +41 -40
- package/dist/components/fields/EntityPicker/EntityPicker.esm.js.map +1 -1
- package/dist/components/fields/EntityTagsPicker/EntityTagsPicker.esm.js +5 -4
- package/dist/components/fields/EntityTagsPicker/EntityTagsPicker.esm.js.map +1 -1
- package/dist/components/fields/MultiEntityPicker/MultiEntityPicker.esm.js +45 -44
- package/dist/components/fields/MultiEntityPicker/MultiEntityPicker.esm.js.map +1 -1
- package/dist/components/fields/MyGroupsPicker/MyGroupsPicker.esm.js +36 -35
- package/dist/components/fields/MyGroupsPicker/MyGroupsPicker.esm.js.map +1 -1
- package/dist/components/fields/OwnedEntityPicker/OwnedEntityPicker.esm.js +4 -4
- package/dist/components/fields/OwnedEntityPicker/OwnedEntityPicker.esm.js.map +1 -1
- package/dist/components/fields/OwnerPicker/OwnerPicker.esm.js +2 -2
- package/dist/components/fields/OwnerPicker/OwnerPicker.esm.js.map +1 -1
- package/dist/components/fields/RepoBranchPicker/BitbucketRepoBranchPicker.esm.js +26 -23
- package/dist/components/fields/RepoBranchPicker/BitbucketRepoBranchPicker.esm.js.map +1 -1
- package/dist/components/fields/RepoBranchPicker/DefaultRepoBranchPicker.esm.js +17 -15
- package/dist/components/fields/RepoBranchPicker/DefaultRepoBranchPicker.esm.js.map +1 -1
- package/dist/components/fields/RepoBranchPicker/GitHubRepoBranchPicker.esm.js +26 -23
- package/dist/components/fields/RepoBranchPicker/GitHubRepoBranchPicker.esm.js.map +1 -1
- package/dist/components/fields/RepoBranchPicker/RepoBranchPicker.esm.js +13 -5
- package/dist/components/fields/RepoBranchPicker/RepoBranchPicker.esm.js.map +1 -1
- package/dist/components/fields/RepoUrlPicker/AzureRepoPicker.esm.js +62 -53
- package/dist/components/fields/RepoUrlPicker/AzureRepoPicker.esm.js.map +1 -1
- package/dist/components/fields/RepoUrlPicker/BitbucketRepoPicker.esm.js +85 -77
- package/dist/components/fields/RepoUrlPicker/BitbucketRepoPicker.esm.js.map +1 -1
- package/dist/components/fields/RepoUrlPicker/GerritRepoPicker.esm.js +28 -25
- package/dist/components/fields/RepoUrlPicker/GerritRepoPicker.esm.js.map +1 -1
- package/dist/components/fields/RepoUrlPicker/GiteaRepoPicker.esm.js +33 -30
- package/dist/components/fields/RepoUrlPicker/GiteaRepoPicker.esm.js.map +1 -1
- package/dist/components/fields/RepoUrlPicker/GithubRepoPicker.esm.js +37 -34
- package/dist/components/fields/RepoUrlPicker/GithubRepoPicker.esm.js.map +1 -1
- package/dist/components/fields/RepoUrlPicker/GitlabRepoPicker.esm.js +41 -37
- package/dist/components/fields/RepoUrlPicker/GitlabRepoPicker.esm.js.map +1 -1
- package/dist/components/fields/RepoUrlPicker/RepoUrlPicker.esm.js +98 -83
- package/dist/components/fields/RepoUrlPicker/RepoUrlPicker.esm.js.map +1 -1
- package/dist/components/fields/RepoUrlPicker/RepoUrlPickerHost.esm.js +22 -19
- package/dist/components/fields/RepoUrlPicker/RepoUrlPickerHost.esm.js.map +1 -1
- package/dist/components/fields/RepoUrlPicker/RepoUrlPickerRepoName.esm.js +42 -39
- package/dist/components/fields/RepoUrlPicker/RepoUrlPickerRepoName.esm.js.map +1 -1
- package/dist/components/fields/SecretInput/SecretInput.esm.js +5 -5
- package/dist/components/fields/SecretInput/SecretInput.esm.js.map +1 -1
- package/dist/components/fields/VirtualizedListbox.esm.js +29 -26
- package/dist/components/fields/VirtualizedListbox.esm.js.map +1 -1
- package/dist/index.d.ts +17 -16
- package/dist/translation.esm.js +12 -10
- package/dist/translation.esm.js.map +1 -1
- package/package.json +18 -18
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
1
2
|
import Grid from '@material-ui/core/Grid';
|
|
2
3
|
import Divider from '@material-ui/core/Divider';
|
|
3
4
|
import IconButton from '@material-ui/core/IconButton';
|
|
@@ -6,7 +7,6 @@ import { makeStyles } from '@material-ui/core/styles';
|
|
|
6
7
|
import CloseIcon from '@material-ui/icons/Close';
|
|
7
8
|
import RefreshIcon from '@material-ui/icons/Refresh';
|
|
8
9
|
import SaveIcon from '@material-ui/icons/Save';
|
|
9
|
-
import React from 'react';
|
|
10
10
|
import { useDirectoryEditor } from './DirectoryEditorContext.esm.js';
|
|
11
11
|
import { FileBrowser } from '../../../components/FileBrowser/FileBrowser.esm.js';
|
|
12
12
|
import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
|
|
@@ -47,50 +47,58 @@ function TemplateEditorBrowser(props) {
|
|
|
47
47
|
if (!directoryEditor) {
|
|
48
48
|
return null;
|
|
49
49
|
}
|
|
50
|
-
return /* @__PURE__ */
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
50
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
51
|
+
/* @__PURE__ */ jsxs(Grid, { className: classes.grid, container: true, spacing: 0, alignItems: "center", children: [
|
|
52
|
+
/* @__PURE__ */ jsx(
|
|
53
|
+
Tooltip,
|
|
54
|
+
{
|
|
55
|
+
title: t("templateEditorPage.templateEditorBrowser.saveIconTooltip"),
|
|
56
|
+
children: /* @__PURE__ */ jsx(
|
|
57
|
+
IconButton,
|
|
58
|
+
{
|
|
59
|
+
size: "small",
|
|
60
|
+
disabled: directoryEditor.files.every((file) => !file.dirty),
|
|
61
|
+
onClick: () => directoryEditor.save(),
|
|
62
|
+
children: /* @__PURE__ */ jsx(SaveIcon, {})
|
|
63
|
+
}
|
|
64
|
+
)
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
/* @__PURE__ */ jsx(
|
|
68
|
+
Tooltip,
|
|
69
|
+
{
|
|
70
|
+
title: t(
|
|
71
|
+
"templateEditorPage.templateEditorBrowser.reloadIconTooltip"
|
|
72
|
+
),
|
|
73
|
+
children: /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: () => directoryEditor.reload(), children: /* @__PURE__ */ jsx(RefreshIcon, {}) })
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
/* @__PURE__ */ jsx(
|
|
77
|
+
Tooltip,
|
|
78
|
+
{
|
|
79
|
+
title: t("templateEditorPage.templateEditorBrowser.closeIconTooltip"),
|
|
80
|
+
children: /* @__PURE__ */ jsx(
|
|
81
|
+
IconButton,
|
|
82
|
+
{
|
|
83
|
+
size: "small",
|
|
84
|
+
className: classes.closeButton,
|
|
85
|
+
onClick: handleClose,
|
|
86
|
+
children: /* @__PURE__ */ jsx(CloseIcon, {})
|
|
87
|
+
}
|
|
88
|
+
)
|
|
89
|
+
}
|
|
69
90
|
)
|
|
70
|
-
},
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
{
|
|
75
|
-
title: t("templateEditorPage.templateEditorBrowser.closeIconTooltip")
|
|
76
|
-
},
|
|
77
|
-
/* @__PURE__ */ React.createElement(
|
|
78
|
-
IconButton,
|
|
91
|
+
] }),
|
|
92
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
93
|
+
/* @__PURE__ */ jsx(
|
|
94
|
+
FileBrowser,
|
|
79
95
|
{
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
/* @__PURE__ */ React.createElement(CloseIcon, null)
|
|
96
|
+
selected: directoryEditor.selectedFile?.path ?? "",
|
|
97
|
+
onSelect: directoryEditor.setSelectedFile,
|
|
98
|
+
filePaths: directoryEditor.files.map((file) => file.path) ?? []
|
|
99
|
+
}
|
|
85
100
|
)
|
|
86
|
-
|
|
87
|
-
FileBrowser,
|
|
88
|
-
{
|
|
89
|
-
selected: directoryEditor.selectedFile?.path ?? "",
|
|
90
|
-
onSelect: directoryEditor.setSelectedFile,
|
|
91
|
-
filePaths: directoryEditor.files.map((file) => file.path) ?? []
|
|
92
|
-
}
|
|
93
|
-
));
|
|
101
|
+
] });
|
|
94
102
|
}
|
|
95
103
|
|
|
96
104
|
export { TemplateEditorBrowser };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TemplateEditorBrowser.esm.js","sources":["../../../../src/alpha/components/TemplateEditorPage/TemplateEditorBrowser.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 Grid from '@material-ui/core/Grid';\nimport Divider from '@material-ui/core/Divider';\nimport IconButton from '@material-ui/core/IconButton';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport { makeStyles } from '@material-ui/core/styles';\nimport CloseIcon from '@material-ui/icons/Close';\nimport RefreshIcon from '@material-ui/icons/Refresh';\nimport SaveIcon from '@material-ui/icons/Save';\nimport
|
|
1
|
+
{"version":3,"file":"TemplateEditorBrowser.esm.js","sources":["../../../../src/alpha/components/TemplateEditorPage/TemplateEditorBrowser.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 Grid from '@material-ui/core/Grid';\nimport Divider from '@material-ui/core/Divider';\nimport IconButton from '@material-ui/core/IconButton';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport { makeStyles } from '@material-ui/core/styles';\nimport CloseIcon from '@material-ui/icons/Close';\nimport RefreshIcon from '@material-ui/icons/Refresh';\nimport SaveIcon from '@material-ui/icons/Save';\nimport { useDirectoryEditor } from './DirectoryEditorContext';\nimport { FileBrowser } from '../../../components/FileBrowser';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { scaffolderTranslationRef } from '../../../translation';\n\nconst useStyles = makeStyles(\n theme => ({\n grid: {\n '& svg': {\n margin: theme.spacing(1),\n },\n },\n closeButton: {\n marginLeft: 'auto',\n },\n }),\n { name: 'ScaffolderTemplateEditorBrowser' },\n);\n\n/** The local file browser for the template editor */\nexport function TemplateEditorBrowser(props: { onClose?: () => void }) {\n const classes = useStyles();\n const directoryEditor = useDirectoryEditor();\n const changedFiles = directoryEditor?.files.filter(file => file.dirty);\n const { t } = useTranslationRef(scaffolderTranslationRef);\n\n const handleClose = () => {\n if (!props.onClose) {\n return;\n }\n if (changedFiles?.length) {\n // eslint-disable-next-line no-alert\n const accepted = window.confirm(\n t('templateEditorPage.templateEditorBrowser.closeConfirmMessage'),\n );\n if (!accepted) {\n return;\n }\n }\n props.onClose();\n };\n\n if (!directoryEditor) {\n return null;\n }\n\n return (\n <>\n <Grid className={classes.grid} container spacing={0} alignItems=\"center\">\n <Tooltip\n title={t('templateEditorPage.templateEditorBrowser.saveIconTooltip')}\n >\n <IconButton\n size=\"small\"\n disabled={directoryEditor.files.every(file => !file.dirty)}\n onClick={() => directoryEditor.save()}\n >\n <SaveIcon />\n </IconButton>\n </Tooltip>\n <Tooltip\n title={t(\n 'templateEditorPage.templateEditorBrowser.reloadIconTooltip',\n )}\n >\n <IconButton size=\"small\" onClick={() => directoryEditor.reload()}>\n <RefreshIcon />\n </IconButton>\n </Tooltip>\n <Tooltip\n title={t('templateEditorPage.templateEditorBrowser.closeIconTooltip')}\n >\n <IconButton\n size=\"small\"\n className={classes.closeButton}\n onClick={handleClose}\n >\n <CloseIcon />\n </IconButton>\n </Tooltip>\n </Grid>\n <Divider />\n <FileBrowser\n selected={directoryEditor.selectedFile?.path ?? ''}\n onSelect={directoryEditor.setSelectedFile}\n filePaths={directoryEditor.files.map(file => file.path) ?? []}\n />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AAgB,KAAM,CAAA,GAAA,CAAI,UAAQ,IAAK,CAAA,IAAI,KAAK;AAAC;AAAA;AAC9D,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
1
2
|
import { useApiHolder } from '@backstage/core-plugin-api';
|
|
2
3
|
import { makeStyles } from '@material-ui/core/styles';
|
|
3
4
|
import Paper from '@material-ui/core/Paper';
|
|
4
5
|
import Typography from '@material-ui/core/Typography';
|
|
5
|
-
import
|
|
6
|
+
import { useState, useMemo, Component } from 'react';
|
|
6
7
|
import useDebounce from 'react-use/esm/useDebounce';
|
|
7
8
|
import yaml from 'yaml';
|
|
8
9
|
import { useTranslationRef } from '@backstage/frontend-plugin-api';
|
|
@@ -105,7 +106,7 @@ function TemplateEditorForm(props) {
|
|
|
105
106
|
250,
|
|
106
107
|
[contentIsSpec, content, apiHolder]
|
|
107
108
|
);
|
|
108
|
-
return /* @__PURE__ */
|
|
109
|
+
return /* @__PURE__ */ jsx("div", { className: classes.containerWrapper, children: steps ? /* @__PURE__ */ jsx(Paper, { variant: "outlined", children: /* @__PURE__ */ jsx(ErrorBoundary, { invalidator: steps, setErrorText, children: /* @__PURE__ */ jsx(
|
|
109
110
|
Stepper,
|
|
110
111
|
{
|
|
111
112
|
manifest: { steps, title: "Template Editor" },
|
|
@@ -117,7 +118,7 @@ function TemplateEditorForm(props) {
|
|
|
117
118
|
layouts,
|
|
118
119
|
formProps: props.formProps
|
|
119
120
|
}
|
|
120
|
-
))) : /* @__PURE__ */
|
|
121
|
+
) }) }) : /* @__PURE__ */ jsx(Typography, { variant: "body1", color: "textSecondary", children: t("templateEditorForm.stepper.emptyText") }) });
|
|
121
122
|
}
|
|
122
123
|
function TemplateEditorFormDirectoryEditorDryRun(props) {
|
|
123
124
|
const { setErrorText, fieldExtensions = [], layouts } = props;
|
|
@@ -144,7 +145,7 @@ function TemplateEditorFormDirectoryEditorDryRun(props) {
|
|
|
144
145
|
if (!directoryEditor) {
|
|
145
146
|
return null;
|
|
146
147
|
}
|
|
147
|
-
return /* @__PURE__ */
|
|
148
|
+
return /* @__PURE__ */ jsx(
|
|
148
149
|
TemplateEditorForm,
|
|
149
150
|
{
|
|
150
151
|
onDryRun: handleDryRun,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TemplateEditorForm.esm.js","sources":["../../../../src/alpha/components/TemplateEditorPage/TemplateEditorForm.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 { useApiHolder } from '@backstage/core-plugin-api';\nimport { JsonObject, JsonValue } from '@backstage/types';\nimport { makeStyles } from '@material-ui/core/styles';\nimport Paper from '@material-ui/core/Paper';\nimport Typography from '@material-ui/core/Typography';\nimport React, { Component, ReactNode, useMemo, useState } from 'react';\nimport useDebounce from 'react-use/esm/useDebounce';\nimport yaml from 'yaml';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport {\n LayoutOptions,\n TemplateParameterSchema,\n FieldExtensionOptions,\n FormProps,\n} from '@backstage/plugin-scaffolder-react';\nimport {\n Stepper,\n createAsyncValidators,\n} from '@backstage/plugin-scaffolder-react/alpha';\nimport { useDryRun } from './DryRunContext';\nimport { useDirectoryEditor } from './DirectoryEditorContext';\n\nimport { scaffolderTranslationRef } from '../../../translation';\n\nconst useStyles = makeStyles({\n containerWrapper: {\n width: '100%',\n },\n});\n\ninterface ErrorBoundaryProps {\n invalidator: unknown;\n setErrorText(errorText: string | undefined): void;\n children: ReactNode;\n}\n\ninterface ErrorBoundaryState {\n shouldRender: boolean;\n}\n\nclass ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {\n state = {\n shouldRender: true,\n };\n\n componentDidUpdate(prevProps: { invalidator: unknown }) {\n if (prevProps.invalidator !== this.props.invalidator) {\n this.setState({ shouldRender: true });\n }\n }\n\n componentDidCatch(error: Error) {\n this.props.setErrorText(error.message);\n this.setState({ shouldRender: false });\n }\n\n render() {\n return this.state.shouldRender ? this.props.children : null;\n }\n}\n\ninterface TemplateEditorFormProps {\n content?: string;\n /** Setting this to true will cause the content to be parsed as if it is the template entity spec */\n contentIsSpec?: boolean;\n setErrorText: (errorText?: string) => void;\n\n onDryRun?: (data: JsonObject) => Promise<void>;\n fieldExtensions?: FieldExtensionOptions<any, any>[];\n layouts?: LayoutOptions[];\n formProps?: FormProps;\n}\n\nfunction isJsonObject(value: JsonValue | undefined): value is JsonObject {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/** Shows the a template form that is parsed from the provided content */\nexport function TemplateEditorForm(props: TemplateEditorFormProps) {\n const {\n content,\n contentIsSpec,\n onDryRun,\n setErrorText,\n fieldExtensions = [],\n layouts = [],\n } = props;\n const classes = useStyles();\n const apiHolder = useApiHolder();\n const { t } = useTranslationRef(scaffolderTranslationRef);\n\n const [steps, setSteps] = useState<TemplateParameterSchema['steps']>();\n\n const fields = useMemo(() => {\n return Object.fromEntries(\n fieldExtensions.map(({ name, component }) => [name, component]),\n );\n }, [fieldExtensions]);\n\n useDebounce(\n () => {\n try {\n if (!content) {\n setSteps(undefined);\n return;\n }\n const parsed: JsonValue = yaml\n .parseAllDocuments(content)\n .filter(c => c)\n .map(c => c.toJSON())[0];\n\n if (!isJsonObject(parsed)) {\n setSteps(undefined);\n return;\n }\n\n let rootObj = parsed;\n if (!contentIsSpec) {\n const isTemplate =\n String(parsed.kind).toLocaleLowerCase('en-US') === 'template';\n if (!isTemplate) {\n setSteps(undefined);\n return;\n }\n\n rootObj = isJsonObject(parsed.spec) ? parsed.spec : {};\n }\n\n const { parameters } = rootObj;\n\n if (!Array.isArray(parameters)) {\n setErrorText('Template parameters must be an array');\n setSteps(undefined);\n return;\n }\n\n const fieldValidators = Object.fromEntries(\n fieldExtensions.map(({ name, validation }) => [name, validation]),\n );\n\n setErrorText();\n setSteps(\n parameters.flatMap(param =>\n isJsonObject(param)\n ? [\n {\n title: String(param.title),\n schema: param,\n validate: createAsyncValidators(param, fieldValidators, {\n apiHolder,\n }),\n },\n ]\n : [],\n ),\n );\n } catch (e) {\n setErrorText(e.message);\n }\n },\n 250,\n [contentIsSpec, content, apiHolder],\n );\n\n return (\n <div className={classes.containerWrapper}>\n {steps ? (\n <Paper variant=\"outlined\">\n <ErrorBoundary invalidator={steps} setErrorText={setErrorText}>\n <Stepper\n manifest={{ steps, title: 'Template Editor' }}\n extensions={fieldExtensions}\n components={fields}\n onCreate={async options => {\n await onDryRun?.(options);\n }}\n layouts={layouts}\n formProps={props.formProps}\n />\n </ErrorBoundary>\n </Paper>\n ) : (\n <Typography variant=\"body1\" color=\"textSecondary\">\n {t('templateEditorForm.stepper.emptyText')}\n </Typography>\n )}\n </div>\n );\n}\n\n/** A version of the TemplateEditorForm that is connected to the DirectoryEditor and DryRun contexts */\nexport function TemplateEditorFormDirectoryEditorDryRun(\n props: Pick<\n TemplateEditorFormProps,\n 'setErrorText' | 'fieldExtensions' | 'layouts' | 'formProps'\n >,\n) {\n const { setErrorText, fieldExtensions = [], layouts } = props;\n const dryRun = useDryRun();\n\n const directoryEditor = useDirectoryEditor();\n const { selectedFile } = directoryEditor ?? {};\n\n const handleDryRun = async (data: JsonObject) => {\n if (!selectedFile) {\n return;\n }\n\n try {\n await dryRun.execute({\n templateContent: selectedFile.content,\n values: data,\n files: directoryEditor?.files ?? [],\n });\n setErrorText();\n } catch (e) {\n setErrorText(String(e.cause || e));\n throw e;\n }\n };\n\n const content =\n selectedFile && selectedFile.path.match(/\\.ya?ml$/)\n ? selectedFile.content\n : undefined;\n\n if (!directoryEditor) {\n return null;\n }\n\n return (\n <TemplateEditorForm\n onDryRun={handleDryRun}\n fieldExtensions={fieldExtensions}\n setErrorText={setErrorText}\n content={content}\n layouts={layouts}\n formProps={props.formProps}\n />\n );\n}\n\nTemplateEditorForm.DirectoryEditorDryRun =\n TemplateEditorFormDirectoryEditorDryRun;\n"],"names":[],"mappings":";;;;;;;;;;;;;AAuCA,MAAM,YAAY,UAAW,CAAA;AAAA,EAC3B,gBAAkB,EAAA;AAAA,IAChB,KAAO,EAAA;AAAA;AAEX,CAAC,CAAA;AAYD,MAAM,sBAAsB,SAAkD,CAAA;AAAA,EAC5E,KAAQ,GAAA;AAAA,IACN,YAAc,EAAA;AAAA,GAChB;AAAA,EAEA,mBAAmB,SAAqC,EAAA;AACtD,IAAA,IAAI,SAAU,CAAA,WAAA,KAAgB,IAAK,CAAA,KAAA,CAAM,WAAa,EAAA;AACpD,MAAA,IAAA,CAAK,QAAS,CAAA,EAAE,YAAc,EAAA,IAAA,EAAM,CAAA;AAAA;AACtC;AACF,EAEA,kBAAkB,KAAc,EAAA;AAC9B,IAAK,IAAA,CAAA,KAAA,CAAM,YAAa,CAAA,KAAA,CAAM,OAAO,CAAA;AACrC,IAAA,IAAA,CAAK,QAAS,CAAA,EAAE,YAAc,EAAA,KAAA,EAAO,CAAA;AAAA;AACvC,EAEA,MAAS,GAAA;AACP,IAAA,OAAO,IAAK,CAAA,KAAA,CAAM,YAAe,GAAA,IAAA,CAAK,MAAM,QAAW,GAAA,IAAA;AAAA;AAE3D;AAcA,SAAS,aAAa,KAAmD,EAAA;AACvE,EAAO,OAAA,OAAO,UAAU,QAAY,IAAA,KAAA,KAAU,QAAQ,CAAC,KAAA,CAAM,QAAQ,KAAK,CAAA;AAC5E;AAGO,SAAS,mBAAmB,KAAgC,EAAA;AACjE,EAAM,MAAA;AAAA,IACJ,OAAA;AAAA,IACA,aAAA;AAAA,IACA,QAAA;AAAA,IACA,YAAA;AAAA,IACA,kBAAkB,EAAC;AAAA,IACn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AAA,CAAK,MAAM,UAAU,CAAA,GAC9C,aAAa,OACb,GAAA,KAAA,CAAA;AAEN,EAAA,IAAI,CAAC,eAAiB,EAAA;AACpB,IAAO,OAAA,IAAA;AAAA;AAGT,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,kBAAA;AAAA,IAAA;AAAA,MACC,QAAU,EAAA,YAAA;AAAA,MACV,eAAA;AAAA,MACA,YAAA;AAAA,MACA,OAAA;AAAA,MACA,OAAA;AAAA,MACA,WAAW,KAAM,CAAA;AAAA;AAAA,GACnB;AAEJ;AAEA,kBAAA,CAAmB,qBACjB,GAAA,uCAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"TemplateEditorForm.esm.js","sources":["../../../../src/alpha/components/TemplateEditorPage/TemplateEditorForm.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 { useApiHolder } from '@backstage/core-plugin-api';\nimport { JsonObject, JsonValue } from '@backstage/types';\nimport { makeStyles } from '@material-ui/core/styles';\nimport Paper from '@material-ui/core/Paper';\nimport Typography from '@material-ui/core/Typography';\nimport { Component, ReactNode, useMemo, useState } from 'react';\nimport useDebounce from 'react-use/esm/useDebounce';\nimport yaml from 'yaml';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport {\n LayoutOptions,\n TemplateParameterSchema,\n FieldExtensionOptions,\n FormProps,\n} from '@backstage/plugin-scaffolder-react';\nimport {\n Stepper,\n createAsyncValidators,\n} from '@backstage/plugin-scaffolder-react/alpha';\nimport { useDryRun } from './DryRunContext';\nimport { useDirectoryEditor } from './DirectoryEditorContext';\n\nimport { scaffolderTranslationRef } from '../../../translation';\n\nconst useStyles = makeStyles({\n containerWrapper: {\n width: '100%',\n },\n});\n\ninterface ErrorBoundaryProps {\n invalidator: unknown;\n setErrorText(errorText: string | undefined): void;\n children: ReactNode;\n}\n\ninterface ErrorBoundaryState {\n shouldRender: boolean;\n}\n\nclass ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {\n state = {\n shouldRender: true,\n };\n\n componentDidUpdate(prevProps: { invalidator: unknown }) {\n if (prevProps.invalidator !== this.props.invalidator) {\n this.setState({ shouldRender: true });\n }\n }\n\n componentDidCatch(error: Error) {\n this.props.setErrorText(error.message);\n this.setState({ shouldRender: false });\n }\n\n render() {\n return this.state.shouldRender ? this.props.children : null;\n }\n}\n\ninterface TemplateEditorFormProps {\n content?: string;\n /** Setting this to true will cause the content to be parsed as if it is the template entity spec */\n contentIsSpec?: boolean;\n setErrorText: (errorText?: string) => void;\n\n onDryRun?: (data: JsonObject) => Promise<void>;\n fieldExtensions?: FieldExtensionOptions<any, any>[];\n layouts?: LayoutOptions[];\n formProps?: FormProps;\n}\n\nfunction isJsonObject(value: JsonValue | undefined): value is JsonObject {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/** Shows the a template form that is parsed from the provided content */\nexport function TemplateEditorForm(props: TemplateEditorFormProps) {\n const {\n content,\n contentIsSpec,\n onDryRun,\n setErrorText,\n fieldExtensions = [],\n layouts = [],\n } = props;\n const classes = useStyles();\n const apiHolder = useApiHolder();\n const { t } = useTranslationRef(scaffolderTranslationRef);\n\n const [steps, setSteps] = useState<TemplateParameterSchema['steps']>();\n\n const fields = useMemo(() => {\n return Object.fromEntries(\n fieldExtensions.map(({ name, component }) => [name, component]),\n );\n }, [fieldExtensions]);\n\n useDebounce(\n () => {\n try {\n if (!content) {\n setSteps(undefined);\n return;\n }\n const parsed: JsonValue = yaml\n .parseAllDocuments(content)\n .filter(c => c)\n .map(c => c.toJSON())[0];\n\n if (!isJsonObject(parsed)) {\n setSteps(undefined);\n return;\n }\n\n let rootObj = parsed;\n if (!contentIsSpec) {\n const isTemplate =\n String(parsed.kind).toLocaleLowerCase('en-US') === 'template';\n if (!isTemplate) {\n setSteps(undefined);\n return;\n }\n\n rootObj = isJsonObject(parsed.spec) ? parsed.spec : {};\n }\n\n const { parameters } = rootObj;\n\n if (!Array.isArray(parameters)) {\n setErrorText('Template parameters must be an array');\n setSteps(undefined);\n return;\n }\n\n const fieldValidators = Object.fromEntries(\n fieldExtensions.map(({ name, validation }) => [name, validation]),\n );\n\n setErrorText();\n setSteps(\n parameters.flatMap(param =>\n isJsonObject(param)\n ? [\n {\n title: String(param.title),\n schema: param,\n validate: createAsyncValidators(param, fieldValidators, {\n apiHolder,\n }),\n },\n ]\n : [],\n ),\n );\n } catch (e) {\n setErrorText(e.message);\n }\n },\n 250,\n [contentIsSpec, content, apiHolder],\n );\n\n return (\n <div className={classes.containerWrapper}>\n {steps ? (\n <Paper variant=\"outlined\">\n <ErrorBoundary invalidator={steps} setErrorText={setErrorText}>\n <Stepper\n manifest={{ steps, title: 'Template Editor' }}\n extensions={fieldExtensions}\n components={fields}\n onCreate={async options => {\n await onDryRun?.(options);\n }}\n layouts={layouts}\n formProps={props.formProps}\n />\n </ErrorBoundary>\n </Paper>\n ) : (\n <Typography variant=\"body1\" color=\"textSecondary\">\n {t('templateEditorForm.stepper.emptyText')}\n </Typography>\n )}\n </div>\n );\n}\n\n/** A version of the TemplateEditorForm that is connected to the DirectoryEditor and DryRun contexts */\nexport function TemplateEditorFormDirectoryEditorDryRun(\n props: Pick<\n TemplateEditorFormProps,\n 'setErrorText' | 'fieldExtensions' | 'layouts' | 'formProps'\n >,\n) {\n const { setErrorText, fieldExtensions = [], layouts } = props;\n const dryRun = useDryRun();\n\n const directoryEditor = useDirectoryEditor();\n const { selectedFile } = directoryEditor ?? {};\n\n const handleDryRun = async (data: JsonObject) => {\n if (!selectedFile) {\n return;\n }\n\n try {\n await dryRun.execute({\n templateContent: selectedFile.content,\n values: data,\n files: directoryEditor?.files ?? [],\n });\n setErrorText();\n } catch (e) {\n setErrorText(String(e.cause || e));\n throw e;\n }\n };\n\n const content =\n selectedFile && selectedFile.path.match(/\\.ya?ml$/)\n ? selectedFile.content\n : undefined;\n\n if (!directoryEditor) {\n return null;\n }\n\n return (\n <TemplateEditorForm\n onDryRun={handleDryRun}\n fieldExtensions={fieldExtensions}\n setErrorText={setErrorText}\n content={content}\n layouts={layouts}\n formProps={props.formProps}\n />\n );\n}\n\nTemplateEditorForm.DirectoryEditorDryRun =\n TemplateEditorFormDirectoryEditorDryRun;\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAuCA,MAAM,YAAY,UAAW,CAAA;AAAA,EAC3B,gBAAkB,EAAA;AAAA,IAChB,KAAO,EAAA;AAAA;AAEX,CAAC,CAAA;AAYD,MAAM,sBAAsB,SAAkD,CAAA;AAAA,EAC5E,KAAQ,GAAA;AAAA,IACN,YAAc,EAAA;AAAA,GAChB;AAAA,EAEA,mBAAmB,SAAqC,EAAA;AACtD,IAAA,IAAI,SAAU,CAAA,WAAA,KAAgB,IAAK,CAAA,KAAA,CAAM,WAAa,EAAA;AACpD,MAAA,IAAA,CAAK,QAAS,CAAA,EAAE,YAAc,EAAA,IAAA,EAAM,CAAA;AAAA;AACtC;AACF,EAEA,kBAAkB,KAAc,EAAA;AAC9B,IAAK,IAAA,CAAA,KAAA,CAAM,YAAa,CAAA,KAAA,CAAM,OAAO,CAAA;AACrC,IAAA,IAAA,CAAK,QAAS,CAAA,EAAE,YAAc,EAAA,KAAA,EAAO,CAAA;AAAA;AACvC,EAEA,MAAS,GAAA;AACP,IAAA,OAAO,IAAK,CAAA,KAAA,CAAM,YAAe,GAAA,IAAA,CAAK,MAAM,QAAW,GAAA,IAAA;AAAA;AAE3D;AAcA,SAAS,aAAa,KAAmD,EAAA;AACvE,EAAO,OAAA,OAAO,UAAU,QAAY,IAAA,KAAA,KAAU,QAAQ,CAAC,KAAA,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,CAAG,EAAA;AACV,MAAA,YAAA,CAAa,MAAO,CAAA,CAAA,CAAE,KAAS,IAAA,CAAC,CAAC,CAAA;AACjC,MAAM,MAAA,CAAA;AAAA;AACR,GACF;AAEA,EAAM,MAAA,OAAA,GACJ,gBAAgB,YAAa,CAAA,IAAA,CAAK,MAAM,UAAU,CAAA,GAC9C,aAAa,OACb,GAAA,KAAA,CAAA;AAEN,EAAA,IAAI,CAAC,eAAiB,EAAA;AACpB,IAAO,OAAA,IAAA;AAAA;AAGT,EACE,uBAAA,GAAA;AAAA,IAAC,kBAAA;AAAA,IAAA;AAAA,MACC,QAAU,EAAA,YAAA;AAAA,MACV,eAAA;AAAA,MACA,YAAA;AAAA,MACA,OAAA;AAAA,MACA,OAAA;AAAA,MACA,WAAW,KAAM,CAAA;AAAA;AAAA,GACnB;AAEJ;AAEA,kBAAA,CAAmB,qBACjB,GAAA,uCAAA;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import Card from '@material-ui/core/Card';
|
|
3
3
|
import CardActionArea from '@material-ui/core/CardActionArea';
|
|
4
4
|
import CardContent from '@material-ui/core/CardContent';
|
|
@@ -65,82 +65,99 @@ function ActionCard(props) {
|
|
|
65
65
|
const { t } = useTranslationRef(scaffolderTranslationRef);
|
|
66
66
|
const classes = useStyles();
|
|
67
67
|
const { Icon, title, description, action } = props;
|
|
68
|
-
return /* @__PURE__ */
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
{
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
68
|
+
return /* @__PURE__ */ jsxs(Card, { className: classes.card, children: [
|
|
69
|
+
!supportsLoad && /* @__PURE__ */ jsx(
|
|
70
|
+
Tooltip,
|
|
71
|
+
{
|
|
72
|
+
placement: "top",
|
|
73
|
+
title: t(
|
|
74
|
+
"templateEditorPage.templateEditorIntro.loadLocal.unsupportedTooltip"
|
|
75
|
+
),
|
|
76
|
+
children: /* @__PURE__ */ jsx(InfoOutlinedIcon, {})
|
|
77
|
+
}
|
|
78
|
+
),
|
|
79
|
+
/* @__PURE__ */ jsxs(CardActionArea, { onClick: action, children: [
|
|
80
|
+
/* @__PURE__ */ jsx(CardMedia, { children: /* @__PURE__ */ jsx(
|
|
81
|
+
Icon,
|
|
82
|
+
{
|
|
83
|
+
className: classes.icon,
|
|
84
|
+
color: supportsLoad ? void 0 : "disabled"
|
|
85
|
+
}
|
|
86
|
+
) }),
|
|
87
|
+
/* @__PURE__ */ jsxs(CardContent, { className: classes.cardContent, children: [
|
|
88
|
+
/* @__PURE__ */ jsx(
|
|
89
|
+
Typography,
|
|
90
|
+
{
|
|
91
|
+
gutterBottom: true,
|
|
92
|
+
variant: "h5",
|
|
93
|
+
component: "h2",
|
|
94
|
+
color: supportsLoad ? void 0 : "textSecondary",
|
|
95
|
+
children: title
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body2", color: "textSecondary", component: "p", children: description })
|
|
99
|
+
] })
|
|
100
|
+
] })
|
|
101
|
+
] });
|
|
93
102
|
}
|
|
94
103
|
function TemplateEditorIntro(props) {
|
|
95
104
|
const classes = useStyles();
|
|
96
105
|
const { t } = useTranslationRef(scaffolderTranslationRef);
|
|
97
|
-
return /* @__PURE__ */
|
|
98
|
-
|
|
99
|
-
{
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
title: t(
|
|
112
|
-
"templateEditorPage.templateEditorIntro.createLocal.title"
|
|
113
|
-
),
|
|
114
|
-
description: t(
|
|
115
|
-
"templateEditorPage.templateEditorIntro.createLocal.description"
|
|
106
|
+
return /* @__PURE__ */ jsxs("div", { style: props.style, children: [
|
|
107
|
+
/* @__PURE__ */ jsx(Typography, { variant: "h4", component: "h2", className: classes.introText, children: t("templateEditorPage.templateEditorIntro.title") }),
|
|
108
|
+
/* @__PURE__ */ jsx("div", { className: classes.gridRoot, children: /* @__PURE__ */ jsxs("div", { className: classes.cardGrid, children: [
|
|
109
|
+
/* @__PURE__ */ jsx(
|
|
110
|
+
ActionCard,
|
|
111
|
+
{
|
|
112
|
+
title: t("templateEditorPage.templateEditorIntro.loadLocal.title"),
|
|
113
|
+
description: t(
|
|
114
|
+
"templateEditorPage.templateEditorIntro.loadLocal.description"
|
|
115
|
+
),
|
|
116
|
+
requireLoad: true,
|
|
117
|
+
Icon: PublishIcon,
|
|
118
|
+
action: () => props.onSelect?.("local")
|
|
119
|
+
}
|
|
116
120
|
),
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
), /* @__PURE__ */ React.createElement(
|
|
132
|
-
ActionCard,
|
|
133
|
-
{
|
|
134
|
-
title: t(
|
|
135
|
-
"templateEditorPage.templateEditorIntro.fieldExplorer.title"
|
|
121
|
+
/* @__PURE__ */ jsx(
|
|
122
|
+
ActionCard,
|
|
123
|
+
{
|
|
124
|
+
title: t(
|
|
125
|
+
"templateEditorPage.templateEditorIntro.createLocal.title"
|
|
126
|
+
),
|
|
127
|
+
description: t(
|
|
128
|
+
"templateEditorPage.templateEditorIntro.createLocal.description"
|
|
129
|
+
),
|
|
130
|
+
requireLoad: true,
|
|
131
|
+
action: () => props.onSelect?.("create-template"),
|
|
132
|
+
Icon: CreateNewFolderIcon
|
|
133
|
+
}
|
|
136
134
|
),
|
|
137
|
-
|
|
138
|
-
|
|
135
|
+
/* @__PURE__ */ jsx(
|
|
136
|
+
ActionCard,
|
|
137
|
+
{
|
|
138
|
+
title: t("templateEditorPage.templateEditorIntro.formEditor.title"),
|
|
139
|
+
description: t(
|
|
140
|
+
"templateEditorPage.templateEditorIntro.formEditor.description"
|
|
141
|
+
),
|
|
142
|
+
Icon: ListAltIcon,
|
|
143
|
+
action: () => props.onSelect?.("form")
|
|
144
|
+
}
|
|
139
145
|
),
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
146
|
+
/* @__PURE__ */ jsx(
|
|
147
|
+
ActionCard,
|
|
148
|
+
{
|
|
149
|
+
title: t(
|
|
150
|
+
"templateEditorPage.templateEditorIntro.fieldExplorer.title"
|
|
151
|
+
),
|
|
152
|
+
description: t(
|
|
153
|
+
"templateEditorPage.templateEditorIntro.fieldExplorer.description"
|
|
154
|
+
),
|
|
155
|
+
Icon: FormatListBulletedIcon,
|
|
156
|
+
action: () => props.onSelect?.("field-explorer")
|
|
157
|
+
}
|
|
158
|
+
)
|
|
159
|
+
] }) })
|
|
160
|
+
] });
|
|
144
161
|
}
|
|
145
162
|
|
|
146
163
|
export { TemplateEditorIntro };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TemplateEditorIntro.esm.js","sources":["../../../../src/alpha/components/TemplateEditorPage/TemplateEditorIntro.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 */\n\nimport React from 'react';\nimport Card from '@material-ui/core/Card';\nimport CardActionArea from '@material-ui/core/CardActionArea';\nimport CardContent from '@material-ui/core/CardContent';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { WebFileSystemAccess } from '../../../lib/filesystem';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { scaffolderTranslationRef } from '../../../translation';\nimport CreateNewFolderIcon from '@material-ui/icons/CreateNewFolder';\nimport ListAltIcon from '@material-ui/icons/ListAlt';\nimport FormatListBulletedIcon from '@material-ui/icons/FormatListBulleted';\nimport InfoOutlinedIcon from '@material-ui/icons/InfoOutlined';\nimport CardMedia from '@material-ui/core/CardMedia';\nimport PublishIcon from '@material-ui/icons/Publish';\nimport SvgIcon from '@material-ui/core/SvgIcon';\nimport Tooltip from '@material-ui/core/Tooltip';\n\nconst useStyles = makeStyles(theme => ({\n gridRoot: {\n display: 'flex',\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n },\n cardGrid: {\n maxWidth: 1000,\n display: 'grid',\n gridGap: theme.spacing(2),\n gridAutoFlow: 'row',\n [theme.breakpoints.up('md')]: {\n gridTemplateRows: '1fr 1fr',\n gridTemplateColumns: '1fr 1fr',\n },\n },\n card: {\n display: 'grid',\n gridTemplateColumns: 'auto 1fr',\n gridTemplateRows: '1fr',\n alignItems: 'center',\n margin: theme.spacing(0, 1),\n marginTop: theme.spacing(2),\n padding: theme.spacing(2),\n },\n icon: {\n justifySelf: 'center',\n paddingTop: theme.spacing(1),\n fontSize: 48,\n },\n introText: {\n textAlign: 'center',\n marginTop: theme.spacing(2),\n },\n infoIcon: {\n position: 'absolute',\n top: theme.spacing(1),\n right: theme.spacing(1),\n },\n cardContent: {\n padding: theme.spacing(1),\n },\n}));\n\ninterface EditorIntroProps {\n style?: JSX.IntrinsicElements['div']['style'];\n onSelect?: (\n option: 'create-template' | 'local' | 'form' | 'field-explorer',\n ) => void;\n}\n\nfunction ActionCard(props: {\n title: string;\n description: string;\n Icon: typeof SvgIcon;\n action?: React.MouseEventHandler;\n requireLoad?: boolean;\n}) {\n const supportsLoad = props.requireLoad\n ? WebFileSystemAccess.isSupported()\n : true;\n const { t } = useTranslationRef(scaffolderTranslationRef);\n\n const classes = useStyles();\n const { Icon, title, description, action } = props;\n return (\n <Card className={classes.card}>\n {!supportsLoad && (\n <Tooltip\n placement=\"top\"\n title={t(\n 'templateEditorPage.templateEditorIntro.loadLocal.unsupportedTooltip',\n )}\n >\n <InfoOutlinedIcon />\n </Tooltip>\n )}\n\n <CardActionArea onClick={action}>\n <CardMedia>\n <Icon\n className={classes.icon}\n color={supportsLoad ? undefined : 'disabled'}\n />\n </CardMedia>\n <CardContent className={classes.cardContent}>\n <Typography\n gutterBottom\n variant=\"h5\"\n component=\"h2\"\n color={supportsLoad ? undefined : 'textSecondary'}\n >\n {title}\n </Typography>\n <Typography variant=\"body2\" color=\"textSecondary\" component=\"p\">\n {description}\n </Typography>\n </CardContent>\n </CardActionArea>\n </Card>\n );\n}\nexport function TemplateEditorIntro(props: EditorIntroProps) {\n const classes = useStyles();\n const { t } = useTranslationRef(scaffolderTranslationRef);\n\n return (\n <div style={props.style}>\n <Typography variant=\"h4\" component=\"h2\" className={classes.introText}>\n {t('templateEditorPage.templateEditorIntro.title')}\n </Typography>\n <div className={classes.gridRoot}>\n <div className={classes.cardGrid}>\n <ActionCard\n title={t('templateEditorPage.templateEditorIntro.loadLocal.title')}\n description={t(\n 'templateEditorPage.templateEditorIntro.loadLocal.description',\n )}\n requireLoad\n Icon={PublishIcon}\n action={() => props.onSelect?.('local')}\n />\n <ActionCard\n title={t(\n 'templateEditorPage.templateEditorIntro.createLocal.title',\n )}\n description={t(\n 'templateEditorPage.templateEditorIntro.createLocal.description',\n )}\n requireLoad\n action={() => props.onSelect?.('create-template')}\n Icon={CreateNewFolderIcon}\n />\n\n <ActionCard\n title={t('templateEditorPage.templateEditorIntro.formEditor.title')}\n description={t(\n 'templateEditorPage.templateEditorIntro.formEditor.description',\n )}\n Icon={ListAltIcon}\n action={() => props.onSelect?.('form')}\n />\n\n <ActionCard\n title={t(\n 'templateEditorPage.templateEditorIntro.fieldExplorer.title',\n )}\n description={t(\n 'templateEditorPage.templateEditorIntro.fieldExplorer.description',\n )}\n Icon={FormatListBulletedIcon}\n action={() => props.onSelect?.('field-explorer')}\n />\n </div>\n </div>\n </div>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAkCA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,QAAU,EAAA;AAAA,IACR,OAAS,EAAA,MAAA;AAAA,IACT,IAAM,EAAA,CAAA;AAAA,IACN,UAAY,EAAA,QAAA;AAAA,IACZ,cAAgB,EAAA;AAAA,GAClB;AAAA,EACA,QAAU,EAAA;AAAA,IACR,QAAU,EAAA,GAAA;AAAA,IACV,OAAS,EAAA,MAAA;AAAA,IACT,OAAA,EAAS,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,IACxB,YAAc,EAAA,KAAA;AAAA,IACd,CAAC,KAAM,CAAA,WAAA,CAAY,EAAG,CAAA,IAAI,CAAC,GAAG;AAAA,MAC5B,gBAAkB,EAAA,SAAA;AAAA,MAClB,mBAAqB,EAAA;AAAA;AACvB,GACF;AAAA,EACA,IAAM,EAAA;AAAA,IACJ,OAAS,EAAA,MAAA;AAAA,IACT,mBAAqB,EAAA,UAAA;AAAA,IACrB,gBAAkB,EAAA,KAAA;AAAA,IAClB,UAAY,EAAA,QAAA;AAAA,IACZ,MAAQ,EAAA,KAAA,CAAM,OAAQ,CAAA,CAAA,EAAG,CAAC,CAAA;AAAA,IAC1B,SAAA,EAAW,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,IAC1B,OAAA,EAAS,KAAM,CAAA,OAAA,CAAQ,CAAC;AAAA,GAC1B;AAAA,EACA,IAAM,EAAA;AAAA,IACJ,WAAa,EAAA,QAAA;AAAA,IACb,U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EAAE,wDAAwD,CAAA;AAAA,MACjE,WAAa,EAAA,CAAA;AAAA,QACX;AAAA,OACF;AAAA,MACA,WAAW,EAAA,IAAA;AAAA,MACX,IAAM,EAAA,WAAA;AAAA,MACN,MAAQ,EAAA,MAAM,KAAM,CAAA,QAAA,GAAW,OAAO;AAAA;AAAA,GAExC,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,KAAO,EAAA,CAAA;AAAA,QACL;AAAA,OACF;AAAA,MACA,WAAa,EAAA,CAAA;AAAA,QACX;AAAA,OACF;AAAA,MACA,WAAW,EAAA,IAAA;AAAA,MACX,MAAQ,EAAA,MAAM,KAAM,CAAA,QAAA,GAAW,iBAAiB,CAAA;AAAA,MAChD,IAAM,EAAA;AAAA;AAAA,GAGR,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,KAAA,EAAO,EAAE,yDAAyD,CAAA;AAAA,MAClE,WAAa,EAAA,CAAA;AAAA,QACX;AAAA,OACF;AAAA,MACA,IAAM,EAAA,WAAA;AAAA,MACN,MAAQ,EAAA,MAAM,KAAM,CAAA,QAAA,GAAW,MAAM;AAAA;AAAA,GAGvC,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,KAAO,EAAA,CAAA;AAAA,QACL;AAAA,OACF;AAAA,MACA,WAAa,EAAA,CAAA;AAAA,QACX;AAAA,OACF;AAAA,MACA,IAAM,EAAA,sBAAA;AAAA,MACN,MAAQ,EAAA,MAAM,KAAM,CAAA,QAAA,GAAW,gBAAgB;AAAA;AAAA,GAEnD,CACF,CACF,CAAA;AAEJ;;;;"}
|
|
1
|
+
{"version":3,"file":"TemplateEditorIntro.esm.js","sources":["../../../../src/alpha/components/TemplateEditorPage/TemplateEditorIntro.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 */\n\nimport { MouseEventHandler } from 'react';\nimport Card from '@material-ui/core/Card';\nimport CardActionArea from '@material-ui/core/CardActionArea';\nimport CardContent from '@material-ui/core/CardContent';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { WebFileSystemAccess } from '../../../lib/filesystem';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { scaffolderTranslationRef } from '../../../translation';\nimport CreateNewFolderIcon from '@material-ui/icons/CreateNewFolder';\nimport ListAltIcon from '@material-ui/icons/ListAlt';\nimport FormatListBulletedIcon from '@material-ui/icons/FormatListBulleted';\nimport InfoOutlinedIcon from '@material-ui/icons/InfoOutlined';\nimport CardMedia from '@material-ui/core/CardMedia';\nimport PublishIcon from '@material-ui/icons/Publish';\nimport SvgIcon from '@material-ui/core/SvgIcon';\nimport Tooltip from '@material-ui/core/Tooltip';\n\nconst useStyles = makeStyles(theme => ({\n gridRoot: {\n display: 'flex',\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n },\n cardGrid: {\n maxWidth: 1000,\n display: 'grid',\n gridGap: theme.spacing(2),\n gridAutoFlow: 'row',\n [theme.breakpoints.up('md')]: {\n gridTemplateRows: '1fr 1fr',\n gridTemplateColumns: '1fr 1fr',\n },\n },\n card: {\n display: 'grid',\n gridTemplateColumns: 'auto 1fr',\n gridTemplateRows: '1fr',\n alignItems: 'center',\n margin: theme.spacing(0, 1),\n marginTop: theme.spacing(2),\n padding: theme.spacing(2),\n },\n icon: {\n justifySelf: 'center',\n paddingTop: theme.spacing(1),\n fontSize: 48,\n },\n introText: {\n textAlign: 'center',\n marginTop: theme.spacing(2),\n },\n infoIcon: {\n position: 'absolute',\n top: theme.spacing(1),\n right: theme.spacing(1),\n },\n cardContent: {\n padding: theme.spacing(1),\n },\n}));\n\ninterface EditorIntroProps {\n style?: JSX.IntrinsicElements['div']['style'];\n onSelect?: (\n option: 'create-template' | 'local' | 'form' | 'field-explorer',\n ) => void;\n}\n\nfunction ActionCard(props: {\n title: string;\n description: string;\n Icon: typeof SvgIcon;\n action?: MouseEventHandler;\n requireLoad?: boolean;\n}) {\n const supportsLoad = props.requireLoad\n ? WebFileSystemAccess.isSupported()\n : true;\n const { t } = useTranslationRef(scaffolderTranslationRef);\n\n const classes = useStyles();\n const { Icon, title, description, action } = props;\n return (\n <Card className={classes.card}>\n {!supportsLoad && (\n <Tooltip\n placement=\"top\"\n title={t(\n 'templateEditorPage.templateEditorIntro.loadLocal.unsupportedTooltip',\n )}\n >\n <InfoOutlinedIcon />\n </Tooltip>\n )}\n\n <CardActionArea onClick={action}>\n <CardMedia>\n <Icon\n className={classes.icon}\n color={supportsLoad ? undefined : 'disabled'}\n />\n </CardMedia>\n <CardContent className={classes.cardContent}>\n <Typography\n gutterBottom\n variant=\"h5\"\n component=\"h2\"\n color={supportsLoad ? undefined : 'textSecondary'}\n >\n {title}\n </Typography>\n <Typography variant=\"body2\" color=\"textSecondary\" component=\"p\">\n {description}\n </Typography>\n </CardContent>\n </CardActionArea>\n </Card>\n );\n}\nexport function TemplateEditorIntro(props: EditorIntroProps) {\n const classes = useStyles();\n const { t } = useTranslationRef(scaffolderTranslationRef);\n\n return (\n <div style={props.style}>\n <Typography variant=\"h4\" component=\"h2\" className={classes.introText}>\n {t('templateEditorPage.templateEditorIntro.title')}\n </Typography>\n <div className={classes.gridRoot}>\n <div className={classes.cardGrid}>\n <ActionCard\n title={t('templateEditorPage.templateEditorIntro.loadLocal.title')}\n description={t(\n 'templateEditorPage.templateEditorIntro.loadLocal.description',\n )}\n requireLoad\n Icon={PublishIcon}\n action={() => props.onSelect?.('local')}\n />\n <ActionCard\n title={t(\n 'templateEditorPage.templateEditorIntro.createLocal.title',\n )}\n description={t(\n 'templateEditorPage.templateEditorIntro.createLocal.description',\n )}\n requireLoad\n action={() => props.onSelect?.('create-template')}\n Icon={CreateNewFolderIcon}\n />\n\n <ActionCard\n title={t('templateEditorPage.templateEditorIntro.formEditor.title')}\n description={t(\n 'templateEditorPage.templateEditorIntro.formEditor.description',\n )}\n Icon={ListAltIcon}\n action={() => props.onSelect?.('form')}\n />\n\n <ActionCard\n title={t(\n 'templateEditorPage.templateEditorIntro.fieldExplorer.title',\n )}\n description={t(\n 'templateEditorPage.templateEditorIntro.fieldExplorer.description',\n )}\n Icon={FormatListBulletedIcon}\n action={() => props.onSelect?.('field-explorer')}\n />\n </div>\n </div>\n </div>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAkCA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,QAAU,EAAA;AAAA,IACR,OAAS,EAAA,MAAA;AAAA,IACT,IAAM,EAAA,CAAA;AAAA,IACN,UAAY,EAAA,QAAA;AAAA,IACZ,cAAgB,EAAA;AAAA,GAClB;AAAA,EACA,QAAU,EAAA;AAAA,IACR,QAAU,EAAA,GAAA;AAAA,IACV,OAAS,EAAA,MAAA;AAAA,IACT,OAAA,EAAS,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,IACxB,YAAc,EAAA,KAAA;AAAA,IACd,CAAC,KAAM,CAAA,WAAA,CAAY,EAAG,CAAA,IAAI,CAAC,GAAG;AAAA,MAC5B,gBAAkB,EAAA,SAAA;AAAA,MAClB,mBAAqB,EAAA;AAAA;AACvB,GACF;AAAA,EACA,IAAM,EAAA;AAAA,IACJ,OAAS,EAAA,MAAA;AAAA,IACT,mBAAqB,EAAA,UAAA;AAAA,IACrB,gBAAkB,EAAA,KAAA;AAAA,IAClB,UAAY,EAAA,QAAA;AAAA,IACZ,MAAQ,EAAA,KAAA,CAAM,OAAQ,CAAA,CA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A,MAAM,KAAM,CAAA,QAAA,GAAW,gBAAgB;AAAA;AAAA;AACjD,KAAA,EACF,CACF,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { withStyles } from '@material-ui/core/styles';
|
|
3
3
|
|
|
4
4
|
const TemplateEditorLayout = withStyles(
|
|
@@ -26,7 +26,7 @@ const TemplateEditorLayout = withStyles(
|
|
|
26
26
|
}
|
|
27
27
|
}),
|
|
28
28
|
{ name: "ScaffolderTemplateEditorLayout" }
|
|
29
|
-
)(({ children, classes }) => /* @__PURE__ */
|
|
29
|
+
)(({ children, classes }) => /* @__PURE__ */ jsx("main", { className: classes.root, children }));
|
|
30
30
|
const TemplateEditorLayoutToolbar = withStyles(
|
|
31
31
|
{
|
|
32
32
|
root: {
|
|
@@ -34,7 +34,7 @@ const TemplateEditorLayoutToolbar = withStyles(
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
{ name: "ScaffolderTemplateEditorLayoutToolbar" }
|
|
37
|
-
)(({ children, classes }) => /* @__PURE__ */
|
|
37
|
+
)(({ children, classes }) => /* @__PURE__ */ jsx("section", { className: classes.root, children }));
|
|
38
38
|
const TemplateEditorLayoutBrowser = withStyles(
|
|
39
39
|
(theme) => ({
|
|
40
40
|
root: {
|
|
@@ -46,7 +46,7 @@ const TemplateEditorLayoutBrowser = withStyles(
|
|
|
46
46
|
}
|
|
47
47
|
}),
|
|
48
48
|
{ name: "ScaffolderTemplateEditorLayoutBrowser" }
|
|
49
|
-
)(({ children, classes }) => /* @__PURE__ */
|
|
49
|
+
)(({ children, classes }) => /* @__PURE__ */ jsx("section", { className: classes.root, children }));
|
|
50
50
|
const TemplateEditorLayoutFiles = withStyles(
|
|
51
51
|
{
|
|
52
52
|
root: {
|
|
@@ -55,7 +55,7 @@ const TemplateEditorLayoutFiles = withStyles(
|
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
{ name: "ScaffolderTemplateEditorLayoutFiles" }
|
|
58
|
-
)(({ children, classes }) => /* @__PURE__ */
|
|
58
|
+
)(({ children, classes }) => /* @__PURE__ */ jsx("section", { className: classes.root, children }));
|
|
59
59
|
const TemplateEditorLayoutPreview = withStyles(
|
|
60
60
|
(theme) => ({
|
|
61
61
|
root: {
|
|
@@ -80,7 +80,7 @@ const TemplateEditorLayoutPreview = withStyles(
|
|
|
80
80
|
}
|
|
81
81
|
}),
|
|
82
82
|
{ name: "ScaffolderTemplateEditorLayoutPreview" }
|
|
83
|
-
)(({ children, classes }) => /* @__PURE__ */
|
|
83
|
+
)(({ children, classes }) => /* @__PURE__ */ jsx("section", { className: classes.root, children: /* @__PURE__ */ jsx("div", { className: classes.scroll, children }) }));
|
|
84
84
|
const TemplateEditorLayoutConsole = withStyles(
|
|
85
85
|
{
|
|
86
86
|
root: {
|
|
@@ -88,7 +88,7 @@ const TemplateEditorLayoutConsole = withStyles(
|
|
|
88
88
|
}
|
|
89
89
|
},
|
|
90
90
|
{ name: "ScaffolderTemplateEditorLayoutConsole" }
|
|
91
|
-
)(({ children, classes }) => /* @__PURE__ */
|
|
91
|
+
)(({ children, classes }) => /* @__PURE__ */ jsx("section", { className: classes.root, children }));
|
|
92
92
|
|
|
93
93
|
export { TemplateEditorLayout, TemplateEditorLayoutBrowser, TemplateEditorLayoutConsole, TemplateEditorLayoutFiles, TemplateEditorLayoutPreview, TemplateEditorLayoutToolbar };
|
|
94
94
|
//# sourceMappingURL=TemplateEditorLayout.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TemplateEditorLayout.esm.js","sources":["../../../../src/alpha/components/TemplateEditorPage/TemplateEditorLayout.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
|
|
1
|
+
{"version":3,"file":"TemplateEditorLayout.esm.js","sources":["../../../../src/alpha/components/TemplateEditorPage/TemplateEditorLayout.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 { PropsWithChildren } from 'react';\nimport { WithStyles, withStyles } from '@material-ui/core/styles';\n\nexport const TemplateEditorLayout = withStyles(\n theme => ({\n root: {\n height: '100%',\n gridArea: 'pageContent',\n display: 'grid',\n gridTemplateAreas: `\n \"toolbar\"\n \"browser\"\n \"editor\"\n \"preview\"\n \"results\"\n `,\n [theme.breakpoints.up('md')]: {\n gridTemplateAreas: `\n \"toolbar toolbar toolbar\"\n \"browser editor preview\"\n \"results results results\"\n `,\n gridTemplateColumns: '1fr 3fr 2fr',\n gridTemplateRows: 'auto 1fr auto',\n },\n },\n }),\n { name: 'ScaffolderTemplateEditorLayout' },\n)(({ children, classes }: PropsWithChildren<WithStyles>) => (\n <main className={classes.root}>{children}</main>\n));\n\nexport const TemplateEditorLayoutToolbar = withStyles(\n {\n root: {\n gridArea: 'toolbar',\n },\n },\n { name: 'ScaffolderTemplateEditorLayoutToolbar' },\n)(({ children, classes }: PropsWithChildren<WithStyles>) => (\n <section className={classes.root}>{children}</section>\n));\n\nexport const TemplateEditorLayoutBrowser = withStyles(\n theme => ({\n root: {\n gridArea: 'browser',\n overflow: 'auto',\n [theme.breakpoints.up('md')]: {\n borderRight: `1px solid ${theme.palette.divider}`,\n },\n },\n }),\n { name: 'ScaffolderTemplateEditorLayoutBrowser' },\n)(({ children, classes }: PropsWithChildren<WithStyles>) => (\n <section className={classes.root}>{children}</section>\n));\n\nexport const TemplateEditorLayoutFiles = withStyles(\n {\n root: {\n gridArea: 'editor',\n overflow: 'auto',\n },\n },\n { name: 'ScaffolderTemplateEditorLayoutFiles' },\n)(({ children, classes }: PropsWithChildren<WithStyles>) => (\n <section className={classes.root}>{children}</section>\n));\n\nexport const TemplateEditorLayoutPreview = withStyles(\n theme => ({\n root: {\n gridArea: 'preview',\n position: 'relative',\n backgroundColor: theme.palette.background.default,\n [theme.breakpoints.up('md')]: {\n borderLeft: `1px solid ${theme.palette.divider}`,\n },\n },\n scroll: {\n height: '100%',\n padding: theme.spacing(1),\n [theme.breakpoints.up('md')]: {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n overflow: 'auto',\n },\n },\n }),\n { name: 'ScaffolderTemplateEditorLayoutPreview' },\n)(({ children, classes }: PropsWithChildren<WithStyles>) => (\n <section className={classes.root}>\n <div className={classes.scroll}>{children}</div>\n </section>\n));\n\nexport const TemplateEditorLayoutConsole = withStyles(\n {\n root: {\n gridArea: 'results',\n },\n },\n { name: 'ScaffolderTemplateEditorLayoutConsole' },\n)(({ children, classes }: PropsWithChildren<WithStyles>) => (\n <section className={classes.root}>{children}</section>\n));\n"],"names":[],"mappings":";;;AAmBO,MAAM,oBAAuB,GAAA,UAAA;AAAA,EAClC,CAAU,KAAA,MAAA;AAAA,IACR,IAAM,EAAA;AAAA,MACJ,MAAQ,EAAA,MAAA;AAAA,MACR,QAAU,EAAA,aAAA;AAAA,MACV,OAAS,EAAA,MAAA;AAAA,MACT,iBAAmB,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAA,CAAA;AAAA,MAOnB,CAAC,KAAM,CAAA,W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QAAA,EAAS,GAC5C,CACD;AAEM,MAAM,2BAA8B,GAAA,UAAA;AAAA,EACzC;AAAA,IACE,IAAM,EAAA;AAAA,MACJ,QAAU,EAAA;AAAA;AACZ,GACF;AAAA,EACA,EAAE,MAAM,uCAAwC;AAClD,CAAE,CAAA,CAAC,EAAE,QAAA,EAAU,OAAQ,EAAA,qBACpB,GAAA,CAAA,SAAA,EAAA,EAAQ,SAAW,EAAA,OAAA,CAAQ,IAAO,EAAA,QAAA,EAAS,CAC7C;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { makeStyles } from '@material-ui/core/styles';
|
|
3
3
|
import { Page, Header, Content } from '@backstage/core-components';
|
|
4
4
|
import { useRouteRef } from '@backstage/core-plugin-api';
|
|
@@ -19,22 +19,25 @@ function TemplateEditorPage(props) {
|
|
|
19
19
|
const classes = useStyles();
|
|
20
20
|
const editLink = useRouteRef(editRouteRef);
|
|
21
21
|
const { t } = useTranslationRef(scaffolderTranslationRef);
|
|
22
|
-
return /* @__PURE__ */
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
{
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
22
|
+
return /* @__PURE__ */ jsxs(Page, { themeId: "home", children: [
|
|
23
|
+
/* @__PURE__ */ jsx(
|
|
24
|
+
Header,
|
|
25
|
+
{
|
|
26
|
+
title: t("templateEditorPage.title"),
|
|
27
|
+
subtitle: t("templateEditorPage.subtitle"),
|
|
28
|
+
type: t("templateIntroPage.title"),
|
|
29
|
+
typeLink: editLink()
|
|
30
|
+
}
|
|
31
|
+
),
|
|
32
|
+
/* @__PURE__ */ jsx(Content, { className: classes.content, children: /* @__PURE__ */ jsx(
|
|
33
|
+
TemplateEditor,
|
|
34
|
+
{
|
|
35
|
+
layouts: props.layouts,
|
|
36
|
+
formProps: props.formProps,
|
|
37
|
+
fieldExtensions: props.fieldExtensions
|
|
38
|
+
}
|
|
39
|
+
) })
|
|
40
|
+
] });
|
|
38
41
|
}
|
|
39
42
|
|
|
40
43
|
export { TemplateEditorPage };
|