@backstage/plugin-catalog-import 0.13.1-next.0 → 0.13.1-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -0
- package/dist/alpha.d.ts +3 -0
- package/dist/components/ImportInfoCard/ImportInfoCard.esm.js +8 -15
- package/dist/components/ImportInfoCard/ImportInfoCard.esm.js.map +1 -1
- package/dist/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.esm.js +4 -8
- package/dist/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.esm.js.map +1 -1
- package/dist/package.json.esm.js +1 -1
- package/dist/translation.esm.js +4 -1
- package/dist/translation.esm.js.map +1 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
# @backstage/plugin-catalog-import
|
|
2
2
|
|
|
3
|
+
## 0.13.1-next.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5d7c539: Catalog import plugin full support i18n
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/core-components@0.17.3-next.0
|
|
10
|
+
- @backstage/plugin-catalog-react@1.19.0-next.2
|
|
11
|
+
- @backstage/frontend-plugin-api@0.10.3-next.1
|
|
12
|
+
- @backstage/integration-react@1.2.7
|
|
13
|
+
- @backstage/catalog-client@1.10.1-next.0
|
|
14
|
+
- @backstage/catalog-model@1.7.4
|
|
15
|
+
- @backstage/config@1.3.2
|
|
16
|
+
- @backstage/core-compat-api@0.4.3-next.2
|
|
17
|
+
- @backstage/core-plugin-api@1.10.7
|
|
18
|
+
- @backstage/errors@1.2.7
|
|
19
|
+
- @backstage/integration@1.17.0
|
|
20
|
+
- @backstage/plugin-catalog-common@1.1.4
|
|
21
|
+
|
|
22
|
+
## 0.13.1-next.1
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- Updated dependencies
|
|
27
|
+
- @backstage/catalog-client@1.10.1-next.0
|
|
28
|
+
- @backstage/plugin-catalog-react@1.18.1-next.1
|
|
29
|
+
- @backstage/catalog-model@1.7.4
|
|
30
|
+
- @backstage/config@1.3.2
|
|
31
|
+
- @backstage/core-compat-api@0.4.3-next.1
|
|
32
|
+
- @backstage/core-components@0.17.2
|
|
33
|
+
- @backstage/core-plugin-api@1.10.7
|
|
34
|
+
- @backstage/errors@1.2.7
|
|
35
|
+
- @backstage/frontend-plugin-api@0.10.3-next.0
|
|
36
|
+
- @backstage/integration@1.17.0
|
|
37
|
+
- @backstage/integration-react@1.2.7
|
|
38
|
+
- @backstage/plugin-catalog-common@1.1.4
|
|
39
|
+
|
|
3
40
|
## 0.13.1-next.0
|
|
4
41
|
|
|
5
42
|
### Patch Changes
|
package/dist/alpha.d.ts
CHANGED
|
@@ -15,6 +15,8 @@ declare const catalogImportTranslationRef: _backstage_core_plugin_api_alpha.Tran
|
|
|
15
15
|
readonly "importInfoCard.fileLinkTitle": "Link to an existing entity file";
|
|
16
16
|
readonly "importInfoCard.examplePrefix": "Example: ";
|
|
17
17
|
readonly "importInfoCard.fileLinkDescription": "The wizard analyzes the file, previews the entities, and adds them to the {{appTitle}} catalog.";
|
|
18
|
+
readonly "importInfoCard.exampleDescription": "The wizard discovers all {{catalogFilename}} files in the repository, previews the entities, and adds them to the {{appTitle}} catalog.";
|
|
19
|
+
readonly "importInfoCard.preparePullRequestDescription": "If no entities are found, the wizard will prepare a Pull Request that adds an example {{catalogFilename}} and prepares the {{appTitle}} catalog to load all entities as soon as the Pull Request is merged.";
|
|
18
20
|
readonly "importInfoCard.githubIntegration.label": "GitHub only";
|
|
19
21
|
readonly "importInfoCard.githubIntegration.title": "Link to a repository";
|
|
20
22
|
readonly "importStepper.finish.title": "Finish";
|
|
@@ -54,6 +56,7 @@ declare const catalogImportTranslationRef: _backstage_core_plugin_api_alpha.Tran
|
|
|
54
56
|
readonly "stepInitAnalyzeUrl.error.locations": "There are no entities at this location";
|
|
55
57
|
readonly "stepInitAnalyzeUrl.urlHelperText": "Enter the full path to your entity file to start tracking your component";
|
|
56
58
|
readonly "stepInitAnalyzeUrl.nextButtonText": "Analyze";
|
|
59
|
+
readonly "stepPrepareCreatePullRequest.description": "You entered a link to a {{integrationType}} repository but a {{catalogFilename}} could not be found. Use this form to open a Pull Request that creates one.";
|
|
57
60
|
readonly "stepPrepareCreatePullRequest.nextButtonText": "Create PR";
|
|
58
61
|
readonly "stepPrepareCreatePullRequest.previewPr.title": "Preview Pull Request";
|
|
59
62
|
readonly "stepPrepareCreatePullRequest.previewPr.subheader": "Create a new Pull Request";
|
|
@@ -57,21 +57,14 @@ const ImportInfoCard = (props) => {
|
|
|
57
57
|
t("importInfoCard.examplePrefix"),
|
|
58
58
|
/* @__PURE__ */ jsx("code", { children: exampleRepositoryUrl })
|
|
59
59
|
] }),
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
catalogImportApi.preparePullRequest && /* @__PURE__ */ jsxs(Typography, { variant: "body2", paragraph: true, children: [
|
|
69
|
-
"If no entities are found, the wizard will prepare a Pull Request that adds an example ",
|
|
70
|
-
/* @__PURE__ */ jsx("code", { children: catalogFilename }),
|
|
71
|
-
" and prepares the ",
|
|
72
|
-
appTitle,
|
|
73
|
-
" catalog to load all entities as soon as the Pull Request is merged."
|
|
74
|
-
] })
|
|
60
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body2", paragraph: true, children: t("importInfoCard.exampleDescription", {
|
|
61
|
+
catalogFilename: /* @__PURE__ */ jsx("code", { children: catalogFilename }),
|
|
62
|
+
appTitle
|
|
63
|
+
}) }),
|
|
64
|
+
catalogImportApi.preparePullRequest && /* @__PURE__ */ jsx(Typography, { variant: "body2", paragraph: true, children: t("importInfoCard.preparePullRequestDescription", {
|
|
65
|
+
catalogFilename: /* @__PURE__ */ jsx("code", { children: catalogFilename }),
|
|
66
|
+
appTitle
|
|
67
|
+
}) })
|
|
75
68
|
] })
|
|
76
69
|
]
|
|
77
70
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImportInfoCard.esm.js","sources":["../../../src/components/ImportInfoCard/ImportInfoCard.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { InfoCard } from '@backstage/core-components';\nimport { configApiRef, useApi } from '@backstage/core-plugin-api';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport Chip from '@material-ui/core/Chip';\nimport Typography from '@material-ui/core/Typography';\n\nimport { catalogImportApiRef } from '../../api';\nimport { useCatalogFilename } from '../../hooks';\nimport { catalogImportTranslationRef } from '../../translation';\n\n/**\n * Props for {@link ImportInfoCard}.\n *\n * @public\n */\nexport interface ImportInfoCardProps {\n exampleLocationUrl?: string;\n exampleRepositoryUrl?: string;\n}\n\n/**\n * Shows information about the import process.\n *\n * @public\n */\nexport const ImportInfoCard = (props: ImportInfoCardProps) => {\n const {\n exampleLocationUrl = 'https://github.com/backstage/backstage/blob/master/catalog-info.yaml',\n exampleRepositoryUrl = 'https://github.com/backstage/backstage',\n } = props;\n\n const { t } = useTranslationRef(catalogImportTranslationRef);\n const configApi = useApi(configApiRef);\n const appTitle = configApi.getOptionalString('app.title') || 'Backstage';\n const catalogImportApi = useApi(catalogImportApiRef);\n\n const hasGithubIntegration = configApi.has('integrations.github');\n\n const catalogFilename = useCatalogFilename();\n\n return (\n <InfoCard\n title={t('importInfoCard.title')}\n titleTypographyProps={{ component: 'h3' }}\n deepLink={{\n title: t('importInfoCard.deepLinkTitle'),\n link: 'https://backstage.io/docs/features/software-catalog/',\n }}\n >\n <Typography variant=\"body2\" paragraph>\n {t('importInfoCard.linkDescription', { appTitle })}\n </Typography>\n <Typography component=\"h4\" variant=\"h6\">\n {t('importInfoCard.fileLinkTitle')}\n </Typography>\n <Typography variant=\"subtitle2\" color=\"textSecondary\" paragraph>\n {t('importInfoCard.examplePrefix')}\n <code>{exampleLocationUrl}</code>\n </Typography>\n <Typography variant=\"body2\" paragraph>\n {t('importInfoCard.fileLinkDescription', { appTitle })}\n </Typography>\n {hasGithubIntegration && (\n <>\n <Typography component=\"h4\" variant=\"h6\">\n {t('importInfoCard.githubIntegration.title')}\n <Chip\n label={t('importInfoCard.githubIntegration.label')}\n variant=\"outlined\"\n size=\"small\"\n style={{ marginLeft: 8, marginBottom: 0 }}\n />\n </Typography>\n <Typography variant=\"subtitle2\" color=\"textSecondary\" paragraph>\n {t('importInfoCard.examplePrefix')}\n <code>{exampleRepositoryUrl}</code>\n </Typography>\n <Typography variant=\"body2\" paragraph>\n
|
|
1
|
+
{"version":3,"file":"ImportInfoCard.esm.js","sources":["../../../src/components/ImportInfoCard/ImportInfoCard.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { InfoCard } from '@backstage/core-components';\nimport { configApiRef, useApi } from '@backstage/core-plugin-api';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport Chip from '@material-ui/core/Chip';\nimport Typography from '@material-ui/core/Typography';\n\nimport { catalogImportApiRef } from '../../api';\nimport { useCatalogFilename } from '../../hooks';\nimport { catalogImportTranslationRef } from '../../translation';\n\n/**\n * Props for {@link ImportInfoCard}.\n *\n * @public\n */\nexport interface ImportInfoCardProps {\n exampleLocationUrl?: string;\n exampleRepositoryUrl?: string;\n}\n\n/**\n * Shows information about the import process.\n *\n * @public\n */\nexport const ImportInfoCard = (props: ImportInfoCardProps) => {\n const {\n exampleLocationUrl = 'https://github.com/backstage/backstage/blob/master/catalog-info.yaml',\n exampleRepositoryUrl = 'https://github.com/backstage/backstage',\n } = props;\n\n const { t } = useTranslationRef(catalogImportTranslationRef);\n const configApi = useApi(configApiRef);\n const appTitle = configApi.getOptionalString('app.title') || 'Backstage';\n const catalogImportApi = useApi(catalogImportApiRef);\n\n const hasGithubIntegration = configApi.has('integrations.github');\n\n const catalogFilename = useCatalogFilename();\n\n return (\n <InfoCard\n title={t('importInfoCard.title')}\n titleTypographyProps={{ component: 'h3' }}\n deepLink={{\n title: t('importInfoCard.deepLinkTitle'),\n link: 'https://backstage.io/docs/features/software-catalog/',\n }}\n >\n <Typography variant=\"body2\" paragraph>\n {t('importInfoCard.linkDescription', { appTitle })}\n </Typography>\n <Typography component=\"h4\" variant=\"h6\">\n {t('importInfoCard.fileLinkTitle')}\n </Typography>\n <Typography variant=\"subtitle2\" color=\"textSecondary\" paragraph>\n {t('importInfoCard.examplePrefix')}\n <code>{exampleLocationUrl}</code>\n </Typography>\n <Typography variant=\"body2\" paragraph>\n {t('importInfoCard.fileLinkDescription', { appTitle })}\n </Typography>\n {hasGithubIntegration && (\n <>\n <Typography component=\"h4\" variant=\"h6\">\n {t('importInfoCard.githubIntegration.title')}\n <Chip\n label={t('importInfoCard.githubIntegration.label')}\n variant=\"outlined\"\n size=\"small\"\n style={{ marginLeft: 8, marginBottom: 0 }}\n />\n </Typography>\n <Typography variant=\"subtitle2\" color=\"textSecondary\" paragraph>\n {t('importInfoCard.examplePrefix')}\n <code>{exampleRepositoryUrl}</code>\n </Typography>\n <Typography variant=\"body2\" paragraph>\n {t('importInfoCard.exampleDescription', {\n catalogFilename: <code>{catalogFilename}</code>,\n appTitle,\n })}\n </Typography>\n {catalogImportApi.preparePullRequest && (\n <Typography variant=\"body2\" paragraph>\n {t('importInfoCard.preparePullRequestDescription', {\n catalogFilename: <code>{catalogFilename}</code>,\n appTitle,\n })}\n </Typography>\n )}\n </>\n )}\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAyCa,MAAA,cAAA,GAAiB,CAAC,KAA+B,KAAA;AAC5D,EAAM,MAAA;AAAA,IACJ,kBAAqB,GAAA,sEAAA;AAAA,IACrB,oBAAuB,GAAA;AAAA,GACrB,GAAA,KAAA;AAEJ,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,2BAA2B,CAAA;AAC3D,EAAM,MAAA,SAAA,GAAY,OAAO,YAAY,CAAA;AACrC,EAAA,MAAM,QAAW,GAAA,SAAA,CAAU,iBAAkB,CAAA,WAAW,CAAK,IAAA,WAAA;AAC7D,EAAM,MAAA,gBAAA,GAAmB,OAAO,mBAAmB,CAAA;AAEnD,EAAM,MAAA,oBAAA,GAAuB,SAAU,CAAA,GAAA,CAAI,qBAAqB,CAAA;AAEhE,EAAA,MAAM,kBAAkB,kBAAmB,EAAA;AAE3C,EACE,uBAAA,IAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,KAAA,EAAO,EAAE,sBAAsB,CAAA;AAAA,MAC/B,oBAAA,EAAsB,EAAE,SAAA,EAAW,IAAK,EAAA;AAAA,MACxC,QAAU,EAAA;AAAA,QACR,KAAA,EAAO,EAAE,8BAA8B,CAAA;AAAA,QACvC,IAAM,EAAA;AAAA,OACR;AAAA,MAEA,QAAA,EAAA;AAAA,wBAAC,GAAA,CAAA,UAAA,EAAA,EAAW,OAAQ,EAAA,OAAA,EAAQ,SAAS,EAAA,IAAA,EAClC,YAAE,gCAAkC,EAAA,EAAE,QAAS,EAAC,CACnD,EAAA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W,EAAA,EAAA,OAAA,EAAQ,SAAQ,SAAS,EAAA,IAAA,EAClC,YAAE,mCAAqC,EAAA;AAAA,YACtC,eAAA,kBAAkB,GAAA,CAAA,MAAA,EAAA,EAAM,QAAgB,EAAA,eAAA,EAAA,CAAA;AAAA,YACxC;AAAA,WACD,CACH,EAAA,CAAA;AAAA,UACC,gBAAA,CAAiB,sCACf,GAAA,CAAA,UAAA,EAAA,EAAW,SAAQ,OAAQ,EAAA,SAAA,EAAS,IAClC,EAAA,QAAA,EAAA,CAAA,CAAE,8CAAgD,EAAA;AAAA,YACjD,eAAA,kBAAkB,GAAA,CAAA,MAAA,EAAA,EAAM,QAAgB,EAAA,eAAA,EAAA,CAAA;AAAA,YACxC;AAAA,WACD,CACH,EAAA;AAAA,SAEJ,EAAA;AAAA;AAAA;AAAA,GAEJ;AAEJ;;;;"}
|
|
@@ -128,14 +128,10 @@ const StepPrepareCreatePullRequest = (props) => {
|
|
|
128
128
|
]
|
|
129
129
|
);
|
|
130
130
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
" ",
|
|
136
|
-
/* @__PURE__ */ jsx("code", { children: catalogFilename }),
|
|
137
|
-
" could not be found. Use this form to open a Pull Request that creates one."
|
|
138
|
-
] }),
|
|
131
|
+
/* @__PURE__ */ jsx(Typography, { children: t("stepPrepareCreatePullRequest.description", {
|
|
132
|
+
integrationType: analyzeResult.integrationType,
|
|
133
|
+
catalogFilename: /* @__PURE__ */ jsx("code", { children: catalogFilename })
|
|
134
|
+
}) }),
|
|
139
135
|
!prDefaultsLoading && /* @__PURE__ */ jsx(
|
|
140
136
|
PreparePullRequestForm,
|
|
141
137
|
{
|
package/dist/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepPrepareCreatePullRequest.esm.js","sources":["../../../src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Entity } from '@backstage/catalog-model';\nimport { errorApiRef, useApi } from '@backstage/core-plugin-api';\nimport { assertError } from '@backstage/errors';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport {\n catalogApiRef,\n humanizeEntityRef,\n} from '@backstage/plugin-catalog-react';\nimport Box from '@material-ui/core/Box';\nimport FormHelperText from '@material-ui/core/FormHelperText';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { ReactNode, useCallback, useEffect, useState } from 'react';\nimport { NestedValue, UseFormReturn } from 'react-hook-form';\nimport useAsync from 'react-use/esm/useAsync';\nimport YAML from 'yaml';\n\nimport { AnalyzeResult, catalogImportApiRef } from '../../api';\nimport { useCatalogFilename } from '../../hooks';\nimport { catalogImportTranslationRef } from '../../translation';\nimport { PartialEntity } from '../../types';\nimport { BackButton, NextButton } from '../Buttons';\nimport { PrepareResult } from '../useImportState';\nimport { PreparePullRequestForm } from './PreparePullRequestForm';\nimport { PreviewCatalogInfoComponent } from './PreviewCatalogInfoComponent';\nimport { PreviewPullRequestComponent } from './PreviewPullRequestComponent';\n\nconst useStyles = makeStyles(theme => ({\n previewCard: {\n marginTop: theme.spacing(1),\n },\n previewCardContent: {\n paddingTop: 0,\n },\n}));\n\ntype FormData = {\n title: string;\n body: string;\n componentName: string;\n owner: string;\n useCodeowners: boolean;\n};\n\n/**\n * Helper for unpacking NestedValue into the underlying type.\n *\n * @public\n * @deprecated This is a copy of the type from react-hook-form, and will be removed in a future release\n */\nexport type UnpackNestedValue<T> = T extends NestedValue<infer U>\n ? U\n : T extends Date | FileList | File | Blob\n ? T\n : T extends object\n ? {\n [K in keyof T]: UnpackNestedValue<T[K]>;\n }\n : T;\n\n/**\n * Props for {@link StepPrepareCreatePullRequest}.\n *\n * @public\n */\nexport interface StepPrepareCreatePullRequestProps {\n analyzeResult: Extract<AnalyzeResult, { type: 'repository' }>;\n onPrepare: (\n result: PrepareResult,\n opts?: { notRepeatable?: boolean },\n ) => void;\n onGoBack?: () => void;\n\n renderFormFields: (\n props: Pick<\n UseFormReturn<FormData>,\n 'register' | 'setValue' | 'formState'\n > & {\n values: UnpackNestedValue<FormData>;\n groups: string[];\n groupsLoading: boolean;\n },\n ) => ReactNode;\n}\n\nexport function generateEntities(\n entities: PartialEntity[],\n componentName: string,\n owner?: string,\n): Entity[] {\n return entities.map(e => ({\n ...e,\n apiVersion: e.apiVersion!,\n kind: e.kind!,\n metadata: {\n ...e.metadata,\n name: componentName,\n },\n spec: {\n ...e.spec,\n ...(owner ? { owner } : {}),\n },\n }));\n}\n\n/**\n * Prepares a pull request.\n *\n * @public\n */\nexport const StepPrepareCreatePullRequest = (\n props: StepPrepareCreatePullRequestProps,\n) => {\n const { analyzeResult, onPrepare, onGoBack, renderFormFields } = props;\n\n const { t } = useTranslationRef(catalogImportTranslationRef);\n const classes = useStyles();\n const catalogApi = useApi(catalogApiRef);\n const catalogImportApi = useApi(catalogImportApiRef);\n const errorApi = useApi(errorApiRef);\n\n const [submitted, setSubmitted] = useState(false);\n const [error, setError] = useState<string>();\n\n const catalogFilename = useCatalogFilename();\n\n const {\n loading: prDefaultsLoading,\n value: prDefaults,\n error: prDefaultsError,\n } = useAsync(\n () => catalogImportApi.preparePullRequest!(),\n [catalogImportApi.preparePullRequest],\n );\n\n useEffect(() => {\n if (prDefaultsError) {\n errorApi.post(prDefaultsError);\n }\n }, [prDefaultsError, errorApi]);\n\n const { loading: groupsLoading, value: groups } = useAsync(async () => {\n const groupEntities = await catalogApi.getEntities({\n filter: { kind: 'group' },\n });\n\n return groupEntities.items\n .map(e => humanizeEntityRef(e, { defaultKind: 'group' }))\n .sort();\n });\n\n const handleResult = useCallback(\n async (data: FormData) => {\n setSubmitted(true);\n\n try {\n const pr = await catalogImportApi.submitPullRequest({\n repositoryUrl: analyzeResult.url,\n title: data.title,\n body: data.body,\n fileContent: generateEntities(\n analyzeResult.generatedEntities,\n data.componentName,\n data.owner,\n )\n .map(e => YAML.stringify(e))\n .join('---\\n'),\n });\n\n onPrepare(\n {\n type: 'repository',\n url: analyzeResult.url,\n integrationType: analyzeResult.integrationType,\n pullRequest: {\n url: pr.link,\n },\n locations: [\n {\n target: pr.location,\n entities: generateEntities(\n analyzeResult.generatedEntities,\n data.componentName,\n data.owner,\n ).map(e => ({\n kind: e.kind,\n namespace: e.metadata.namespace!,\n name: e.metadata.name,\n })),\n },\n ],\n },\n { notRepeatable: true },\n );\n } catch (e) {\n assertError(e);\n setError(e.message);\n setSubmitted(false);\n }\n },\n [\n analyzeResult.generatedEntities,\n analyzeResult.integrationType,\n analyzeResult.url,\n catalogImportApi,\n onPrepare,\n ],\n );\n\n return (\n <>\n <Typography>\n You entered a link to a {analyzeResult.integrationType} repository but a{' '}\n <code>{catalogFilename}</code> could not be found. Use this form to open\n a Pull Request that creates one.\n </Typography>\n\n {!prDefaultsLoading && (\n <PreparePullRequestForm<FormData>\n onSubmit={handleResult}\n defaultValues={{\n title: prDefaults?.title ?? '',\n body: prDefaults?.body ?? '',\n owner:\n (analyzeResult.generatedEntities[0]?.spec?.owner as string) || '',\n componentName:\n analyzeResult.generatedEntities[0]?.metadata?.name || '',\n useCodeowners: false,\n }}\n render={({ values, formState, register, setValue }) => (\n <>\n {renderFormFields({\n values,\n formState,\n register,\n setValue,\n groups: groups ?? [],\n groupsLoading,\n })}\n\n <Box marginTop={2}>\n <Typography variant=\"h6\">\n {t('stepPrepareCreatePullRequest.previewPr.title')}\n </Typography>\n </Box>\n\n <PreviewPullRequestComponent\n title={values.title}\n description={values.body}\n classes={{\n card: classes.previewCard,\n cardContent: classes.previewCardContent,\n }}\n />\n\n <Box marginTop={2} marginBottom={1}>\n <Typography variant=\"h6\">\n {t('stepPrepareCreatePullRequest.previewCatalogInfo.title')}\n </Typography>\n </Box>\n\n <PreviewCatalogInfoComponent\n entities={generateEntities(\n analyzeResult.generatedEntities,\n values.componentName,\n values.owner,\n )}\n repositoryUrl={analyzeResult.url}\n classes={{\n card: classes.previewCard,\n cardContent: classes.previewCardContent,\n }}\n />\n\n {error && <FormHelperText error>{error}</FormHelperText>}\n\n <Grid container spacing={0}>\n {onGoBack && (\n <BackButton onClick={onGoBack} disabled={submitted} />\n )}\n <NextButton\n type=\"submit\"\n disabled={Boolean(\n formState.errors.title ||\n formState.errors.body ||\n formState.errors.owner,\n )}\n loading={submitted}\n >\n {t('stepPrepareCreatePullRequest.nextButtonText')}\n </NextButton>\n </Grid>\n </>\n )}\n />\n )}\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA4CA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,WAAa,EAAA;AAAA,IACX,SAAA,EAAW,KAAM,CAAA,OAAA,CAAQ,CAAC;AAAA,GAC5B;AAAA,EACA,kBAAoB,EAAA;AAAA,IAClB,UAAY,EAAA;AAAA;AAEhB,CAAE,CAAA,CAAA;AAmDc,SAAA,gBAAA,CACd,QACA,EAAA,aAAA,EACA,KACU,EAAA;AACV,EAAO,OAAA,QAAA,CAAS,IAAI,CAAM,CAAA,MAAA;AAAA,IACxB,GAAG,CAAA;AAAA,IACH,YAAY,CAAE,CAAA,UAAA;AAAA,IACd,MAAM,CAAE,CAAA,IAAA;AAAA,IACR,QAAU,EAAA;AAAA,MACR,GAAG,CAAE,CAAA,QAAA;AAAA,MACL,IAAM,EAAA;AAAA,KACR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;AAAA,UAEC,KAAS,oBAAA,GAAA,CAAC,cAAe,EAAA,EAAA,KAAA,EAAK,MAAE,QAAM,EAAA,KAAA,EAAA,CAAA;AAAA,0BAEtC,IAAA,CAAA,IAAA,EAAA,EAAK,SAAS,EAAA,IAAA,EAAC,SAAS,CACtB,EAAA,QAAA,EAAA;AAAA,YAAA,QAAA,oBACE,GAAA,CAAA,UAAA,EAAA,EAAW,OAAS,EAAA,QAAA,EAAU,UAAU,SAAW,EAAA,CAAA;AAAA,4BAEtD,GAAA;AAAA,cAAC,UAAA;AAAA,cAAA;AAAA,gBACC,IAAK,EAAA,QAAA;AAAA,gBACL,QAAU,EAAA,OAAA;AAAA,kBACR,UAAU,MAAO,CAAA,KAAA,IACf,UAAU,MAAO,CAAA,IAAA,IACjB,UAAU,MAAO,CAAA;AAAA,iBACrB;AAAA,gBACA,OAAS,EAAA,SAAA;AAAA,gBAER,YAAE,6CAA6C;AAAA;AAAA;AAClD,WACF,EAAA;AAAA,SACF,EAAA;AAAA;AAAA;AAEJ,GAEJ,EAAA,CAAA;AAEJ;;;;"}
|
|
1
|
+
{"version":3,"file":"StepPrepareCreatePullRequest.esm.js","sources":["../../../src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Entity } from '@backstage/catalog-model';\nimport { errorApiRef, useApi } from '@backstage/core-plugin-api';\nimport { assertError } from '@backstage/errors';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport {\n catalogApiRef,\n humanizeEntityRef,\n} from '@backstage/plugin-catalog-react';\nimport Box from '@material-ui/core/Box';\nimport FormHelperText from '@material-ui/core/FormHelperText';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { ReactNode, useCallback, useEffect, useState } from 'react';\nimport { NestedValue, UseFormReturn } from 'react-hook-form';\nimport useAsync from 'react-use/esm/useAsync';\nimport YAML from 'yaml';\n\nimport { AnalyzeResult, catalogImportApiRef } from '../../api';\nimport { useCatalogFilename } from '../../hooks';\nimport { catalogImportTranslationRef } from '../../translation';\nimport { PartialEntity } from '../../types';\nimport { BackButton, NextButton } from '../Buttons';\nimport { PrepareResult } from '../useImportState';\nimport { PreparePullRequestForm } from './PreparePullRequestForm';\nimport { PreviewCatalogInfoComponent } from './PreviewCatalogInfoComponent';\nimport { PreviewPullRequestComponent } from './PreviewPullRequestComponent';\n\nconst useStyles = makeStyles(theme => ({\n previewCard: {\n marginTop: theme.spacing(1),\n },\n previewCardContent: {\n paddingTop: 0,\n },\n}));\n\ntype FormData = {\n title: string;\n body: string;\n componentName: string;\n owner: string;\n useCodeowners: boolean;\n};\n\n/**\n * Helper for unpacking NestedValue into the underlying type.\n *\n * @public\n * @deprecated This is a copy of the type from react-hook-form, and will be removed in a future release\n */\nexport type UnpackNestedValue<T> = T extends NestedValue<infer U>\n ? U\n : T extends Date | FileList | File | Blob\n ? T\n : T extends object\n ? {\n [K in keyof T]: UnpackNestedValue<T[K]>;\n }\n : T;\n\n/**\n * Props for {@link StepPrepareCreatePullRequest}.\n *\n * @public\n */\nexport interface StepPrepareCreatePullRequestProps {\n analyzeResult: Extract<AnalyzeResult, { type: 'repository' }>;\n onPrepare: (\n result: PrepareResult,\n opts?: { notRepeatable?: boolean },\n ) => void;\n onGoBack?: () => void;\n\n renderFormFields: (\n props: Pick<\n UseFormReturn<FormData>,\n 'register' | 'setValue' | 'formState'\n > & {\n values: UnpackNestedValue<FormData>;\n groups: string[];\n groupsLoading: boolean;\n },\n ) => ReactNode;\n}\n\nexport function generateEntities(\n entities: PartialEntity[],\n componentName: string,\n owner?: string,\n): Entity[] {\n return entities.map(e => ({\n ...e,\n apiVersion: e.apiVersion!,\n kind: e.kind!,\n metadata: {\n ...e.metadata,\n name: componentName,\n },\n spec: {\n ...e.spec,\n ...(owner ? { owner } : {}),\n },\n }));\n}\n\n/**\n * Prepares a pull request.\n *\n * @public\n */\nexport const StepPrepareCreatePullRequest = (\n props: StepPrepareCreatePullRequestProps,\n) => {\n const { analyzeResult, onPrepare, onGoBack, renderFormFields } = props;\n\n const { t } = useTranslationRef(catalogImportTranslationRef);\n const classes = useStyles();\n const catalogApi = useApi(catalogApiRef);\n const catalogImportApi = useApi(catalogImportApiRef);\n const errorApi = useApi(errorApiRef);\n\n const [submitted, setSubmitted] = useState(false);\n const [error, setError] = useState<string>();\n\n const catalogFilename = useCatalogFilename();\n\n const {\n loading: prDefaultsLoading,\n value: prDefaults,\n error: prDefaultsError,\n } = useAsync(\n () => catalogImportApi.preparePullRequest!(),\n [catalogImportApi.preparePullRequest],\n );\n\n useEffect(() => {\n if (prDefaultsError) {\n errorApi.post(prDefaultsError);\n }\n }, [prDefaultsError, errorApi]);\n\n const { loading: groupsLoading, value: groups } = useAsync(async () => {\n const groupEntities = await catalogApi.getEntities({\n filter: { kind: 'group' },\n });\n\n return groupEntities.items\n .map(e => humanizeEntityRef(e, { defaultKind: 'group' }))\n .sort();\n });\n\n const handleResult = useCallback(\n async (data: FormData) => {\n setSubmitted(true);\n\n try {\n const pr = await catalogImportApi.submitPullRequest({\n repositoryUrl: analyzeResult.url,\n title: data.title,\n body: data.body,\n fileContent: generateEntities(\n analyzeResult.generatedEntities,\n data.componentName,\n data.owner,\n )\n .map(e => YAML.stringify(e))\n .join('---\\n'),\n });\n\n onPrepare(\n {\n type: 'repository',\n url: analyzeResult.url,\n integrationType: analyzeResult.integrationType,\n pullRequest: {\n url: pr.link,\n },\n locations: [\n {\n target: pr.location,\n entities: generateEntities(\n analyzeResult.generatedEntities,\n data.componentName,\n data.owner,\n ).map(e => ({\n kind: e.kind,\n namespace: e.metadata.namespace!,\n name: e.metadata.name,\n })),\n },\n ],\n },\n { notRepeatable: true },\n );\n } catch (e) {\n assertError(e);\n setError(e.message);\n setSubmitted(false);\n }\n },\n [\n analyzeResult.generatedEntities,\n analyzeResult.integrationType,\n analyzeResult.url,\n catalogImportApi,\n onPrepare,\n ],\n );\n\n return (\n <>\n <Typography>\n {t('stepPrepareCreatePullRequest.description', {\n integrationType: analyzeResult.integrationType,\n catalogFilename: <code>{catalogFilename}</code>,\n })}\n </Typography>\n\n {!prDefaultsLoading && (\n <PreparePullRequestForm<FormData>\n onSubmit={handleResult}\n defaultValues={{\n title: prDefaults?.title ?? '',\n body: prDefaults?.body ?? '',\n owner:\n (analyzeResult.generatedEntities[0]?.spec?.owner as string) || '',\n componentName:\n analyzeResult.generatedEntities[0]?.metadata?.name || '',\n useCodeowners: false,\n }}\n render={({ values, formState, register, setValue }) => (\n <>\n {renderFormFields({\n values,\n formState,\n register,\n setValue,\n groups: groups ?? [],\n groupsLoading,\n })}\n\n <Box marginTop={2}>\n <Typography variant=\"h6\">\n {t('stepPrepareCreatePullRequest.previewPr.title')}\n </Typography>\n </Box>\n\n <PreviewPullRequestComponent\n title={values.title}\n description={values.body}\n classes={{\n card: classes.previewCard,\n cardContent: classes.previewCardContent,\n }}\n />\n\n <Box marginTop={2} marginBottom={1}>\n <Typography variant=\"h6\">\n {t('stepPrepareCreatePullRequest.previewCatalogInfo.title')}\n </Typography>\n </Box>\n\n <PreviewCatalogInfoComponent\n entities={generateEntities(\n analyzeResult.generatedEntities,\n values.componentName,\n values.owner,\n )}\n repositoryUrl={analyzeResult.url}\n classes={{\n card: classes.previewCard,\n cardContent: classes.previewCardContent,\n }}\n />\n\n {error && <FormHelperText error>{error}</FormHelperText>}\n\n <Grid container spacing={0}>\n {onGoBack && (\n <BackButton onClick={onGoBack} disabled={submitted} />\n )}\n <NextButton\n type=\"submit\"\n disabled={Boolean(\n formState.errors.title ||\n formState.errors.body ||\n formState.errors.owner,\n )}\n loading={submitted}\n >\n {t('stepPrepareCreatePullRequest.nextButtonText')}\n </NextButton>\n </Grid>\n </>\n )}\n />\n )}\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA4CA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,WAAa,EAAA;AAAA,IACX,SAAA,EAAW,KAAM,CAAA,OAAA,CAAQ,CAAC;AAAA,GAC5B;AAAA,EACA,kBAAoB,EAAA;AAAA,IAClB,UAAY,EAAA;AAAA;AAEhB,CAAE,CAAA,CAAA;AAmDc,SAAA,gBAAA,CACd,QACA,EAAA,aAAA,EACA,KACU,EAAA;AACV,EAAO,OAAA,QAAA,CAAS,IAAI,CAAM,CAAA,MAAA;AAAA,IACxB,GAAG,CAAA;AAAA,IACH,YAAY,CAAE,CAAA,UAAA;AAAA,IACd,MAAM,CAAE,CAAA,IAAA;AAAA,IACR,QAAU,EAAA;AAAA,MACR,GAAG,CAAE,CAAA,QAAA;AAAA,MACL,IAAM,EAAA;AAAA,KACR;AAAA,IACA,IAAM,EAAA;AAAA,MACJ,GAAG,CAAE,CAAA,IAAA;AAAA,MACL,GAAI,KAAA,GAAQ,EAAE,KAAA,KAAU;AAAC;AAC3B,GACA,CAAA,CAAA;AACJ;AAOa,MAAA,4BAAA,GAA+B,CAC1C,KACG,KAAA;AACH,EAAA,MAAM,EAAE,aAAA,EAAe,SAAW,EAAA,QAAA,EAAU,kBAAqB,GAAA,KAAA;AAEjE,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,2BAA2B,CAAA;AAC3D,EAAA,MAAM,UAAU,SAAU,EAAA;AAC1B,EAAM,MAAA,UAAA,GAAa,OAAO,aAAa,CAAA;AACvC,EAAM,MAAA,gBAAA,GAAmB,OAAO,mBAAmB,CAAA;AACnD,EAAM,MAAA,QAAA,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AS,EAAA,SAAA;AAAA,gBAER,YAAE,6CAA6C;AAAA;AAAA;AAClD,WACF,EAAA;AAAA,SACF,EAAA;AAAA;AAAA;AAEJ,GAEJ,EAAA,CAAA;AAEJ;;;;"}
|
package/dist/package.json.esm.js
CHANGED
package/dist/translation.esm.js
CHANGED
|
@@ -21,7 +21,9 @@ const catalogImportTranslationRef = createTranslationRef({
|
|
|
21
21
|
githubIntegration: {
|
|
22
22
|
title: "Link to a repository",
|
|
23
23
|
label: "GitHub only"
|
|
24
|
-
}
|
|
24
|
+
},
|
|
25
|
+
exampleDescription: "The wizard discovers all {{catalogFilename}} files in the repository, previews the entities, and adds them to the {{appTitle}} catalog.",
|
|
26
|
+
preparePullRequestDescription: "If no entities are found, the wizard will prepare a Pull Request that adds an example {{catalogFilename}} and prepares the {{appTitle}} catalog to load all entities as soon as the Pull Request is merged."
|
|
25
27
|
},
|
|
26
28
|
importStepper: {
|
|
27
29
|
singleLocation: {
|
|
@@ -89,6 +91,7 @@ const catalogImportTranslationRef = createTranslationRef({
|
|
|
89
91
|
nextButtonText: "Analyze"
|
|
90
92
|
},
|
|
91
93
|
stepPrepareCreatePullRequest: {
|
|
94
|
+
description: "You entered a link to a {{integrationType}} repository but a {{catalogFilename}} could not be found. Use this form to open a Pull Request that creates one.",
|
|
92
95
|
previewPr: {
|
|
93
96
|
title: "Preview Pull Request",
|
|
94
97
|
subheader: "Create a new Pull Request"
|
|
@@ -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 */\n\nimport { createTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @alpha */\nexport const catalogImportTranslationRef = createTranslationRef({\n id: 'catalog-import',\n messages: {\n buttons: {\n back: 'Back',\n },\n defaultImportPage: {\n headerTitle: 'Register an existing component',\n contentHeaderTitle: 'Start tracking your component in {{appTitle}}',\n supportTitle:\n 'Start tracking your component in {{appTitle}} by adding it to the software catalog.',\n },\n importInfoCard: {\n title: 'Register an existing component',\n deepLinkTitle: 'Learn more about the Software Catalog',\n linkDescription:\n 'Enter the URL to your source code repository to add it to {{appTitle}}.',\n fileLinkTitle: 'Link to an existing entity file',\n examplePrefix: 'Example: ',\n fileLinkDescription:\n 'The wizard analyzes the file, previews the entities, and adds them to the {{appTitle}} catalog.',\n githubIntegration: {\n title: 'Link to a repository',\n label: 'GitHub only',\n },\n },\n importStepper: {\n singleLocation: {\n title: 'Select Locations',\n description: 'Discovered Locations: 1',\n },\n multipleLocations: {\n title: 'Select Locations',\n description: 'Discovered Locations: {{length, number}}',\n },\n noLocation: {\n title: 'Create Pull Request',\n createPr: {\n detailsTitle: 'Pull Request Details',\n titleLabel: 'Pull Request Title',\n titlePlaceholder: 'Add Backstage catalog entity descriptor files',\n bodyLabel: 'Pull Request Body',\n bodyPlaceholder: 'A describing text with Markdown support',\n configurationTitle: 'Entity Configuration',\n componentNameLabel: 'Name of the created component',\n componentNamePlaceholder: 'my-component',\n ownerLoadingText: 'Loading groups…',\n ownerHelperText:\n 'Select an owner from the list or enter a reference to a Group or a User',\n ownerErrorHelperText: 'required value',\n ownerLabel: 'Entity Owner',\n ownerPlaceholder: 'my-group',\n codeownersHelperText:\n 'WARNING: This may fail if no CODEOWNERS file is found at the target location.',\n },\n },\n analyze: {\n title: 'Select URL',\n },\n prepare: {\n title: 'Import Actions',\n description: 'Optional',\n },\n review: {\n title: 'Review',\n },\n finish: {\n title: 'Finish',\n },\n },\n stepFinishImportLocation: {\n backButtonText: 'Register another',\n repository: {\n title: 'The following Pull Request has been opened: ',\n description:\n 'Your entities will be imported as soon as the Pull Request is merged.',\n },\n locations: {\n new: 'The following entities have been added to the catalog:',\n existing: 'A refresh was triggered for the following locations:',\n viewButtonText: 'View Component',\n backButtonText: 'Register another',\n },\n },\n stepInitAnalyzeUrl: {\n error: {\n repository: \"Couldn't generate entities for your repository\",\n locations: 'There are no entities at this location',\n default:\n 'Received unknown analysis result of type {{type}}. Please contact the support team.',\n url: 'Must start with http:// or https://.',\n },\n urlHelperText:\n 'Enter the full path to your entity file to start tracking your component',\n nextButtonText: 'Analyze',\n },\n stepPrepareCreatePullRequest: {\n previewPr: {\n title: 'Preview Pull Request',\n subheader: 'Create a new Pull Request',\n },\n previewCatalogInfo: {\n title: 'Preview Entities',\n },\n nextButtonText: 'Create PR',\n },\n stepPrepareSelectLocations: {\n locations: {\n description:\n 'Select one or more locations that are present in your git repository:',\n selectAll: 'Select All',\n },\n existingLocations: {\n description: 'These locations already exist in the catalog:',\n },\n nextButtonText: 'Review',\n },\n stepReviewLocation: {\n prepareResult: {\n title: 'The following Pull Request has been opened: ',\n description:\n 'You can already import the location and {{appTitle}} will fetch the entities as soon as the Pull Request is merged.',\n },\n catalog: {\n exists: 'The following locations already exist in the catalog:',\n new: 'The following entities will be added to the catalog:',\n },\n refresh: 'Refresh',\n import: 'Import',\n },\n },\n});\n"],"names":[],"mappings":";;AAmBO,MAAM,8BAA8B,oBAAqB,CAAA;AAAA,EAC9D,EAAI,EAAA,gBAAA;AAAA,EACJ,QAAU,EAAA;AAAA,IACR,OAAS,EAAA;AAAA,MACP,IAAM,EAAA;AAAA,KACR;AAAA,IACA,iBAAmB,EAAA;AAAA,MACjB,WAAa,EAAA,gCAAA;AAAA,MACb,kBAAoB,EAAA,+CAAA;AAAA,MACpB,YACE,EAAA;AAAA,KACJ;AAAA,IACA,cAAgB,EAAA;AAAA,MACd,KAAO,EAAA,gCAAA;AAAA,MACP,aAAe,EAAA,uCAAA;AAAA,MACf,eACE,EAAA,yEAAA;AAAA,MACF,aAAe,EAAA,iCAAA;AAAA,MACf,aAAe,EAAA,WAAA;AAAA,MACf,mBACE,EAAA,iGAAA;AAAA,MACF,iBAAmB,EAAA;AAAA,QACjB,KAAO,EAAA,sBAAA;AAAA,QACP,KAAO,EAAA;AAAA;
|
|
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 */\n\nimport { createTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @alpha */\nexport const catalogImportTranslationRef = createTranslationRef({\n id: 'catalog-import',\n messages: {\n buttons: {\n back: 'Back',\n },\n defaultImportPage: {\n headerTitle: 'Register an existing component',\n contentHeaderTitle: 'Start tracking your component in {{appTitle}}',\n supportTitle:\n 'Start tracking your component in {{appTitle}} by adding it to the software catalog.',\n },\n importInfoCard: {\n title: 'Register an existing component',\n deepLinkTitle: 'Learn more about the Software Catalog',\n linkDescription:\n 'Enter the URL to your source code repository to add it to {{appTitle}}.',\n fileLinkTitle: 'Link to an existing entity file',\n examplePrefix: 'Example: ',\n fileLinkDescription:\n 'The wizard analyzes the file, previews the entities, and adds them to the {{appTitle}} catalog.',\n githubIntegration: {\n title: 'Link to a repository',\n label: 'GitHub only',\n },\n exampleDescription:\n 'The wizard discovers all {{catalogFilename}} files in the repository, previews the entities, and adds them to the {{appTitle}} catalog.',\n preparePullRequestDescription:\n 'If no entities are found, the wizard will prepare a Pull Request that adds an example {{catalogFilename}} and prepares the {{appTitle}} catalog to load all entities as soon as the Pull Request is merged.',\n },\n importStepper: {\n singleLocation: {\n title: 'Select Locations',\n description: 'Discovered Locations: 1',\n },\n multipleLocations: {\n title: 'Select Locations',\n description: 'Discovered Locations: {{length, number}}',\n },\n noLocation: {\n title: 'Create Pull Request',\n createPr: {\n detailsTitle: 'Pull Request Details',\n titleLabel: 'Pull Request Title',\n titlePlaceholder: 'Add Backstage catalog entity descriptor files',\n bodyLabel: 'Pull Request Body',\n bodyPlaceholder: 'A describing text with Markdown support',\n configurationTitle: 'Entity Configuration',\n componentNameLabel: 'Name of the created component',\n componentNamePlaceholder: 'my-component',\n ownerLoadingText: 'Loading groups…',\n ownerHelperText:\n 'Select an owner from the list or enter a reference to a Group or a User',\n ownerErrorHelperText: 'required value',\n ownerLabel: 'Entity Owner',\n ownerPlaceholder: 'my-group',\n codeownersHelperText:\n 'WARNING: This may fail if no CODEOWNERS file is found at the target location.',\n },\n },\n analyze: {\n title: 'Select URL',\n },\n prepare: {\n title: 'Import Actions',\n description: 'Optional',\n },\n review: {\n title: 'Review',\n },\n finish: {\n title: 'Finish',\n },\n },\n stepFinishImportLocation: {\n backButtonText: 'Register another',\n repository: {\n title: 'The following Pull Request has been opened: ',\n description:\n 'Your entities will be imported as soon as the Pull Request is merged.',\n },\n locations: {\n new: 'The following entities have been added to the catalog:',\n existing: 'A refresh was triggered for the following locations:',\n viewButtonText: 'View Component',\n backButtonText: 'Register another',\n },\n },\n stepInitAnalyzeUrl: {\n error: {\n repository: \"Couldn't generate entities for your repository\",\n locations: 'There are no entities at this location',\n default:\n 'Received unknown analysis result of type {{type}}. Please contact the support team.',\n url: 'Must start with http:// or https://.',\n },\n urlHelperText:\n 'Enter the full path to your entity file to start tracking your component',\n nextButtonText: 'Analyze',\n },\n stepPrepareCreatePullRequest: {\n description:\n 'You entered a link to a {{integrationType}} repository but a {{catalogFilename}} could not be found. Use this form to open a Pull Request that creates one.',\n previewPr: {\n title: 'Preview Pull Request',\n subheader: 'Create a new Pull Request',\n },\n previewCatalogInfo: {\n title: 'Preview Entities',\n },\n nextButtonText: 'Create PR',\n },\n stepPrepareSelectLocations: {\n locations: {\n description:\n 'Select one or more locations that are present in your git repository:',\n selectAll: 'Select All',\n },\n existingLocations: {\n description: 'These locations already exist in the catalog:',\n },\n nextButtonText: 'Review',\n },\n stepReviewLocation: {\n prepareResult: {\n title: 'The following Pull Request has been opened: ',\n description:\n 'You can already import the location and {{appTitle}} will fetch the entities as soon as the Pull Request is merged.',\n },\n catalog: {\n exists: 'The following locations already exist in the catalog:',\n new: 'The following entities will be added to the catalog:',\n },\n refresh: 'Refresh',\n import: 'Import',\n },\n },\n});\n"],"names":[],"mappings":";;AAmBO,MAAM,8BAA8B,oBAAqB,CAAA;AAAA,EAC9D,EAAI,EAAA,gBAAA;AAAA,EACJ,QAAU,EAAA;AAAA,IACR,OAAS,EAAA;AAAA,MACP,IAAM,EAAA;AAAA,KACR;AAAA,IACA,iBAAmB,EAAA;AAAA,MACjB,WAAa,EAAA,gCAAA;AAAA,MACb,kBAAoB,EAAA,+CAAA;AAAA,MACpB,YACE,EAAA;AAAA,KACJ;AAAA,IACA,cAAgB,EAAA;AAAA,MACd,KAAO,EAAA,gCAAA;AAAA,MACP,aAAe,EAAA,uCAAA;AAAA,MACf,eACE,EAAA,yEAAA;AAAA,MACF,aAAe,EAAA,iCAAA;AAAA,MACf,aAAe,EAAA,WAAA;AAAA,MACf,mBACE,EAAA,iGAAA;AAAA,MACF,iBAAmB,EAAA;AAAA,QACjB,KAAO,EAAA,sBAAA;AAAA,QACP,KAAO,EAAA;AAAA,OACT;AAAA,MACA,kBACE,EAAA,yIAAA;AAAA,MACF,6BACE,EAAA;AAAA,KACJ;AAAA,IACA,aAAe,EAAA;AAAA,MACb,cAAgB,EAAA;AAAA,QACd,KAAO,EAAA,kBAAA;AAAA,QACP,WAAa,EAAA;AAAA,OACf;AAAA,MACA,iBAAmB,EAAA;AAAA,QACjB,KAAO,EAAA,kBAAA;AAAA,QACP,WAAa,EAAA;AAAA,OACf;AAAA,MACA,UAAY,EAAA;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EAAA;AAAA,OACP;AAAA,MACA,aACE,EAAA,0EAAA;AAAA,MACF,cAAgB,EAAA;AAAA,KAClB;AAAA,IACA,4BAA8B,EAAA;AAAA,MAC5B,WACE,EAAA,6JAAA;AAAA,MACF,SAAW,EAAA;AAAA,QACT,KAAO,EAAA,sBAAA;AAAA,QACP,SAAW,EAAA;AAAA,OACb;AAAA,MACA,kBAAoB,EAAA;AAAA,QAClB,KAAO,EAAA;AAAA,OACT;AAAA,MACA,cAAgB,EAAA;AAAA,KAClB;AAAA,IACA,0BAA4B,EAAA;AAAA,MAC1B,SAAW,EAAA;AAAA,QACT,WACE,EAAA,uEAAA;AAAA,QACF,SAAW,EAAA;AAAA,OACb;AAAA,MACA,iBAAmB,EAAA;AAAA,QACjB,WAAa,EAAA;AAAA,OACf;AAAA,MACA,cAAgB,EAAA;AAAA,KAClB;AAAA,IACA,kBAAoB,EAAA;AAAA,MAClB,aAAe,EAAA;AAAA,QACb,KAAO,EAAA,8CAAA;AAAA,QACP,WACE,EAAA;AAAA,OACJ;AAAA,MACA,OAAS,EAAA;AAAA,QACP,MAAQ,EAAA,uDAAA;AAAA,QACR,GAAK,EAAA;AAAA,OACP;AAAA,MACA,OAAS,EAAA,SAAA;AAAA,MACT,MAAQ,EAAA;AAAA;AACV;AAEJ,CAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-catalog-import",
|
|
3
|
-
"version": "0.13.1-next.
|
|
3
|
+
"version": "0.13.1-next.2",
|
|
4
4
|
"description": "A Backstage plugin the helps you import entities into your catalog",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "frontend-plugin",
|
|
@@ -66,18 +66,18 @@
|
|
|
66
66
|
"test": "backstage-cli package test"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@backstage/catalog-client": "1.10.0",
|
|
69
|
+
"@backstage/catalog-client": "1.10.1-next.0",
|
|
70
70
|
"@backstage/catalog-model": "1.7.4",
|
|
71
71
|
"@backstage/config": "1.3.2",
|
|
72
|
-
"@backstage/core-compat-api": "0.4.3-next.
|
|
73
|
-
"@backstage/core-components": "0.17.
|
|
72
|
+
"@backstage/core-compat-api": "0.4.3-next.2",
|
|
73
|
+
"@backstage/core-components": "0.17.3-next.0",
|
|
74
74
|
"@backstage/core-plugin-api": "1.10.7",
|
|
75
75
|
"@backstage/errors": "1.2.7",
|
|
76
|
-
"@backstage/frontend-plugin-api": "0.10.3-next.
|
|
76
|
+
"@backstage/frontend-plugin-api": "0.10.3-next.1",
|
|
77
77
|
"@backstage/integration": "1.17.0",
|
|
78
78
|
"@backstage/integration-react": "1.2.7",
|
|
79
79
|
"@backstage/plugin-catalog-common": "1.1.4",
|
|
80
|
-
"@backstage/plugin-catalog-react": "1.
|
|
80
|
+
"@backstage/plugin-catalog-react": "1.19.0-next.2",
|
|
81
81
|
"@material-ui/core": "^4.12.2",
|
|
82
82
|
"@material-ui/icons": "^4.9.1",
|
|
83
83
|
"@material-ui/lab": "4.0.0-alpha.61",
|
|
@@ -90,10 +90,10 @@
|
|
|
90
90
|
"yaml": "^2.0.0"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
|
-
"@backstage/cli": "0.
|
|
93
|
+
"@backstage/cli": "0.33.0-next.1",
|
|
94
94
|
"@backstage/core-app-api": "1.17.0",
|
|
95
|
-
"@backstage/dev-utils": "1.1.11-next.
|
|
96
|
-
"@backstage/plugin-catalog": "1.31.0-next.
|
|
95
|
+
"@backstage/dev-utils": "1.1.11-next.2",
|
|
96
|
+
"@backstage/plugin-catalog": "1.31.0-next.2",
|
|
97
97
|
"@backstage/test-utils": "1.7.8",
|
|
98
98
|
"@testing-library/dom": "^10.0.0",
|
|
99
99
|
"@testing-library/jest-dom": "^6.0.0",
|