@backstage/plugin-catalog-import 0.13.12-next.1 → 0.13.12-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 CHANGED
@@ -1,5 +1,25 @@
1
1
  # @backstage/plugin-catalog-import
2
2
 
3
+ ## 0.13.12-next.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 482ceed: Migrated from `assertError` to `toError` for error handling.
8
+ - e5af44c: Replaced deprecated `humanizeEntityRef` usage with the Catalog Presentation API.
9
+ - Updated dependencies
10
+ - @backstage/errors@1.3.0-next.0
11
+ - @backstage/core-components@0.18.9-next.1
12
+ - @backstage/plugin-catalog-react@2.1.2-next.2
13
+ - @backstage/integration@2.0.1-next.0
14
+ - @backstage/catalog-client@1.14.1-next.0
15
+ - @backstage/catalog-model@1.7.8-next.0
16
+ - @backstage/config@1.3.7-next.0
17
+ - @backstage/core-plugin-api@1.12.5-next.2
18
+ - @backstage/frontend-plugin-api@0.16.0-next.2
19
+ - @backstage/integration-react@1.2.17-next.1
20
+ - @backstage/plugin-catalog-common@1.1.9-next.0
21
+ - @backstage/plugin-permission-react@0.4.42-next.1
22
+
3
23
  ## 0.13.12-next.1
4
24
 
5
25
  ### Patch Changes
@@ -1,8 +1,8 @@
1
1
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
2
  import { useApi, errorApiRef } from '@backstage/core-plugin-api';
3
- import { assertError } from '@backstage/errors';
3
+ import { toError } from '@backstage/errors';
4
4
  import { useTranslationRef } from '@backstage/frontend-plugin-api';
5
- import { catalogApiRef, humanizeEntityRef } from '@backstage/plugin-catalog-react';
5
+ import { catalogApiRef, entityPresentationApiRef } from '@backstage/plugin-catalog-react';
6
6
  import Box from '@material-ui/core/Box';
7
7
  import FormHelperText from '@material-ui/core/FormHelperText';
8
8
  import Grid from '@material-ui/core/Grid';
@@ -50,6 +50,7 @@ const StepPrepareCreatePullRequest = (props) => {
50
50
  const { t } = useTranslationRef(catalogImportTranslationRef);
51
51
  const classes = useStyles();
52
52
  const catalogApi = useApi(catalogApiRef);
53
+ const entityPresentationApi = useApi(entityPresentationApiRef);
53
54
  const catalogImportApi = useApi(catalogImportApiRef);
54
55
  const errorApi = useApi(errorApiRef);
55
56
  const [submitted, setSubmitted] = useState(false);
@@ -72,7 +73,12 @@ const StepPrepareCreatePullRequest = (props) => {
72
73
  const groupEntities = await catalogApi.getEntities({
73
74
  filter: { kind: "group" }
74
75
  });
75
- return groupEntities.items.map((e) => humanizeEntityRef(e, { defaultKind: "group" })).sort();
76
+ const presentations = await Promise.all(
77
+ groupEntities.items.map(
78
+ (e) => entityPresentationApi.forEntity(e, { defaultKind: "group" }).promise
79
+ )
80
+ );
81
+ return presentations.map((p) => p.primaryTitle).sort();
76
82
  });
77
83
  const handleResult = useCallback(
78
84
  async (data) => {
@@ -114,8 +120,7 @@ const StepPrepareCreatePullRequest = (props) => {
114
120
  { notRepeatable: true }
115
121
  );
116
122
  } catch (e) {
117
- assertError(e);
118
- setError(e.message);
123
+ setError(toError(e).message);
119
124
  setSubmitted(false);
120
125
  }
121
126
  },
