@backstage/plugin-scaffolder 1.26.0-next.1 → 1.26.0-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/alpha/package.json +1 -1
  3. package/dist/alpha/components/TemplateEditorPage/CustomFieldExplorer.esm.js +61 -29
  4. package/dist/alpha/components/TemplateEditorPage/CustomFieldExplorer.esm.js.map +1 -1
  5. package/dist/alpha/components/TemplateEditorPage/CustomFieldPlaygroud.esm.js +36 -13
  6. package/dist/alpha/components/TemplateEditorPage/CustomFieldPlaygroud.esm.js.map +1 -1
  7. package/dist/alpha/components/TemplateEditorPage/CustomFieldsPage.esm.js +6 -15
  8. package/dist/alpha/components/TemplateEditorPage/CustomFieldsPage.esm.js.map +1 -1
  9. package/dist/alpha/components/TemplateEditorPage/DirectoryEditorContext.esm.js +4 -3
  10. package/dist/alpha/components/TemplateEditorPage/DirectoryEditorContext.esm.js.map +1 -1
  11. package/dist/alpha/components/TemplateEditorPage/TemplateEditor.esm.js +35 -80
  12. package/dist/alpha/components/TemplateEditorPage/TemplateEditor.esm.js.map +1 -1
  13. package/dist/alpha/components/TemplateEditorPage/TemplateEditorBrowser.esm.js +9 -6
  14. package/dist/alpha/components/TemplateEditorPage/TemplateEditorBrowser.esm.js.map +1 -1
  15. package/dist/alpha/components/TemplateEditorPage/TemplateEditorForm.esm.js +5 -2
  16. package/dist/alpha/components/TemplateEditorPage/TemplateEditorForm.esm.js.map +1 -1
  17. package/dist/alpha/components/TemplateEditorPage/TemplateEditorIntro.esm.js +17 -16
  18. package/dist/alpha/components/TemplateEditorPage/TemplateEditorIntro.esm.js.map +1 -1
  19. package/dist/alpha/components/TemplateEditorPage/TemplateEditorLayout.esm.js +94 -0
  20. package/dist/alpha/components/TemplateEditorPage/TemplateEditorLayout.esm.js.map +1 -0
  21. package/dist/alpha/components/TemplateEditorPage/TemplateEditorPage.esm.js +22 -34
  22. package/dist/alpha/components/TemplateEditorPage/TemplateEditorPage.esm.js.map +1 -1
  23. package/dist/alpha/components/TemplateEditorPage/TemplateEditorTextArea.esm.js +10 -20
  24. package/dist/alpha/components/TemplateEditorPage/TemplateEditorTextArea.esm.js.map +1 -1
  25. package/dist/alpha/components/TemplateEditorPage/TemplateEditorToolbar.esm.js +42 -14
  26. package/dist/alpha/components/TemplateEditorPage/TemplateEditorToolbar.esm.js.map +1 -1
  27. package/dist/alpha/components/TemplateEditorPage/TemplateEditorToolbarFileMenu.esm.js +73 -0
  28. package/dist/alpha/components/TemplateEditorPage/TemplateEditorToolbarFileMenu.esm.js.map +1 -0
  29. package/dist/alpha/components/TemplateEditorPage/TemplateEditorToolbarTemplatesMenu.esm.js +84 -0
  30. package/dist/alpha/components/TemplateEditorPage/TemplateEditorToolbarTemplatesMenu.esm.js.map +1 -0
  31. package/dist/alpha/components/TemplateEditorPage/TemplateFormPage.esm.js +3 -1
  32. package/dist/alpha/components/TemplateEditorPage/TemplateFormPage.esm.js.map +1 -1
  33. package/dist/alpha/components/TemplateEditorPage/TemplateFormPreviewer.esm.js +58 -95
  34. package/dist/alpha/components/TemplateEditorPage/TemplateFormPreviewer.esm.js.map +1 -1
  35. package/dist/alpha/components/TemplateEditorPage/TemplateIntroPage.esm.js +54 -0
  36. package/dist/alpha/components/TemplateEditorPage/TemplateIntroPage.esm.js.map +1 -0
  37. package/dist/alpha/components/TemplateEditorPage/useTemplateDirectory.esm.js +33 -0
  38. package/dist/alpha/components/TemplateEditorPage/useTemplateDirectory.esm.js.map +1 -0
  39. package/dist/alpha.d.ts +25 -6
  40. package/dist/components/ActionsPage/ActionsPage.esm.js +42 -8
  41. package/dist/components/ActionsPage/ActionsPage.esm.js.map +1 -1
  42. package/dist/components/Router/Router.esm.js +4 -4
  43. package/dist/components/Router/Router.esm.js.map +1 -1
  44. package/dist/lib/filesystem/WebFileSystemAccess.esm.js +1 -13
  45. package/dist/lib/filesystem/WebFileSystemAccess.esm.js.map +1 -1
  46. package/dist/lib/filesystem/WebFileSystemStore.esm.js +15 -0
  47. package/dist/lib/filesystem/WebFileSystemStore.esm.js.map +1 -0
  48. package/dist/lib/filesystem/createExampleTemplate.esm.js +1 -0
  49. package/dist/lib/filesystem/createExampleTemplate.esm.js.map +1 -1
  50. package/dist/translation.esm.js +40 -5
  51. package/dist/translation.esm.js.map +1 -1
  52. package/package.json +14 -14
  53. package/dist/alpha/components/TemplateEditorPage/TemplatePage.esm.js +0 -52
  54. package/dist/alpha/components/TemplateEditorPage/TemplatePage.esm.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ActionsPage.esm.js","sources":["../../../src/components/ActionsPage/ActionsPage.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 */\nimport React, { Fragment, useEffect, useState } from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport {\n ActionExample,\n scaffolderApiRef,\n} from '@backstage/plugin-scaffolder-react';\nimport Accordion from '@material-ui/core/Accordion';\nimport AccordionDetails from '@material-ui/core/AccordionDetails';\nimport AccordionSummary from '@material-ui/core/AccordionSummary';\nimport Box from '@material-ui/core/Box';\nimport Collapse from '@material-ui/core/Collapse';\nimport Grid from '@material-ui/core/Grid';\nimport Paper from '@material-ui/core/Paper';\nimport Table from '@material-ui/core/Table';\nimport TableBody from '@material-ui/core/TableBody';\nimport TableCell from '@material-ui/core/TableCell';\nimport TableContainer from '@material-ui/core/TableContainer';\nimport TableHead from '@material-ui/core/TableHead';\nimport TableRow from '@material-ui/core/TableRow';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { JSONSchema7, JSONSchema7Definition } from 'json-schema';\nimport classNames from 'classnames';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport ExpandLessIcon from '@material-ui/icons/ExpandLess';\nimport LinkIcon from '@material-ui/icons/Link';\n\nimport { useApi, useRouteRef } from '@backstage/core-plugin-api';\nimport {\n CodeSnippet,\n Content,\n EmptyState,\n ErrorPanel,\n Header,\n Link,\n MarkdownContent,\n Page,\n Progress,\n} from '@backstage/core-components';\nimport Chip from '@material-ui/core/Chip';\nimport { ScaffolderPageContextMenu } from '@backstage/plugin-scaffolder-react/alpha';\nimport { useNavigate } from 'react-router-dom';\nimport {\n editRouteRef,\n rootRouteRef,\n scaffolderListTaskRouteRef,\n} from '../../routes';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { scaffolderTranslationRef } from '../../translation';\n\nconst useStyles = makeStyles(theme => ({\n code: {\n fontFamily: 'Menlo, monospace',\n padding: theme.spacing(1),\n backgroundColor:\n theme.palette.type === 'dark'\n ? theme.palette.grey[700]\n : theme.palette.grey[300],\n display: 'inline-block',\n borderRadius: 5,\n border: `1px solid ${theme.palette.grey[500]}`,\n position: 'relative',\n },\n\n codeRequired: {\n '&::after': {\n position: 'absolute',\n content: '\"*\"',\n top: 0,\n right: theme.spacing(0.5),\n fontWeight: 'bolder',\n color: theme.palette.error.light,\n },\n },\n link: {\n paddingLeft: theme.spacing(1),\n },\n}));\n\nconst ExamplesTable = (props: { examples: ActionExample[] }) => {\n return (\n <Grid container>\n {props.examples.map((example, index) => {\n return (\n <Fragment key={`example-${index}`}>\n <Grid item lg={3}>\n <Box padding={4}>\n <Typography>{example.description}</Typography>\n </Box>\n </Grid>\n <Grid item lg={9}>\n <Box padding={1}>\n <CodeSnippet\n text={example.example}\n showLineNumbers\n showCopyCodeButton\n language=\"yaml\"\n />\n </Box>\n </Grid>\n </Fragment>\n );\n })}\n </Grid>\n );\n};\n\nexport const ActionPageContent = () => {\n const api = useApi(scaffolderApiRef);\n const { t } = useTranslationRef(scaffolderTranslationRef);\n\n const classes = useStyles();\n const { loading, value, error } = useAsync(async () => {\n return api.listActions();\n }, [api]);\n\n const [isExpanded, setIsExpanded] = useState<{ [key: string]: boolean }>({});\n\n useEffect(() => {\n if (value && window.location.hash) {\n document.querySelector(window.location.hash)?.scrollIntoView();\n }\n }, [value]);\n\n if (loading) {\n return <Progress />;\n }\n\n if (error) {\n return (\n <>\n <ErrorPanel error={error} />\n <EmptyState\n missing=\"info\"\n title={t('actionsPage.content.emptyState.title')}\n description={t('actionsPage.content.emptyState.description')}\n />\n </>\n );\n }\n\n const renderTable = (rows?: JSX.Element[]) => {\n if (!rows || rows.length < 1) {\n return (\n <Typography>{t('actionsPage.content.noRowsDescription')}</Typography>\n );\n }\n return (\n <TableContainer component={Paper}>\n <Table size=\"small\">\n <TableHead>\n <TableRow>\n <TableCell>{t('actionsPage.content.tableCell.name')}</TableCell>\n <TableCell>{t('actionsPage.content.tableCell.title')}</TableCell>\n <TableCell>\n {t('actionsPage.content.tableCell.description')}\n </TableCell>\n <TableCell>{t('actionsPage.content.tableCell.type')}</TableCell>\n </TableRow>\n </TableHead>\n <TableBody>{rows}</TableBody>\n </Table>\n </TableContainer>\n );\n };\n\n const getTypes = (properties: JSONSchema7) => {\n if (!properties.type) {\n return ['unknown'];\n }\n\n if (properties.type !== 'array') {\n return [properties.type].flat();\n }\n\n return [\n `${properties.type}(${\n (properties.items as JSONSchema7 | undefined)?.type ?? 'unknown'\n })`,\n ];\n };\n\n const formatRows = (parentId: string, input?: JSONSchema7) => {\n const properties = input?.properties;\n if (!properties) {\n return undefined;\n }\n\n return Object.entries(properties).map(entry => {\n const [key] = entry;\n const id = `${parentId}.${key}`;\n const props = entry[1] as unknown as JSONSchema7;\n const codeClassname = classNames(classes.code, {\n [classes.codeRequired]: input.required?.includes(key),\n });\n const types = getTypes(props);\n\n return (\n <React.Fragment key={id}>\n <TableRow key={id}>\n <TableCell>\n <div className={codeClassname}>{key}</div>\n </TableCell>\n <TableCell>{props.title}</TableCell>\n <TableCell>{props.description}</TableCell>\n <TableCell>\n {types.map(type =>\n type.includes('object') ? (\n <Chip\n label={type}\n key={type}\n icon={\n isExpanded[id] ? <ExpandLessIcon /> : <ExpandMoreIcon />\n }\n variant=\"outlined\"\n onClick={() =>\n setIsExpanded(prevState => {\n const state = { ...prevState };\n state[id] = !prevState[id];\n return state;\n })\n }\n />\n ) : (\n <Chip label={type} key={type} variant=\"outlined\" />\n ),\n )}\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell style={{ paddingBottom: 0, paddingTop: 0 }} colSpan={6}>\n <Collapse in={isExpanded[id]} timeout=\"auto\" unmountOnExit>\n <Box sx={{ margin: 1 }}>\n <Typography variant=\"h6\" component=\"div\">\n {key}\n </Typography>\n {renderTable(\n formatRows(\n id,\n props.type === 'array'\n ? ({\n properties:\n (props.items as JSONSchema7 | undefined)\n ?.properties ?? {},\n } as unknown as JSONSchema7 | undefined)\n : props,\n ),\n )}\n </Box>\n </Collapse>\n </TableCell>\n </TableRow>\n </React.Fragment>\n );\n });\n };\n\n const renderTables = (\n name: string,\n id: string,\n input?: JSONSchema7Definition[],\n ) => {\n if (!input) {\n return undefined;\n }\n\n return (\n <>\n <Typography variant=\"h6\" component=\"h4\">\n {name}\n </Typography>\n {input.map((i, index) => (\n <div key={index}>\n {renderTable(\n formatRows(`${id}.${index}`, i as unknown as JSONSchema7),\n )}\n </div>\n ))}\n </>\n );\n };\n\n return value?.map(action => {\n if (action.id.startsWith('legacy:')) {\n return undefined;\n }\n\n const oneOf = renderTables(\n 'oneOf',\n `${action.id}.input`,\n action.schema?.input?.oneOf,\n );\n return (\n <Box pb={4} key={action.id}>\n <Typography\n id={action.id.replaceAll(':', '-')}\n variant=\"h4\"\n component=\"h2\"\n className={classes.code}\n >\n {action.id}\n </Typography>\n <Link\n className={classes.link}\n to={`#${action.id.replaceAll(':', '-')}`}\n >\n <LinkIcon />\n </Link>\n {action.description && <MarkdownContent content={action.description} />}\n {action.schema?.input && (\n <Box pb={2}>\n <Typography variant=\"h5\" component=\"h3\">\n {t('actionsPage.action.input')}\n </Typography>\n {renderTable(\n formatRows(`${action.id}.input`, action?.schema?.input),\n )}\n {oneOf}\n </Box>\n )}\n {action.schema?.output && (\n <Box pb={2}>\n <Typography variant=\"h5\" component=\"h3\">\n {t('actionsPage.action.output')}\n </Typography>\n {renderTable(\n formatRows(`${action.id}.output`, action?.schema?.output),\n )}\n </Box>\n )}\n {action.examples && (\n <Accordion>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography variant=\"h5\" component=\"h3\">\n {t('actionsPage.action.examples')}\n </Typography>\n </AccordionSummary>\n <AccordionDetails>\n <Box pb={2}>\n <ExamplesTable examples={action.examples} />\n </Box>\n </AccordionDetails>\n </Accordion>\n )}\n </Box>\n );\n });\n};\nexport const ActionsPage = () => {\n const navigate = useNavigate();\n const editorLink = useRouteRef(editRouteRef);\n const tasksLink = useRouteRef(scaffolderListTaskRouteRef);\n const createLink = useRouteRef(rootRouteRef);\n const { t } = useTranslationRef(scaffolderTranslationRef);\n\n const scaffolderPageContextMenuProps = {\n onEditorClicked: () => navigate(editorLink()),\n onActionsClicked: undefined,\n onTasksClicked: () => navigate(tasksLink()),\n onCreateClicked: () => navigate(createLink()),\n };\n\n return (\n <Page themeId=\"home\">\n <Header\n pageTitleOverride={t('actionsPage.pageTitle')}\n title={t('actionsPage.title')}\n subtitle={t('actionsPage.subtitle')}\n >\n <ScaffolderPageContextMenu {...scaffolderPageContextMenuProps} />\n </Header>\n <Content>\n <ActionPageContent />\n </Content>\n </Page>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,IAAM,EAAA;AAAA,IACJ,UAAY,EAAA,kBAAA;AAAA,IACZ,OAAA,EAAS,KAAM,CAAA,O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;AACxD,EAAM,MAAA,UAAA,GAAa,YAAY,YAAY,CAAA,CAAA;AAC3C,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,wBAAwB,CAAA,CAAA;AAExD,EAAA,MAAM,8BAAiC,GAAA;AAAA,IACrC,eAAiB,EAAA,MAAM,QAAS,CAAA,UAAA,EAAY,CAAA;AAAA,IAC5C,gBAAkB,EAAA,KAAA,CAAA;AAAA,IAClB,cAAgB,EAAA,MAAM,QAAS,CAAA,SAAA,EAAW,CAAA;AAAA,IAC1C,eAAiB,EAAA,MAAM,QAAS,CAAA,UAAA,EAAY,CAAA;AAAA,GAC9C,CAAA;AAEA,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,IAAK,EAAA,EAAA,OAAA,EAAQ,MACZ,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,iBAAA,EAAmB,EAAE,uBAAuB,CAAA;AAAA,MAC5C,KAAA,EAAO,EAAE,mBAAmB,CAAA;AAAA,MAC5B,QAAA,EAAU,EAAE,sBAAsB,CAAA;AAAA,KAAA;AAAA,oBAElC,KAAA,CAAA,aAAA,CAAC,yBAA2B,EAAA,EAAA,GAAG,8BAAgC,EAAA,CAAA;AAAA,qBAEhE,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA,IAAA,kBACE,KAAA,CAAA,aAAA,CAAA,iBAAA,EAAA,IAAkB,CACrB,CACF,CAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"ActionsPage.esm.js","sources":["../../../src/components/ActionsPage/ActionsPage.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 */\nimport React, { Fragment, useEffect, useState } from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport {\n Action,\n ActionExample,\n scaffolderApiRef,\n} from '@backstage/plugin-scaffolder-react';\nimport Accordion from '@material-ui/core/Accordion';\nimport AccordionDetails from '@material-ui/core/AccordionDetails';\nimport AccordionSummary from '@material-ui/core/AccordionSummary';\nimport Box from '@material-ui/core/Box';\nimport Collapse from '@material-ui/core/Collapse';\nimport Grid from '@material-ui/core/Grid';\nimport Paper from '@material-ui/core/Paper';\nimport Table from '@material-ui/core/Table';\nimport TableBody from '@material-ui/core/TableBody';\nimport TableCell from '@material-ui/core/TableCell';\nimport TableContainer from '@material-ui/core/TableContainer';\nimport TableHead from '@material-ui/core/TableHead';\nimport TableRow from '@material-ui/core/TableRow';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { JSONSchema7, JSONSchema7Definition } from 'json-schema';\nimport classNames from 'classnames';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport ExpandLessIcon from '@material-ui/icons/ExpandLess';\nimport LinkIcon from '@material-ui/icons/Link';\nimport Autocomplete from '@material-ui/lab/Autocomplete';\nimport TextField from '@material-ui/core/TextField';\nimport InputAdornment from '@material-ui/core/InputAdornment';\nimport SearchIcon from '@material-ui/icons/Search';\n\nimport { useApi, useRouteRef } from '@backstage/core-plugin-api';\nimport {\n CodeSnippet,\n Content,\n EmptyState,\n ErrorPanel,\n Header,\n Link,\n MarkdownContent,\n Page,\n Progress,\n} from '@backstage/core-components';\nimport Chip from '@material-ui/core/Chip';\nimport { ScaffolderPageContextMenu } from '@backstage/plugin-scaffolder-react/alpha';\nimport { useNavigate } from 'react-router-dom';\nimport {\n editRouteRef,\n rootRouteRef,\n scaffolderListTaskRouteRef,\n} from '../../routes';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { scaffolderTranslationRef } from '../../translation';\n\nconst useStyles = makeStyles(theme => ({\n code: {\n fontFamily: 'Menlo, monospace',\n padding: theme.spacing(1),\n backgroundColor:\n theme.palette.type === 'dark'\n ? theme.palette.grey[700]\n : theme.palette.grey[300],\n display: 'inline-block',\n borderRadius: 5,\n border: `1px solid ${theme.palette.grey[500]}`,\n position: 'relative',\n },\n\n codeRequired: {\n '&::after': {\n position: 'absolute',\n content: '\"*\"',\n top: 0,\n right: theme.spacing(0.5),\n fontWeight: 'bolder',\n color: theme.palette.error.light,\n },\n },\n link: {\n paddingLeft: theme.spacing(1),\n },\n}));\n\nconst ExamplesTable = (props: { examples: ActionExample[] }) => {\n return (\n <Grid container>\n {props.examples.map((example, index) => {\n return (\n <Fragment key={`example-${index}`}>\n <Grid item lg={3}>\n <Box padding={4}>\n <Typography>{example.description}</Typography>\n </Box>\n </Grid>\n <Grid item lg={9}>\n <Box padding={1}>\n <CodeSnippet\n text={example.example}\n showLineNumbers\n showCopyCodeButton\n language=\"yaml\"\n />\n </Box>\n </Grid>\n </Fragment>\n );\n })}\n </Grid>\n );\n};\n\nexport const ActionPageContent = () => {\n const api = useApi(scaffolderApiRef);\n const { t } = useTranslationRef(scaffolderTranslationRef);\n\n const classes = useStyles();\n const {\n loading,\n value = [],\n error,\n } = useAsync(async () => {\n return api.listActions();\n }, [api]);\n\n const [selectedAction, setSelectedAction] = useState<Action | null>(null);\n const [isExpanded, setIsExpanded] = useState<{ [key: string]: boolean }>({});\n\n useEffect(() => {\n if (value.length && window.location.hash) {\n document.querySelector(window.location.hash)?.scrollIntoView();\n }\n }, [value]);\n\n if (loading) {\n return <Progress />;\n }\n\n if (error) {\n return (\n <>\n <ErrorPanel error={error} />\n <EmptyState\n missing=\"info\"\n title={t('actionsPage.content.emptyState.title')}\n description={t('actionsPage.content.emptyState.description')}\n />\n </>\n );\n }\n\n const renderTable = (rows?: JSX.Element[]) => {\n if (!rows || rows.length < 1) {\n return (\n <Typography>{t('actionsPage.content.noRowsDescription')}</Typography>\n );\n }\n return (\n <TableContainer component={Paper}>\n <Table size=\"small\">\n <TableHead>\n <TableRow>\n <TableCell>{t('actionsPage.content.tableCell.name')}</TableCell>\n <TableCell>{t('actionsPage.content.tableCell.title')}</TableCell>\n <TableCell>\n {t('actionsPage.content.tableCell.description')}\n </TableCell>\n <TableCell>{t('actionsPage.content.tableCell.type')}</TableCell>\n </TableRow>\n </TableHead>\n <TableBody>{rows}</TableBody>\n </Table>\n </TableContainer>\n );\n };\n\n const getTypes = (properties: JSONSchema7) => {\n if (!properties.type) {\n return ['unknown'];\n }\n\n if (properties.type !== 'array') {\n return [properties.type].flat();\n }\n\n return [\n `${properties.type}(${\n (properties.items as JSONSchema7 | undefined)?.type ?? 'unknown'\n })`,\n ];\n };\n\n const formatRows = (parentId: string, input?: JSONSchema7) => {\n const properties = input?.properties;\n if (!properties) {\n return undefined;\n }\n\n return Object.entries(properties).map(entry => {\n const [key] = entry;\n const id = `${parentId}.${key}`;\n const props = entry[1] as unknown as JSONSchema7;\n const codeClassname = classNames(classes.code, {\n [classes.codeRequired]: input.required?.includes(key),\n });\n const types = getTypes(props);\n\n return (\n <React.Fragment key={id}>\n <TableRow key={id}>\n <TableCell>\n <div className={codeClassname}>{key}</div>\n </TableCell>\n <TableCell>{props.title}</TableCell>\n <TableCell>{props.description}</TableCell>\n <TableCell>\n {types.map(type =>\n type.includes('object') ? (\n <Chip\n label={type}\n key={type}\n icon={\n isExpanded[id] ? <ExpandLessIcon /> : <ExpandMoreIcon />\n }\n variant=\"outlined\"\n onClick={() =>\n setIsExpanded(prevState => {\n const state = { ...prevState };\n state[id] = !prevState[id];\n return state;\n })\n }\n />\n ) : (\n <Chip label={type} key={type} variant=\"outlined\" />\n ),\n )}\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell style={{ paddingBottom: 0, paddingTop: 0 }} colSpan={6}>\n <Collapse in={isExpanded[id]} timeout=\"auto\" unmountOnExit>\n <Box sx={{ margin: 1 }}>\n <Typography variant=\"h6\" component=\"div\">\n {key}\n </Typography>\n {renderTable(\n formatRows(\n id,\n props.type === 'array'\n ? ({\n properties:\n (props.items as JSONSchema7 | undefined)\n ?.properties ?? {},\n } as unknown as JSONSchema7 | undefined)\n : props,\n ),\n )}\n </Box>\n </Collapse>\n </TableCell>\n </TableRow>\n </React.Fragment>\n );\n });\n };\n\n const renderTables = (\n name: string,\n id: string,\n input?: JSONSchema7Definition[],\n ) => {\n if (!input) {\n return undefined;\n }\n\n return (\n <>\n <Typography variant=\"h6\" component=\"h4\">\n {name}\n </Typography>\n {input.map((i, index) => (\n <div key={index}>\n {renderTable(\n formatRows(`${id}.${index}`, i as unknown as JSONSchema7),\n )}\n </div>\n ))}\n </>\n );\n };\n\n return (\n <>\n <Box pb={3}>\n <Autocomplete\n id=\"actions-autocomplete\"\n options={value}\n loading={loading}\n getOptionLabel={option => option.id}\n renderInput={params => (\n <TextField\n {...params}\n aria-label={t('actionsPage.content.searchFieldPlaceholder')}\n placeholder={t('actionsPage.content.searchFieldPlaceholder')}\n variant=\"outlined\"\n InputProps={{\n ...params.InputProps,\n startAdornment: (\n <InputAdornment position=\"start\">\n <SearchIcon />\n </InputAdornment>\n ),\n }}\n />\n )}\n onChange={(_event, option) => {\n setSelectedAction(option);\n }}\n fullWidth\n />\n </Box>\n {(selectedAction ? [selectedAction] : value).map(action => {\n if (action.id.startsWith('legacy:')) {\n return undefined;\n }\n\n const oneOf = renderTables(\n 'oneOf',\n `${action.id}.input`,\n action.schema?.input?.oneOf,\n );\n return (\n <Box pb={3} key={action.id}>\n <Box display=\"flex\" alignItems=\"center\">\n <Typography\n id={action.id.replaceAll(':', '-')}\n variant=\"h5\"\n component=\"h2\"\n className={classes.code}\n >\n {action.id}\n </Typography>\n <Link\n className={classes.link}\n to={`#${action.id.replaceAll(':', '-')}`}\n >\n <LinkIcon />\n </Link>\n </Box>\n {action.description && (\n <MarkdownContent content={action.description} />\n )}\n {action.schema?.input && (\n <Box pb={2}>\n <Typography variant=\"h6\" component=\"h3\">\n {t('actionsPage.action.input')}\n </Typography>\n {renderTable(\n formatRows(`${action.id}.input`, action?.schema?.input),\n )}\n {oneOf}\n </Box>\n )}\n {action.schema?.output && (\n <Box pb={2}>\n <Typography variant=\"h5\" component=\"h3\">\n {t('actionsPage.action.output')}\n </Typography>\n {renderTable(\n formatRows(`${action.id}.output`, action?.schema?.output),\n )}\n </Box>\n )}\n {action.examples && (\n <Accordion>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography variant=\"h6\" component=\"h3\">\n {t('actionsPage.action.examples')}\n </Typography>\n </AccordionSummary>\n <AccordionDetails>\n <Box pb={2}>\n <ExamplesTable examples={action.examples} />\n </Box>\n </AccordionDetails>\n </Accordion>\n )}\n </Box>\n );\n })}\n </>\n );\n};\nexport const ActionsPage = () => {\n const navigate = useNavigate();\n const editorLink = useRouteRef(editRouteRef);\n const tasksLink = useRouteRef(scaffolderListTaskRouteRef);\n const createLink = useRouteRef(rootRouteRef);\n const { t } = useTranslationRef(scaffolderTranslationRef);\n\n const scaffolderPageContextMenuProps = {\n onEditorClicked: () => navigate(editorLink()),\n onActionsClicked: undefined,\n onTasksClicked: () => navigate(tasksLink()),\n onCreateClicked: () => navigate(createLink()),\n };\n\n return (\n <Page themeId=\"home\">\n <Header\n pageTitleOverride={t('actionsPage.pageTitle')}\n title={t('actionsPage.title')}\n subtitle={t('actionsPage.subtitle')}\n >\n <ScaffolderPageContextMenu {...scaffolderPageContextMenuProps} />\n </Header>\n <Content>\n <ActionPageContent />\n </Content>\n </Page>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsEA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,IAAM,EAAA;AAAA,IACJ,UAAY,EAAA,kBAAA;AAAA,IACZ,OAAA,EAAS,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,IACxB,eACE,EAAA,KAAA,CAAM,OAAQ,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EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,wBAAwB,CAAA,CAAA;AAExD,EAAA,MAAM,8BAAiC,GAAA;AAAA,IACrC,eAAiB,EAAA,MAAM,QAAS,CAAA,UAAA,EAAY,CAAA;AAAA,IAC5C,gBAAkB,EAAA,KAAA,CAAA;AAAA,IAClB,cAAgB,EAAA,MAAM,QAAS,CAAA,SAAA,EAAW,CAAA;AAAA,IAC1C,eAAiB,EAAA,MAAM,QAAS,CAAA,UAAA,EAAY,CAAA;AAAA,GAC9C,CAAA;AAEA,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,IAAK,EAAA,EAAA,OAAA,EAAQ,MACZ,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,iBAAA,EAAmB,EAAE,uBAAuB,CAAA;AAAA,MAC5C,KAAA,EAAO,EAAE,mBAAmB,CAAA;AAAA,MAC5B,QAAA,EAAU,EAAE,sBAAsB,CAAA;AAAA,KAAA;AAAA,oBAElC,KAAA,CAAA,aAAA,CAAC,yBAA2B,EAAA,EAAA,GAAG,8BAAgC,EAAA,CAAA;AAAA,qBAEhE,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA,IAAA,kBACE,KAAA,CAAA,aAAA,CAAA,iBAAA,EAAA,IAAkB,CACrB,CACF,CAAA,CAAA;AAEJ;;;;"}
@@ -9,9 +9,9 @@ import { ListTasksPage } from '../ListTasksPage/ListTasksPage.esm.js';
9
9
  import { TemplateListPage } from '../../alpha/components/TemplateListPage/TemplateListPage.esm.js';
10
10
  import { TemplateWizardPage } from '../../alpha/components/TemplateWizardPage/TemplateWizardPage.esm.js';
11
11
  import { OngoingTask } from '../OngoingTask/OngoingTask.esm.js';
12
- import { TemplatePage } from '../../alpha/components/TemplateEditorPage/TemplatePage.esm.js';
13
- import { TemplateFormPage } from '../../alpha/components/TemplateEditorPage/TemplateFormPage.esm.js';
14
12
  import { TemplateEditorPage } from '../../alpha/components/TemplateEditorPage/TemplateEditorPage.esm.js';
13
+ import { TemplateFormPage } from '../../alpha/components/TemplateEditorPage/TemplateFormPage.esm.js';
14
+ import { TemplateIntroPage } from '../../alpha/components/TemplateEditorPage/TemplateIntroPage.esm.js';
15
15
  import { CustomFieldsPage } from '../../alpha/components/TemplateEditorPage/CustomFieldsPage.esm.js';
16
16
 
17
17
  const Router = (props) => {
@@ -81,7 +81,7 @@ const Router = (props) => {
81
81
  Route,
82
82
  {
83
83
  path: editRouteRef.path,
84
- element: /* @__PURE__ */ React.createElement(SecretsContextProvider, null, /* @__PURE__ */ React.createElement(TemplateEditorPage, null))
84
+ element: /* @__PURE__ */ React.createElement(SecretsContextProvider, null, /* @__PURE__ */ React.createElement(TemplateIntroPage, null))
85
85
  }
86
86
  ), /* @__PURE__ */ React.createElement(
87
87
  Route,
@@ -113,7 +113,7 @@ const Router = (props) => {
113
113
  {
114
114
  path: editorRouteRef.path,
115
115
  element: /* @__PURE__ */ React.createElement(SecretsContextProvider, null, /* @__PURE__ */ React.createElement(
116
- TemplatePage,
116
+ TemplateEditorPage,
117
117
  {
118
118
  layouts: customLayouts,
119
119
  formProps: props.formProps,
@@ -1 +1 @@
1
- {"version":3,"file":"Router.esm.js","sources":["../../../src/components/Router/Router.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, { PropsWithChildren } from 'react';\nimport { Routes, Route, useOutlet } from 'react-router-dom';\n\nimport {\n FieldExtensionOptions,\n FormProps,\n ReviewStepProps,\n TemplateGroupFilter,\n} from '@backstage/plugin-scaffolder-react';\nimport {\n ScaffolderTaskOutput,\n SecretsContextProvider,\n useCustomFieldExtensions,\n useCustomLayouts,\n} from '@backstage/plugin-scaffolder-react';\n\nimport { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';\nimport { DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS } from '../../extensions/default';\n\nimport {\n actionsRouteRef,\n editorRouteRef,\n customFieldsRouteRef,\n editRouteRef,\n scaffolderListTaskRouteRef,\n scaffolderTaskRouteRef,\n selectedTemplateRouteRef,\n templateFormRouteRef,\n} from '../../routes';\nimport { ErrorPage } from '@backstage/core-components';\n\nimport { ActionsPage } from '../../components/ActionsPage';\nimport { ListTasksPage } from '../../components/ListTasksPage';\n\nimport {\n TemplateListPageProps,\n TemplateWizardPageProps,\n} from '@backstage/plugin-scaffolder/alpha';\nimport { TemplateListPage, TemplateWizardPage } from '../../alpha/components';\nimport { OngoingTask } from '../OngoingTask';\nimport {\n TemplatePage,\n TemplateFormPage,\n TemplateEditorPage,\n CustomFieldsPage,\n} from '../../alpha/components/TemplateEditorPage';\n\n/**\n * The Props for the Scaffolder Router\n *\n * @public\n */\nexport type RouterProps = {\n components?: {\n ReviewStepComponent?: React.ComponentType<ReviewStepProps>;\n TemplateCardComponent?: React.ComponentType<{\n template: TemplateEntityV1beta3;\n }>;\n TaskPageComponent?: React.ComponentType<PropsWithChildren<{}>>;\n EXPERIMENTAL_TemplateOutputsComponent?: React.ComponentType<{\n output?: ScaffolderTaskOutput;\n }>;\n EXPERIMENTAL_TemplateListPageComponent?: React.ComponentType<TemplateListPageProps>;\n EXPERIMENTAL_TemplateWizardPageComponent?: React.ComponentType<TemplateWizardPageProps>;\n };\n groups?: TemplateGroupFilter[];\n templateFilter?: (entity: TemplateEntityV1beta3) => boolean;\n headerOptions?: {\n pageTitleOverride?: string;\n title?: string;\n subtitle?: string;\n };\n defaultPreviewTemplate?: string;\n formProps?: FormProps;\n contextMenu?: {\n /** Whether to show a link to the template editor */\n editor?: boolean;\n /** Whether to show a link to the actions documentation */\n actions?: boolean;\n /** Whether to show a link to the tasks page */\n tasks?: boolean;\n };\n};\n\n/**\n * The Scaffolder Router\n *\n * @public\n */\nexport const Router = (props: PropsWithChildren<RouterProps>) => {\n const {\n components: {\n TemplateCardComponent,\n TaskPageComponent = OngoingTask,\n ReviewStepComponent,\n EXPERIMENTAL_TemplateOutputsComponent: TemplateOutputsComponent,\n EXPERIMENTAL_TemplateListPageComponent:\n TemplateListPageComponent = TemplateListPage,\n EXPERIMENTAL_TemplateWizardPageComponent:\n TemplateWizardPageComponent = TemplateWizardPage,\n } = {},\n } = props;\n const outlet = useOutlet() || props.children;\n const customFieldExtensions =\n useCustomFieldExtensions<FieldExtensionOptions>(outlet);\n\n const fieldExtensions = [\n ...customFieldExtensions,\n ...DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS.filter(\n ({ name }) =>\n !customFieldExtensions.some(\n customFieldExtension => customFieldExtension.name === name,\n ),\n ),\n ] as FieldExtensionOptions[];\n\n const customLayouts = useCustomLayouts(outlet);\n\n return (\n <Routes>\n <Route\n path=\"/\"\n element={\n <TemplateListPageComponent\n TemplateCardComponent={TemplateCardComponent}\n contextMenu={props.contextMenu}\n groups={props.groups}\n templateFilter={props.templateFilter}\n headerOptions={props.headerOptions}\n />\n }\n />\n <Route\n path={selectedTemplateRouteRef.path}\n element={\n <SecretsContextProvider>\n <TemplateWizardPageComponent\n headerOptions={props.headerOptions}\n customFieldExtensions={fieldExtensions}\n layouts={customLayouts}\n components={{ ReviewStepComponent }}\n formProps={props.formProps}\n />\n </SecretsContextProvider>\n }\n />\n <Route\n path={scaffolderTaskRouteRef.path}\n element={\n <TaskPageComponent\n TemplateOutputsComponent={TemplateOutputsComponent}\n />\n }\n />\n <Route\n path={editRouteRef.path}\n element={\n <SecretsContextProvider>\n <TemplateEditorPage />\n </SecretsContextProvider>\n }\n />\n <Route\n path={customFieldsRouteRef.path}\n element={\n <SecretsContextProvider>\n <CustomFieldsPage fieldExtensions={fieldExtensions} />\n </SecretsContextProvider>\n }\n />\n <Route\n path={templateFormRouteRef.path}\n element={\n <SecretsContextProvider>\n <TemplateFormPage\n layouts={customLayouts}\n formProps={props.formProps}\n fieldExtensions={fieldExtensions}\n />\n </SecretsContextProvider>\n }\n />\n\n <Route path={actionsRouteRef.path} element={<ActionsPage />} />\n <Route\n path={scaffolderListTaskRouteRef.path}\n element={<ListTasksPage />}\n />\n <Route\n path={editorRouteRef.path}\n element={\n <SecretsContextProvider>\n <TemplatePage\n layouts={customLayouts}\n formProps={props.formProps}\n fieldExtensions={fieldExtensions}\n />\n </SecretsContextProvider>\n }\n />\n <Route\n path=\"*\"\n element={<ErrorPage status=\"404\" statusMessage=\"Page not found\" />}\n />\n </Routes>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAwGa,MAAA,MAAA,GAAS,CAAC,KAA0C,KAAA;AAC/D,EAAM,MAAA;AAAA,IACJ,UAAY,EAAA;AAAA,MACV,qBAAA;AAAA,MACA,iBAAoB,GAAA,WAAA;AAAA,MACpB,mBAAA;AAAA,MACA,qCAAuC,EAAA,wBAAA;AAAA,MACvC,wCACE,yBAA4B,GAAA,gBAAA;AAAA,MAC9B,0CACE,2BAA8B,GAAA,kBAAA;AAAA,QAC9B,EAAC;AAAA,GACH,GAAA,KAAA,CAAA;AACJ,EAAM,MAAA,MAAA,GAAS,SAAU,EAAA,IAAK,KAAM,CAAA,QAAA,CAAA;AACpC,EAAM,MAAA,qBAAA,GACJ,yBAAgD,MAAM,CAAA,CAAA;AAExD,EAAA,MAAM,eAAkB,GAAA;AAAA,IACtB,GAAG,qBAAA;AAAA,IACH,GAAG,mCAAoC,CAAA,MAAA;AAAA,MACrC,CAAC,EAAE,IAAK,EAAA,KACN,CAAC,qBAAsB,CAAA,IAAA;AAAA,QACrB,CAAA,oBAAA,KAAwB,qBAAqB,IAAS,KAAA,IAAA;AAAA,OACxD;AAAA,KACJ;AAAA,GACF,CAAA;AAEA,EAAM,MAAA,a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ACT,WAAW,KAAM,CAAA,SAAA;AAAA,UACjB,eAAA;AAAA,SAAA;AAAA,OAEJ,CAAA;AAAA,KAAA;AAAA,GAGJ,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,IAAK,EAAA,GAAA;AAAA,MACL,yBAAU,KAAA,CAAA,aAAA,CAAA,SAAA,EAAA,EAAU,MAAO,EAAA,KAAA,EAAM,eAAc,gBAAiB,EAAA,CAAA;AAAA,KAAA;AAAA,GAEpE,CAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"Router.esm.js","sources":["../../../src/components/Router/Router.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, { PropsWithChildren } from 'react';\nimport { Routes, Route, useOutlet } from 'react-router-dom';\n\nimport {\n FieldExtensionOptions,\n FormProps,\n ReviewStepProps,\n TemplateGroupFilter,\n} from '@backstage/plugin-scaffolder-react';\nimport {\n ScaffolderTaskOutput,\n SecretsContextProvider,\n useCustomFieldExtensions,\n useCustomLayouts,\n} from '@backstage/plugin-scaffolder-react';\n\nimport { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';\nimport { DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS } from '../../extensions/default';\n\nimport {\n actionsRouteRef,\n editorRouteRef,\n customFieldsRouteRef,\n editRouteRef,\n scaffolderListTaskRouteRef,\n scaffolderTaskRouteRef,\n selectedTemplateRouteRef,\n templateFormRouteRef,\n} from '../../routes';\nimport { ErrorPage } from '@backstage/core-components';\n\nimport { ActionsPage } from '../../components/ActionsPage';\nimport { ListTasksPage } from '../../components/ListTasksPage';\n\nimport {\n TemplateListPageProps,\n TemplateWizardPageProps,\n} from '@backstage/plugin-scaffolder/alpha';\nimport { TemplateListPage, TemplateWizardPage } from '../../alpha/components';\nimport { OngoingTask } from '../OngoingTask';\nimport {\n TemplateFormPage,\n TemplateIntroPage,\n TemplateEditorPage,\n CustomFieldsPage,\n} from '../../alpha/components/TemplateEditorPage';\n\n/**\n * The Props for the Scaffolder Router\n *\n * @public\n */\nexport type RouterProps = {\n components?: {\n ReviewStepComponent?: React.ComponentType<ReviewStepProps>;\n TemplateCardComponent?: React.ComponentType<{\n template: TemplateEntityV1beta3;\n }>;\n TaskPageComponent?: React.ComponentType<PropsWithChildren<{}>>;\n EXPERIMENTAL_TemplateOutputsComponent?: React.ComponentType<{\n output?: ScaffolderTaskOutput;\n }>;\n EXPERIMENTAL_TemplateListPageComponent?: React.ComponentType<TemplateListPageProps>;\n EXPERIMENTAL_TemplateWizardPageComponent?: React.ComponentType<TemplateWizardPageProps>;\n };\n groups?: TemplateGroupFilter[];\n templateFilter?: (entity: TemplateEntityV1beta3) => boolean;\n headerOptions?: {\n pageTitleOverride?: string;\n title?: string;\n subtitle?: string;\n };\n defaultPreviewTemplate?: string;\n formProps?: FormProps;\n contextMenu?: {\n /** Whether to show a link to the template editor */\n editor?: boolean;\n /** Whether to show a link to the actions documentation */\n actions?: boolean;\n /** Whether to show a link to the tasks page */\n tasks?: boolean;\n };\n};\n\n/**\n * The Scaffolder Router\n *\n * @public\n */\nexport const Router = (props: PropsWithChildren<RouterProps>) => {\n const {\n components: {\n TemplateCardComponent,\n TaskPageComponent = OngoingTask,\n ReviewStepComponent,\n EXPERIMENTAL_TemplateOutputsComponent: TemplateOutputsComponent,\n EXPERIMENTAL_TemplateListPageComponent:\n TemplateListPageComponent = TemplateListPage,\n EXPERIMENTAL_TemplateWizardPageComponent:\n TemplateWizardPageComponent = TemplateWizardPage,\n } = {},\n } = props;\n const outlet = useOutlet() || props.children;\n const customFieldExtensions =\n useCustomFieldExtensions<FieldExtensionOptions>(outlet);\n\n const fieldExtensions = [\n ...customFieldExtensions,\n ...DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS.filter(\n ({ name }) =>\n !customFieldExtensions.some(\n customFieldExtension => customFieldExtension.name === name,\n ),\n ),\n ] as FieldExtensionOptions[];\n\n const customLayouts = useCustomLayouts(outlet);\n\n return (\n <Routes>\n <Route\n path=\"/\"\n element={\n <TemplateListPageComponent\n TemplateCardComponent={TemplateCardComponent}\n contextMenu={props.contextMenu}\n groups={props.groups}\n templateFilter={props.templateFilter}\n headerOptions={props.headerOptions}\n />\n }\n />\n <Route\n path={selectedTemplateRouteRef.path}\n element={\n <SecretsContextProvider>\n <TemplateWizardPageComponent\n headerOptions={props.headerOptions}\n customFieldExtensions={fieldExtensions}\n layouts={customLayouts}\n components={{ ReviewStepComponent }}\n formProps={props.formProps}\n />\n </SecretsContextProvider>\n }\n />\n <Route\n path={scaffolderTaskRouteRef.path}\n element={\n <TaskPageComponent\n TemplateOutputsComponent={TemplateOutputsComponent}\n />\n }\n />\n <Route\n path={editRouteRef.path}\n element={\n <SecretsContextProvider>\n <TemplateIntroPage />\n </SecretsContextProvider>\n }\n />\n <Route\n path={customFieldsRouteRef.path}\n element={\n <SecretsContextProvider>\n <CustomFieldsPage fieldExtensions={fieldExtensions} />\n </SecretsContextProvider>\n }\n />\n <Route\n path={templateFormRouteRef.path}\n element={\n <SecretsContextProvider>\n <TemplateFormPage\n layouts={customLayouts}\n formProps={props.formProps}\n fieldExtensions={fieldExtensions}\n />\n </SecretsContextProvider>\n }\n />\n\n <Route path={actionsRouteRef.path} element={<ActionsPage />} />\n <Route\n path={scaffolderListTaskRouteRef.path}\n element={<ListTasksPage />}\n />\n <Route\n path={editorRouteRef.path}\n element={\n <SecretsContextProvider>\n <TemplateEditorPage\n layouts={customLayouts}\n formProps={props.formProps}\n fieldExtensions={fieldExtensions}\n />\n </SecretsContextProvider>\n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-keyval';
2
-
3
1
  const showDirectoryPicker = window.showDirectoryPicker;
4
2
  class WebFileAccess {
5
3
  constructor(path, handle) {
@@ -74,16 +72,6 @@ class WebFileSystemAccess {
74
72
  constructor() {
75
73
  }
76
74
  }
77
- class WebFileSystemStore {
78
- static key = "scalfolder-template-editor-directory";
79
- static async getDirectory() {
80
- const directory = await get(WebFileSystemStore.key);
81
- return directory.handle;
82
- }
83
- static async setDirectory(directory) {
84
- return set(WebFileSystemStore.key, directory);
85
- }
86
- }
87
75
 
88
- export { WebFileSystemAccess, WebFileSystemStore };
76
+ export { WebDirectoryAccess, WebFileSystemAccess };
89
77
  //# sourceMappingURL=WebFileSystemAccess.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"WebFileSystemAccess.esm.js","sources":["../../../src/lib/filesystem/WebFileSystemAccess.ts"],"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 { get, set } from 'idb-keyval';\nimport { TemplateDirectoryAccess, TemplateFileAccess } from './types';\n\ntype WritableFileHandle = FileSystemFileHandle & {\n createWritable(): Promise<{\n write(data: string | Blob | BufferSource): Promise<void>;\n close(): Promise<void>;\n }>;\n};\n\n// A nicer type than the one from the TS lib\ninterface IterableDirectoryHandle extends FileSystemDirectoryHandle {\n values(): AsyncIterable<\n | ({ kind: 'file' } & WritableFileHandle)\n | ({ kind: 'directory' } & IterableDirectoryHandle)\n >;\n}\n\nconst showDirectoryPicker = (window as any).showDirectoryPicker as\n | (() => Promise<IterableDirectoryHandle>)\n | undefined;\n\nclass WebFileAccess implements TemplateFileAccess {\n constructor(\n readonly path: string,\n private readonly handle: WritableFileHandle,\n ) {}\n\n file(): Promise<File> {\n return this.handle.getFile();\n }\n\n async save(data: string | Blob | BufferSource): Promise<void> {\n const writable = await this.handle.createWritable();\n await writable.write(data);\n await writable.close();\n }\n}\n\nclass WebDirectoryAccess implements TemplateDirectoryAccess {\n constructor(private readonly handle: IterableDirectoryHandle) {}\n\n async listFiles(): Promise<TemplateFileAccess[]> {\n const content = [];\n for await (const entry of this.listDirectoryContents(this.handle)) {\n content.push(entry);\n }\n return content;\n }\n\n private async *listDirectoryContents(\n dirHandle: IterableDirectoryHandle,\n basePath: string[] = [],\n ): AsyncIterable<TemplateFileAccess> {\n for await (const handle of dirHandle.values()) {\n if (handle.kind === 'file') {\n yield new WebFileAccess([...basePath, handle.name].join('/'), handle);\n } else if (handle.kind === 'directory') {\n // Skip git storage directory\n if (handle.name === '.git') {\n continue;\n }\n yield* this.listDirectoryContents(handle, [...basePath, handle.name]);\n }\n }\n }\n\n async createFile(options: { name: string; data: string }): Promise<void> {\n const { name, data } = options;\n let file: FileSystemFileHandle;\n\n // Current create template does not require support for nested directories\n if (name.includes('/')) {\n const [dir, path] = name.split('/');\n const handle = await this.handle.getDirectoryHandle(dir, {\n create: true,\n });\n file = await handle.getFileHandle(path, { create: true });\n } else {\n file = await this.handle.getFileHandle(name, {\n create: true,\n });\n }\n const writable = await file.createWritable();\n await writable.write(data);\n await writable.close();\n }\n}\n\n/** @internal */\nexport class WebFileSystemAccess {\n static isSupported(): boolean {\n return Boolean(showDirectoryPicker);\n }\n\n static fromHandle(handle: IterableDirectoryHandle) {\n return new WebDirectoryAccess(handle);\n }\n\n static async requestDirectoryAccess(): Promise<TemplateDirectoryAccess> {\n if (!showDirectoryPicker) {\n throw new Error('File system access is not supported');\n }\n const handle = await showDirectoryPicker();\n return new WebDirectoryAccess(handle);\n }\n\n private constructor() {}\n}\n\nexport class WebFileSystemStore {\n private static readonly key = 'scalfolder-template-editor-directory';\n\n static async getDirectory(): Promise<IterableDirectoryHandle | undefined> {\n const directory = await get(WebFileSystemStore.key);\n return directory.handle;\n }\n\n static async setDirectory(directory: TemplateDirectoryAccess | undefined) {\n return set(WebFileSystemStore.key, directory);\n }\n}\n"],"names":[],"mappings":";;AAkCA,MAAM,sBAAuB,MAAe,CAAA,mBAAA,CAAA;AAI5C,MAAM,aAA4C,CAAA;AAAA,EAChD,WAAA,CACW,MACQ,MACjB,EAAA;AAFS,IAAA,IAAA,CAAA,IAAA,GAAA,IAAA,CAAA;AACQ,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA,CAAA;AAAA,GAChB;AAAA,EAEH,IAAsB,GAAA;AACpB,IAAO,OAAA,IAAA,CAAK,OAAO,OAAQ,EAAA,CAAA;AAAA,GAC7B;AAAA,EAEA,MAAM,KAAK,IAAmD,EAAA;AAC5D,IAAA,MAAM,QAAW,GAAA,MAAM,IAAK,CAAA,MAAA,CAAO,cAAe,EAAA,CAAA;AAClD,IAAM,MAAA,QAAA,CAAS,MAAM,IAAI,CAAA,CAAA;AACzB,IAAA,MAAM,SAAS,KAAM,EAAA,CAAA;AAAA,GACvB;AACF,CAAA;AAEA,MAAM,kBAAsD,CAAA;AAAA,EAC1D,YAA6B,MAAiC,EAAA;AAAjC,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA,CAAA;AAAA,GAAkC;AAAA,EAE/D,MAAM,SAA2C,GAAA;AAC/C,IAAA,MAAM,UAAU,EAAC,CAAA;AACjB,IAAA,WAAA,MAAiB,KAAS,IAAA,IAAA,CAAK,qBAAsB,CAAA,IAAA,CAAK,MAAM,CAAG,EAAA;AACjE,MAAA,OAAA,CAAQ,KAAK,KAAK,CAAA,CAAA;AAAA,KACpB;AACA,IAAO,OAAA,OAAA,CAAA;AAAA,GACT;AAAA,EAEA,OAAe,qBAAA,CACb,SACA,EAAA,QAAA,GAAqB,EACc,EAAA;AACnC,IAAiB,WAAA,MAAA,MAAA,IAAU,SAAU,CAAA,MAAA,EAAU,EAAA;AAC7C,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AA,CAAS,MAAM,IAAI,CAAA,CAAA;AACzB,IAAA,MAAM,SAAS,KAAM,EAAA,CAAA;AAAA,GACvB;AACF,CAAA;AAGO,MAAM,mBAAoB,CAAA;AAAA,EAC/B,OAAO,WAAuB,GAAA;AAC5B,IAAA,OAAO,QAAQ,mBAAmB,CAAA,CAAA;AAAA,GACpC;AAAA,EAEA,OAAO,WAAW,MAAiC,EAAA;AACjD,IAAO,OAAA,IAAI,mBAAmB,MAAM,CAAA,CAAA;AAAA,GACtC;AAAA,EAEA,aAAa,sBAA2D,GAAA;AACtE,IAAA,IAAI,CAAC,mBAAqB,EAAA;AACxB,MAAM,MAAA,IAAI,MAAM,qCAAqC,CAAA,CAAA;AAAA,KACvD;AACA,IAAM,MAAA,MAAA,GAAS,MAAM,mBAAoB,EAAA,CAAA;AACzC,IAAO,OAAA,IAAI,mBAAmB,MAAM,CAAA,CAAA;AAAA,GACtC;AAAA,EAEQ,WAAc,GAAA;AAAA,GAAC;AACzB,CAAA;AAEO,MAAM,kBAAmB,CAAA;AAAA,EAC9B,OAAwB,GAAM,GAAA,sCAAA,CAAA;AAAA,EAE9B,aAAa,YAA6D,GAAA;AACxE,IAAA,MAAM,SAAY,GAAA,MAAM,GAAI,CAAA,kBAAA,CAAmB,GAAG,CAAA,CAAA;AAClD,IAAA,OAAO,SAAU,CAAA,MAAA,CAAA;AAAA,GACnB;AAAA,EAEA,aAAa,aAAa,SAAgD,EAAA;AACxE,IAAO,OAAA,GAAA,CAAI,kBAAmB,CAAA,GAAA,EAAK,SAAS,CAAA,CAAA;AAAA,GAC9C;AACF;;;;"}
1
+ {"version":3,"file":"WebFileSystemAccess.esm.js","sources":["../../../src/lib/filesystem/WebFileSystemAccess.ts"],"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 { TemplateDirectoryAccess, TemplateFileAccess } from './types';\n\ntype WritableFileHandle = FileSystemFileHandle & {\n createWritable(): Promise<{\n write(data: string | Blob | BufferSource): Promise<void>;\n close(): Promise<void>;\n }>;\n};\n\n// A nicer type than the one from the TS lib\nexport interface IterableDirectoryHandle extends FileSystemDirectoryHandle {\n values(): AsyncIterable<\n | ({ kind: 'file' } & WritableFileHandle)\n | ({ kind: 'directory' } & IterableDirectoryHandle)\n >;\n}\n\nconst showDirectoryPicker = (window as any).showDirectoryPicker as\n | (() => Promise<IterableDirectoryHandle>)\n | undefined;\n\nclass WebFileAccess implements TemplateFileAccess {\n constructor(\n readonly path: string,\n private readonly handle: WritableFileHandle,\n ) {}\n\n file(): Promise<File> {\n return this.handle.getFile();\n }\n\n async save(data: string | Blob | BufferSource): Promise<void> {\n const writable = await this.handle.createWritable();\n await writable.write(data);\n await writable.close();\n }\n}\n\n/** @internal */\nexport class WebDirectoryAccess implements TemplateDirectoryAccess {\n constructor(private readonly handle: IterableDirectoryHandle) {}\n\n async listFiles(): Promise<TemplateFileAccess[]> {\n const content = [];\n for await (const entry of this.listDirectoryContents(this.handle)) {\n content.push(entry);\n }\n return content;\n }\n\n private async *listDirectoryContents(\n dirHandle: IterableDirectoryHandle,\n basePath: string[] = [],\n ): AsyncIterable<TemplateFileAccess> {\n for await (const handle of dirHandle.values()) {\n if (handle.kind === 'file') {\n yield new WebFileAccess([...basePath, handle.name].join('/'), handle);\n } else if (handle.kind === 'directory') {\n // Skip git storage directory\n if (handle.name === '.git') {\n continue;\n }\n yield* this.listDirectoryContents(handle, [...basePath, handle.name]);\n }\n }\n }\n\n async createFile(options: { name: string; data: string }): Promise<void> {\n const { name, data } = options;\n let file: FileSystemFileHandle;\n\n // Current create template does not require support for nested directories\n if (name.includes('/')) {\n const [dir, path] = name.split('/');\n const handle = await this.handle.getDirectoryHandle(dir, {\n create: true,\n });\n file = await handle.getFileHandle(path, { create: true });\n } else {\n file = await this.handle.getFileHandle(name, {\n create: true,\n });\n }\n const writable = await file.createWritable();\n await writable.write(data);\n await writable.close();\n }\n}\n\n/** @internal */\nexport class WebFileSystemAccess {\n static isSupported(): boolean {\n return Boolean(showDirectoryPicker);\n }\n\n static fromHandle(handle: IterableDirectoryHandle) {\n return new WebDirectoryAccess(handle);\n }\n\n static async requestDirectoryAccess(): Promise<TemplateDirectoryAccess> {\n if (!showDirectoryPicker) {\n throw new Error('File system access is not supported');\n }\n const handle = await showDirectoryPicker();\n return new WebDirectoryAccess(handle);\n }\n\n private constructor() {}\n}\n"],"names":[],"mappings":"AAiCA,MAAM,sBAAuB,MAAe,CAAA,mBAAA,CAAA;AAI5C,MAAM,aAA4C,CAAA;AAAA,EAChD,WAAA,CACW,MACQ,MACjB,EAAA;AAFS,IAAA,IAAA,CAAA,IAAA,GAAA,IAAA,CAAA;AACQ,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA,CAAA;AAAA,GAChB;AAAA,EAEH,IAAsB,GAAA;AACpB,IAAO,OAAA,IAAA,CAAK,OAAO,OAAQ,EAAA,CAAA;AAAA,GAC7B;AAAA,EAEA,MAAM,KAAK,IAAmD,EAAA;AAC5D,IAAA,MAAM,QAAW,GAAA,MAAM,IAAK,CAAA,MAAA,CAAO,cAAe,EAAA,CAAA;AAClD,IAAM,MAAA,QAAA,CAAS,MAAM,IAAI,CAAA,CAAA;AACzB,IAAA,MAAM,SAAS,KAAM,EAAA,CAAA;AAAA,GACvB;AACF,CAAA;AAGO,MAAM,kBAAsD,CAAA;AAAA,EACjE,YAA6B,MAAiC,EAAA;AAAjC,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA,CAAA;AAAA,GAAkC;AAAA,EAE/D,MAAM,SAA2C,GAAA;AAC/C,IAAA,MAAM,UAAU,EAAC,CAAA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A,IAAA,GAAO,MAAM,MAAO,CAAA,aAAA,CAAc,MAAM,EAAE,MAAA,EAAQ,MAAM,CAAA,CAAA;AAAA,KACnD,MAAA;AACL,MAAA,IAAA,GAAO,MAAM,IAAA,CAAK,MAAO,CAAA,aAAA,CAAc,IAAM,EAAA;AAAA,QAC3C,MAAQ,EAAA,IAAA;AAAA,OACT,CAAA,CAAA;AAAA,KACH;AACA,IAAM,MAAA,QAAA,GAAW,MAAM,IAAA,CAAK,cAAe,EAAA,CAAA;AAC3C,IAAM,MAAA,QAAA,CAAS,MAAM,IAAI,CAAA,CAAA;AACzB,IAAA,MAAM,SAAS,KAAM,EAAA,CAAA;AAAA,GACvB;AACF,CAAA;AAGO,MAAM,mBAAoB,CAAA;AAAA,EAC/B,OAAO,WAAuB,GAAA;AAC5B,IAAA,OAAO,QAAQ,mBAAmB,CAAA,CAAA;AAAA,GACpC;AAAA,EAEA,OAAO,WAAW,MAAiC,EAAA;AACjD,IAAO,OAAA,IAAI,mBAAmB,MAAM,CAAA,CAAA;AAAA,GACtC;AAAA,EAEA,aAAa,sBAA2D,GAAA;AACtE,IAAA,IAAI,CAAC,mBAAqB,EAAA;AACxB,MAAM,MAAA,IAAI,MAAM,qCAAqC,CAAA,CAAA;AAAA,KACvD;AACA,IAAM,MAAA,MAAA,GAAS,MAAM,mBAAoB,EAAA,CAAA;AACzC,IAAO,OAAA,IAAI,mBAAmB,MAAM,CAAA,CAAA;AAAA,GACtC;AAAA,EAEQ,WAAc,GAAA;AAAA,GAAC;AACzB;;;;"}
@@ -0,0 +1,15 @@
1
+ import { get, set } from 'idb-keyval';
2
+
3
+ class WebFileSystemStore {
4
+ static key = "scalfolder-template-editor-directory";
5
+ static async getDirectory() {
6
+ const directory = await get(WebFileSystemStore.key);
7
+ return directory.handle;
8
+ }
9
+ static async setDirectory(directory) {
10
+ return set(WebFileSystemStore.key, directory);
11
+ }
12
+ }
13
+
14
+ export { WebFileSystemStore };
15
+ //# sourceMappingURL=WebFileSystemStore.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebFileSystemStore.esm.js","sources":["../../../src/lib/filesystem/WebFileSystemStore.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 */\n\nimport { get, set } from 'idb-keyval';\nimport { TemplateDirectoryAccess } from './types';\nimport { IterableDirectoryHandle } from './WebFileSystemAccess';\n\nexport class WebFileSystemStore {\n private static readonly key = 'scalfolder-template-editor-directory';\n\n static async getDirectory(): Promise<IterableDirectoryHandle | undefined> {\n const directory = await get(WebFileSystemStore.key);\n return directory.handle;\n }\n\n static async setDirectory(directory: TemplateDirectoryAccess | undefined) {\n return set(WebFileSystemStore.key, directory);\n }\n}\n"],"names":[],"mappings":";;AAoBO,MAAM,kBAAmB,CAAA;AAAA,EAC9B,OAAwB,GAAM,GAAA,sCAAA,CAAA;AAAA,EAE9B,aAAa,YAA6D,GAAA;AACxE,IAAA,MAAM,SAAY,GAAA,MAAM,GAAI,CAAA,kBAAA,CAAmB,GAAG,CAAA,CAAA;AAClD,IAAA,OAAO,SAAU,CAAA,MAAA,CAAA;AAAA,GACnB;AAAA,EAEA,aAAa,aAAa,SAAgD,EAAA;AACxE,IAAO,OAAA,GAAA,CAAI,kBAAmB,CAAA,GAAA,EAAK,SAAS,CAAA,CAAA;AAAA,GAC9C;AACF;;;;"}
@@ -70,6 +70,7 @@ async function createExampleTemplate(directory) {
70
70
  for (const [name, data] of Object.entries(files)) {
71
71
  await directory.createFile({ name, data });
72
72
  }
73
+ return directory;
73
74
  }
74
75
 
75
76
  export { createExampleTemplate };
@@ -1 +1 @@
1
- {"version":3,"file":"createExampleTemplate.esm.js","sources":["../../../src/lib/filesystem/createExampleTemplate.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 */\n\nimport { TemplateDirectoryAccess } from './types';\n\nconst files = {\n 'template.yaml': `\napiVersion: scaffolder.backstage.io/v1beta3\n# https://backstage.io/docs/features/software-catalog/descriptor-format#kind-template\nkind: Template\nmetadata:\n name: generated-example-template\n title: Scaffolder Example Template\n description: An example template for the scaffolder\nspec:\n owner: user:guest\n type: service\n # These parameters are used to generate the input form in the frontend, and are\n # used to gather input data for the execution of the template.\n parameters:\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\n steps:\n - id: fetch-base\n name: Fetch Base\n action: fetch:template\n input:\n url: ./skeleton\n values:\n name: \\${{parameters.name}}\n owner: \\${{parameters.owner}}\n destination: \\${{ parameters.repoUrl | parseRepoUrl }}`,\n 'skeleton/README.md': `# This service is named \\${{values.name}}!`,\n 'skeleton/catalog-info.yaml': `apiVersion: backstage.io/v1alpha1\nkind: Component\nmetadata:\n name: \\${{values.component_id | dump}}\n {%- if values.description %}\n description: \\${{values.description | dump}}\n {%- endif %}\n annotations:\n github.com/project-slug: \\${{values.destination.owner + \"/\" + values.destination.repo}}\n backstage.io/techdocs-ref: dir:.\nspec:\n type: service\n lifecycle: experimental\n owner: \\${{values.owner | dump}}`,\n};\n\nexport async function createExampleTemplate(\n directory: TemplateDirectoryAccess,\n) {\n for (const [name, data] of Object.entries(files)) {\n await directory.createFile({ name, data });\n }\n}\n"],"names":[],"mappings":"AAkBA,MAAM,KAAQ,GAAA;AAAA,EACZ,eAAiB,EAAA,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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gEAAA,CAAA;AAAA,EAmDjB,oBAAsB,EAAA,CAAA,0CAAA,CAAA;AAAA,EACtB,4BAA8B,EAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kCAAA,CAAA;AAchC,CAAA,CAAA;AAEA,eAAsB,sBACpB,SACA,EAAA;AACA,EAAA,KAAA,MAAW,CAAC,IAAM,EAAA,IAAI,KAAK,MAAO,CAAA,OAAA,CAAQ,KAAK,CAAG,EAAA;AAChD,IAAA,MAAM,SAAU,CAAA,UAAA,CAAW,EAAE,IAAA,EAAM,MAAM,CAAA,CAAA;AAAA,GAC3C;AACF;;;;"}
1
+ {"version":3,"file":"createExampleTemplate.esm.js","sources":["../../../src/lib/filesystem/createExampleTemplate.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 */\n\nimport { TemplateDirectoryAccess } from './types';\n\nconst files = {\n 'template.yaml': `\napiVersion: scaffolder.backstage.io/v1beta3\n# https://backstage.io/docs/features/software-catalog/descriptor-format#kind-template\nkind: Template\nmetadata:\n name: generated-example-template\n title: Scaffolder Example Template\n description: An example template for the scaffolder\nspec:\n owner: user:guest\n type: service\n # These parameters are used to generate the input form in the frontend, and are\n # used to gather input data for the execution of the template.\n parameters:\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\n steps:\n - id: fetch-base\n name: Fetch Base\n action: fetch:template\n input:\n url: ./skeleton\n values:\n name: \\${{parameters.name}}\n owner: \\${{parameters.owner}}\n destination: \\${{ parameters.repoUrl | parseRepoUrl }}`,\n 'skeleton/README.md': `# This service is named \\${{values.name}}!`,\n 'skeleton/catalog-info.yaml': `apiVersion: backstage.io/v1alpha1\nkind: Component\nmetadata:\n name: \\${{values.component_id | dump}}\n {%- if values.description %}\n description: \\${{values.description | dump}}\n {%- endif %}\n annotations:\n github.com/project-slug: \\${{values.destination.owner + \"/\" + values.destination.repo}}\n backstage.io/techdocs-ref: dir:.\nspec:\n type: service\n lifecycle: experimental\n owner: \\${{values.owner | dump}}`,\n};\n\nexport async function createExampleTemplate(\n directory: TemplateDirectoryAccess,\n) {\n for (const [name, data] of Object.entries(files)) {\n await directory.createFile({ name, data });\n }\n return directory;\n}\n"],"names":[],"mappings":"AAkBA,MAAM,KAAQ,GAAA;AAAA,EACZ,eAAiB,EAAA,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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gEAAA,CAAA;AAAA,EAmDjB,oBAAsB,EAAA,CAAA,0CAAA,CAAA;AAAA,EACtB,4BAA8B,EAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kCAAA,CAAA;AAchC,CAAA,CAAA;AAEA,eAAsB,sBACpB,SACA,EAAA;AACA,EAAA,KAAA,MAAW,CAAC,IAAM,EAAA,IAAI,KAAK,MAAO,CAAA,OAAA,CAAQ,KAAK,CAAG,EAAA;AAChD,IAAA,MAAM,SAAU,CAAA,UAAA,CAAW,EAAE,IAAA,EAAM,MAAM,CAAA,CAAA;AAAA,GAC3C;AACA,EAAO,OAAA,SAAA,CAAA;AACT;;;;"}
@@ -12,6 +12,7 @@ const scaffolderTranslationRef = createTranslationRef({
12
12
  title: "No information to display",
13
13
  description: "There are no actions installed or there was an issue communicating with backend."
14
14
  },
15
+ searchFieldPlaceholder: "Search for an action",
15
16
  tableCell: {
16
17
  name: "Name",
17
18
  title: "Title",
@@ -172,12 +173,20 @@ const scaffolderTranslationRef = createTranslationRef({
172
173
  templateTypePicker: {
173
174
  title: "Categories"
174
175
  },
176
+ templateIntroPage: {
177
+ title: "Manage Templates",
178
+ subtitle: "Edit, preview, and try out templates, forms, and custom fields"
179
+ },
175
180
  templateFormPage: {
176
- title: "Template Form Playground",
177
- subtitle: "Edit, preview, and try out templates and template forms"
181
+ title: "Template Editor",
182
+ subtitle: "Edit, preview, and try out templates forms"
183
+ },
184
+ templateCustomFieldPage: {
185
+ title: "Custom Field Explorer",
186
+ subtitle: "Edit, preview, and try out custom fields"
178
187
  },
179
188
  templateEditorPage: {
180
- title: "Manage Templates",
189
+ title: "Template Editor",
181
190
  subtitle: "Edit, preview, and try out templates and template forms",
182
191
  dryRunResults: {
183
192
  title: "Dry-run results"
@@ -229,7 +238,7 @@ const scaffolderTranslationRef = createTranslationRef({
229
238
  unsupportedTooltip: "Only supported in some Chromium-based browsers"
230
239
  },
231
240
  formEditor: {
232
- title: "Template playground",
241
+ title: "Template Form Playground",
233
242
  description: "Preview and edit a template form, either using a sample template or by loading a template from the catalog."
234
243
  },
235
244
  fieldExplorer: {
@@ -239,7 +248,8 @@ const scaffolderTranslationRef = createTranslationRef({
239
248
  },
240
249
  templateEditorTextArea: {
241
250
  saveIconTooltip: "Save file",
242
- refreshIconTooltip: "Reload file"
251
+ refreshIconTooltip: "Reload file",
252
+ emptyStateParagraph: "Please select an action on the file menu."
243
253
  },
244
254
  templateFormPreviewer: {
245
255
  title: "Load Existing Template"
@@ -268,6 +278,31 @@ const scaffolderTranslationRef = createTranslationRef({
268
278
  pageContextMenu: {
269
279
  editConfigurationTitle: "Edit Configuration"
270
280
  }
281
+ },
282
+ templateEditorToolbar: {
283
+ customFieldExplorerTooltip: "Custom Fields Explorer",
284
+ installedActionsDocumentationTooltip: "Installed Actions Documentation",
285
+ addToCatalogButton: "Publish",
286
+ addToCatalogDialogTitle: "Publish changes",
287
+ addToCatalogDialogContent: {
288
+ stepsIntroduction: "Follow the instructions below to create or update a template:",
289
+ stepsListItems: "Save the template files in a local directory\nCreate a pull request to a new or existing git repository\nIf the template already exists, the changes will be reflected in the software catalog once the pull request gets merged\nBut if you are creating a new template, follow the documentation linked below to register the new template repository in software catalog"
290
+ },
291
+ addToCatalogDialogActions: {
292
+ documentationButton: "Go to the documentation",
293
+ documentationUrl: "https://backstage.io/docs/features/software-templates/adding-templates/"
294
+ }
295
+ },
296
+ templateEditorToolbarFileMenu: {
297
+ button: "File",
298
+ options: {
299
+ openDirectory: "Open template directory",
300
+ createDirectory: "Create template directory",
301
+ closeEditor: "Close template editor"
302
+ }
303
+ },
304
+ templateEditorToolbarTemplatesMenu: {
305
+ button: "Templates"
271
306
  }
272
307
  }
273
308
  });
@@ -1 +1 @@
1
- {"version":3,"file":"translation.esm.js","sources":["../src/translation.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 { createTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @alpha */\nexport const scaffolderTranslationRef = createTranslationRef({\n id: 'scaffolder',\n messages: {\n actionsPage: {\n title: 'Installed actions',\n pageTitle: 'Create a New Component',\n subtitle: 'This is the collection of all installed actions',\n content: {\n emptyState: {\n title: 'No information to display',\n description:\n 'There are no actions installed or there was an issue communicating with backend.',\n },\n tableCell: {\n name: 'Name',\n title: 'Title',\n description: 'Description',\n type: 'Type',\n },\n noRowsDescription: 'No schema defined',\n },\n action: {\n input: 'Input',\n output: 'Output',\n examples: 'Examples',\n },\n },\n fields: {\n entityNamePicker: {\n title: 'Name',\n description: 'Unique name of the component',\n },\n entityPicker: {\n title: 'Entity',\n description: 'An entity from the catalog',\n },\n entityTagsPicker: {\n title: 'Tags',\n description:\n \"Add any relevant tags, hit 'Enter' to add new tags. Valid format: [a-z0-9+#] separated by [-], at most 63 characters\",\n },\n myGroupsPicker: {\n title: 'Entity',\n description: 'An entity from the catalog',\n },\n ownedEntityPicker: {\n title: 'Entity',\n description: 'An entity from the catalog',\n },\n ownerPicker: {\n title: 'Owner',\n description: 'The owner of the component',\n },\n azureRepoPicker: {\n organization: {\n title: 'Organization',\n description: 'The Organization that this repo will belong to',\n },\n project: {\n title: 'Project',\n description: 'The Project that this repo will belong to',\n },\n },\n bitbucketRepoPicker: {\n workspaces: {\n title: 'Allowed Workspaces',\n inputTitle: 'Workspaces',\n description: 'The Workspace that this repo will belong to',\n },\n project: {\n title: 'Allowed Projects',\n inputTitle: 'Projects',\n description: 'The Project that this repo will belong to',\n },\n },\n gerritRepoPicker: {\n owner: {\n title: 'Owner',\n description: 'The owner of the project (optional)',\n },\n parent: {\n title: 'Parent',\n description: 'The project parent that the repo will belong to',\n },\n },\n giteaRepoPicker: {\n owner: {\n title: 'Owner Available',\n inputTitle: 'Owner',\n description:\n 'Gitea namespace where this repository will belong to. It can be the name of organization, group, subgroup, user, or the project.',\n },\n },\n githubRepoPicker: {\n owner: {\n title: 'Owner Available',\n inputTitle: 'Owner',\n description:\n 'The organization, user or project that this repo will belong to',\n },\n },\n gitlabRepoPicker: {\n owner: {\n title: 'Owner Available',\n inputTitle: 'Owner',\n description:\n 'GitLab namespace where this repository will belong to. It can be the name of organization, group, subgroup, user, or the project.',\n },\n },\n repoUrlPicker: {\n host: {\n title: 'Host',\n description: 'The host where the repository will be created',\n },\n repository: {\n title: 'Repositories Available',\n inputTitle: 'Repository',\n description: 'The name of the repository',\n },\n },\n },\n listTaskPage: {\n title: 'List template tasks',\n pageTitle: 'Templates Tasks',\n subtitle: 'All tasks that have been started',\n content: {\n emptyState: {\n title: 'No information to display',\n description:\n 'There are no tasks or there was an issue communicating with backend.',\n },\n tableTitle: 'Tasks',\n tableCell: {\n taskID: 'Task ID',\n template: 'Template',\n created: 'Created',\n owner: 'Owner',\n status: 'Status',\n },\n },\n },\n ownerListPicker: {\n title: 'Task Owner',\n options: {\n owned: 'Owned',\n all: 'All',\n },\n },\n ongoingTask: {\n title: 'Run of',\n pageTitle: {\n hasTemplateName: 'Run of {{templateName}}',\n noTemplateName: 'Scaffolder Run',\n },\n subtitle: 'Task {{taskId}}',\n cancelButtonTitle: 'Cancel',\n retryButtonTitle: 'Retry',\n startOverButtonTitle: 'Start Over',\n hideLogsButtonTitle: 'Hide Logs',\n showLogsButtonTitle: 'Show Logs',\n contextMenu: {\n hideLogs: 'Hide Logs',\n showLogs: 'Show Logs',\n hideButtonBar: 'Hide Button Bar',\n retry: 'Retry',\n showButtonBar: 'Show Button Bar',\n startOver: 'Start Over',\n cancel: 'Cancel',\n },\n },\n templateEditorForm: {\n stepper: {\n emptyText: 'There are no spec parameters in the template to preview.',\n },\n },\n templateTypePicker: {\n title: 'Categories',\n },\n templateFormPage: {\n title: 'Template Form Playground',\n subtitle: 'Edit, preview, and try out templates and template forms',\n },\n templateEditorPage: {\n title: 'Manage Templates',\n subtitle: 'Edit, preview, and try out templates and template forms',\n dryRunResults: {\n title: 'Dry-run results',\n },\n dryRunResultsList: {\n title: 'Result {{resultId}}',\n downloadButtonTitle: 'Download as .zip',\n deleteButtonTitle: 'Delete result',\n },\n dryRunResultsView: {\n tab: {\n files: 'Files',\n log: 'Log',\n output: 'Output',\n },\n },\n taskStatusStepper: {\n skippedStepTitle: 'Skipped',\n },\n customFieldExplorer: {\n selectFieldLabel: 'Choose Custom Field Extension',\n fieldForm: {\n title: 'Field Options',\n applyButtonTitle: 'Apply',\n },\n fieldPreview: {\n title: 'Field Preview',\n },\n preview: {\n title: 'Template Spec',\n },\n },\n templateEditorBrowser: {\n closeConfirmMessage: 'Are you sure? Unsaved changes will be lost',\n saveIconTooltip: 'Save all files',\n reloadIconTooltip: 'Reload directory',\n closeIconTooltip: 'Close directory',\n },\n templateEditorIntro: {\n title: 'Get started by choosing one of the options below',\n loadLocal: {\n title: 'Load Template Directory',\n description:\n 'Load a local template directory, allowing you to both edit and try executing your own template.',\n unsupportedTooltip: 'Only supported in some Chromium-based browsers',\n },\n createLocal: {\n title: 'Create New Template',\n description:\n 'Create a local template directory, allowing you to both edit and try executing your own template.',\n unsupportedTooltip: 'Only supported in some Chromium-based browsers',\n },\n formEditor: {\n title: 'Template playground',\n description:\n 'Preview and edit a template form, either using a sample template or by loading a template from the catalog.',\n },\n fieldExplorer: {\n title: 'Custom Field Explorer',\n description:\n 'View and play around with available installed custom field extensions.',\n },\n },\n templateEditorTextArea: {\n saveIconTooltip: 'Save file',\n refreshIconTooltip: 'Reload file',\n },\n templateFormPreviewer: {\n title: 'Load Existing Template',\n },\n },\n templateListPage: {\n title: 'Create a new component',\n subtitle:\n 'Create new software components using standard templates in your organization',\n pageTitle: 'Create a new component',\n templateGroups: {\n defaultTitle: 'Templates',\n otherTitle: 'Other Templates',\n },\n contentHeader: {\n registerExistingButtonTitle: 'Register Existing Component',\n supportButtonTitle:\n 'Create new software components using standard templates. Different templates create different kinds of components (services, websites, documentation, ...).',\n },\n additionalLinksForEntity: {\n viewTechDocsTitle: 'View TechDocs',\n },\n },\n templateWizardPage: {\n title: 'Create a new component',\n subtitle:\n 'Create new software components using standard templates in your organization',\n pageTitle: 'Create a new component',\n pageContextMenu: {\n editConfigurationTitle: 'Edit Configuration',\n },\n },\n },\n});\n"],"names":[],"mappings":";;AAkBO,MAAM,2BAA2B,oBAAqB,CAAA;AAAA,EAC3D,EAAI,EAAA,YAAA;AAAA,EACJ,QAAU,EAAA;AAAA,IACR,WAAa,EAAA;AAAA,MACX,KAAO,EAAA,mBAAA;AAAA,MACP,SAAW,EAAA,wBAAA;AAAA,MACX,QAAU,EAAA,iDAAA;AAAA,MACV,OAAS,EAAA;AAAA,QACP,UAAY,EAAA;AAAA,UACV,KAAO,EAAA,2BAAA;AAAA,UACP,WACE,EAAA,kFAAA;AAAA,SACJ;AAAA,QACA,SAAW,EAAA;AAAA,UACT,IAAM,EAAA,MAAA;AAAA,UACN,KAAO,EAAA,OAAA;AAAA,UACP,WAAa,EAAA,aAAA;AAAA,UACb,IAAM,EAAA,MAAA;AAAA,SACR;AAAA,QACA,iBAAmB,EAAA,mBAAA;AAAA,OACrB;AAAA,MACA,MAAQ,EAAA;AAAA,Q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ACtB;AAAA,QACA,UAAY,EAAA;AAAA,UACV,KAAO,EAAA,qBAAA;AAAA,UACP,WACE,EAAA,6GAAA;AAAA,SACJ;AAAA,QACA,aAAe,EAAA;AAAA,UACb,KAAO,EAAA,uBAAA;AAAA,UACP,WACE,EAAA,wEAAA;AAAA,SACJ;AAAA,OACF;AAAA,MACA,sBAAwB,EAAA;AAAA,QACtB,eAAiB,EAAA,WAAA;AAAA,QACjB,kBAAoB,EAAA,aAAA;AAAA,OACtB;AAAA,MACA,qBAAuB,EAAA;AAAA,QACrB,KAAO,EAAA,wBAAA;AAAA,OACT;AAAA,KACF;AAAA,IACA,gBAAkB,EAAA;AAAA,MAChB,KAAO,EAAA,wBAAA;AAAA,MACP,QACE,EAAA,8EAAA;AAAA,MACF,SAAW,EAAA,wBAAA;AAAA,MACX,cAAgB,EAAA;AAAA,QACd,YAAc,EAAA,WAAA;AAAA,QACd,UAAY,EAAA,iBAAA;AAAA,OACd;AAAA,MACA,aAAe,EAAA;AAAA,QACb,2BAA6B,EAAA,6BAAA;AAAA,QAC7B,kBACE,EAAA,6JAAA;AAAA,OACJ;AAAA,MACA,wBAA0B,EAAA;AAAA,QACxB,iBAAmB,EAAA,eAAA;AAAA,OACrB;AAAA,KACF;AAAA,IACA,kBAAoB,EAAA;AAAA,MAClB,KAAO,EAAA,wBAAA;AAAA,MACP,QACE,EAAA,8EAAA;AAAA,MACF,SAAW,EAAA,wBAAA;AAAA,MACX,eAAiB,EAAA;AAAA,QACf,sBAAwB,EAAA,oBAAA;AAAA,OAC1B;AAAA,KACF;AAAA,GACF;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"translation.esm.js","sources":["../src/translation.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 { createTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @alpha */\nexport const scaffolderTranslationRef = createTranslationRef({\n id: 'scaffolder',\n messages: {\n actionsPage: {\n title: 'Installed actions',\n pageTitle: 'Create a New Component',\n subtitle: 'This is the collection of all installed actions',\n content: {\n emptyState: {\n title: 'No information to display',\n description:\n 'There are no actions installed or there was an issue communicating with backend.',\n },\n searchFieldPlaceholder: 'Search for an action',\n tableCell: {\n name: 'Name',\n title: 'Title',\n description: 'Description',\n type: 'Type',\n },\n noRowsDescription: 'No schema defined',\n },\n action: {\n input: 'Input',\n output: 'Output',\n examples: 'Examples',\n },\n },\n fields: {\n entityNamePicker: {\n title: 'Name',\n description: 'Unique name of the component',\n },\n entityPicker: {\n title: 'Entity',\n description: 'An entity from the catalog',\n },\n entityTagsPicker: {\n title: 'Tags',\n description:\n \"Add any relevant tags, hit 'Enter' to add new tags. Valid format: [a-z0-9+#] separated by [-], at most 63 characters\",\n },\n myGroupsPicker: {\n title: 'Entity',\n description: 'An entity from the catalog',\n },\n ownedEntityPicker: {\n title: 'Entity',\n description: 'An entity from the catalog',\n },\n ownerPicker: {\n title: 'Owner',\n description: 'The owner of the component',\n },\n azureRepoPicker: {\n organization: {\n title: 'Organization',\n description: 'The Organization that this repo will belong to',\n },\n project: {\n title: 'Project',\n description: 'The Project that this repo will belong to',\n },\n },\n bitbucketRepoPicker: {\n workspaces: {\n title: 'Allowed Workspaces',\n inputTitle: 'Workspaces',\n description: 'The Workspace that this repo will belong to',\n },\n project: {\n title: 'Allowed Projects',\n inputTitle: 'Projects',\n description: 'The Project that this repo will belong to',\n },\n },\n gerritRepoPicker: {\n owner: {\n title: 'Owner',\n description: 'The owner of the project (optional)',\n },\n parent: {\n title: 'Parent',\n description: 'The project parent that the repo will belong to',\n },\n },\n giteaRepoPicker: {\n owner: {\n title: 'Owner Available',\n inputTitle: 'Owner',\n description:\n 'Gitea namespace where this repository will belong to. It can be the name of organization, group, subgroup, user, or the project.',\n },\n },\n githubRepoPicker: {\n owner: {\n title: 'Owner Available',\n inputTitle: 'Owner',\n description:\n 'The organization, user or project that this repo will belong to',\n },\n },\n gitlabRepoPicker: {\n owner: {\n title: 'Owner Available',\n inputTitle: 'Owner',\n description:\n 'GitLab namespace where this repository will belong to. It can be the name of organization, group, subgroup, user, or the project.',\n },\n },\n repoUrlPicker: {\n host: {\n title: 'Host',\n description: 'The host where the repository will be created',\n },\n repository: {\n title: 'Repositories Available',\n inputTitle: 'Repository',\n description: 'The name of the repository',\n },\n },\n },\n listTaskPage: {\n title: 'List template tasks',\n pageTitle: 'Templates Tasks',\n subtitle: 'All tasks that have been started',\n content: {\n emptyState: {\n title: 'No information to display',\n description:\n 'There are no tasks or there was an issue communicating with backend.',\n },\n tableTitle: 'Tasks',\n tableCell: {\n taskID: 'Task ID',\n template: 'Template',\n created: 'Created',\n owner: 'Owner',\n status: 'Status',\n },\n },\n },\n ownerListPicker: {\n title: 'Task Owner',\n options: {\n owned: 'Owned',\n all: 'All',\n },\n },\n ongoingTask: {\n title: 'Run of',\n pageTitle: {\n hasTemplateName: 'Run of {{templateName}}',\n noTemplateName: 'Scaffolder Run',\n },\n subtitle: 'Task {{taskId}}',\n cancelButtonTitle: 'Cancel',\n retryButtonTitle: 'Retry',\n startOverButtonTitle: 'Start Over',\n hideLogsButtonTitle: 'Hide Logs',\n showLogsButtonTitle: 'Show Logs',\n contextMenu: {\n hideLogs: 'Hide Logs',\n showLogs: 'Show Logs',\n hideButtonBar: 'Hide Button Bar',\n retry: 'Retry',\n showButtonBar: 'Show Button Bar',\n startOver: 'Start Over',\n cancel: 'Cancel',\n },\n },\n templateEditorForm: {\n stepper: {\n emptyText: 'There are no spec parameters in the template to preview.',\n },\n },\n templateTypePicker: {\n title: 'Categories',\n },\n templateIntroPage: {\n title: 'Manage Templates',\n subtitle:\n 'Edit, preview, and try out templates, forms, and custom fields',\n },\n templateFormPage: {\n title: 'Template Editor',\n subtitle: 'Edit, preview, and try out templates forms',\n },\n templateCustomFieldPage: {\n title: 'Custom Field Explorer',\n subtitle: 'Edit, preview, and try out custom fields',\n },\n templateEditorPage: {\n title: 'Template Editor',\n subtitle: 'Edit, preview, and try out templates and template forms',\n dryRunResults: {\n title: 'Dry-run results',\n },\n dryRunResultsList: {\n title: 'Result {{resultId}}',\n downloadButtonTitle: 'Download as .zip',\n deleteButtonTitle: 'Delete result',\n },\n dryRunResultsView: {\n tab: {\n files: 'Files',\n log: 'Log',\n output: 'Output',\n },\n },\n taskStatusStepper: {\n skippedStepTitle: 'Skipped',\n },\n customFieldExplorer: {\n selectFieldLabel: 'Choose Custom Field Extension',\n fieldForm: {\n title: 'Field Options',\n applyButtonTitle: 'Apply',\n },\n fieldPreview: {\n title: 'Field Preview',\n },\n preview: {\n title: 'Template Spec',\n },\n },\n templateEditorBrowser: {\n closeConfirmMessage: 'Are you sure? Unsaved changes will be lost',\n saveIconTooltip: 'Save all files',\n reloadIconTooltip: 'Reload directory',\n closeIconTooltip: 'Close directory',\n },\n templateEditorIntro: {\n title: 'Get started by choosing one of the options below',\n loadLocal: {\n title: 'Load Template Directory',\n description:\n 'Load a local template directory, allowing you to both edit and try executing your own template.',\n unsupportedTooltip: 'Only supported in some Chromium-based browsers',\n },\n createLocal: {\n title: 'Create New Template',\n description:\n 'Create a local template directory, allowing you to both edit and try executing your own template.',\n unsupportedTooltip: 'Only supported in some Chromium-based browsers',\n },\n formEditor: {\n title: 'Template Form Playground',\n description:\n 'Preview and edit a template form, either using a sample template or by loading a template from the catalog.',\n },\n fieldExplorer: {\n title: 'Custom Field Explorer',\n description:\n 'View and play around with available installed custom field extensions.',\n },\n },\n templateEditorTextArea: {\n saveIconTooltip: 'Save file',\n refreshIconTooltip: 'Reload file',\n emptyStateParagraph: 'Please select an action on the file menu.',\n },\n templateFormPreviewer: {\n title: 'Load Existing Template',\n },\n },\n templateListPage: {\n title: 'Create a new component',\n subtitle:\n 'Create new software components using standard templates in your organization',\n pageTitle: 'Create a new component',\n templateGroups: {\n defaultTitle: 'Templates',\n otherTitle: 'Other Templates',\n },\n contentHeader: {\n registerExistingButtonTitle: 'Register Existing Component',\n supportButtonTitle:\n 'Create new software components using standard templates. Different templates create different kinds of components (services, websites, documentation, ...).',\n },\n additionalLinksForEntity: {\n viewTechDocsTitle: 'View TechDocs',\n },\n },\n templateWizardPage: {\n title: 'Create a new component',\n subtitle:\n 'Create new software components using standard templates in your organization',\n pageTitle: 'Create a new component',\n pageContextMenu: {\n editConfigurationTitle: 'Edit Configuration',\n },\n },\n templateEditorToolbar: {\n customFieldExplorerTooltip: 'Custom Fields Explorer',\n installedActionsDocumentationTooltip: 'Installed Actions Documentation',\n addToCatalogButton: 'Publish',\n addToCatalogDialogTitle: 'Publish changes',\n addToCatalogDialogContent: {\n stepsIntroduction:\n 'Follow the instructions below to create or update a template:',\n stepsListItems:\n 'Save the template files in a local directory\\nCreate a pull request to a new or existing git repository\\nIf the template already exists, the changes will be reflected in the software catalog once the pull request gets merged\\nBut if you are creating a new template, follow the documentation linked below to register the new template repository in software catalog',\n },\n addToCatalogDialogActions: {\n documentationButton: 'Go to the documentation',\n documentationUrl:\n 'https://backstage.io/docs/features/software-templates/adding-templates/',\n },\n },\n templateEditorToolbarFileMenu: {\n button: 'File',\n options: {\n openDirectory: 'Open template directory',\n createDirectory: 'Create template directory',\n closeEditor: 'Close template editor',\n },\n },\n templateEditorToolbarTemplatesMenu: {\n button: 'Templates',\n },\n },\n});\n"],"names":[],"mappings":";;AAkBO,MAAM,2BAA2B,oBAAqB,CAAA;AAAA,EAC3D,EAAI,EAAA,YAAA;AAAA,EACJ,QAAU,EAAA;AAAA,IACR,WAAa,EAAA;AAAA,MACX,KAAO,EAAA,mBAAA;AAAA,MACP,SAAW,EAAA,wBAAA;AAAA,MACX,QAAU,EAAA,iDAAA;AAAA,MACV,OAA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BAAA;AAAA,QAC7B,kBACE,EAAA,6JAAA;AAAA,OACJ;AAAA,MACA,wBAA0B,EAAA;AAAA,QACxB,iBAAmB,EAAA,eAAA;AAAA,OACrB;AAAA,KACF;AAAA,IACA,kBAAoB,EAAA;AAAA,MAClB,KAAO,EAAA,wBAAA;AAAA,MACP,QACE,EAAA,8EAAA;AAAA,MACF,SAAW,EAAA,wBAAA;AAAA,MACX,eAAiB,EAAA;AAAA,QACf,sBAAwB,EAAA,oBAAA;AAAA,OAC1B;AAAA,KACF;AAAA,IACA,qBAAuB,EAAA;AAAA,MACrB,0BAA4B,EAAA,wBAAA;AAAA,MAC5B,oCAAsC,EAAA,iCAAA;AAAA,MACtC,kBAAoB,EAAA,SAAA;AAAA,MACpB,uBAAyB,EAAA,iBAAA;AAAA,MACzB,yBAA2B,EAAA;AAAA,QACzB,iBACE,EAAA,+DAAA;AAAA,QACF,cACE,EAAA,6WAAA;AAAA,OACJ;AAAA,MACA,yBAA2B,EAAA;AAAA,QACzB,mBAAqB,EAAA,yBAAA;AAAA,QACrB,gBACE,EAAA,yEAAA;AAAA,OACJ;AAAA,KACF;AAAA,IACA,6BAA+B,EAAA;AAAA,MAC7B,MAAQ,EAAA,MAAA;AAAA,MACR,OAAS,EAAA;AAAA,QACP,aAAe,EAAA,yBAAA;AAAA,QACf,eAAiB,EAAA,2BAAA;AAAA,QACjB,WAAa,EAAA,uBAAA;AAAA,OACf;AAAA,KACF;AAAA,IACA,kCAAoC,EAAA;AAAA,MAClC,MAAQ,EAAA,WAAA;AAAA,KACV;AAAA,GACF;AACF,CAAC;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-scaffolder",
3
- "version": "1.26.0-next.1",
3
+ "version": "1.26.0-next.2",
4
4
  "description": "The Backstage plugin that helps you create new things",
5
5
  "backstage": {
6
6
  "role": "frontend-plugin",
@@ -58,20 +58,20 @@
58
58
  "test": "backstage-cli package test"
59
59
  },
60
60
  "dependencies": {
61
- "@backstage/catalog-client": "1.7.0",
61
+ "@backstage/catalog-client": "1.7.1-next.0",
62
62
  "@backstage/catalog-model": "1.7.0",
63
- "@backstage/core-compat-api": "0.3.1-next.1",
64
- "@backstage/core-components": "0.15.1-next.1",
63
+ "@backstage/core-compat-api": "0.3.1-next.2",
64
+ "@backstage/core-components": "0.15.1-next.2",
65
65
  "@backstage/core-plugin-api": "1.10.0-next.1",
66
66
  "@backstage/errors": "1.2.4",
67
- "@backstage/frontend-plugin-api": "0.9.0-next.1",
68
- "@backstage/integration": "1.15.1-next.0",
69
- "@backstage/integration-react": "1.2.0-next.1",
67
+ "@backstage/frontend-plugin-api": "0.9.0-next.2",
68
+ "@backstage/integration": "1.15.1-next.1",
69
+ "@backstage/integration-react": "1.2.0-next.2",
70
70
  "@backstage/plugin-catalog-common": "1.1.0",
71
- "@backstage/plugin-catalog-react": "1.14.0-next.1",
71
+ "@backstage/plugin-catalog-react": "1.14.0-next.2",
72
72
  "@backstage/plugin-permission-react": "0.4.27-next.1",
73
73
  "@backstage/plugin-scaffolder-common": "1.5.6",
74
- "@backstage/plugin-scaffolder-react": "1.13.0-next.1",
74
+ "@backstage/plugin-scaffolder-react": "1.13.0-next.2",
75
75
  "@backstage/types": "1.1.1",
76
76
  "@codemirror/language": "^6.0.0",
77
77
  "@codemirror/legacy-modes": "^6.1.0",
@@ -87,7 +87,7 @@
87
87
  "@rjsf/validator-ajv8": "5.21.1",
88
88
  "@uiw/react-codemirror": "^4.9.3",
89
89
  "classnames": "^2.2.6",
90
- "git-url-parse": "^14.0.0",
90
+ "git-url-parse": "^15.0.0",
91
91
  "humanize-duration": "^3.25.1",
92
92
  "idb-keyval": "5.0.2",
93
93
  "json-schema": "^0.4.0",
@@ -105,12 +105,12 @@
105
105
  "zod-to-json-schema": "^3.20.4"
106
106
  },
107
107
  "devDependencies": {
108
- "@backstage/cli": "0.28.0-next.1",
108
+ "@backstage/cli": "0.28.0-next.2",
109
109
  "@backstage/core-app-api": "1.15.1-next.1",
110
- "@backstage/dev-utils": "1.1.2-next.1",
111
- "@backstage/plugin-catalog": "1.24.0-next.1",
110
+ "@backstage/dev-utils": "1.1.2-next.2",
111
+ "@backstage/plugin-catalog": "1.24.0-next.2",
112
112
  "@backstage/plugin-permission-common": "0.8.1",
113
- "@backstage/test-utils": "1.6.1-next.1",
113
+ "@backstage/test-utils": "1.6.1-next.2",
114
114
  "@testing-library/dom": "^10.0.0",
115
115
  "@testing-library/jest-dom": "^6.0.0",
116
116
  "@testing-library/react": "^16.0.0",
@@ -1,52 +0,0 @@
1
- import React, { useCallback } from 'react';
2
- import useAsyncRetry from 'react-use/esm/useAsyncRetry';
3
- import { Page, Header, Content, Progress } from '@backstage/core-components';
4
- import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
5
- import { scaffolderTranslationRef } from '../../../translation.esm.js';
6
- import { WebFileSystemStore, WebFileSystemAccess } from '../../../lib/filesystem/WebFileSystemAccess.esm.js';
7
- import { TemplateEditor } from './TemplateEditor.esm.js';
8
- import { makeStyles } from '@material-ui/core/styles';
9
-
10
- const useStyles = makeStyles(
11
- {
12
- content: {
13
- padding: 0
14
- }
15
- },
16
- { name: "ScaffolderTemplateEditorToolbar" }
17
- );
18
- function TemplatePage(props) {
19
- const classes = useStyles();
20
- const { t } = useTranslationRef(scaffolderTranslationRef);
21
- const { value, loading, retry } = useAsyncRetry(async () => {
22
- const directory = await WebFileSystemStore.getDirectory();
23
- if (!directory) return void 0;
24
- return WebFileSystemAccess.fromHandle(directory);
25
- }, []);
26
- const handleLoadDirectory = useCallback(() => {
27
- WebFileSystemAccess.requestDirectoryAccess().then(WebFileSystemStore.setDirectory).then(retry);
28
- }, [retry]);
29
- const handleCloseDirectory = useCallback(() => {
30
- WebFileSystemStore.setDirectory(void 0).then(retry);
31
- }, [retry]);
32
- return /* @__PURE__ */ React.createElement(Page, { themeId: "home" }, /* @__PURE__ */ React.createElement(
33
- Header,
34
- {
35
- title: t("templateEditorPage.title"),
36
- subtitle: t("templateEditorPage.subtitle")
37
- }
38
- ), /* @__PURE__ */ React.createElement(Content, { className: classes.content }, loading ? /* @__PURE__ */ React.createElement(Progress, null) : /* @__PURE__ */ React.createElement(
39
- TemplateEditor,
40
- {
41
- directory: value,
42
- layouts: props.layouts,
43
- formProps: props.formProps,
44
- fieldExtensions: props.fieldExtensions,
45
- onClose: handleCloseDirectory,
46
- onLoad: handleLoadDirectory
47
- }
48
- )));
49
- }
50
-
51
- export { TemplatePage };
52
- //# sourceMappingURL=TemplatePage.esm.js.map