@backstage/plugin-scaffolder 1.25.1 → 1.26.0-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 +59 -5
- package/alpha/package.json +1 -1
- package/dist/alpha/api/FormFieldsApi.esm.js +40 -0
- package/dist/alpha/api/FormFieldsApi.esm.js.map +1 -0
- package/dist/alpha/api/ref.esm.js +8 -0
- package/dist/alpha/api/ref.esm.js.map +1 -0
- package/dist/alpha/api.esm.js +27 -0
- package/dist/alpha/api.esm.js.map +1 -0
- package/dist/{next → alpha/components}/TemplateEditorPage/CustomFieldExplorer.esm.js +1 -1
- package/dist/alpha/components/TemplateEditorPage/CustomFieldExplorer.esm.js.map +1 -0
- package/dist/alpha/components/TemplateEditorPage/CustomFieldPlaygroud.esm.js +167 -0
- package/dist/alpha/components/TemplateEditorPage/CustomFieldPlaygroud.esm.js.map +1 -0
- package/dist/alpha/components/TemplateEditorPage/CustomFieldsPage.esm.js +33 -0
- package/dist/alpha/components/TemplateEditorPage/CustomFieldsPage.esm.js.map +1 -0
- package/dist/{next → alpha/components}/TemplateEditorPage/DirectoryEditorContext.esm.js +4 -7
- package/dist/alpha/components/TemplateEditorPage/DirectoryEditorContext.esm.js.map +1 -0
- package/dist/alpha/components/TemplateEditorPage/DryRunContext.esm.js.map +1 -0
- package/dist/{next → alpha/components}/TemplateEditorPage/DryRunResults/DryRunResults.esm.js +1 -1
- package/dist/alpha/components/TemplateEditorPage/DryRunResults/DryRunResults.esm.js.map +1 -0
- package/dist/{next → alpha/components}/TemplateEditorPage/DryRunResults/DryRunResultsList.esm.js +2 -2
- package/dist/alpha/components/TemplateEditorPage/DryRunResults/DryRunResultsList.esm.js.map +1 -0
- package/dist/alpha/components/TemplateEditorPage/DryRunResults/DryRunResultsSplitView.esm.js.map +1 -0
- package/dist/{next → alpha/components}/TemplateEditorPage/DryRunResults/DryRunResultsView.esm.js +2 -2
- package/dist/alpha/components/TemplateEditorPage/DryRunResults/DryRunResultsView.esm.js.map +1 -0
- package/dist/alpha/components/TemplateEditorPage/DryRunResults/IconLink.esm.js.map +1 -0
- package/dist/alpha/components/TemplateEditorPage/DryRunResults/TaskPageLinks.esm.js.map +1 -0
- package/dist/{next → alpha/components}/TemplateEditorPage/DryRunResults/TaskStatusStepper.esm.js +1 -1
- package/dist/alpha/components/TemplateEditorPage/DryRunResults/TaskStatusStepper.esm.js.map +1 -0
- package/dist/alpha/components/TemplateEditorPage/TemplateEditor.esm.js +94 -0
- package/dist/alpha/components/TemplateEditorPage/TemplateEditor.esm.js.map +1 -0
- package/dist/{next → alpha/components}/TemplateEditorPage/TemplateEditorBrowser.esm.js +36 -38
- package/dist/alpha/components/TemplateEditorPage/TemplateEditorBrowser.esm.js.map +1 -0
- package/dist/{next → alpha/components}/TemplateEditorPage/TemplateEditorForm.esm.js +12 -20
- package/dist/alpha/components/TemplateEditorPage/TemplateEditorForm.esm.js.map +1 -0
- package/dist/alpha/components/TemplateEditorPage/TemplateEditorIntro.esm.js +146 -0
- package/dist/alpha/components/TemplateEditorPage/TemplateEditorIntro.esm.js.map +1 -0
- package/dist/alpha/components/TemplateEditorPage/TemplateEditorPage.esm.js +53 -0
- package/dist/alpha/components/TemplateEditorPage/TemplateEditorPage.esm.js.map +1 -0
- package/dist/{next → alpha/components}/TemplateEditorPage/TemplateEditorTextArea.esm.js +36 -3
- package/dist/alpha/components/TemplateEditorPage/TemplateEditorTextArea.esm.js.map +1 -0
- package/dist/alpha/components/TemplateEditorPage/TemplateEditorToolbar.esm.js +98 -0
- package/dist/alpha/components/TemplateEditorPage/TemplateEditorToolbar.esm.js.map +1 -0
- package/dist/alpha/components/TemplateEditorPage/TemplateFormPage.esm.js +43 -0
- package/dist/alpha/components/TemplateEditorPage/TemplateFormPage.esm.js.map +1 -0
- package/dist/{next → alpha/components}/TemplateEditorPage/TemplateFormPreviewer.esm.js +77 -39
- package/dist/alpha/components/TemplateEditorPage/TemplateFormPreviewer.esm.js.map +1 -0
- package/dist/alpha/components/TemplateEditorPage/TemplatePage.esm.js +52 -0
- package/dist/alpha/components/TemplateEditorPage/TemplatePage.esm.js.map +1 -0
- package/dist/{next → alpha/components}/TemplateListPage/RegisterExistingButton.esm.js +1 -1
- package/dist/alpha/components/TemplateListPage/RegisterExistingButton.esm.js.map +1 -0
- package/dist/{next → alpha/components}/TemplateListPage/TemplateListPage.esm.js +2 -2
- package/dist/alpha/components/TemplateListPage/TemplateListPage.esm.js.map +1 -0
- package/dist/{next → alpha/components}/TemplateWizardPage/TemplateWizardPage.esm.js +2 -2
- package/dist/alpha/components/TemplateWizardPage/TemplateWizardPage.esm.js.map +1 -0
- package/dist/{next → alpha/components}/TemplateWizardPage/TemplateWizardPageContextMenu.esm.js +1 -1
- package/dist/alpha/components/TemplateWizardPage/TemplateWizardPageContextMenu.esm.js.map +1 -0
- package/dist/alpha/extensions.esm.js +30 -0
- package/dist/alpha/extensions.esm.js.map +1 -0
- package/dist/alpha/fields/RepoUrlPicker.esm.js +37 -0
- package/dist/alpha/fields/RepoUrlPicker.esm.js.map +1 -0
- package/dist/alpha/plugin.esm.js +32 -0
- package/dist/alpha/plugin.esm.js.map +1 -0
- package/dist/alpha.d.ts +80 -9
- package/dist/alpha.esm.js +1 -60
- package/dist/alpha.esm.js.map +1 -1
- package/dist/api.esm.js +19 -5
- package/dist/api.esm.js.map +1 -1
- package/dist/components/ActionsPage/ActionsPage.esm.js +30 -5
- package/dist/components/ActionsPage/ActionsPage.esm.js.map +1 -1
- package/dist/components/FileBrowser/FileBrowser.esm.js +4 -3
- package/dist/components/FileBrowser/FileBrowser.esm.js.map +1 -1
- package/dist/components/ListTasksPage/ListTasksPage.esm.js +17 -3
- package/dist/components/ListTasksPage/ListTasksPage.esm.js.map +1 -1
- package/dist/components/ListTasksPage/OwnerListPicker.esm.js +2 -2
- package/dist/components/ListTasksPage/OwnerListPicker.esm.js.map +1 -1
- package/dist/components/ListTasksPage/columns/CreatedAtColumn.esm.js +10 -5
- package/dist/components/ListTasksPage/columns/CreatedAtColumn.esm.js.map +1 -1
- package/dist/components/OngoingTask/ContextMenu.esm.js +15 -2
- package/dist/components/OngoingTask/ContextMenu.esm.js.map +1 -1
- package/dist/components/OngoingTask/OngoingTask.esm.js +24 -1
- package/dist/components/OngoingTask/OngoingTask.esm.js.map +1 -1
- package/dist/components/Router/Router.esm.js +35 -7
- package/dist/components/Router/Router.esm.js.map +1 -1
- package/dist/components/fields/EntityPicker/EntityPicker.esm.js +1 -1
- package/dist/components/fields/EntityPicker/EntityPicker.esm.js.map +1 -1
- package/dist/components/fields/MultiEntityPicker/MultiEntityPicker.esm.js +1 -0
- package/dist/components/fields/MultiEntityPicker/MultiEntityPicker.esm.js.map +1 -1
- package/dist/components/fields/RepoUrlPicker/RepoUrlPicker.esm.js.map +1 -1
- package/dist/components/fields/RepoUrlPicker/schema.esm.js +5 -6
- package/dist/components/fields/RepoUrlPicker/schema.esm.js.map +1 -1
- package/dist/components/fields/utils.esm.js +2 -1
- package/dist/components/fields/utils.esm.js.map +1 -1
- package/dist/index.d.ts +13 -8
- package/dist/lib/filesystem/WebFileSystemAccess.esm.js +34 -1
- package/dist/lib/filesystem/WebFileSystemAccess.esm.js.map +1 -1
- package/dist/lib/filesystem/createExampleTemplate.esm.js +76 -0
- package/dist/lib/filesystem/createExampleTemplate.esm.js.map +1 -0
- package/dist/packages/opaque-internal/src/OpaqueType.esm.js +103 -0
- package/dist/packages/opaque-internal/src/OpaqueType.esm.js.map +1 -0
- package/dist/packages/scaffolder-internal/src/wiring/InternalFormField.esm.js +6 -0
- package/dist/packages/scaffolder-internal/src/wiring/InternalFormField.esm.js.map +1 -0
- package/dist/plugin.esm.js +5 -2
- package/dist/plugin.esm.js.map +1 -1
- package/dist/routes.esm.js +16 -1
- package/dist/routes.esm.js.map +1 -1
- package/dist/translation.esm.js +22 -3
- package/dist/translation.esm.js.map +1 -1
- package/package.json +34 -23
- package/dist/next/TemplateEditorPage/CustomFieldExplorer.esm.js.map +0 -1
- package/dist/next/TemplateEditorPage/DirectoryEditorContext.esm.js.map +0 -1
- package/dist/next/TemplateEditorPage/DryRunContext.esm.js.map +0 -1
- package/dist/next/TemplateEditorPage/DryRunResults/DryRunResults.esm.js.map +0 -1
- package/dist/next/TemplateEditorPage/DryRunResults/DryRunResultsList.esm.js.map +0 -1
- package/dist/next/TemplateEditorPage/DryRunResults/DryRunResultsSplitView.esm.js.map +0 -1
- package/dist/next/TemplateEditorPage/DryRunResults/DryRunResultsView.esm.js.map +0 -1
- package/dist/next/TemplateEditorPage/DryRunResults/IconLink.esm.js.map +0 -1
- package/dist/next/TemplateEditorPage/DryRunResults/TaskPageLinks.esm.js.map +0 -1
- package/dist/next/TemplateEditorPage/DryRunResults/TaskStatusStepper.esm.js.map +0 -1
- package/dist/next/TemplateEditorPage/TemplateEditor.esm.js +0 -56
- package/dist/next/TemplateEditorPage/TemplateEditor.esm.js.map +0 -1
- package/dist/next/TemplateEditorPage/TemplateEditorBrowser.esm.js.map +0 -1
- package/dist/next/TemplateEditorPage/TemplateEditorForm.esm.js.map +0 -1
- package/dist/next/TemplateEditorPage/TemplateEditorIntro.esm.js +0 -91
- package/dist/next/TemplateEditorPage/TemplateEditorIntro.esm.js.map +0 -1
- package/dist/next/TemplateEditorPage/TemplateEditorPage.esm.js +0 -87
- package/dist/next/TemplateEditorPage/TemplateEditorPage.esm.js.map +0 -1
- package/dist/next/TemplateEditorPage/TemplateEditorTextArea.esm.js.map +0 -1
- package/dist/next/TemplateEditorPage/TemplateFormPreviewer.esm.js.map +0 -1
- package/dist/next/TemplateListPage/RegisterExistingButton.esm.js.map +0 -1
- package/dist/next/TemplateListPage/TemplateListPage.esm.js.map +0 -1
- package/dist/next/TemplateWizardPage/TemplateWizardPage.esm.js.map +0 -1
- package/dist/next/TemplateWizardPage/TemplateWizardPageContextMenu.esm.js.map +0 -1
- /package/dist/{next → alpha/components}/TemplateEditorPage/DryRunContext.esm.js +0 -0
- /package/dist/{next → alpha/components}/TemplateEditorPage/DryRunResults/DryRunResultsSplitView.esm.js +0 -0
- /package/dist/{next → alpha/components}/TemplateEditorPage/DryRunResults/IconLink.esm.js +0 -0
- /package/dist/{next → alpha/components}/TemplateEditorPage/DryRunResults/TaskPageLinks.esm.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TemplatePage.esm.js","sources":["../../../../src/alpha/components/TemplateEditorPage/TemplatePage.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 React, { useCallback } from 'react';\nimport useAsyncRetry from 'react-use/esm/useAsyncRetry';\n\nimport { Page, Header, Content, Progress } from '@backstage/core-components';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport {\n FormProps,\n FieldExtensionOptions,\n type LayoutOptions,\n} from '@backstage/plugin-scaffolder-react';\n\nimport { scaffolderTranslationRef } from '../../../translation';\nimport {\n WebFileSystemAccess,\n WebFileSystemStore,\n} from '../../../lib/filesystem';\nimport { TemplateEditor } from './TemplateEditor';\n\nimport { makeStyles } from '@material-ui/core/styles';\n\nconst useStyles = makeStyles(\n {\n content: {\n padding: 0,\n },\n },\n { name: 'ScaffolderTemplateEditorToolbar' },\n);\n\ninterface TemplatePageProps {\n defaultPreviewTemplate?: string;\n fieldExtensions?: FieldExtensionOptions<any, any>[];\n layouts?: LayoutOptions[];\n formProps?: FormProps;\n}\n\nexport function TemplatePage(props: TemplatePageProps) {\n const classes = useStyles();\n const { t } = useTranslationRef(scaffolderTranslationRef);\n\n const { value, loading, retry } = useAsyncRetry(async () => {\n const directory = await WebFileSystemStore.getDirectory();\n if (!directory) return undefined;\n return WebFileSystemAccess.fromHandle(directory);\n }, []);\n\n const handleLoadDirectory = useCallback(() => {\n WebFileSystemAccess.requestDirectoryAccess()\n .then(WebFileSystemStore.setDirectory)\n .then(retry);\n }, [retry]);\n\n const handleCloseDirectory = useCallback(() => {\n WebFileSystemStore.setDirectory(undefined).then(retry);\n }, [retry]);\n\n return (\n <Page themeId=\"home\">\n <Header\n title={t('templateEditorPage.title')}\n subtitle={t('templateEditorPage.subtitle')}\n />\n <Content className={classes.content}>\n {loading ? (\n <Progress />\n ) : (\n <TemplateEditor\n directory={value}\n layouts={props.layouts}\n formProps={props.formProps}\n fieldExtensions={props.fieldExtensions}\n onClose={handleCloseDirectory}\n onLoad={handleLoadDirectory}\n />\n )}\n </Content>\n </Page>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;AAoCA,MAAM,SAAY,GAAA,UAAA;AAAA,EAChB;AAAA,IACE,OAAS,EAAA;AAAA,MACP,OAAS,EAAA,CAAA;AAAA,KACX;AAAA,GACF;AAAA,EACA,EAAE,MAAM,iCAAkC,EAAA;AAC5C,CAAA,CAAA;AASO,SAAS,aAAa,KAA0B,EAAA;AACrD,EAAA,MAAM,UAAU,SAAU,EAAA,CAAA;AAC1B,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,wBAAwB,CAAA,CAAA;AAExD,EAAA,MAAM,EAAE,KAAO,EAAA,OAAA,EAAS,KAAM,EAAA,GAAI,cAAc,YAAY;AAC1D,IAAM,MAAA,SAAA,GAAY,MAAM,kBAAA,CAAmB,YAAa,EAAA,CAAA;AACxD,IAAI,IAAA,CAAC,WAAkB,OAAA,KAAA,CAAA,CAAA;AACvB,IAAO,OAAA,mBAAA,CAAoB,WAAW,SAAS,CAAA,CAAA;AAAA,GACjD,EAAG,EAAE,CAAA,CAAA;AAEL,EAAM,MAAA,mBAAA,GAAsB,YAAY,MAAM;AAC5C,IAAA,mBAAA,CAAoB,wBACjB,CAAA,IAAA,CAAK,mBAAmB,YAAY,CAAA,CACpC,KAAK,KAAK,CAAA,CAAA;AAAA,GACf,EAAG,CAAC,KAAK,CAAC,CAAA,CAAA;AAEV,EAAM,MAAA,oBAAA,GAAuB,YAAY,MAAM;AAC7C,IAAA,kBAAA,CAAmB,YAAa,CAAA,KAAA,CAAS,CAAE,CAAA,IAAA,CAAK,KAAK,CAAA,CAAA;AAAA,GACvD,EAAG,CAAC,KAAK,CAAC,CAAA,CAAA;AAEV,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,IAAK,EAAA,EAAA,OAAA,EAAQ,MACZ,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,KAAA,EAAO,EAAE,0BAA0B,CAAA;AAAA,MACnC,QAAA,EAAU,EAAE,6BAA6B,CAAA;AAAA,KAAA;AAAA,GAC3C,sCACC,OAAQ,EAAA,EAAA,SAAA,EAAW,QAAQ,OACzB,EAAA,EAAA,OAAA,mBACE,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA,IAAS,CAEV,mBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,cAAA;AAAA,IAAA;AAAA,MACC,SAAW,EAAA,KAAA;AAAA,MACX,SAAS,KAAM,CAAA,OAAA;AAAA,MACf,WAAW,KAAM,CAAA,SAAA;AAAA,MACjB,iBAAiB,KAAM,CAAA,eAAA;AAAA,MACvB,OAAS,EAAA,oBAAA;AAAA,MACT,MAAQ,EAAA,mBAAA;AAAA,KAAA;AAAA,GAGd,CACF,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -28,7 +28,7 @@ const RegisterExistingButton = (props) => {
|
|
|
28
28
|
to
|
|
29
29
|
},
|
|
30
30
|
/* @__PURE__ */ React.createElement(CreateComponentIcon, null)
|
|
31
|
-
) : /* @__PURE__ */ React.createElement(Button, { component: Link, variant: "
|
|
31
|
+
) : /* @__PURE__ */ React.createElement(Button, { component: Link, variant: "outlined", color: "primary", to }, title);
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
export { RegisterExistingButton };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RegisterExistingButton.esm.js","sources":["../../../../src/alpha/components/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=\"outlined\" 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,UAAW,EAAA,KAAA,EAAM,SAAU,EAAA,EAAA,EAAA,EAC/D,KACH,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -5,10 +5,10 @@ import { DocsIcon, Page, Header, Content, ContentHeader, SupportButton } from '@
|
|
|
5
5
|
import { EntityListProvider, CatalogFilterLayout, EntitySearchBar, EntityKindPicker, UserListPicker, EntityTagPicker, EntityOwnerPicker } from '@backstage/plugin-catalog-react';
|
|
6
6
|
import { ScaffolderPageContextMenu, TemplateCategoryPicker, TemplateGroups } from '@backstage/plugin-scaffolder-react/alpha';
|
|
7
7
|
import { RegisterExistingButton } from './RegisterExistingButton.esm.js';
|
|
8
|
-
import { registerComponentRouteRef, editRouteRef, actionsRouteRef, scaffolderListTaskRouteRef, viewTechDocRouteRef, selectedTemplateRouteRef } from '
|
|
8
|
+
import { registerComponentRouteRef, editRouteRef, actionsRouteRef, scaffolderListTaskRouteRef, viewTechDocRouteRef, selectedTemplateRouteRef } from '../../../routes.esm.js';
|
|
9
9
|
import { parseEntityRef, stringifyEntityRef } from '@backstage/catalog-model';
|
|
10
10
|
import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
|
|
11
|
-
import { scaffolderTranslationRef } from '
|
|
11
|
+
import { scaffolderTranslationRef } from '../../../translation.esm.js';
|
|
12
12
|
|
|
13
13
|
const createGroupsWithOther = (groups, t) => [
|
|
14
14
|
...groups,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TemplateListPage.esm.js","sources":["../../../../src/alpha/components/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 EntityOwnerPicker,\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';\nimport {\n TranslationFunction,\n useTranslationRef,\n} from '@backstage/core-plugin-api/alpha';\nimport { scaffolderTranslationRef } from '../../../translation';\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 createGroupsWithOther = (\n groups: TemplateGroupFilter[],\n t: TranslationFunction<typeof scaffolderTranslationRef.T>,\n): TemplateGroupFilter[] => [\n ...groups,\n {\n title: t('templateListPage.templateGroups.otherTitle'),\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 const { t } = useTranslationRef(scaffolderTranslationRef);\n\n const groups = givenGroups.length\n ? createGroupsWithOther(givenGroups, t)\n : [\n {\n title: t('templateListPage.templateGroups.defaultTitle'),\n filter: () => true,\n },\n ];\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: t(\n 'templateListPage.additionalLinksForEntity.viewTechDocsTitle',\n ),\n url: viewTechDocsLink({ kind, namespace, name }),\n },\n ]\n : [];\n },\n [app, viewTechDocsLink, t],\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={t('templateListPage.pageTitle')}\n title={t('templateListPage.title')}\n subtitle={t('templateListPage.subtitle')}\n {...headerOptions}\n >\n <ScaffolderPageContextMenu {...scaffolderPageContextMenuProps} />\n </Header>\n <Content>\n <ContentHeader>\n <RegisterExistingButton\n title={t(\n 'templateListPage.contentHeader.registerExistingButtonTitle',\n )}\n to={registerComponentLink && registerComponentLink()}\n />\n <SupportButton>\n {t('templateListPage.contentHeader.supportButtonTitle')}\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 <EntityOwnerPicker />\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":[],"mappings":";;;;;;;;;;;;AAkFA,MAAM,qBAAA,GAAwB,CAC5B,MAAA,EACA,CAC0B,KAAA;AAAA,EAC1B,GAAG,MAAA;AAAA,EACH;AAAA,IACE,KAAA,EAAO,EAAE,4CAA4C,CAAA;AAAA,IACrD,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,KAAiC,KAAA;AAChE,EAAM,MAAA,qBAAA,GAAwB,YAAY,yBAAyB,CAAA,CAAA;AACnE,EAAM,MAAA;AAAA,IACJ,qBAAA;AAAA,IACA,MAAA,EAAQ,cAAc,EAAC;AAAA,IACvB,cAAA;AAAA,IACA,aAAA;AAAA,GACE,GAAA,KAAA,CAAA;AACJ,EAAA,MAAM,WAAW,WAAY,EAAA,CAAA;AAC7B,EAAM,MAAA,UAAA,GAAa,YAAY,YAAY,CAAA,CAAA;AAC3C,EAAM,MAAA,WAAA,GAAc,YAAY,eAAe,CAAA,CAAA;AAC/C,EAAM,MAAA,SAAA,GAAY,YAAY,0BAA0B,CAAA,CAAA;AACxD,EAAM,MAAA,gBAAA,GAAmB,YAAY,mBAAmB,CAAA,CAAA;AACxD,EAAM,MAAA,aAAA,GAAgB,YAAY,wBAAwB,CAAA,CAAA;AAC1D,EAAA,MAAM,M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AAA,CAAC,mBACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,oBAAoB,OAApB,EAAA,IAAA,kBACE,KAAA,CAAA,aAAA,CAAA,eAAA,EAAA,IAAgB,CACjB,kBAAA,KAAA,CAAA,aAAA,CAAC,oBAAiB,aAAc,EAAA,UAAA,EAAW,MAAM,EAAA,IAAA,EAAC,CAClD,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,cAAA;AAAA,IAAA;AAAA,MACC,aAAc,EAAA,KAAA;AAAA,MACd,gBAAA,EAAkB,CAAC,KAAA,EAAO,SAAS,CAAA;AAAA,KAAA;AAAA,GAErC,kBAAA,KAAA,CAAA,aAAA,CAAC,sBAAuB,EAAA,IAAA,CAAA,sCACvB,eAAgB,EAAA,IAAA,CAAA,kBAChB,KAAA,CAAA,aAAA,CAAA,iBAAA,EAAA,IAAkB,CACrB,CAAA,kBACC,KAAA,CAAA,aAAA,CAAA,mBAAA,CAAoB,SAApB,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;;;;"}
|
|
@@ -7,9 +7,9 @@ import { useTemplateSecrets, scaffolderApiRef } from '@backstage/plugin-scaffold
|
|
|
7
7
|
import { catalogApiRef } from '@backstage/plugin-catalog-react';
|
|
8
8
|
import { Workflow } from '@backstage/plugin-scaffolder-react/alpha';
|
|
9
9
|
import { Page, Header } from '@backstage/core-components';
|
|
10
|
-
import { rootRouteRef, scaffolderTaskRouteRef, selectedTemplateRouteRef } from '
|
|
10
|
+
import { rootRouteRef, scaffolderTaskRouteRef, selectedTemplateRouteRef } from '../../../routes.esm.js';
|
|
11
11
|
import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
|
|
12
|
-
import { scaffolderTranslationRef } from '
|
|
12
|
+
import { scaffolderTranslationRef } from '../../../translation.esm.js';
|
|
13
13
|
import { TemplateWizardPageContextMenu } from './TemplateWizardPageContextMenu.esm.js';
|
|
14
14
|
|
|
15
15
|
const TemplateWizardPage = (props) => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TemplateWizardPage.esm.js","sources":["../../../../src/alpha/components/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';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { scaffolderTranslationRef } from '../../../translation';\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 const { t } = useTranslationRef(scaffolderTranslationRef);\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={t('templateWizardPage.pageTitle')}\n title={t('templateWizardPage.title')}\n subtitle={t('templateWizardPage.subtitle')}\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":";;;;;;;;;;;;;;AAqEa,MAAA,kBAAA,GAAqB,CAAC,KAAmC,KAAA;AACpE,EAAM,MAAA,OA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,CAAC,QAAS,EAAA,EAAA,EAAA,EAAI,SAAW,EAAA,CAAA,CAAA;AAE/C,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,gBAAiB,EAAA,EAAA,UAAA,EAAY,EAAE,SAAA,EAAW,aACzC,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,IAAK,EAAA,EAAA,OAAA,EAAQ,SACZ,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,iBAAA,EAAmB,EAAE,8BAA8B,CAAA;AAAA,MACnD,KAAA,EAAO,EAAE,0BAA0B,CAAA;AAAA,MACnC,QAAA,EAAU,EAAE,6BAA6B,CAAA;AAAA,MACxC,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;;;;"}
|
package/dist/{next → alpha/components}/TemplateWizardPage/TemplateWizardPageContextMenu.esm.js
RENAMED
|
@@ -9,7 +9,7 @@ import Edit from '@material-ui/icons/Edit';
|
|
|
9
9
|
import MoreVert from '@material-ui/icons/MoreVert';
|
|
10
10
|
import React, { useState } from 'react';
|
|
11
11
|
import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
|
|
12
|
-
import { scaffolderTranslationRef } from '
|
|
12
|
+
import { scaffolderTranslationRef } from '../../../translation.esm.js';
|
|
13
13
|
|
|
14
14
|
const useStyles = makeStyles((theme) => ({
|
|
15
15
|
button: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TemplateWizardPageContextMenu.esm.js","sources":["../../../../src/alpha/components/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';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { scaffolderTranslationRef } from '../../../translation';\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 const { t } = useTranslationRef(scaffolderTranslationRef);\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\n primary={t(\n 'templateWizardPage.pageContextMenu.editConfigurationTitle',\n )}\n />\n </MenuItem>\n </MenuList>\n </Popover>\n </>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AA6BA,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;AAC5D,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,wBAAwB,CAAA,CAAA;AAExD,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,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;AAAA,GAEJ,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { convertLegacyRouteRef, compatWrapper } from '@backstage/core-compat-api';
|
|
2
|
+
import { PageBlueprint, NavItemBlueprint } from '@backstage/frontend-plugin-api';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { rootRouteRef } from '../routes.esm.js';
|
|
5
|
+
import CreateComponentIcon from '@material-ui/icons/AddCircleOutline';
|
|
6
|
+
import { FormFieldBlueprint } from '@backstage/plugin-scaffolder-react/alpha';
|
|
7
|
+
|
|
8
|
+
const scaffolderPage = PageBlueprint.make({
|
|
9
|
+
params: {
|
|
10
|
+
routeRef: convertLegacyRouteRef(rootRouteRef),
|
|
11
|
+
defaultPath: "/create",
|
|
12
|
+
loader: () => import('../components/Router/index.esm.js').then((m) => compatWrapper(/* @__PURE__ */ React.createElement(m.Router, null)))
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
const scaffolderNavItem = NavItemBlueprint.make({
|
|
16
|
+
params: {
|
|
17
|
+
routeRef: convertLegacyRouteRef(rootRouteRef),
|
|
18
|
+
title: "Create...",
|
|
19
|
+
icon: CreateComponentIcon
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
const repoUrlPickerFormField = FormFieldBlueprint.make({
|
|
23
|
+
name: "repo-url-picker",
|
|
24
|
+
params: {
|
|
25
|
+
field: () => import('./fields/RepoUrlPicker.esm.js').then((m) => m.RepoUrlPicker)
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export { repoUrlPickerFormField, scaffolderNavItem, scaffolderPage };
|
|
30
|
+
//# sourceMappingURL=extensions.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extensions.esm.js","sources":["../../src/alpha/extensions.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n compatWrapper,\n convertLegacyRouteRef,\n} from '@backstage/core-compat-api';\nimport {\n NavItemBlueprint,\n PageBlueprint,\n} from '@backstage/frontend-plugin-api';\nimport React from 'react';\nimport { rootRouteRef } from '../routes';\nimport CreateComponentIcon from '@material-ui/icons/AddCircleOutline';\nimport { FormFieldBlueprint } from '@backstage/plugin-scaffolder-react/alpha';\n\nexport const scaffolderPage = PageBlueprint.make({\n params: {\n routeRef: convertLegacyRouteRef(rootRouteRef),\n defaultPath: '/create',\n loader: () =>\n import('../components/Router').then(m => compatWrapper(<m.Router />)),\n },\n});\n\nexport const scaffolderNavItem = NavItemBlueprint.make({\n params: {\n routeRef: convertLegacyRouteRef(rootRouteRef),\n title: 'Create...',\n icon: CreateComponentIcon,\n },\n});\n\nexport const repoUrlPickerFormField = FormFieldBlueprint.make({\n name: 'repo-url-picker',\n params: {\n field: () => import('./fields/RepoUrlPicker').then(m => m.RepoUrlPicker),\n },\n});\n"],"names":[],"mappings":";;;;;;;AA6Ba,MAAA,cAAA,GAAiB,cAAc,IAAK,CAAA;AAAA,EAC/C,MAAQ,EAAA;AAAA,IACN,QAAA,EAAU,sBAAsB,YAAY,CAAA;AAAA,IAC5C,WAAa,EAAA,SAAA;AAAA,IACb,MAAQ,EAAA,MACN,OAAO,mCAAsB,CAAE,CAAA,IAAA,CAAK,CAAK,CAAA,KAAA,aAAA,iBAAe,KAAA,CAAA,aAAA,CAAA,CAAA,CAAE,MAAF,EAAA,IAAS,CAAE,CAAC,CAAA;AAAA,GACxE;AACF,CAAC,EAAA;AAEY,MAAA,iBAAA,GAAoB,iBAAiB,IAAK,CAAA;AAAA,EACrD,MAAQ,EAAA;AAAA,IACN,QAAA,EAAU,sBAAsB,YAAY,CAAA;AAAA,IAC5C,KAAO,EAAA,WAAA;AAAA,IACP,IAAM,EAAA,mBAAA;AAAA,GACR;AACF,CAAC,EAAA;AAEY,MAAA,sBAAA,GAAyB,mBAAmB,IAAK,CAAA;AAAA,EAC5D,IAAM,EAAA,iBAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,KAAA,EAAO,MAAM,OAAO,+BAAwB,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,aAAa,CAAA;AAAA,GACzE;AACF,CAAC;;;;"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { createFormField } from '@backstage/plugin-scaffolder-react/alpha';
|
|
2
|
+
import { RepoUrlPicker as RepoUrlPicker$1 } from '../../components/fields/RepoUrlPicker/RepoUrlPicker.esm.js';
|
|
3
|
+
import '../../components/fields/EntityPicker/schema.esm.js';
|
|
4
|
+
import '../../components/fields/OwnerPicker/schema.esm.js';
|
|
5
|
+
import { RepoUrlPickerFieldSchema } from '../../components/fields/RepoUrlPicker/schema.esm.js';
|
|
6
|
+
import { repoPickerValidation } from '../../components/fields/RepoUrlPicker/validation.esm.js';
|
|
7
|
+
import '../../components/fields/OwnedEntityPicker/schema.esm.js';
|
|
8
|
+
import '../../components/fields/EntityTagsPicker/schema.esm.js';
|
|
9
|
+
import '../../components/fields/MyGroupsPicker/schema.esm.js';
|
|
10
|
+
import 'zod-to-json-schema';
|
|
11
|
+
import 'react';
|
|
12
|
+
import 'lodash/capitalize';
|
|
13
|
+
import '@backstage/core-components';
|
|
14
|
+
import '@material-ui/core/Box';
|
|
15
|
+
import '@material-ui/core/Checkbox';
|
|
16
|
+
import '@material-ui/core/FormControlLabel';
|
|
17
|
+
import '@material-ui/core/TextField';
|
|
18
|
+
import '@material-ui/core/Typography';
|
|
19
|
+
import '@material-ui/icons/CheckBox';
|
|
20
|
+
import '@material-ui/icons/CheckBoxOutlineBlank';
|
|
21
|
+
import '@material-ui/icons/ExpandMore';
|
|
22
|
+
import '@material-ui/lab/Autocomplete';
|
|
23
|
+
import '@backstage/plugin-catalog-react';
|
|
24
|
+
import '@backstage/core-plugin-api';
|
|
25
|
+
import '@backstage/core-plugin-api/alpha';
|
|
26
|
+
import '../../translation.esm.js';
|
|
27
|
+
import '../../components/OngoingTask/OngoingTask.esm.js';
|
|
28
|
+
|
|
29
|
+
const RepoUrlPicker = createFormField({
|
|
30
|
+
component: RepoUrlPicker$1,
|
|
31
|
+
name: "RepoUrlPicker",
|
|
32
|
+
validation: repoPickerValidation,
|
|
33
|
+
schema: RepoUrlPickerFieldSchema
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export { RepoUrlPicker };
|
|
37
|
+
//# sourceMappingURL=RepoUrlPicker.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RepoUrlPicker.esm.js","sources":["../../../src/alpha/fields/RepoUrlPicker.ts"],"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 */\nimport { createFormField } from '@backstage/plugin-scaffolder-react/alpha';\nimport { RepoUrlPicker as Component } from '../../components/fields/RepoUrlPicker/RepoUrlPicker';\nimport {\n RepoUrlPickerFieldSchema,\n repoPickerValidation,\n} from '../../components';\n\nexport const RepoUrlPicker = createFormField({\n component: Component,\n name: 'RepoUrlPicker',\n validation: repoPickerValidation,\n schema: RepoUrlPickerFieldSchema,\n});\n"],"names":["Component"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBO,MAAM,gBAAgB,eAAgB,CAAA;AAAA,EAC3C,SAAW,EAAAA,eAAA;AAAA,EACX,IAAM,EAAA,eAAA;AAAA,EACN,UAAY,EAAA,oBAAA;AAAA,EACZ,MAAQ,EAAA,wBAAA;AACV,CAAC;;;;"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { convertLegacyRouteRefs } from '@backstage/core-compat-api';
|
|
2
|
+
import { createFrontendPlugin } from '@backstage/frontend-plugin-api';
|
|
3
|
+
import { rootRouteRef, selectedTemplateRouteRef, scaffolderTaskRouteRef, actionsRouteRef, scaffolderListTaskRouteRef, editRouteRef, registerComponentRouteRef, viewTechDocRouteRef } from '../routes.esm.js';
|
|
4
|
+
import { scaffolderApi } from './api.esm.js';
|
|
5
|
+
import { scaffolderPage, scaffolderNavItem, repoUrlPickerFormField } from './extensions.esm.js';
|
|
6
|
+
import { formFieldsApi } from './api/FormFieldsApi.esm.js';
|
|
7
|
+
|
|
8
|
+
var plugin = createFrontendPlugin({
|
|
9
|
+
id: "scaffolder",
|
|
10
|
+
routes: convertLegacyRouteRefs({
|
|
11
|
+
root: rootRouteRef,
|
|
12
|
+
selectedTemplate: selectedTemplateRouteRef,
|
|
13
|
+
ongoingTask: scaffolderTaskRouteRef,
|
|
14
|
+
actions: actionsRouteRef,
|
|
15
|
+
listTasks: scaffolderListTaskRouteRef,
|
|
16
|
+
edit: editRouteRef
|
|
17
|
+
}),
|
|
18
|
+
externalRoutes: convertLegacyRouteRefs({
|
|
19
|
+
registerComponent: registerComponentRouteRef,
|
|
20
|
+
viewTechDoc: viewTechDocRouteRef
|
|
21
|
+
}),
|
|
22
|
+
extensions: [
|
|
23
|
+
scaffolderApi,
|
|
24
|
+
scaffolderPage,
|
|
25
|
+
scaffolderNavItem,
|
|
26
|
+
formFieldsApi,
|
|
27
|
+
repoUrlPickerFormField
|
|
28
|
+
]
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export { plugin as default };
|
|
32
|
+
//# sourceMappingURL=plugin.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.esm.js","sources":["../../src/alpha/plugin.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 { convertLegacyRouteRefs } from '@backstage/core-compat-api';\nimport { createFrontendPlugin } from '@backstage/frontend-plugin-api';\nimport {\n rootRouteRef,\n actionsRouteRef,\n editRouteRef,\n registerComponentRouteRef,\n scaffolderListTaskRouteRef,\n scaffolderTaskRouteRef,\n selectedTemplateRouteRef,\n viewTechDocRouteRef,\n} from '../routes';\nimport { scaffolderApi } from './api';\nimport {\n repoUrlPickerFormField,\n scaffolderNavItem,\n scaffolderPage,\n} from './extensions';\nimport { formFieldsApi } from './api/FormFieldsApi';\n\n/** @alpha */\nexport default createFrontendPlugin({\n id: 'scaffolder',\n routes: convertLegacyRouteRefs({\n root: rootRouteRef,\n selectedTemplate: selectedTemplateRouteRef,\n ongoingTask: scaffolderTaskRouteRef,\n actions: actionsRouteRef,\n listTasks: scaffolderListTaskRouteRef,\n edit: editRouteRef,\n }),\n externalRoutes: convertLegacyRouteRefs({\n registerComponent: registerComponentRouteRef,\n viewTechDoc: viewTechDocRouteRef,\n }),\n extensions: [\n scaffolderApi,\n scaffolderPage,\n scaffolderNavItem,\n formFieldsApi,\n repoUrlPickerFormField,\n ],\n});\n"],"names":[],"mappings":";;;;;;;AAqCA,aAAe,oBAAqB,CAAA;AAAA,EAClC,EAAI,EAAA,YAAA;AAAA,EACJ,QAAQ,sBAAuB,CAAA;AAAA,IAC7B,IAAM,EAAA,YAAA;AAAA,IACN,gBAAkB,EAAA,wBAAA;AAAA,IAClB,WAAa,EAAA,sBAAA;AAAA,IACb,OAAS,EAAA,eAAA;AAAA,IACT,SAAW,EAAA,0BAAA;AAAA,IACX,IAAM,EAAA,YAAA;AAAA,GACP,CAAA;AAAA,EACD,gBAAgB,sBAAuB,CAAA;AAAA,IACrC,iBAAmB,EAAA,yBAAA;AAAA,IACnB,WAAa,EAAA,mBAAA;AAAA,GACd,CAAA;AAAA,EACD,UAAY,EAAA;AAAA,IACV,aAAA;AAAA,IACA,cAAA;AAAA,IACA,iBAAA;AAAA,IACA,aAAA;AAAA,IACA,sBAAA;AAAA,GACF;AACF,CAAC,CAAA;;;;"}
|
package/dist/alpha.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
import * as
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import * as React from 'react';
|
|
3
3
|
import React__default from 'react';
|
|
4
4
|
import { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';
|
|
5
5
|
import { TemplateGroupFilter, FieldExtensionOptions, ReviewStepProps, LayoutOptions, FormProps as FormProps$1 } from '@backstage/plugin-scaffolder-react';
|
|
6
6
|
import { FormProps as FormProps$2 } from '@rjsf/core';
|
|
7
7
|
import * as _backstage_core_plugin_api_alpha from '@backstage/core-plugin-api/alpha';
|
|
8
|
+
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
|
9
|
+
import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
|
|
8
10
|
|
|
9
11
|
/** @public */
|
|
10
12
|
type ScaffolderCustomFieldExplorerClassKey = 'root' | 'controls' | 'fieldForm' | 'preview';
|
|
@@ -139,6 +141,7 @@ declare const scaffolderTranslationRef: _backstage_core_plugin_api_alpha.Transla
|
|
|
139
141
|
readonly "ongoingTask.title": "Run of";
|
|
140
142
|
readonly "ongoingTask.contextMenu.cancel": "Cancel";
|
|
141
143
|
readonly "ongoingTask.contextMenu.startOver": "Start Over";
|
|
144
|
+
readonly "ongoingTask.contextMenu.retry": "Retry";
|
|
142
145
|
readonly "ongoingTask.contextMenu.hideLogs": "Hide Logs";
|
|
143
146
|
readonly "ongoingTask.contextMenu.showLogs": "Show Logs";
|
|
144
147
|
readonly "ongoingTask.contextMenu.hideButtonBar": "Hide Button Bar";
|
|
@@ -147,11 +150,15 @@ declare const scaffolderTranslationRef: _backstage_core_plugin_api_alpha.Transla
|
|
|
147
150
|
readonly "ongoingTask.pageTitle.hasTemplateName": "Run of {{templateName}}";
|
|
148
151
|
readonly "ongoingTask.pageTitle.noTemplateName": "Scaffolder Run";
|
|
149
152
|
readonly "ongoingTask.cancelButtonTitle": "Cancel";
|
|
153
|
+
readonly "ongoingTask.retryButtonTitle": "Retry";
|
|
150
154
|
readonly "ongoingTask.startOverButtonTitle": "Start Over";
|
|
151
155
|
readonly "ongoingTask.hideLogsButtonTitle": "Hide Logs";
|
|
152
156
|
readonly "ongoingTask.showLogsButtonTitle": "Show Logs";
|
|
157
|
+
readonly "templateEditorForm.stepper.emptyText": "There are no spec parameters in the template to preview.";
|
|
153
158
|
readonly "templateTypePicker.title": "Categories";
|
|
154
|
-
readonly "
|
|
159
|
+
readonly "templateFormPage.title": "Template Form Playground";
|
|
160
|
+
readonly "templateFormPage.subtitle": "Edit, preview, and try out templates and template forms";
|
|
161
|
+
readonly "templateEditorPage.title": "Manage Templates";
|
|
155
162
|
readonly "templateEditorPage.subtitle": "Edit, preview, and try out templates and template forms";
|
|
156
163
|
readonly "templateEditorPage.dryRunResults.title": "Dry-run results";
|
|
157
164
|
readonly "templateEditorPage.dryRunResultsList.title": "Result {{resultId}}";
|
|
@@ -161,10 +168,11 @@ declare const scaffolderTranslationRef: _backstage_core_plugin_api_alpha.Transla
|
|
|
161
168
|
readonly "templateEditorPage.dryRunResultsView.tab.log": "Log";
|
|
162
169
|
readonly "templateEditorPage.dryRunResultsView.tab.files": "Files";
|
|
163
170
|
readonly "templateEditorPage.taskStatusStepper.skippedStepTitle": "Skipped";
|
|
164
|
-
readonly "templateEditorPage.customFieldExplorer.preview.title": "
|
|
171
|
+
readonly "templateEditorPage.customFieldExplorer.preview.title": "Template Spec";
|
|
165
172
|
readonly "templateEditorPage.customFieldExplorer.fieldForm.title": "Field Options";
|
|
166
173
|
readonly "templateEditorPage.customFieldExplorer.fieldForm.applyButtonTitle": "Apply";
|
|
167
174
|
readonly "templateEditorPage.customFieldExplorer.selectFieldLabel": "Choose Custom Field Extension";
|
|
175
|
+
readonly "templateEditorPage.customFieldExplorer.fieldPreview.title": "Field Preview";
|
|
168
176
|
readonly "templateEditorPage.templateEditorBrowser.closeConfirmMessage": "Are you sure? Unsaved changes will be lost";
|
|
169
177
|
readonly "templateEditorPage.templateEditorBrowser.saveIconTooltip": "Save all files";
|
|
170
178
|
readonly "templateEditorPage.templateEditorBrowser.reloadIconTooltip": "Reload directory";
|
|
@@ -173,7 +181,10 @@ declare const scaffolderTranslationRef: _backstage_core_plugin_api_alpha.Transla
|
|
|
173
181
|
readonly "templateEditorPage.templateEditorIntro.loadLocal.title": "Load Template Directory";
|
|
174
182
|
readonly "templateEditorPage.templateEditorIntro.loadLocal.description": "Load a local template directory, allowing you to both edit and try executing your own template.";
|
|
175
183
|
readonly "templateEditorPage.templateEditorIntro.loadLocal.unsupportedTooltip": "Only supported in some Chromium-based browsers";
|
|
176
|
-
readonly "templateEditorPage.templateEditorIntro.
|
|
184
|
+
readonly "templateEditorPage.templateEditorIntro.createLocal.title": "Create New Template";
|
|
185
|
+
readonly "templateEditorPage.templateEditorIntro.createLocal.description": "Create a local template directory, allowing you to both edit and try executing your own template.";
|
|
186
|
+
readonly "templateEditorPage.templateEditorIntro.createLocal.unsupportedTooltip": "Only supported in some Chromium-based browsers";
|
|
187
|
+
readonly "templateEditorPage.templateEditorIntro.formEditor.title": "Template playground";
|
|
177
188
|
readonly "templateEditorPage.templateEditorIntro.formEditor.description": "Preview and edit a template form, either using a sample template or by loading a template from the catalog.";
|
|
178
189
|
readonly "templateEditorPage.templateEditorIntro.fieldExplorer.title": "Custom Field Explorer";
|
|
179
190
|
readonly "templateEditorPage.templateEditorIntro.fieldExplorer.description": "View and play around with available installed custom field extensions.";
|
|
@@ -194,6 +205,29 @@ declare const scaffolderTranslationRef: _backstage_core_plugin_api_alpha.Transla
|
|
|
194
205
|
readonly "templateWizardPage.pageContextMenu.editConfigurationTitle": "Edit Configuration";
|
|
195
206
|
}>;
|
|
196
207
|
|
|
208
|
+
/*
|
|
209
|
+
* Copyright 2024 The Backstage Authors
|
|
210
|
+
*
|
|
211
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
212
|
+
* you may not use this file except in compliance with the License.
|
|
213
|
+
* You may obtain a copy of the License at
|
|
214
|
+
*
|
|
215
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
216
|
+
*
|
|
217
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
218
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
219
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
220
|
+
* See the License for the specific language governing permissions and
|
|
221
|
+
* limitations under the License.
|
|
222
|
+
*/
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
/** @alpha */
|
|
227
|
+
interface FormField {
|
|
228
|
+
readonly $$type: '@backstage/scaffolder/FormField';
|
|
229
|
+
}
|
|
230
|
+
|
|
197
231
|
/** @alpha */
|
|
198
232
|
declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
199
233
|
root: _backstage_frontend_plugin_api.RouteRef<undefined>;
|
|
@@ -212,16 +246,17 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
212
246
|
}, {
|
|
213
247
|
"api:scaffolder": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
214
248
|
kind: "api";
|
|
215
|
-
namespace: undefined;
|
|
216
249
|
name: undefined;
|
|
217
250
|
config: {};
|
|
218
251
|
configInput: {};
|
|
219
252
|
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.AnyApiFactory, "core.api.factory", {}>;
|
|
220
253
|
inputs: {};
|
|
254
|
+
params: {
|
|
255
|
+
factory: _backstage_frontend_plugin_api.AnyApiFactory;
|
|
256
|
+
};
|
|
221
257
|
}>;
|
|
222
258
|
"page:scaffolder": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
223
259
|
kind: "page";
|
|
224
|
-
namespace: undefined;
|
|
225
260
|
name: undefined;
|
|
226
261
|
config: {
|
|
227
262
|
path: string | undefined;
|
|
@@ -229,14 +264,18 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
229
264
|
configInput: {
|
|
230
265
|
path?: string | undefined;
|
|
231
266
|
};
|
|
232
|
-
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<
|
|
267
|
+
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<React.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
|
|
233
268
|
optional: true;
|
|
234
269
|
}>;
|
|
235
270
|
inputs: {};
|
|
271
|
+
params: {
|
|
272
|
+
defaultPath: string;
|
|
273
|
+
loader: () => Promise<JSX.Element>;
|
|
274
|
+
routeRef?: _backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams> | undefined;
|
|
275
|
+
};
|
|
236
276
|
}>;
|
|
237
277
|
"nav-item:scaffolder": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
238
278
|
kind: "nav-item";
|
|
239
|
-
namespace: undefined;
|
|
240
279
|
name: undefined;
|
|
241
280
|
config: {};
|
|
242
281
|
configInput: {};
|
|
@@ -246,6 +285,38 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
246
285
|
routeRef: _backstage_frontend_plugin_api.RouteRef<undefined>;
|
|
247
286
|
}, "core.nav-item.target", {}>;
|
|
248
287
|
inputs: {};
|
|
288
|
+
params: {
|
|
289
|
+
title: string;
|
|
290
|
+
icon: _backstage_core_plugin_api.IconComponent;
|
|
291
|
+
routeRef: _backstage_frontend_plugin_api.RouteRef<undefined>;
|
|
292
|
+
};
|
|
293
|
+
}>;
|
|
294
|
+
"scaffolder-form-field:scaffolder/repo-url-picker": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
295
|
+
kind: "scaffolder-form-field";
|
|
296
|
+
name: "repo-url-picker";
|
|
297
|
+
config: {};
|
|
298
|
+
configInput: {};
|
|
299
|
+
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<() => Promise<FormField>, "scaffolder.form-field-loader", {}>;
|
|
300
|
+
inputs: {};
|
|
301
|
+
params: {
|
|
302
|
+
field: () => Promise<FormField>;
|
|
303
|
+
};
|
|
304
|
+
}>;
|
|
305
|
+
"api:scaffolder/form-fields": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
306
|
+
config: {};
|
|
307
|
+
configInput: {};
|
|
308
|
+
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.AnyApiFactory, "core.api.factory", {}>;
|
|
309
|
+
inputs: {
|
|
310
|
+
formFields: _backstage_frontend_plugin_api.ExtensionInput<_backstage_frontend_plugin_api.ConfigurableExtensionDataRef<() => Promise<FormField>, "scaffolder.form-field-loader", {}>, {
|
|
311
|
+
singleton: false;
|
|
312
|
+
optional: false;
|
|
313
|
+
}>;
|
|
314
|
+
};
|
|
315
|
+
kind: "api";
|
|
316
|
+
name: "form-fields";
|
|
317
|
+
params: {
|
|
318
|
+
factory: _backstage_frontend_plugin_api.AnyApiFactory;
|
|
319
|
+
};
|
|
249
320
|
}>;
|
|
250
321
|
}>;
|
|
251
322
|
|
package/dist/alpha.esm.js
CHANGED
|
@@ -1,62 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ApiBlueprint, createApiFactory, discoveryApiRef, fetchApiRef, identityApiRef, PageBlueprint, NavItemBlueprint, createFrontendPlugin } from '@backstage/frontend-plugin-api';
|
|
3
|
-
import CreateComponentIcon from '@material-ui/icons/AddCircleOutline';
|
|
4
|
-
import { convertLegacyRouteRef, compatWrapper, convertLegacyRouteRefs } from '@backstage/core-compat-api';
|
|
5
|
-
import { scmIntegrationsApiRef } from '@backstage/integration-react';
|
|
6
|
-
import { scaffolderApiRef } from '@backstage/plugin-scaffolder-react';
|
|
7
|
-
import { ScaffolderClient } from './api.esm.js';
|
|
8
|
-
import { rootRouteRef, selectedTemplateRouteRef, scaffolderTaskRouteRef, actionsRouteRef, scaffolderListTaskRouteRef, editRouteRef, registerComponentRouteRef, viewTechDocRouteRef } from './routes.esm.js';
|
|
9
1
|
export { scaffolderTranslationRef } from './translation.esm.js';
|
|
10
|
-
|
|
11
|
-
const scaffolderApi = ApiBlueprint.make({
|
|
12
|
-
params: {
|
|
13
|
-
factory: createApiFactory({
|
|
14
|
-
api: scaffolderApiRef,
|
|
15
|
-
deps: {
|
|
16
|
-
discoveryApi: discoveryApiRef,
|
|
17
|
-
scmIntegrationsApi: scmIntegrationsApiRef,
|
|
18
|
-
fetchApi: fetchApiRef,
|
|
19
|
-
identityApi: identityApiRef
|
|
20
|
-
},
|
|
21
|
-
factory: ({ discoveryApi, scmIntegrationsApi, fetchApi, identityApi }) => new ScaffolderClient({
|
|
22
|
-
discoveryApi,
|
|
23
|
-
scmIntegrationsApi,
|
|
24
|
-
fetchApi,
|
|
25
|
-
identityApi
|
|
26
|
-
})
|
|
27
|
-
})
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
const scaffolderPage = PageBlueprint.make({
|
|
31
|
-
params: {
|
|
32
|
-
routeRef: convertLegacyRouteRef(rootRouteRef),
|
|
33
|
-
defaultPath: "/create",
|
|
34
|
-
loader: () => import('./components/Router/index.esm.js').then((m) => compatWrapper(/* @__PURE__ */ React.createElement(m.Router, null)))
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
const scaffolderNavItem = NavItemBlueprint.make({
|
|
38
|
-
params: {
|
|
39
|
-
routeRef: convertLegacyRouteRef(rootRouteRef),
|
|
40
|
-
title: "Create...",
|
|
41
|
-
icon: CreateComponentIcon
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
var alpha = createFrontendPlugin({
|
|
45
|
-
id: "scaffolder",
|
|
46
|
-
routes: convertLegacyRouteRefs({
|
|
47
|
-
root: rootRouteRef,
|
|
48
|
-
selectedTemplate: selectedTemplateRouteRef,
|
|
49
|
-
ongoingTask: scaffolderTaskRouteRef,
|
|
50
|
-
actions: actionsRouteRef,
|
|
51
|
-
listTasks: scaffolderListTaskRouteRef,
|
|
52
|
-
edit: editRouteRef
|
|
53
|
-
}),
|
|
54
|
-
externalRoutes: convertLegacyRouteRefs({
|
|
55
|
-
registerComponent: registerComponentRouteRef,
|
|
56
|
-
viewTechDoc: viewTechDocRouteRef
|
|
57
|
-
}),
|
|
58
|
-
extensions: [scaffolderApi, scaffolderPage, scaffolderNavItem]
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
export { alpha as default };
|
|
2
|
+
export { default } from './alpha/plugin.esm.js';
|
|
62
3
|
//# sourceMappingURL=alpha.esm.js.map
|
package/dist/alpha.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alpha.esm.js","sources":[
|
|
1
|
+
{"version":3,"file":"alpha.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/api.esm.js
CHANGED
|
@@ -25,9 +25,11 @@ class ScaffolderClient {
|
|
|
25
25
|
}
|
|
26
26
|
const baseUrl = await this.discoveryApi.getBaseUrl("scaffolder");
|
|
27
27
|
const { userEntityRef } = await this.identityApi.getBackstageIdentity();
|
|
28
|
-
const query = qs.stringify(
|
|
29
|
-
options.filterByOwnership === "owned" ?
|
|
30
|
-
|
|
28
|
+
const query = qs.stringify({
|
|
29
|
+
createdBy: options.filterByOwnership === "owned" ? userEntityRef : void 0,
|
|
30
|
+
limit: options.limit,
|
|
31
|
+
offset: options.offset
|
|
32
|
+
});
|
|
31
33
|
const response = await this.fetchApi.fetch(`${baseUrl}/v2/tasks?${query}`);
|
|
32
34
|
if (!response.ok) {
|
|
33
35
|
throw await ResponseError.fromResponse(response);
|
|
@@ -122,6 +124,7 @@ class ScaffolderClient {
|
|
|
122
124
|
return response.json();
|
|
123
125
|
}
|
|
124
126
|
streamLogsEventStream({
|
|
127
|
+
isTaskRecoverable,
|
|
125
128
|
taskId,
|
|
126
129
|
after
|
|
127
130
|
}) {
|
|
@@ -145,14 +148,14 @@ class ScaffolderClient {
|
|
|
145
148
|
}
|
|
146
149
|
};
|
|
147
150
|
const ctrl = new AbortController();
|
|
148
|
-
fetchEventSource(url, {
|
|
151
|
+
void fetchEventSource(url, {
|
|
149
152
|
fetch: this.fetchApi.fetch,
|
|
150
153
|
signal: ctrl.signal,
|
|
151
154
|
onmessage(e) {
|
|
152
155
|
if (e.event === "log") {
|
|
153
156
|
processEvent(e);
|
|
154
157
|
return;
|
|
155
|
-
} else if (e.event === "completion") {
|
|
158
|
+
} else if (e.event === "completion" && !isTaskRecoverable) {
|
|
156
159
|
processEvent(e);
|
|
157
160
|
subscriber.complete();
|
|
158
161
|
ctrl.abort();
|
|
@@ -219,6 +222,17 @@ class ScaffolderClient {
|
|
|
219
222
|
}
|
|
220
223
|
return await response.json();
|
|
221
224
|
}
|
|
225
|
+
async retry(taskId) {
|
|
226
|
+
const baseUrl = await this.discoveryApi.getBaseUrl("scaffolder");
|
|
227
|
+
const url = `${baseUrl}/v2/tasks/${encodeURIComponent(taskId)}/retry`;
|
|
228
|
+
const response = await this.fetchApi.fetch(url, {
|
|
229
|
+
method: "POST"
|
|
230
|
+
});
|
|
231
|
+
if (!response.ok) {
|
|
232
|
+
throw await ResponseError.fromResponse(response);
|
|
233
|
+
}
|
|
234
|
+
return await response.json();
|
|
235
|
+
}
|
|
222
236
|
async autocomplete({
|
|
223
237
|
token,
|
|
224
238
|
resource,
|