@@ -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 {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,CAAA,KAAA,MAAU;AAAA,EACrC,WAAA,EAAa;AAAA,IACX,SAAA,EAAW,KAAA,CAAM,OAAA,CAAQ,CAAC;AAAA,GAC5B;AAAA,EACA,kBAAA,EAAoB;AAAA,IAClB,UAAA,EAAY;AAAA;AAEhB,CAAA,CAAE,CAAA;AAmDK,SAAS,gBAAA,CACd,QAAA,EACA,aAAA,EACA,KAAA,EACU;AACV,EAAA,OAAO,QAAA,CAAS,IAAI,CAAA,CAAA,MAAM;AAAA,IACxB,GAAG,CAAA;AAAA,IACH,YAAY,CAAA,CAAE,UAAA;AAAA,IACd,MAAM,CAAA,CAAE,IAAA;AAAA,IACR,QAAA,EAAU;AAAA,MACR,GAAG,CAAA,CAAE,QAAA;AAAA,MACL,IAAA,EAAM;AAAA,KACR;AAAA,IACA,IAAA,EAAM;AAAA,MACJ,GAAG,CAAA,CAAE,IAAA;AAAA,MACL,GAAI,KAAA,GAAQ,EAAE,KAAA,KAAU;AAAC;AAC3B,GACF,CAAE,CAAA;AACJ;AAOO,MAAM,4BAAA,GAA+B,CAC1C,KAAA,KACG;AACH,EAAA,MAAM,EAAE,aAAA,EAAe,SAAA,EAAW,QAAA,EAAU,kBAAiB,GAAI,KAAA;AAEjE,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,2BAA2B,CAAA;AAC3D,EAAA,MAAM,UAAU,SAAA,EAAU;AAC1B,EAAA,MAAM,UAAA,GAAa,OAAO,aAAa,CAAA;AACvC,EAAA,MAAM,gBAAA,GAAmB,OAAO,mBAAmB,C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,IAAA,IACjB,UAAU,MAAA,CAAO;AAAA,iBACrB;AAAA,gBACA,OAAA,EAAS,SAAA;AAAA,gBAER,YAAE,6CAA6C;AAAA;AAAA;AAClD,WAAA,EACF;AAAA,SAAA,EACF;AAAA;AAAA;AAEJ,GAAA,EAEJ,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 { toError } from '@backstage/errors';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport {\n catalogApiRef,\n entityPresentationApiRef,\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 entityPresentationApi = useApi(entityPresentationApiRef);\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 const presentations = await Promise.all(\n groupEntities.items.map(\n e =>\n entityPresentationApi.forEntity(e, { defaultKind: 'group' }).promise,\n ),\n );\n return presentations.map(p => p.primaryTitle).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 setError(toError(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,CAAA,KAAA,MAAU;AAAA,EACrC,WAAA,EAAa;AAAA,IACX,SAAA,EAAW,KAAA,CAAM,OAAA,CAAQ,CAAC;AAAA,GAC5B;AAAA,EACA,kBAAA,EAAoB;AAAA,IAClB,UAAA,EA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} from 'react/jsx-runtime';
2
2
  import { stringifyEntityRef } from '@backstage/catalog-model';
3
3
  import { Link } from '@backstage/core-components';
4
4
  import { useApi, configApiRef, useAnalytics } from '@backstage/core-plugin-api';
5
- import { assertError } from '@backstage/errors';
5
+ import { toError } from '@backstage/errors';
6
6
  import { useTranslationRef } from '@backstage/frontend-plugin-api';
7
7
  import { catalogApiRef } from '@backstage/plugin-catalog-react';
8
8
  import FormHelperText from '@material-ui/core/FormHelperText';
@@ -59,8 +59,8 @@ const StepReviewLocation = ({
59
59
  locations
60
60
  });
61
61
  } catch (e) {
62
- assertError(e);
63
- if (prepareResult.type === "repository" && e.message.startsWith(
62
+ const caughtError = toError(e);
63
+ if (prepareResult.type === "repository" && caughtError.message.startsWith(
64
64
  "Location was added but has no entities specified yet"
65
65
  )) {
66
66
  onReview({
@@ -71,7 +71,7 @@ const StepReviewLocation = ({
71
71
  }))
72
72
  });
73
73
  } else {
74
- setError(e.message);
74
+ setError(caughtError.message);
75
75
  setSubmitted(false);
76
76
  }
77
77
  }
@@ -1 +1 @@
1
- {"version":3,"file":"StepReviewLocation.esm.js","sources":["../../../src/components/StepReviewLocation/StepReviewLocation.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 { stringifyEntityRef } from '@backstage/catalog-model';\nimport { Link } from '@backstage/core-components';\nimport { configApiRef, useAnalytics, useApi } from '@backstage/core-plugin-api';\nimport { assertError } from '@backstage/errors';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { catalogApiRef } from '@backstage/plugin-catalog-react';\nimport FormHelperText from '@material-ui/core/FormHelperText';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport LocationOnIcon from '@material-ui/icons/LocationOn';\nimport { useCallback, useState } from 'react';\n\nimport { BackButton, NextButton } from '../Buttons';\nimport { EntityListComponent } from '../EntityListComponent';\nimport { PrepareResult, ReviewResult } from '../useImportState';\nimport { catalogImportTranslationRef } from '../../translation';\n\ntype Props = {\n prepareResult: PrepareResult;\n onReview: (result: ReviewResult) => void;\n onGoBack?: () => void;\n};\n\nexport const StepReviewLocation = ({\n prepareResult,\n onReview,\n onGoBack,\n}: Props) => {\n const { t } = useTranslationRef(catalogImportTranslationRef);\n const catalogApi = useApi(catalogApiRef);\n const configApi = useApi(configApiRef);\n const analytics = useAnalytics();\n\n const appTitle = configApi.getOptionalString('app.title') || 'Backstage';\n\n const [submitted, setSubmitted] = useState(false);\n const [error, setError] = useState<string>();\n const exists =\n prepareResult.type === 'locations' &&\n prepareResult.locations.some(l => l.exists)\n ? true\n : false;\n const handleClick = useCallback(async () => {\n setSubmitted(true);\n analytics.captureEvent('click', 'import entity');\n try {\n let refreshed = new Array<{ target: string }>();\n if (prepareResult.type === 'locations') {\n refreshed = await Promise.all(\n prepareResult.locations\n .filter(l => l.exists)\n .map(async l => {\n const ref = stringifyEntityRef(l.entities[0] ?? l);\n await catalogApi.refreshEntity(ref);\n return { target: l.target };\n }),\n );\n }\n\n const locations = await Promise.all(\n prepareResult.locations\n .filter((l: unknown) => !(l as { exists?: boolean }).exists)\n .map(async l => {\n const result = await catalogApi.addLocation({\n type: 'url',\n target: l.target,\n });\n return {\n target: result.location.target,\n entities: result.entities,\n };\n }),\n );\n\n onReview({\n ...prepareResult,\n ...{ refreshed },\n locations,\n });\n } catch (e) {\n assertError(e);\n // TODO: this error should be handled differently. We add it as 'optional' and\n // it is not uncommon that a PR has not been merged yet.\n if (\n prepareResult.type === 'repository' &&\n e.message.startsWith(\n 'Location was added but has no entities specified yet',\n )\n ) {\n onReview({\n ...prepareResult,\n locations: prepareResult.locations.map(l => ({\n target: l.target,\n entities: [],\n })),\n });\n } else {\n setError(e.message);\n setSubmitted(false);\n }\n }\n }, [prepareResult, onReview, catalogApi, analytics]);\n\n return (\n <>\n {prepareResult.type === 'repository' && (\n <>\n <Typography paragraph>\n {t('stepReviewLocation.prepareResult.title')}\n <Link\n to={prepareResult.pullRequest.url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n {prepareResult.pullRequest.url}\n </Link>\n </Typography>\n\n <Typography paragraph>\n {t('stepReviewLocation.prepareResult.description', { appTitle })}\n </Typography>\n </>\n )}\n\n <Typography>\n {exists\n ? t('stepReviewLocation.catalog.exists')\n : t('stepReviewLocation.catalog.new')}\n </Typography>\n\n <EntityListComponent\n locations={prepareResult.locations}\n locationListItemIcon={() => <LocationOnIcon />}\n />\n\n {error && <FormHelperText error>{error}</FormHelperText>}\n\n <Grid container spacing={0}>\n {onGoBack && <BackButton onClick={onGoBack} disabled={submitted} />}\n <NextButton\n disabled={submitted}\n loading={submitted}\n onClick={() => handleClick()}\n >\n {exists\n ? t('stepReviewLocation.refresh')\n : t('stepReviewLocation.import')}\n </NextButton>\n </Grid>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAuCO,MAAM,qBAAqB,CAAC;AAAA,EACjC,aAAA;AAAA,EACA,QAAA;AAAA,EACA;AACF,CAAA,KAAa;AACX,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,2BAA2B,CAAA;AAC3D,EAAA,MAAM,UAAA,GAAa,OAAO,aAAa,CAAA;AACvC,EAAA,MAAM,SAAA,GAAY,OAAO,YAAY,CAAA;AACrC,EAAA,MAAM,YAAY,YAAA,EAAa;AAE/B,EAAA,MAAM,QAAA,GAAW,SAAA,CAAU,iBAAA,CAAkB,WAAW,CAAA,IAAK,WAAA;AAE7D,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAI,SAAS,KAAK,CAAA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YAEH,wBAAc,WAAA,CAAY;AAAA;AAAA;AAC7B,OAAA,EACF,CAAA;AAAA,sBAEA,GAAA,CAAC,cAAW,SAAA,EAAS,IAAA,EAClB,YAAE,8CAAA,EAAgD,EAAE,QAAA,EAAU,CAAA,EACjE;AAAA,KAAA,EACF,CAAA;AAAA,oBAGF,GAAA,CAAC,cACE,QAAA,EAAA,MAAA,GACG,CAAA,CAAE,mCAAmC,CAAA,GACrC,CAAA,CAAE,gCAAgC,CAAA,EACxC,CAAA;AAAA,oBAEA,GAAA;AAAA,MAAC,mBAAA;AAAA,MAAA;AAAA,QACC,WAAW,aAAA,CAAc,SAAA;AAAA,QACzB,oBAAA,EAAsB,sBAAM,GAAA,CAAC,cAAA,EAAA,EAAe;AAAA;AAAA,KAC9C;AAAA,IAEC,KAAA,oBAAS,GAAA,CAAC,cAAA,EAAA,EAAe,KAAA,EAAK,MAAE,QAAA,EAAA,KAAA,EAAM,CAAA;AAAA,oBAEvC,IAAA,CAAC,IAAA,EAAA,EAAK,SAAA,EAAS,IAAA,EAAC,SAAS,CAAA,EACtB,QAAA,EAAA;AAAA,MAAA,QAAA,oBAAY,GAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAS,QAAA,EAAU,UAAU,SAAA,EAAW,CAAA;AAAA,sBACjE,GAAA;AAAA,QAAC,UAAA;AAAA,QAAA;AAAA,UACC,QAAA,EAAU,SAAA;AAAA,UACV,OAAA,EAAS,SAAA;AAAA,UACT,OAAA,EAAS,MAAM,WAAA,EAAY;AAAA,UAE1B,QAAA,EAAA,MAAA,GACG,CAAA,CAAE,4BAA4B,CAAA,GAC9B,EAAE,2BAA2B;AAAA;AAAA;AACnC,KAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"StepReviewLocation.esm.js","sources":["../../../src/components/StepReviewLocation/StepReviewLocation.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 { stringifyEntityRef } from '@backstage/catalog-model';\nimport { Link } from '@backstage/core-components';\nimport { configApiRef, useAnalytics, useApi } from '@backstage/core-plugin-api';\nimport { toError } from '@backstage/errors';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { catalogApiRef } from '@backstage/plugin-catalog-react';\nimport FormHelperText from '@material-ui/core/FormHelperText';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport LocationOnIcon from '@material-ui/icons/LocationOn';\nimport { useCallback, useState } from 'react';\n\nimport { BackButton, NextButton } from '../Buttons';\nimport { EntityListComponent } from '../EntityListComponent';\nimport { PrepareResult, ReviewResult } from '../useImportState';\nimport { catalogImportTranslationRef } from '../../translation';\n\ntype Props = {\n prepareResult: PrepareResult;\n onReview: (result: ReviewResult) => void;\n onGoBack?: () => void;\n};\n\nexport const StepReviewLocation = ({\n prepareResult,\n onReview,\n onGoBack,\n}: Props) => {\n const { t } = useTranslationRef(catalogImportTranslationRef);\n const catalogApi = useApi(catalogApiRef);\n const configApi = useApi(configApiRef);\n const analytics = useAnalytics();\n\n const appTitle = configApi.getOptionalString('app.title') || 'Backstage';\n\n const [submitted, setSubmitted] = useState(false);\n const [error, setError] = useState<string>();\n const exists =\n prepareResult.type === 'locations' &&\n prepareResult.locations.some(l => l.exists)\n ? true\n : false;\n const handleClick = useCallback(async () => {\n setSubmitted(true);\n analytics.captureEvent('click', 'import entity');\n try {\n let refreshed = new Array<{ target: string }>();\n if (prepareResult.type === 'locations') {\n refreshed = await Promise.all(\n prepareResult.locations\n .filter(l => l.exists)\n .map(async l => {\n const ref = stringifyEntityRef(l.entities[0] ?? l);\n await catalogApi.refreshEntity(ref);\n return { target: l.target };\n }),\n );\n }\n\n const locations = await Promise.all(\n prepareResult.locations\n .filter((l: unknown) => !(l as { exists?: boolean }).exists)\n .map(async l => {\n const result = await catalogApi.addLocation({\n type: 'url',\n target: l.target,\n });\n return {\n target: result.location.target,\n entities: result.entities,\n };\n }),\n );\n\n onReview({\n ...prepareResult,\n ...{ refreshed },\n locations,\n });\n } catch (e) {\n const caughtError = toError(e);\n // TODO: this error should be handled differently. We add it as 'optional' and\n // it is not uncommon that a PR has not been merged yet.\n if (\n prepareResult.type === 'repository' &&\n caughtError.message.startsWith(\n 'Location was added but has no entities specified yet',\n )\n ) {\n onReview({\n ...prepareResult,\n locations: prepareResult.locations.map(l => ({\n target: l.target,\n entities: [],\n })),\n });\n } else {\n setError(caughtError.message);\n setSubmitted(false);\n }\n }\n }, [prepareResult, onReview, catalogApi, analytics]);\n\n return (\n <>\n {prepareResult.type === 'repository' && (\n <>\n <Typography paragraph>\n {t('stepReviewLocation.prepareResult.title')}\n <Link\n to={prepareResult.pullRequest.url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n {prepareResult.pullRequest.url}\n </Link>\n </Typography>\n\n <Typography paragraph>\n {t('stepReviewLocation.prepareResult.description', { appTitle })}\n </Typography>\n </>\n )}\n\n <Typography>\n {exists\n ? t('stepReviewLocation.catalog.exists')\n : t('stepReviewLocation.catalog.new')}\n </Typography>\n\n <EntityListComponent\n locations={prepareResult.locations}\n locationListItemIcon={() => <LocationOnIcon />}\n />\n\n {error && <FormHelperText error>{error}</FormHelperText>}\n\n <Grid container spacing={0}>\n {onGoBack && <BackButton onClick={onGoBack} disabled={submitted} />}\n <NextButton\n disabled={submitted}\n loading={submitted}\n onClick={() => handleClick()}\n >\n {exists\n ? t('stepReviewLocation.refresh')\n : t('stepReviewLocation.import')}\n </NextButton>\n </Grid>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAuCO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A,EAAW,CAAA;AAAA,sBACjE,GAAA;AAAA,QAAC,UAAA;AAAA,QAAA;AAAA,UACC,QAAA,EAAU,SAAA;AAAA,UACV,OAAA,EAAS,SAAA;AAAA,UACT,OAAA,EAAS,MAAM,WAAA,EAAY;AAAA,UAE1B,QAAA,EAAA,MAAA,GACG,CAAA,CAAE,4BAA4B,CAAA,GAC9B,EAAE,2BAA2B;AAAA;AAAA;AACnC,KAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
@@ -1,5 +1,5 @@
1
1
  var name = "@backstage/plugin-catalog-import";
2
- var version = "0.13.12-next.1";
2
+ var version = "0.13.12-next.2";
3
3
  var description = "A Backstage plugin the helps you import entities into your catalog";
4
4
  var backstage = {
5
5
  role: "frontend-plugin",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog-import",
3
- "version": "0.13.12-next.1",
3
+ "version": "0.13.12-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.14.0",
70
- "@backstage/catalog-model": "1.7.7",
71
- "@backstage/config": "1.3.6",
72
- "@backstage/core-components": "0.18.9-next.0",
73
- "@backstage/core-plugin-api": "1.12.5-next.1",
74
- "@backstage/errors": "1.2.7",
75
- "@backstage/frontend-plugin-api": "0.16.0-next.1",
76
- "@backstage/integration": "2.0.0",
77
- "@backstage/integration-react": "1.2.17-next.0",
78
- "@backstage/plugin-catalog-common": "1.1.8",
79
- "@backstage/plugin-catalog-react": "2.1.2-next.1",
80
- "@backstage/plugin-permission-react": "0.4.42-next.0",
69
+ "@backstage/catalog-client": "1.14.1-next.0",
70
+ "@backstage/catalog-model": "1.7.8-next.0",
71
+ "@backstage/config": "1.3.7-next.0",
72
+ "@backstage/core-components": "0.18.9-next.1",
73
+ "@backstage/core-plugin-api": "1.12.5-next.2",
74
+ "@backstage/errors": "1.3.0-next.0",
75
+ "@backstage/frontend-plugin-api": "0.16.0-next.2",
76
+ "@backstage/integration": "2.0.1-next.0",
77
+ "@backstage/integration-react": "1.2.17-next.1",
78
+ "@backstage/plugin-catalog-common": "1.1.9-next.0",
79
+ "@backstage/plugin-catalog-react": "2.1.2-next.2",
80
+ "@backstage/plugin-permission-react": "0.4.42-next.1",
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",
@@ -91,11 +91,11 @@
91
91
  "yaml": "^2.0.0"
92
92
  },
93
93
  "devDependencies": {
94
- "@backstage/cli": "0.36.1-next.1",
95
- "@backstage/core-app-api": "1.20.0-next.1",
96
- "@backstage/dev-utils": "1.1.22-next.1",
97
- "@backstage/plugin-catalog": "2.0.2-next.1",
98
- "@backstage/test-utils": "1.7.17-next.1",
94
+ "@backstage/cli": "0.36.1-next.2",
95
+ "@backstage/core-app-api": "1.20.0-next.2",
96
+ "@backstage/dev-utils": "1.1.22-next.2",
97
+ "@backstage/plugin-catalog": "2.0.2-next.2",
98
+ "@backstage/test-utils": "1.7.17-next.2",
99
99
  "@testing-library/dom": "^10.0.0",
100
100
  "@testing-library/jest-dom": "^6.0.0",
101
101
  "@testing-library/react": "^16.0.0",