@backstage/plugin-scaffolder 1.19.3 → 1.19.4-next.1
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 +39 -0
- package/alpha/package.json +1 -1
- package/dist/alpha.esm.js +3 -8
- package/dist/alpha.esm.js.map +1 -1
- package/dist/{esm/routes-BvToNy4N.esm.js → api.esm.js} +2 -46
- package/dist/api.esm.js.map +1 -0
- package/dist/components/ActionsPage/ActionsPage.esm.js +186 -0
- package/dist/components/ActionsPage/ActionsPage.esm.js.map +1 -0
- package/dist/components/FileBrowser/FileBrowser.esm.js +90 -0
- package/dist/components/FileBrowser/FileBrowser.esm.js.map +1 -0
- package/dist/components/ListTasksPage/ListTasksPage.esm.js +120 -0
- package/dist/components/ListTasksPage/ListTasksPage.esm.js.map +1 -0
- package/dist/components/ListTasksPage/OwnerListPicker.esm.js +88 -0
- package/dist/components/ListTasksPage/OwnerListPicker.esm.js.map +1 -0
- package/dist/components/ListTasksPage/columns/CreatedAtColumn.esm.js +13 -0
- package/dist/components/ListTasksPage/columns/CreatedAtColumn.esm.js.map +1 -0
- package/dist/components/ListTasksPage/columns/OwnerEntityColumn.esm.js +31 -0
- package/dist/components/ListTasksPage/columns/OwnerEntityColumn.esm.js.map +1 -0
- package/dist/components/ListTasksPage/columns/TaskStatusColumn.esm.js +17 -0
- package/dist/components/ListTasksPage/columns/TaskStatusColumn.esm.js.map +1 -0
- package/dist/components/ListTasksPage/columns/TemplateTitleColumn.esm.js +21 -0
- package/dist/components/ListTasksPage/columns/TemplateTitleColumn.esm.js.map +1 -0
- package/dist/components/OngoingTask/ContextMenu.esm.js +86 -0
- package/dist/components/OngoingTask/ContextMenu.esm.js.map +1 -0
- package/dist/components/OngoingTask/OngoingTask.esm.js +173 -0
- package/dist/components/OngoingTask/OngoingTask.esm.js.map +1 -0
- package/dist/components/Router/Router.esm.js +105 -0
- package/dist/components/Router/Router.esm.js.map +1 -0
- package/dist/components/Router/index.esm.js +2 -0
- package/dist/components/Router/index.esm.js.map +1 -0
- package/dist/components/TemplateTypePicker/TemplateTypePicker.esm.js +70 -0
- package/dist/components/TemplateTypePicker/TemplateTypePicker.esm.js.map +1 -0
- package/dist/components/fields/EntityNamePicker/EntityNamePicker.esm.js +34 -0
- package/dist/components/fields/EntityNamePicker/EntityNamePicker.esm.js.map +1 -0
- package/dist/components/fields/EntityNamePicker/schema.esm.js +8 -0
- package/dist/components/fields/EntityNamePicker/schema.esm.js.map +1 -0
- package/dist/components/fields/EntityNamePicker/validation.esm.js +12 -0
- package/dist/components/fields/EntityNamePicker/validation.esm.js.map +1 -0
- package/dist/components/fields/EntityPicker/EntityPicker.esm.js +151 -0
- package/dist/components/fields/EntityPicker/EntityPicker.esm.js.map +1 -0
- package/dist/components/fields/EntityPicker/schema.esm.js +29 -0
- package/dist/components/fields/EntityPicker/schema.esm.js.map +1 -0
- package/dist/components/fields/EntityTagsPicker/EntityTagsPicker.esm.js +84 -0
- package/dist/components/fields/EntityTagsPicker/EntityTagsPicker.esm.js.map +1 -0
- package/dist/components/fields/EntityTagsPicker/schema.esm.js +15 -0
- package/dist/components/fields/EntityTagsPicker/schema.esm.js.map +1 -0
- package/dist/components/fields/MultiEntityPicker/MultiEntityPicker.esm.js +168 -0
- package/dist/components/fields/MultiEntityPicker/MultiEntityPicker.esm.js.map +1 -0
- package/dist/components/fields/MultiEntityPicker/schema.esm.js +23 -0
- package/dist/components/fields/MultiEntityPicker/schema.esm.js.map +1 -0
- package/dist/components/fields/MyGroupsPicker/MyGroupsPicker.esm.js +83 -0
- package/dist/components/fields/MyGroupsPicker/MyGroupsPicker.esm.js.map +1 -0
- package/dist/components/fields/MyGroupsPicker/schema.esm.js +14 -0
- package/dist/components/fields/MyGroupsPicker/schema.esm.js.map +1 -0
- package/dist/components/fields/OwnedEntityPicker/OwnedEntityPicker.esm.js +68 -0
- package/dist/components/fields/OwnedEntityPicker/OwnedEntityPicker.esm.js.map +1 -0
- package/dist/components/fields/OwnedEntityPicker/schema.esm.js +24 -0
- package/dist/components/fields/OwnedEntityPicker/schema.esm.js.map +1 -0
- package/dist/components/fields/OwnerPicker/OwnerPicker.esm.js +37 -0
- package/dist/components/fields/OwnerPicker/OwnerPicker.esm.js.map +1 -0
- package/dist/components/fields/OwnerPicker/schema.esm.js +24 -0
- package/dist/components/fields/OwnerPicker/schema.esm.js.map +1 -0
- package/dist/components/fields/RepoUrlPicker/AzureRepoPicker.esm.js +75 -0
- package/dist/components/fields/RepoUrlPicker/AzureRepoPicker.esm.js.map +1 -0
- package/dist/components/fields/RepoUrlPicker/BitbucketRepoPicker.esm.js +80 -0
- package/dist/components/fields/RepoUrlPicker/BitbucketRepoPicker.esm.js.map +1 -0
- package/dist/components/fields/RepoUrlPicker/GerritRepoPicker.esm.js +38 -0
- package/dist/components/fields/RepoUrlPicker/GerritRepoPicker.esm.js.map +1 -0
- package/dist/components/fields/RepoUrlPicker/GiteaRepoPicker.esm.js +44 -0
- package/dist/components/fields/RepoUrlPicker/GiteaRepoPicker.esm.js.map +1 -0
- package/dist/components/fields/RepoUrlPicker/GithubRepoPicker.esm.js +42 -0
- package/dist/components/fields/RepoUrlPicker/GithubRepoPicker.esm.js.map +1 -0
- package/dist/components/fields/RepoUrlPicker/GitlabRepoPicker.esm.js +44 -0
- package/dist/components/fields/RepoUrlPicker/GitlabRepoPicker.esm.js.map +1 -0
- package/dist/components/fields/RepoUrlPicker/RepoUrlPicker.esm.js +200 -0
- package/dist/components/fields/RepoUrlPicker/RepoUrlPicker.esm.js.map +1 -0
- package/dist/components/fields/RepoUrlPicker/RepoUrlPickerHost.esm.js +56 -0
- package/dist/components/fields/RepoUrlPicker/RepoUrlPickerHost.esm.js.map +1 -0
- package/dist/components/fields/RepoUrlPicker/RepoUrlPickerRepoName.esm.js +48 -0
- package/dist/components/fields/RepoUrlPicker/RepoUrlPickerRepoName.esm.js.map +1 -0
- package/dist/components/fields/RepoUrlPicker/schema.esm.js +32 -0
- package/dist/components/fields/RepoUrlPicker/schema.esm.js.map +1 -0
- package/dist/components/fields/RepoUrlPicker/utils.esm.js +46 -0
- package/dist/components/fields/RepoUrlPicker/utils.esm.js.map +1 -0
- package/dist/components/fields/RepoUrlPicker/validation.esm.js +43 -0
- package/dist/components/fields/RepoUrlPicker/validation.esm.js.map +1 -0
- package/dist/components/fields/SecretInput/SecretInput.esm.js +48 -0
- package/dist/components/fields/SecretInput/SecretInput.esm.js.map +1 -0
- package/dist/components/fields/utils.esm.js +15 -0
- package/dist/components/fields/utils.esm.js.map +1 -0
- package/dist/deprecated.esm.js +13 -0
- package/dist/deprecated.esm.js.map +1 -0
- package/dist/extensions/default.esm.js +72 -0
- package/dist/extensions/default.esm.js.map +1 -0
- package/dist/index.esm.js +13 -214
- package/dist/index.esm.js.map +1 -1
- package/dist/lib/download/helpers.esm.js +11 -0
- package/dist/lib/download/helpers.esm.js.map +1 -0
- package/dist/lib/filesystem/WebFileSystemAccess.esm.js +56 -0
- package/dist/lib/filesystem/WebFileSystemAccess.esm.js.map +1 -0
- package/dist/next/TemplateEditorPage/CustomFieldExplorer.esm.js +151 -0
- package/dist/next/TemplateEditorPage/CustomFieldExplorer.esm.js.map +1 -0
- package/dist/next/TemplateEditorPage/DirectoryEditorContext.esm.js +186 -0
- package/dist/next/TemplateEditorPage/DirectoryEditorContext.esm.js.map +1 -0
- package/dist/next/TemplateEditorPage/DryRunContext.esm.js +110 -0
- package/dist/next/TemplateEditorPage/DryRunContext.esm.js.map +1 -0
- package/dist/next/TemplateEditorPage/DryRunResults/DryRunResults.esm.js +70 -0
- package/dist/next/TemplateEditorPage/DryRunResults/DryRunResults.esm.js.map +1 -0
- package/dist/next/TemplateEditorPage/DryRunResults/DryRunResultsList.esm.js +98 -0
- package/dist/next/TemplateEditorPage/DryRunResults/DryRunResultsList.esm.js.map +1 -0
- package/dist/next/TemplateEditorPage/DryRunResults/DryRunResultsSplitView.esm.js +31 -0
- package/dist/next/TemplateEditorPage/DryRunResults/DryRunResultsSplitView.esm.js.map +1 -0
- package/dist/next/TemplateEditorPage/DryRunResults/DryRunResultsView.esm.js +145 -0
- package/dist/next/TemplateEditorPage/DryRunResults/DryRunResultsView.esm.js.map +1 -0
- package/dist/next/TemplateEditorPage/DryRunResults/IconLink.esm.js +25 -0
- package/dist/next/TemplateEditorPage/DryRunResults/IconLink.esm.js.map +1 -0
- package/dist/next/TemplateEditorPage/DryRunResults/TaskPageLinks.esm.js +40 -0
- package/dist/next/TemplateEditorPage/DryRunResults/TaskPageLinks.esm.js.map +1 -0
- package/dist/next/TemplateEditorPage/DryRunResults/TaskStatusStepper.esm.js +135 -0
- package/dist/next/TemplateEditorPage/DryRunResults/TaskStatusStepper.esm.js.map +1 -0
- package/dist/next/TemplateEditorPage/TemplateEditor.esm.js +52 -0
- package/dist/next/TemplateEditorPage/TemplateEditor.esm.js.map +1 -0
- package/dist/next/TemplateEditorPage/TemplateEditorBrowser.esm.js +74 -0
- package/dist/next/TemplateEditorPage/TemplateEditorBrowser.esm.js.map +1 -0
- package/dist/next/TemplateEditorPage/TemplateEditorForm.esm.js +174 -0
- package/dist/next/TemplateEditorPage/TemplateEditorForm.esm.js.map +1 -0
- package/dist/next/TemplateEditorPage/TemplateEditorIntro.esm.js +93 -0
- package/dist/next/TemplateEditorPage/TemplateEditorIntro.esm.js.map +1 -0
- package/dist/next/TemplateEditorPage/TemplateEditorPage.esm.js +82 -0
- package/dist/next/TemplateEditorPage/TemplateEditorPage.esm.js.map +1 -0
- package/dist/next/TemplateEditorPage/TemplateEditorTextArea.esm.js +120 -0
- package/dist/next/TemplateEditorPage/TemplateEditorTextArea.esm.js.map +1 -0
- package/dist/next/TemplateEditorPage/TemplateFormPreviewer.esm.js +160 -0
- package/dist/next/TemplateEditorPage/TemplateFormPreviewer.esm.js.map +1 -0
- package/dist/next/TemplateListPage/RegisterExistingButton.esm.js +35 -0
- package/dist/next/TemplateListPage/RegisterExistingButton.esm.js.map +1 -0
- package/dist/next/TemplateListPage/TemplateListPage.esm.js +101 -0
- package/dist/next/TemplateListPage/TemplateListPage.esm.js.map +1 -0
- package/dist/next/TemplateWizardPage/TemplateWizardPage.esm.js +67 -0
- package/dist/next/TemplateWizardPage/TemplateWizardPage.esm.js.map +1 -0
- package/dist/next/TemplateWizardPage/TemplateWizardPageContextMenu.esm.js +60 -0
- package/dist/next/TemplateWizardPage/TemplateWizardPageContextMenu.esm.js.map +1 -0
- package/dist/plugin.esm.js +125 -0
- package/dist/plugin.esm.js.map +1 -0
- package/dist/routes.esm.js +47 -0
- package/dist/routes.esm.js.map +1 -0
- package/package.json +18 -18
- package/dist/esm/OngoingTask-ClfJCJcE.esm.js +0 -1575
- package/dist/esm/OngoingTask-ClfJCJcE.esm.js.map +0 -1
- package/dist/esm/index-UcPid-q1.esm.js +0 -2553
- package/dist/esm/index-UcPid-q1.esm.js.map +0 -1
- package/dist/esm/routes-BvToNy4N.esm.js.map +0 -1
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { useApi, alertApiRef } from '@backstage/core-plugin-api';
|
|
2
|
+
import { catalogApiRef, humanizeEntityRef } from '@backstage/plugin-catalog-react';
|
|
3
|
+
import FormControl from '@material-ui/core/FormControl';
|
|
4
|
+
import IconButton from '@material-ui/core/IconButton';
|
|
5
|
+
import InputLabel from '@material-ui/core/InputLabel';
|
|
6
|
+
import LinearProgress from '@material-ui/core/LinearProgress';
|
|
7
|
+
import MenuItem from '@material-ui/core/MenuItem';
|
|
8
|
+
import Select from '@material-ui/core/Select';
|
|
9
|
+
import { makeStyles } from '@material-ui/core/styles';
|
|
10
|
+
import CloseIcon from '@material-ui/icons/Close';
|
|
11
|
+
import React, { useState, useCallback } from 'react';
|
|
12
|
+
import useAsync from 'react-use/esm/useAsync';
|
|
13
|
+
import yaml from 'yaml';
|
|
14
|
+
import { TemplateEditorForm } from './TemplateEditorForm.esm.js';
|
|
15
|
+
import { TemplateEditorTextArea } from './TemplateEditorTextArea.esm.js';
|
|
16
|
+
|
|
17
|
+
const EXAMPLE_TEMPLATE_PARAMS_YAML = `# Edit the template parameters below to see how they will render in the scaffolder form UI
|
|
18
|
+
parameters:
|
|
19
|
+
- title: Fill in some steps
|
|
20
|
+
required:
|
|
21
|
+
- name
|
|
22
|
+
properties:
|
|
23
|
+
name:
|
|
24
|
+
title: Name
|
|
25
|
+
type: string
|
|
26
|
+
description: Unique name of the component
|
|
27
|
+
owner:
|
|
28
|
+
title: Owner
|
|
29
|
+
type: string
|
|
30
|
+
description: Owner of the component
|
|
31
|
+
ui:field: OwnerPicker
|
|
32
|
+
ui:options:
|
|
33
|
+
catalogFilter:
|
|
34
|
+
kind: Group
|
|
35
|
+
- title: Choose a location
|
|
36
|
+
required:
|
|
37
|
+
- repoUrl
|
|
38
|
+
properties:
|
|
39
|
+
repoUrl:
|
|
40
|
+
title: Repository Location
|
|
41
|
+
type: string
|
|
42
|
+
ui:field: RepoUrlPicker
|
|
43
|
+
ui:options:
|
|
44
|
+
allowedHosts:
|
|
45
|
+
- github.com
|
|
46
|
+
steps:
|
|
47
|
+
- id: fetch-base
|
|
48
|
+
name: Fetch Base
|
|
49
|
+
action: fetch:template
|
|
50
|
+
input:
|
|
51
|
+
url: ./template
|
|
52
|
+
values:
|
|
53
|
+
name: \${{parameters.name}}
|
|
54
|
+
`;
|
|
55
|
+
const useStyles = makeStyles((theme) => ({
|
|
56
|
+
root: {
|
|
57
|
+
gridArea: "pageContent",
|
|
58
|
+
display: "grid",
|
|
59
|
+
gridTemplateAreas: `
|
|
60
|
+
"controls controls"
|
|
61
|
+
"textArea preview"
|
|
62
|
+
`,
|
|
63
|
+
gridTemplateRows: "auto 1fr",
|
|
64
|
+
gridTemplateColumns: "1fr 1fr"
|
|
65
|
+
},
|
|
66
|
+
controls: {
|
|
67
|
+
gridArea: "controls",
|
|
68
|
+
display: "flex",
|
|
69
|
+
flexFlow: "row nowrap",
|
|
70
|
+
alignItems: "center",
|
|
71
|
+
margin: theme.spacing(1)
|
|
72
|
+
},
|
|
73
|
+
textArea: {
|
|
74
|
+
gridArea: "textArea"
|
|
75
|
+
},
|
|
76
|
+
preview: {
|
|
77
|
+
gridArea: "preview"
|
|
78
|
+
}
|
|
79
|
+
}));
|
|
80
|
+
const TemplateFormPreviewer = ({
|
|
81
|
+
defaultPreviewTemplate = EXAMPLE_TEMPLATE_PARAMS_YAML,
|
|
82
|
+
customFieldExtensions = [],
|
|
83
|
+
onClose,
|
|
84
|
+
layouts = []
|
|
85
|
+
}) => {
|
|
86
|
+
const classes = useStyles();
|
|
87
|
+
const alertApi = useApi(alertApiRef);
|
|
88
|
+
const catalogApi = useApi(catalogApiRef);
|
|
89
|
+
const [selectedTemplate, setSelectedTemplate] = useState("");
|
|
90
|
+
const [errorText, setErrorText] = useState();
|
|
91
|
+
const [templateOptions, setTemplateOptions] = useState([]);
|
|
92
|
+
const [templateYaml, setTemplateYaml] = useState(defaultPreviewTemplate);
|
|
93
|
+
const { loading } = useAsync(
|
|
94
|
+
() => catalogApi.getEntities({
|
|
95
|
+
filter: { kind: "template" },
|
|
96
|
+
fields: [
|
|
97
|
+
"kind",
|
|
98
|
+
"metadata.namespace",
|
|
99
|
+
"metadata.name",
|
|
100
|
+
"metadata.title",
|
|
101
|
+
"spec.parameters",
|
|
102
|
+
"spec.steps",
|
|
103
|
+
"spec.output"
|
|
104
|
+
]
|
|
105
|
+
}).then(
|
|
106
|
+
({ items }) => setTemplateOptions(
|
|
107
|
+
items.map((template) => {
|
|
108
|
+
var _a;
|
|
109
|
+
return {
|
|
110
|
+
label: (_a = template.metadata.title) != null ? _a : humanizeEntityRef(template, { defaultKind: "template" }),
|
|
111
|
+
value: template
|
|
112
|
+
};
|
|
113
|
+
})
|
|
114
|
+
)
|
|
115
|
+
).catch(
|
|
116
|
+
(e) => alertApi.post({
|
|
117
|
+
message: `Error loading exisiting templates: ${e.message}`,
|
|
118
|
+
severity: "error"
|
|
119
|
+
})
|
|
120
|
+
),
|
|
121
|
+
[catalogApi]
|
|
122
|
+
);
|
|
123
|
+
const handleSelectChange = useCallback(
|
|
124
|
+
// TODO(Rugvip): Afaik this should be Entity, but didn't want to make runtime changes while fixing types
|
|
125
|
+
(selected) => {
|
|
126
|
+
setSelectedTemplate(selected);
|
|
127
|
+
setTemplateYaml(yaml.stringify(selected.spec));
|
|
128
|
+
},
|
|
129
|
+
[setTemplateYaml]
|
|
130
|
+
);
|
|
131
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, loading && /* @__PURE__ */ React.createElement(LinearProgress, null), /* @__PURE__ */ React.createElement("main", { className: classes.root }, /* @__PURE__ */ React.createElement("div", { className: classes.controls }, /* @__PURE__ */ React.createElement(FormControl, { variant: "outlined", size: "small", fullWidth: true }, /* @__PURE__ */ React.createElement(InputLabel, { id: "select-template-label" }, "Load Existing Template"), /* @__PURE__ */ React.createElement(
|
|
132
|
+
Select,
|
|
133
|
+
{
|
|
134
|
+
value: selectedTemplate,
|
|
135
|
+
label: "Load Existing Template",
|
|
136
|
+
labelId: "select-template-label",
|
|
137
|
+
onChange: (e) => handleSelectChange(e.target.value)
|
|
138
|
+
},
|
|
139
|
+
templateOptions.map((option, idx) => /* @__PURE__ */ React.createElement(MenuItem, { key: idx, value: option.value }, option.label))
|
|
140
|
+
)), /* @__PURE__ */ React.createElement(IconButton, { size: "medium", onClick: onClose }, /* @__PURE__ */ React.createElement(CloseIcon, null))), /* @__PURE__ */ React.createElement("div", { className: classes.textArea }, /* @__PURE__ */ React.createElement(
|
|
141
|
+
TemplateEditorTextArea,
|
|
142
|
+
{
|
|
143
|
+
content: templateYaml,
|
|
144
|
+
onUpdate: setTemplateYaml,
|
|
145
|
+
errorText
|
|
146
|
+
}
|
|
147
|
+
)), /* @__PURE__ */ React.createElement("div", { className: classes.preview }, /* @__PURE__ */ React.createElement(
|
|
148
|
+
TemplateEditorForm,
|
|
149
|
+
{
|
|
150
|
+
content: templateYaml,
|
|
151
|
+
contentIsSpec: true,
|
|
152
|
+
fieldExtensions: customFieldExtensions,
|
|
153
|
+
setErrorText,
|
|
154
|
+
layouts
|
|
155
|
+
}
|
|
156
|
+
))));
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
export { TemplateFormPreviewer };
|
|
160
|
+
//# sourceMappingURL=TemplateFormPreviewer.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TemplateFormPreviewer.esm.js","sources":["../../../src/next/TemplateEditorPage/TemplateFormPreviewer.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 { Entity } from '@backstage/catalog-model';\nimport { alertApiRef, useApi } from '@backstage/core-plugin-api';\nimport {\n catalogApiRef,\n humanizeEntityRef,\n} from '@backstage/plugin-catalog-react';\nimport FormControl from '@material-ui/core/FormControl';\nimport IconButton from '@material-ui/core/IconButton';\nimport InputLabel from '@material-ui/core/InputLabel';\nimport LinearProgress from '@material-ui/core/LinearProgress';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport Select from '@material-ui/core/Select';\nimport { makeStyles } from '@material-ui/core/styles';\nimport CloseIcon from '@material-ui/icons/Close';\nimport React, { useCallback, useState } from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport yaml from 'yaml';\nimport {\n LayoutOptions,\n FieldExtensionOptions,\n} from '@backstage/plugin-scaffolder-react';\nimport { TemplateEditorForm } from './TemplateEditorForm';\nimport { TemplateEditorTextArea } from './TemplateEditorTextArea';\n\nconst EXAMPLE_TEMPLATE_PARAMS_YAML = `# Edit the template parameters below to see how they will render in the scaffolder form UI\nparameters:\n - title: Fill in some steps\n required:\n - name\n properties:\n name:\n title: Name\n type: string\n description: Unique name of the component\n owner:\n title: Owner\n type: string\n description: Owner of the component\n ui:field: OwnerPicker\n ui:options:\n catalogFilter:\n kind: Group\n - title: Choose a location\n required:\n - repoUrl\n properties:\n repoUrl:\n title: Repository Location\n type: string\n ui:field: RepoUrlPicker\n ui:options:\n allowedHosts:\n - github.com\nsteps:\n - id: fetch-base\n name: Fetch Base\n action: fetch:template\n input:\n url: ./template\n values:\n name: \\${{parameters.name}}\n`;\n\ntype TemplateOption = {\n label: string;\n value: Entity;\n};\n\nconst useStyles = makeStyles(theme => ({\n root: {\n gridArea: 'pageContent',\n display: 'grid',\n gridTemplateAreas: `\n \"controls controls\"\n \"textArea preview\"\n `,\n gridTemplateRows: 'auto 1fr',\n gridTemplateColumns: '1fr 1fr',\n },\n controls: {\n gridArea: 'controls',\n display: 'flex',\n flexFlow: 'row nowrap',\n alignItems: 'center',\n margin: theme.spacing(1),\n },\n textArea: {\n gridArea: 'textArea',\n },\n preview: {\n gridArea: 'preview',\n },\n}));\n\nexport const TemplateFormPreviewer = ({\n defaultPreviewTemplate = EXAMPLE_TEMPLATE_PARAMS_YAML,\n customFieldExtensions = [],\n onClose,\n layouts = [],\n}: {\n defaultPreviewTemplate?: string;\n customFieldExtensions?: FieldExtensionOptions<any, any>[];\n onClose?: () => void;\n layouts?: LayoutOptions[];\n}) => {\n const classes = useStyles();\n const alertApi = useApi(alertApiRef);\n const catalogApi = useApi(catalogApiRef);\n const [selectedTemplate, setSelectedTemplate] = useState('');\n const [errorText, setErrorText] = useState<string>();\n const [templateOptions, setTemplateOptions] = useState<TemplateOption[]>([]);\n const [templateYaml, setTemplateYaml] = useState(defaultPreviewTemplate);\n\n const { loading } = useAsync(\n () =>\n catalogApi\n .getEntities({\n filter: { kind: 'template' },\n fields: [\n 'kind',\n 'metadata.namespace',\n 'metadata.name',\n 'metadata.title',\n 'spec.parameters',\n 'spec.steps',\n 'spec.output',\n ],\n })\n .then(({ items }) =>\n setTemplateOptions(\n items.map(template => ({\n label:\n template.metadata.title ??\n humanizeEntityRef(template, { defaultKind: 'template' }),\n value: template,\n })),\n ),\n )\n .catch(e =>\n alertApi.post({\n message: `Error loading exisiting templates: ${e.message}`,\n severity: 'error',\n }),\n ),\n [catalogApi],\n );\n\n const handleSelectChange = useCallback(\n // TODO(Rugvip): Afaik this should be Entity, but didn't want to make runtime changes while fixing types\n (selected: any) => {\n setSelectedTemplate(selected);\n setTemplateYaml(yaml.stringify(selected.spec));\n },\n [setTemplateYaml],\n );\n\n return (\n <>\n {loading && <LinearProgress />}\n <main className={classes.root}>\n <div className={classes.controls}>\n <FormControl variant=\"outlined\" size=\"small\" fullWidth>\n <InputLabel id=\"select-template-label\">\n Load Existing Template\n </InputLabel>\n <Select\n value={selectedTemplate}\n label=\"Load Existing Template\"\n labelId=\"select-template-label\"\n onChange={e => handleSelectChange(e.target.value)}\n >\n {templateOptions.map((option, idx) => (\n <MenuItem key={idx} value={option.value as any}>\n {option.label}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n\n <IconButton size=\"medium\" onClick={onClose}>\n <CloseIcon />\n </IconButton>\n </div>\n <div className={classes.textArea}>\n <TemplateEditorTextArea\n content={templateYaml}\n onUpdate={setTemplateYaml}\n errorText={errorText}\n />\n </div>\n <div className={classes.preview}>\n <TemplateEditorForm\n content={templateYaml}\n contentIsSpec\n fieldExtensions={customFieldExtensions}\n setErrorText={setErrorText}\n layouts={layouts}\n />\n </div>\n </main>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAuCA,MAAM,4BAA+B,GAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA,CAAA;AA4CrC,MAAM,SAAA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,aAAA;AAAA,IAAC,sBAAA;AAAA,IAAA;AAAA,MACC,OAAS,EAAA,YAAA;AAAA,MACT,QAAU,EAAA,eAAA;AAAA,MACV,SAAA;AAAA,KAAA;AAAA,GAEJ,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,KAAI,EAAA,EAAA,SAAA,EAAW,QAAQ,OACtB,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,kBAAA;AAAA,IAAA;AAAA,MACC,OAAS,EAAA,YAAA;AAAA,MACT,aAAa,EAAA,IAAA;AAAA,MACb,eAAiB,EAAA,qBAAA;AAAA,MACjB,YAAA;AAAA,MACA,OAAA;AAAA,KAAA;AAAA,GAEJ,CACF,CACF,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import Button from '@material-ui/core/Button';
|
|
2
|
+
import IconButton from '@material-ui/core/IconButton';
|
|
3
|
+
import useMediaQuery from '@material-ui/core/useMediaQuery';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { Link } from 'react-router-dom';
|
|
6
|
+
import CreateComponentIcon from '@material-ui/icons/AddCircleOutline';
|
|
7
|
+
import { catalogEntityCreatePermission } from '@backstage/plugin-catalog-common/alpha';
|
|
8
|
+
import { usePermission } from '@backstage/plugin-permission-react';
|
|
9
|
+
|
|
10
|
+
const RegisterExistingButton = (props) => {
|
|
11
|
+
const { title, to } = props;
|
|
12
|
+
const { allowed } = usePermission({
|
|
13
|
+
permission: catalogEntityCreatePermission
|
|
14
|
+
});
|
|
15
|
+
const isXSScreen = useMediaQuery(
|
|
16
|
+
(theme) => theme.breakpoints.down("xs")
|
|
17
|
+
);
|
|
18
|
+
if (!to || !allowed) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
return isXSScreen ? /* @__PURE__ */ React.createElement(
|
|
22
|
+
IconButton,
|
|
23
|
+
{
|
|
24
|
+
component: Link,
|
|
25
|
+
color: "primary",
|
|
26
|
+
title,
|
|
27
|
+
size: "small",
|
|
28
|
+
to
|
|
29
|
+
},
|
|
30
|
+
/* @__PURE__ */ React.createElement(CreateComponentIcon, null)
|
|
31
|
+
) : /* @__PURE__ */ React.createElement(Button, { component: Link, variant: "contained", color: "primary", to }, title);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export { RegisterExistingButton };
|
|
35
|
+
//# sourceMappingURL=RegisterExistingButton.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RegisterExistingButton.esm.js","sources":["../../../src/next/TemplateListPage/RegisterExistingButton.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 Button from '@material-ui/core/Button';\nimport IconButton from '@material-ui/core/IconButton';\nimport useMediaQuery from '@material-ui/core/useMediaQuery';\nimport React from 'react';\nimport { Link as RouterLink, LinkProps } from 'react-router-dom';\nimport AddCircleOutline from '@material-ui/icons/AddCircleOutline';\nimport { catalogEntityCreatePermission } from '@backstage/plugin-catalog-common/alpha';\nimport { usePermission } from '@backstage/plugin-permission-react';\nimport { Theme } from '@material-ui/core/styles';\n\n/**\n * Properties for {@link RegisterExistingButton}\n *\n * @alpha\n */\nexport type RegisterExistingButtonProps = {\n title: string;\n} & Partial<Pick<LinkProps, 'to'>>;\n\n/**\n * A button that helps users to register an existing component.\n * @alpha\n */\nexport const RegisterExistingButton = (props: RegisterExistingButtonProps) => {\n const { title, to } = props;\n const { allowed } = usePermission({\n permission: catalogEntityCreatePermission,\n });\n const isXSScreen = useMediaQuery<Theme>(theme =>\n theme.breakpoints.down('xs'),\n );\n\n if (!to || !allowed) {\n return null;\n }\n\n return isXSScreen ? (\n <IconButton\n component={RouterLink}\n color=\"primary\"\n title={title}\n size=\"small\"\n to={to}\n >\n <AddCircleOutline />\n </IconButton>\n ) : (\n <Button component={RouterLink} variant=\"contained\" color=\"primary\" to={to}>\n {title}\n </Button>\n );\n};\n"],"names":["RouterLink","AddCircleOutline"],"mappings":";;;;;;;;;AAuCa,MAAA,sBAAA,GAAyB,CAAC,KAAuC,KAAA;AAC5E,EAAM,MAAA,EAAE,KAAO,EAAA,EAAA,EAAO,GAAA,KAAA,CAAA;AACtB,EAAM,MAAA,EAAE,OAAQ,EAAA,GAAI,aAAc,CAAA;AAAA,IAChC,UAAY,EAAA,6BAAA;AAAA,GACb,CAAA,CAAA;AACD,EAAA,MAAM,UAAa,GAAA,aAAA;AAAA,IAAqB,CACtC,KAAA,KAAA,KAAA,CAAM,WAAY,CAAA,IAAA,CAAK,IAAI,CAAA;AAAA,GAC7B,CAAA;AAEA,EAAI,IAAA,CAAC,EAAM,IAAA,CAAC,OAAS,EAAA;AACnB,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAEA,EAAA,OAAO,UACL,mBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,SAAW,EAAAA,IAAA;AAAA,MACX,KAAM,EAAA,SAAA;AAAA,MACN,KAAA;AAAA,MACA,IAAK,EAAA,OAAA;AAAA,MACL,EAAA;AAAA,KAAA;AAAA,wCAECC,mBAAiB,EAAA,IAAA,CAAA;AAAA,GACpB,mBAEC,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EAAO,SAAW,EAAAD,IAAA,EAAY,SAAQ,WAAY,EAAA,KAAA,EAAM,SAAU,EAAA,EAAA,EAAA,EAChE,KACH,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
|
+
import { useNavigate } from 'react-router-dom';
|
|
3
|
+
import { useRouteRef, useApp } from '@backstage/core-plugin-api';
|
|
4
|
+
import { DocsIcon, Page, Header, Content, ContentHeader, SupportButton } from '@backstage/core-components';
|
|
5
|
+
import { EntityListProvider, CatalogFilterLayout, EntitySearchBar, EntityKindPicker, UserListPicker, EntityTagPicker } from '@backstage/plugin-catalog-react';
|
|
6
|
+
import { ScaffolderPageContextMenu, TemplateCategoryPicker, TemplateGroups } from '@backstage/plugin-scaffolder-react/alpha';
|
|
7
|
+
import { RegisterExistingButton } from './RegisterExistingButton.esm.js';
|
|
8
|
+
import { registerComponentRouteRef, editRouteRef, actionsRouteRef, scaffolderListTaskRouteRef, viewTechDocRouteRef, selectedTemplateRouteRef } from '../../routes.esm.js';
|
|
9
|
+
import { parseEntityRef, stringifyEntityRef } from '@backstage/catalog-model';
|
|
10
|
+
|
|
11
|
+
const defaultGroup = {
|
|
12
|
+
title: "Templates",
|
|
13
|
+
filter: () => true
|
|
14
|
+
};
|
|
15
|
+
const createGroupsWithOther = (groups) => [
|
|
16
|
+
...groups,
|
|
17
|
+
{
|
|
18
|
+
title: "Other Templates",
|
|
19
|
+
filter: (e) => ![...groups].some(({ filter }) => filter(e))
|
|
20
|
+
}
|
|
21
|
+
];
|
|
22
|
+
const TemplateListPage = (props) => {
|
|
23
|
+
var _a, _b, _c;
|
|
24
|
+
const registerComponentLink = useRouteRef(registerComponentRouteRef);
|
|
25
|
+
const {
|
|
26
|
+
TemplateCardComponent,
|
|
27
|
+
groups: givenGroups = [],
|
|
28
|
+
templateFilter,
|
|
29
|
+
headerOptions
|
|
30
|
+
} = props;
|
|
31
|
+
const navigate = useNavigate();
|
|
32
|
+
const editorLink = useRouteRef(editRouteRef);
|
|
33
|
+
const actionsLink = useRouteRef(actionsRouteRef);
|
|
34
|
+
const tasksLink = useRouteRef(scaffolderListTaskRouteRef);
|
|
35
|
+
const viewTechDocsLink = useRouteRef(viewTechDocRouteRef);
|
|
36
|
+
const templateRoute = useRouteRef(selectedTemplateRouteRef);
|
|
37
|
+
const app = useApp();
|
|
38
|
+
const groups = givenGroups.length ? createGroupsWithOther(givenGroups) : [defaultGroup];
|
|
39
|
+
const scaffolderPageContextMenuProps = {
|
|
40
|
+
onEditorClicked: ((_a = props == null ? void 0 : props.contextMenu) == null ? void 0 : _a.editor) !== false ? () => navigate(editorLink()) : void 0,
|
|
41
|
+
onActionsClicked: ((_b = props == null ? void 0 : props.contextMenu) == null ? void 0 : _b.actions) !== false ? () => navigate(actionsLink()) : void 0,
|
|
42
|
+
onTasksClicked: ((_c = props == null ? void 0 : props.contextMenu) == null ? void 0 : _c.tasks) !== false ? () => navigate(tasksLink()) : void 0
|
|
43
|
+
};
|
|
44
|
+
const additionalLinksForEntity = useCallback(
|
|
45
|
+
(template) => {
|
|
46
|
+
var _a2, _b2;
|
|
47
|
+
const { kind, namespace, name } = parseEntityRef(
|
|
48
|
+
stringifyEntityRef(template)
|
|
49
|
+
);
|
|
50
|
+
return ((_a2 = template.metadata.annotations) == null ? void 0 : _a2["backstage.io/techdocs-ref"]) && viewTechDocsLink ? [
|
|
51
|
+
{
|
|
52
|
+
icon: (_b2 = app.getSystemIcon("docs")) != null ? _b2 : DocsIcon,
|
|
53
|
+
text: "View TechDocs",
|
|
54
|
+
url: viewTechDocsLink({ kind, namespace, name })
|
|
55
|
+
}
|
|
56
|
+
] : [];
|
|
57
|
+
},
|
|
58
|
+
[app, viewTechDocsLink]
|
|
59
|
+
);
|
|
60
|
+
const onTemplateSelected = useCallback(
|
|
61
|
+
(template) => {
|
|
62
|
+
const { namespace, name } = parseEntityRef(stringifyEntityRef(template));
|
|
63
|
+
navigate(templateRoute({ namespace, templateName: name }));
|
|
64
|
+
},
|
|
65
|
+
[navigate, templateRoute]
|
|
66
|
+
);
|
|
67
|
+
return /* @__PURE__ */ React.createElement(EntityListProvider, null, /* @__PURE__ */ React.createElement(Page, { themeId: "home" }, /* @__PURE__ */ React.createElement(
|
|
68
|
+
Header,
|
|
69
|
+
{
|
|
70
|
+
pageTitleOverride: "Create a new component",
|
|
71
|
+
title: "Create a new component",
|
|
72
|
+
subtitle: "Create new software components using standard templates in your organization",
|
|
73
|
+
...headerOptions
|
|
74
|
+
},
|
|
75
|
+
/* @__PURE__ */ React.createElement(ScaffolderPageContextMenu, { ...scaffolderPageContextMenuProps })
|
|
76
|
+
), /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(ContentHeader, { title: "Available Templates" }, /* @__PURE__ */ React.createElement(
|
|
77
|
+
RegisterExistingButton,
|
|
78
|
+
{
|
|
79
|
+
title: "Register Existing Component",
|
|
80
|
+
to: registerComponentLink && registerComponentLink()
|
|
81
|
+
}
|
|
82
|
+
), /* @__PURE__ */ React.createElement(SupportButton, null, "Create new software components using standard templates. Different templates create different kinds of components (services, websites, documentation, ...).")), /* @__PURE__ */ React.createElement(CatalogFilterLayout, null, /* @__PURE__ */ React.createElement(CatalogFilterLayout.Filters, null, /* @__PURE__ */ React.createElement(EntitySearchBar, null), /* @__PURE__ */ React.createElement(EntityKindPicker, { initialFilter: "template", hidden: true }), /* @__PURE__ */ React.createElement(
|
|
83
|
+
UserListPicker,
|
|
84
|
+
{
|
|
85
|
+
initialFilter: "all",
|
|
86
|
+
availableFilters: ["all", "starred"]
|
|
87
|
+
}
|
|
88
|
+
), /* @__PURE__ */ React.createElement(TemplateCategoryPicker, null), /* @__PURE__ */ React.createElement(EntityTagPicker, null)), /* @__PURE__ */ React.createElement(CatalogFilterLayout.Content, null, /* @__PURE__ */ React.createElement(
|
|
89
|
+
TemplateGroups,
|
|
90
|
+
{
|
|
91
|
+
groups,
|
|
92
|
+
templateFilter,
|
|
93
|
+
TemplateCardComponent,
|
|
94
|
+
onTemplateSelected,
|
|
95
|
+
additionalLinksForEntity
|
|
96
|
+
}
|
|
97
|
+
))))));
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export { TemplateListPage };
|
|
101
|
+
//# sourceMappingURL=TemplateListPage.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TemplateListPage.esm.js","sources":["../../../src/next/TemplateListPage/TemplateListPage.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, { useCallback } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';\nimport { useApp, useRouteRef } from '@backstage/core-plugin-api';\n\nimport {\n Content,\n ContentHeader,\n DocsIcon,\n Header,\n Page,\n SupportButton,\n} from '@backstage/core-components';\nimport {\n EntityKindPicker,\n EntityListProvider,\n EntitySearchBar,\n EntityTagPicker,\n CatalogFilterLayout,\n UserListPicker,\n} from '@backstage/plugin-catalog-react';\nimport {\n ScaffolderPageContextMenu,\n TemplateCategoryPicker,\n TemplateGroups,\n} from '@backstage/plugin-scaffolder-react/alpha';\n\nimport { RegisterExistingButton } from './RegisterExistingButton';\nimport {\n actionsRouteRef,\n editRouteRef,\n registerComponentRouteRef,\n scaffolderListTaskRouteRef,\n selectedTemplateRouteRef,\n viewTechDocRouteRef,\n} from '../../routes';\nimport { parseEntityRef, stringifyEntityRef } from '@backstage/catalog-model';\nimport { TemplateGroupFilter } from '@backstage/plugin-scaffolder-react';\n\n/**\n * @alpha\n */\nexport type TemplateListPageProps = {\n TemplateCardComponent?: React.ComponentType<{\n template: TemplateEntityV1beta3;\n }>;\n groups?: TemplateGroupFilter[];\n templateFilter?: (entity: TemplateEntityV1beta3) => boolean;\n contextMenu?: {\n editor?: boolean;\n actions?: boolean;\n tasks?: boolean;\n };\n headerOptions?: {\n pageTitleOverride?: string;\n title?: string;\n subtitle?: string;\n };\n};\n\nconst defaultGroup: TemplateGroupFilter = {\n title: 'Templates',\n filter: () => true,\n};\n\nconst createGroupsWithOther = (\n groups: TemplateGroupFilter[],\n): TemplateGroupFilter[] => [\n ...groups,\n {\n title: 'Other Templates',\n filter: e => ![...groups].some(({ filter }) => filter(e)),\n },\n];\n\n/**\n * @alpha\n */\nexport const TemplateListPage = (props: TemplateListPageProps) => {\n const registerComponentLink = useRouteRef(registerComponentRouteRef);\n const {\n TemplateCardComponent,\n groups: givenGroups = [],\n templateFilter,\n headerOptions,\n } = props;\n const navigate = useNavigate();\n const editorLink = useRouteRef(editRouteRef);\n const actionsLink = useRouteRef(actionsRouteRef);\n const tasksLink = useRouteRef(scaffolderListTaskRouteRef);\n const viewTechDocsLink = useRouteRef(viewTechDocRouteRef);\n const templateRoute = useRouteRef(selectedTemplateRouteRef);\n const app = useApp();\n\n const groups = givenGroups.length\n ? createGroupsWithOther(givenGroups)\n : [defaultGroup];\n\n const scaffolderPageContextMenuProps = {\n onEditorClicked:\n props?.contextMenu?.editor !== false\n ? () => navigate(editorLink())\n : undefined,\n onActionsClicked:\n props?.contextMenu?.actions !== false\n ? () => navigate(actionsLink())\n : undefined,\n onTasksClicked:\n props?.contextMenu?.tasks !== false\n ? () => navigate(tasksLink())\n : undefined,\n };\n\n const additionalLinksForEntity = useCallback(\n (template: TemplateEntityV1beta3) => {\n const { kind, namespace, name } = parseEntityRef(\n stringifyEntityRef(template),\n );\n return template.metadata.annotations?.['backstage.io/techdocs-ref'] &&\n viewTechDocsLink\n ? [\n {\n icon: app.getSystemIcon('docs') ?? DocsIcon,\n text: 'View TechDocs',\n url: viewTechDocsLink({ kind, namespace, name }),\n },\n ]\n : [];\n },\n [app, viewTechDocsLink],\n );\n\n const onTemplateSelected = useCallback(\n (template: TemplateEntityV1beta3) => {\n const { namespace, name } = parseEntityRef(stringifyEntityRef(template));\n\n navigate(templateRoute({ namespace, templateName: name }));\n },\n [navigate, templateRoute],\n );\n\n return (\n <EntityListProvider>\n <Page themeId=\"home\">\n <Header\n pageTitleOverride=\"Create a new component\"\n title=\"Create a new component\"\n subtitle=\"Create new software components using standard templates in your organization\"\n {...headerOptions}\n >\n <ScaffolderPageContextMenu {...scaffolderPageContextMenuProps} />\n </Header>\n <Content>\n <ContentHeader title=\"Available Templates\">\n <RegisterExistingButton\n title=\"Register Existing Component\"\n to={registerComponentLink && registerComponentLink()}\n />\n <SupportButton>\n Create new software components using standard templates. Different\n templates create different kinds of components (services,\n websites, documentation, ...).\n </SupportButton>\n </ContentHeader>\n\n <CatalogFilterLayout>\n <CatalogFilterLayout.Filters>\n <EntitySearchBar />\n <EntityKindPicker initialFilter=\"template\" hidden />\n <UserListPicker\n initialFilter=\"all\"\n availableFilters={['all', 'starred']}\n />\n <TemplateCategoryPicker />\n <EntityTagPicker />\n </CatalogFilterLayout.Filters>\n <CatalogFilterLayout.Content>\n <TemplateGroups\n groups={groups}\n templateFilter={templateFilter}\n TemplateCardComponent={TemplateCardComponent}\n onTemplateSelected={onTemplateSelected}\n additionalLinksForEntity={additionalLinksForEntity}\n />\n </CatalogFilterLayout.Content>\n </CatalogFilterLayout>\n </Content>\n </Page>\n </EntityListProvider>\n );\n};\n"],"names":["_a","_b"],"mappings":";;;;;;;;;;AA4EA,MAAM,YAAoC,GAAA;AAAA,EACxC,KAAO,EAAA,WAAA;AAAA,EACP,QAAQ,MAAM,IAAA;AAChB,CAAA,CAAA;AAEA,MAAM,qBAAA,GAAwB,CAC5B,MAC0B,KAAA;AAAA,EAC1B,GAAG,MAAA;AAAA,EACH;AAAA,IACE,KAAO,EAAA,iBAAA;AAAA,IACP,MAAQ,EAAA,CAAA,CAAA,KAAK,CAAC,CAAC,GAAG,MAAM,CAAA,CAAE,IAAK,CAAA,CAAC,EAAE,MAAA,EAAa,KAAA,MAAA,CAAO,CAAC,CAAC,CAAA;AAAA,GAC1D;AACF,CAAA,CAAA;AAKa,MAAA,gBAAA,GAAmB,CAAC,KA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AAA,CAAC,eAAgB,EAAA,IAAA,CACnB,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,mBAAoB,CAAA,OAAA,EAApB,IACC,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,cAAA;AAAA,IAAA;AAAA,MACC,MAAA;AAAA,MACA,cAAA;AAAA,MACA,qBAAA;AAAA,MACA,kBAAA;AAAA,MACA,wBAAA;AAAA,KAAA;AAAA,GAEJ,CACF,CACF,CACF,CACF,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useNavigate, Navigate } from 'react-router-dom';
|
|
3
|
+
import useAsync from 'react-use/esm/useAsync';
|
|
4
|
+
import { stringifyEntityRef, ANNOTATION_EDIT_URL } from '@backstage/catalog-model';
|
|
5
|
+
import { useRouteRef, useApi, useRouteRefParams, AnalyticsContext } from '@backstage/core-plugin-api';
|
|
6
|
+
import { useTemplateSecrets, scaffolderApiRef } from '@backstage/plugin-scaffolder-react';
|
|
7
|
+
import { catalogApiRef } from '@backstage/plugin-catalog-react';
|
|
8
|
+
import { Workflow } from '@backstage/plugin-scaffolder-react/alpha';
|
|
9
|
+
import { Page, Header } from '@backstage/core-components';
|
|
10
|
+
import { rootRouteRef, scaffolderTaskRouteRef, selectedTemplateRouteRef } from '../../routes.esm.js';
|
|
11
|
+
import { TemplateWizardPageContextMenu } from './TemplateWizardPageContextMenu.esm.js';
|
|
12
|
+
|
|
13
|
+
const TemplateWizardPage = (props) => {
|
|
14
|
+
const rootRef = useRouteRef(rootRouteRef);
|
|
15
|
+
const taskRoute = useRouteRef(scaffolderTaskRouteRef);
|
|
16
|
+
const { secrets } = useTemplateSecrets();
|
|
17
|
+
const scaffolderApi = useApi(scaffolderApiRef);
|
|
18
|
+
const catalogApi = useApi(catalogApiRef);
|
|
19
|
+
const navigate = useNavigate();
|
|
20
|
+
const { templateName, namespace } = useRouteRefParams(
|
|
21
|
+
selectedTemplateRouteRef
|
|
22
|
+
);
|
|
23
|
+
const templateRef = stringifyEntityRef({
|
|
24
|
+
kind: "Template",
|
|
25
|
+
namespace,
|
|
26
|
+
name: templateName
|
|
27
|
+
});
|
|
28
|
+
const { value: editUrl } = useAsync(async () => {
|
|
29
|
+
var _a;
|
|
30
|
+
const data = await catalogApi.getEntityByRef(templateRef);
|
|
31
|
+
return (_a = data == null ? void 0 : data.metadata.annotations) == null ? void 0 : _a[ANNOTATION_EDIT_URL];
|
|
32
|
+
}, [templateRef, catalogApi]);
|
|
33
|
+
const onCreate = async (values) => {
|
|
34
|
+
const { taskId } = await scaffolderApi.scaffold({
|
|
35
|
+
templateRef,
|
|
36
|
+
values,
|
|
37
|
+
secrets
|
|
38
|
+
});
|
|
39
|
+
navigate(taskRoute({ taskId }));
|
|
40
|
+
};
|
|
41
|
+
const onError = () => /* @__PURE__ */ React.createElement(Navigate, { to: rootRef() });
|
|
42
|
+
return /* @__PURE__ */ React.createElement(AnalyticsContext, { attributes: { entityRef: templateRef } }, /* @__PURE__ */ React.createElement(Page, { themeId: "website" }, /* @__PURE__ */ React.createElement(
|
|
43
|
+
Header,
|
|
44
|
+
{
|
|
45
|
+
pageTitleOverride: "Create a new component",
|
|
46
|
+
title: "Create a new component",
|
|
47
|
+
subtitle: "Create new software components using standard templates in your organization",
|
|
48
|
+
...props.headerOptions
|
|
49
|
+
},
|
|
50
|
+
/* @__PURE__ */ React.createElement(TemplateWizardPageContextMenu, { editUrl })
|
|
51
|
+
), /* @__PURE__ */ React.createElement(
|
|
52
|
+
Workflow,
|
|
53
|
+
{
|
|
54
|
+
namespace,
|
|
55
|
+
templateName,
|
|
56
|
+
onCreate,
|
|
57
|
+
components: props.components,
|
|
58
|
+
onError,
|
|
59
|
+
extensions: props.customFieldExtensions,
|
|
60
|
+
formProps: props.formProps,
|
|
61
|
+
layouts: props.layouts
|
|
62
|
+
}
|
|
63
|
+
)));
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export { TemplateWizardPage };
|
|
67
|
+
//# sourceMappingURL=TemplateWizardPage.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TemplateWizardPage.esm.js","sources":["../../../src/next/TemplateWizardPage/TemplateWizardPage.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 React from 'react';\nimport { Navigate, useNavigate } from 'react-router-dom';\nimport useAsync from 'react-use/esm/useAsync';\nimport {\n stringifyEntityRef,\n ANNOTATION_EDIT_URL,\n} from '@backstage/catalog-model';\nimport {\n AnalyticsContext,\n useApi,\n useRouteRef,\n useRouteRefParams,\n} from '@backstage/core-plugin-api';\nimport {\n scaffolderApiRef,\n useTemplateSecrets,\n type LayoutOptions,\n FormProps,\n FieldExtensionOptions,\n ReviewStepProps,\n} from '@backstage/plugin-scaffolder-react';\nimport { catalogApiRef } from '@backstage/plugin-catalog-react';\n\nimport { Workflow } from '@backstage/plugin-scaffolder-react/alpha';\nimport { JsonValue } from '@backstage/types';\nimport { Header, Page } from '@backstage/core-components';\n\nimport {\n rootRouteRef,\n scaffolderTaskRouteRef,\n selectedTemplateRouteRef,\n} from '../../routes';\n\nimport { TemplateWizardPageContextMenu } from './TemplateWizardPageContextMenu';\n\n/**\n * @alpha\n */\nexport type TemplateWizardPageProps = {\n customFieldExtensions: FieldExtensionOptions<any, any>[];\n components?: {\n ReviewStepComponent?: React.ComponentType<ReviewStepProps>;\n };\n layouts?: LayoutOptions[];\n formProps?: FormProps;\n headerOptions?: {\n pageTitleOverride?: string;\n title?: string;\n subtitle?: string;\n };\n};\n\nexport const TemplateWizardPage = (props: TemplateWizardPageProps) => {\n const rootRef = useRouteRef(rootRouteRef);\n const taskRoute = useRouteRef(scaffolderTaskRouteRef);\n const { secrets } = useTemplateSecrets();\n const scaffolderApi = useApi(scaffolderApiRef);\n const catalogApi = useApi(catalogApiRef);\n const navigate = useNavigate();\n const { templateName, namespace } = useRouteRefParams(\n selectedTemplateRouteRef,\n );\n\n const templateRef = stringifyEntityRef({\n kind: 'Template',\n namespace,\n name: templateName,\n });\n\n const { value: editUrl } = useAsync(async () => {\n const data = await catalogApi.getEntityByRef(templateRef);\n return data?.metadata.annotations?.[ANNOTATION_EDIT_URL];\n }, [templateRef, catalogApi]);\n\n const onCreate = async (values: Record<string, JsonValue>) => {\n const { taskId } = await scaffolderApi.scaffold({\n templateRef,\n values,\n secrets,\n });\n\n navigate(taskRoute({ taskId }));\n };\n\n const onError = () => <Navigate to={rootRef()} />;\n\n return (\n <AnalyticsContext attributes={{ entityRef: templateRef }}>\n <Page themeId=\"website\">\n <Header\n pageTitleOverride=\"Create a new component\"\n title=\"Create a new component\"\n subtitle=\"Create new software components using standard templates in your organization\"\n {...props.headerOptions}\n >\n <TemplateWizardPageContextMenu editUrl={editUrl} />\n </Header>\n <Workflow\n namespace={namespace}\n templateName={templateName}\n onCreate={onCreate}\n components={props.components}\n onError={onError}\n extensions={props.customFieldExtensions}\n formProps={props.formProps}\n layouts={props.layouts}\n />\n </Page>\n </AnalyticsContext>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AAmEa,MAAA,kBAAA,GAAqB,CAAC,KAAmC,KAAA;AACpE,EAAM,MAAA,OAAA,GAAU,YAAY,YAAY,CAAA,CAAA;AACxC,EAAM,MAAA,SAAA,GAAY,YAAY,sBAAsB,CAAA,CAAA;AACpD,EAAM,MAAA,EAAE,OAAQ,EAAA,GAAI,kBAAmB,EAAA,CAAA;AACvC,EAAM,MAAA,aAAA,GAAgB,OAAO,gBAAgB,CAAA,CAAA;AAC7C,EAAM,MAAA,UA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AAA,CAAA,aAAA,CAAC,IAAK,EAAA,EAAA,OAAA,EAAQ,SACZ,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,iBAAkB,EAAA,wBAAA;AAAA,MAClB,KAAM,EAAA,wBAAA;AAAA,MACN,QAAS,EAAA,8EAAA;AAAA,MACR,GAAG,KAAM,CAAA,aAAA;AAAA,KAAA;AAAA,oBAEV,KAAA,CAAA,aAAA,CAAC,iCAA8B,OAAkB,EAAA,CAAA;AAAA,GAEnD,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,SAAA;AAAA,MACA,YAAA;AAAA,MACA,QAAA;AAAA,MACA,YAAY,KAAM,CAAA,UAAA;AAAA,MAClB,OAAA;AAAA,MACA,YAAY,KAAM,CAAA,qBAAA;AAAA,MAClB,WAAW,KAAM,CAAA,SAAA;AAAA,MACjB,SAAS,KAAM,CAAA,OAAA;AAAA,KAAA;AAAA,GAEnB,CACF,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import IconButton from '@material-ui/core/IconButton';
|
|
2
|
+
import ListItemIcon from '@material-ui/core/ListItemIcon';
|
|
3
|
+
import ListItemText from '@material-ui/core/ListItemText';
|
|
4
|
+
import MenuItem from '@material-ui/core/MenuItem';
|
|
5
|
+
import MenuList from '@material-ui/core/MenuList';
|
|
6
|
+
import Popover from '@material-ui/core/Popover';
|
|
7
|
+
import { makeStyles } from '@material-ui/core/styles';
|
|
8
|
+
import Edit from '@material-ui/icons/Edit';
|
|
9
|
+
import MoreVert from '@material-ui/icons/MoreVert';
|
|
10
|
+
import React, { useState } from 'react';
|
|
11
|
+
|
|
12
|
+
const useStyles = makeStyles((theme) => ({
|
|
13
|
+
button: {
|
|
14
|
+
color: theme.page.fontColor
|
|
15
|
+
}
|
|
16
|
+
}));
|
|
17
|
+
function TemplateWizardPageContextMenu(props) {
|
|
18
|
+
const { editUrl } = props;
|
|
19
|
+
const classes = useStyles();
|
|
20
|
+
const [anchorEl, setAnchorEl] = useState();
|
|
21
|
+
if (!editUrl) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
const onOpen = (event) => {
|
|
25
|
+
setAnchorEl(event.currentTarget);
|
|
26
|
+
};
|
|
27
|
+
const onClose = () => {
|
|
28
|
+
setAnchorEl(void 0);
|
|
29
|
+
};
|
|
30
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
31
|
+
IconButton,
|
|
32
|
+
{
|
|
33
|
+
id: "long-menu",
|
|
34
|
+
"aria-label": "more",
|
|
35
|
+
"aria-controls": "long-menu",
|
|
36
|
+
"aria-expanded": !!anchorEl,
|
|
37
|
+
"aria-haspopup": "true",
|
|
38
|
+
role: "button",
|
|
39
|
+
onClick: onOpen,
|
|
40
|
+
"data-testid": "menu-button",
|
|
41
|
+
color: "inherit",
|
|
42
|
+
className: classes.button
|
|
43
|
+
},
|
|
44
|
+
/* @__PURE__ */ React.createElement(MoreVert, null)
|
|
45
|
+
), /* @__PURE__ */ React.createElement(
|
|
46
|
+
Popover,
|
|
47
|
+
{
|
|
48
|
+
"aria-labelledby": "long-menu",
|
|
49
|
+
open: Boolean(anchorEl),
|
|
50
|
+
onClose,
|
|
51
|
+
anchorEl,
|
|
52
|
+
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
53
|
+
transformOrigin: { vertical: "top", horizontal: "right" }
|
|
54
|
+
},
|
|
55
|
+
/* @__PURE__ */ React.createElement(MenuList, null, /* @__PURE__ */ React.createElement(MenuItem, { onClick: () => window.open(editUrl, "_blank") }, /* @__PURE__ */ React.createElement(ListItemIcon, null, /* @__PURE__ */ React.createElement(Edit, { fontSize: "small" })), /* @__PURE__ */ React.createElement(ListItemText, { primary: "Edit Configuration" })))
|
|
56
|
+
));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export { TemplateWizardPageContextMenu };
|
|
60
|
+
//# sourceMappingURL=TemplateWizardPageContextMenu.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TemplateWizardPageContextMenu.esm.js","sources":["../../../src/next/TemplateWizardPage/TemplateWizardPageContextMenu.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 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 Edit from '@material-ui/icons/Edit';\nimport MoreVert from '@material-ui/icons/MoreVert';\nimport React, { useState } from 'react';\n\nconst useStyles = makeStyles(theme => ({\n button: {\n color: theme.page.fontColor,\n },\n}));\n\nexport type TemplateWizardPageContextMenuProps = {\n editUrl?: string;\n};\n\nexport function TemplateWizardPageContextMenu(\n props: TemplateWizardPageContextMenuProps,\n) {\n const { editUrl } = props;\n const classes = useStyles();\n const [anchorEl, setAnchorEl] = useState<HTMLButtonElement>();\n\n if (!editUrl) {\n return null;\n }\n\n const onOpen = (event: React.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=\"more\"\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 <MenuItem onClick={() => window.open(editUrl, '_blank')}>\n <ListItemIcon>\n <Edit fontSize=\"small\" />\n </ListItemIcon>\n <ListItemText primary=\"Edit Configuration\" />\n </MenuItem>\n </MenuList>\n </Popover>\n </>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;AA2BA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,MAAQ,EAAA;AAAA,IACN,KAAA,EAAO,MAAM,IAAK,CAAA,SAAA;AAAA,GACpB;AACF,CAAE,CAAA,CAAA,CAAA;AAMK,SAAS,8BACd,KACA,EAAA;AACA,EAAM,MAAA,EAAE,SAAY,GAAA,KAAA,CAAA;AACpB,EAAA,MAAM,UAAU,SAAU,EAAA,CAAA;AAC1B,EAAA,MAAM,CAAC,QAAA,EAAU,WAAW,CAAA,GAAI,QAA4B,EAAA,CAAA;AAE5D,EAAA,IAAI,CAAC,OAAS,EAAA;AACZ,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAEA,EAAM,MAAA,MAAA,GAAS,CAAC,KAAmD,KAAA;AACjE,IAAA,WAAA,CAAY,MAAM,aAAa,CAAA,CAAA;AAAA,GACjC,CAAA;AAEA,EAAA,MAAM,UAAU,MAAM;AACpB,IAAA,WAAA,CAAY,KAAS,CAAA,CAAA,CAAA;AAAA,GACvB,CAAA;AAEA,EAAA,uBAEI,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,EAAG,EAAA,WAAA;AAAA,MACH,YAAW,EAAA,MAAA;AAAA,MACX,eAAc,EAAA,WAAA;AAAA,MACd,eAAA,EAAe,CAAC,CAAC,QAAA;AAAA,MACjB,eAAc,EAAA,MAAA;AAAA,MACd,IAAK,EAAA,QAAA;AAAA,MACL,OAAS,EAAA,MAAA;AAAA,MACT,aAAY,EAAA,aAAA;AAAA,MACZ,KAAM,EAAA,SAAA;AAAA,MACN,WAAW,OAAQ,CAAA,MAAA;AAAA,KAAA;AAAA,wCAElB,QAAS,EAAA,IAAA,CAAA;AAAA,GAEZ,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,OAAA;AAAA,IAAA;AAAA,MACC,iBAAgB,EAAA,WAAA;AAAA,MAChB,IAAA,EAAM,QAAQ,QAAQ,CAAA;AAAA,MACtB,OAAA;AAAA,MACA,QAAA;AAAA,MACA,YAAc,EAAA,EAAE,QAAU,EAAA,QAAA,EAAU,YAAY,OAAQ,EAAA;AAAA,MACxD,eAAiB,EAAA,EAAE,QAAU,EAAA,KAAA,EAAO,YAAY,OAAQ,EAAA;AAAA,KAAA;AAAA,oBAExD,KAAA,CAAA,aAAA,CAAC,QACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,QAAS,EAAA,EAAA,OAAA,EAAS,MAAM,MAAO,CAAA,IAAA,CAAK,OAAS,EAAA,QAAQ,CACpD,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,oCACE,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,QAAS,EAAA,OAAA,EAAQ,CACzB,CAAA,sCACC,YAAa,EAAA,EAAA,OAAA,EAAQ,oBAAqB,EAAA,CAC7C,CACF,CAAA;AAAA,GAEJ,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { scmIntegrationsApiRef } from '@backstage/integration-react';
|
|
2
|
+
import { scaffolderApiRef, createScaffolderFieldExtension } from '@backstage/plugin-scaffolder-react';
|
|
3
|
+
import { ScaffolderClient } from './api.esm.js';
|
|
4
|
+
import { EntityPicker } from './components/fields/EntityPicker/EntityPicker.esm.js';
|
|
5
|
+
import { entityNamePickerValidation } from './components/fields/EntityNamePicker/validation.esm.js';
|
|
6
|
+
import { EntityNamePicker } from './components/fields/EntityNamePicker/EntityNamePicker.esm.js';
|
|
7
|
+
import { OwnerPicker } from './components/fields/OwnerPicker/OwnerPicker.esm.js';
|
|
8
|
+
import { MultiEntityPicker, validateMultiEntityPickerValidation } from './components/fields/MultiEntityPicker/MultiEntityPicker.esm.js';
|
|
9
|
+
import { RepoUrlPickerSchema } from './components/fields/RepoUrlPicker/schema.esm.js';
|
|
10
|
+
import { repoPickerValidation } from './components/fields/RepoUrlPicker/validation.esm.js';
|
|
11
|
+
import { RepoUrlPicker } from './components/fields/RepoUrlPicker/RepoUrlPicker.esm.js';
|
|
12
|
+
import { createPlugin, createApiFactory, discoveryApiRef, fetchApiRef, identityApiRef, createRoutableExtension } from '@backstage/core-plugin-api';
|
|
13
|
+
import { OwnedEntityPicker } from './components/fields/OwnedEntityPicker/OwnedEntityPicker.esm.js';
|
|
14
|
+
import { EntityTagsPicker } from './components/fields/EntityTagsPicker/EntityTagsPicker.esm.js';
|
|
15
|
+
import { rootRouteRef, selectedTemplateRouteRef, scaffolderTaskRouteRef, actionsRouteRef, scaffolderListTaskRouteRef, editRouteRef, registerComponentRouteRef, viewTechDocRouteRef } from './routes.esm.js';
|
|
16
|
+
import { MyGroupsPicker } from './components/fields/MyGroupsPicker/MyGroupsPicker.esm.js';
|
|
17
|
+
import { EntityPickerSchema } from './components/fields/EntityPicker/schema.esm.js';
|
|
18
|
+
import { EntityNamePickerSchema } from './components/fields/EntityNamePicker/schema.esm.js';
|
|
19
|
+
import { MultiEntityPickerSchema } from './components/fields/MultiEntityPicker/schema.esm.js';
|
|
20
|
+
import { OwnerPickerSchema } from './components/fields/OwnerPicker/schema.esm.js';
|
|
21
|
+
import { MyGroupsPickerSchema } from './components/fields/MyGroupsPicker/schema.esm.js';
|
|
22
|
+
import { OwnedEntityPickerSchema } from './components/fields/OwnedEntityPicker/schema.esm.js';
|
|
23
|
+
import { EntityTagsPickerSchema } from './components/fields/EntityTagsPicker/schema.esm.js';
|
|
24
|
+
|
|
25
|
+
const scaffolderPlugin = createPlugin({
|
|
26
|
+
id: "scaffolder",
|
|
27
|
+
apis: [
|
|
28
|
+
createApiFactory({
|
|
29
|
+
api: scaffolderApiRef,
|
|
30
|
+
deps: {
|
|
31
|
+
discoveryApi: discoveryApiRef,
|
|
32
|
+
scmIntegrationsApi: scmIntegrationsApiRef,
|
|
33
|
+
fetchApi: fetchApiRef,
|
|
34
|
+
identityApi: identityApiRef
|
|
35
|
+
},
|
|
36
|
+
factory: ({ discoveryApi, scmIntegrationsApi, fetchApi, identityApi }) => new ScaffolderClient({
|
|
37
|
+
discoveryApi,
|
|
38
|
+
scmIntegrationsApi,
|
|
39
|
+
fetchApi,
|
|
40
|
+
identityApi
|
|
41
|
+
})
|
|
42
|
+
})
|
|
43
|
+
],
|
|
44
|
+
routes: {
|
|
45
|
+
root: rootRouteRef,
|
|
46
|
+
selectedTemplate: selectedTemplateRouteRef,
|
|
47
|
+
ongoingTask: scaffolderTaskRouteRef,
|
|
48
|
+
actions: actionsRouteRef,
|
|
49
|
+
listTasks: scaffolderListTaskRouteRef,
|
|
50
|
+
edit: editRouteRef
|
|
51
|
+
},
|
|
52
|
+
externalRoutes: {
|
|
53
|
+
registerComponent: registerComponentRouteRef,
|
|
54
|
+
viewTechDoc: viewTechDocRouteRef
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
const EntityPickerFieldExtension = scaffolderPlugin.provide(
|
|
58
|
+
createScaffolderFieldExtension({
|
|
59
|
+
component: EntityPicker,
|
|
60
|
+
name: "EntityPicker",
|
|
61
|
+
schema: EntityPickerSchema
|
|
62
|
+
})
|
|
63
|
+
);
|
|
64
|
+
const EntityNamePickerFieldExtension = scaffolderPlugin.provide(
|
|
65
|
+
createScaffolderFieldExtension({
|
|
66
|
+
component: EntityNamePicker,
|
|
67
|
+
name: "EntityNamePicker",
|
|
68
|
+
validation: entityNamePickerValidation,
|
|
69
|
+
schema: EntityNamePickerSchema
|
|
70
|
+
})
|
|
71
|
+
);
|
|
72
|
+
const MultiEntityPickerFieldExtension = scaffolderPlugin.provide(
|
|
73
|
+
createScaffolderFieldExtension({
|
|
74
|
+
component: MultiEntityPicker,
|
|
75
|
+
name: "MultiEntityPicker",
|
|
76
|
+
schema: MultiEntityPickerSchema,
|
|
77
|
+
validation: validateMultiEntityPickerValidation
|
|
78
|
+
})
|
|
79
|
+
);
|
|
80
|
+
const RepoUrlPickerFieldExtension = scaffolderPlugin.provide(
|
|
81
|
+
createScaffolderFieldExtension({
|
|
82
|
+
component: RepoUrlPicker,
|
|
83
|
+
name: "RepoUrlPicker",
|
|
84
|
+
validation: repoPickerValidation,
|
|
85
|
+
schema: RepoUrlPickerSchema
|
|
86
|
+
})
|
|
87
|
+
);
|
|
88
|
+
const OwnerPickerFieldExtension = scaffolderPlugin.provide(
|
|
89
|
+
createScaffolderFieldExtension({
|
|
90
|
+
component: OwnerPicker,
|
|
91
|
+
name: "OwnerPicker",
|
|
92
|
+
schema: OwnerPickerSchema
|
|
93
|
+
})
|
|
94
|
+
);
|
|
95
|
+
const MyGroupsPickerFieldExtension = scaffolderPlugin.provide(
|
|
96
|
+
createScaffolderFieldExtension({
|
|
97
|
+
component: MyGroupsPicker,
|
|
98
|
+
name: "MyGroupsPicker",
|
|
99
|
+
schema: MyGroupsPickerSchema
|
|
100
|
+
})
|
|
101
|
+
);
|
|
102
|
+
const ScaffolderPage = scaffolderPlugin.provide(
|
|
103
|
+
createRoutableExtension({
|
|
104
|
+
name: "ScaffolderPage",
|
|
105
|
+
component: () => import('./components/Router/index.esm.js').then((m) => m.Router),
|
|
106
|
+
mountPoint: rootRouteRef
|
|
107
|
+
})
|
|
108
|
+
);
|
|
109
|
+
const OwnedEntityPickerFieldExtension = scaffolderPlugin.provide(
|
|
110
|
+
createScaffolderFieldExtension({
|
|
111
|
+
component: OwnedEntityPicker,
|
|
112
|
+
name: "OwnedEntityPicker",
|
|
113
|
+
schema: OwnedEntityPickerSchema
|
|
114
|
+
})
|
|
115
|
+
);
|
|
116
|
+
const EntityTagsPickerFieldExtension = scaffolderPlugin.provide(
|
|
117
|
+
createScaffolderFieldExtension({
|
|
118
|
+
component: EntityTagsPicker,
|
|
119
|
+
name: "EntityTagsPicker",
|
|
120
|
+
schema: EntityTagsPickerSchema
|
|
121
|
+
})
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
export { EntityNamePickerFieldExtension, EntityPickerFieldExtension, EntityTagsPickerFieldExtension, MultiEntityPickerFieldExtension, MyGroupsPickerFieldExtension, OwnedEntityPickerFieldExtension, OwnerPickerFieldExtension, RepoUrlPickerFieldExtension, ScaffolderPage, scaffolderPlugin };
|
|
125
|
+
//# sourceMappingURL=plugin.esm.js.map
|