@backstage/plugin-catalog-import 0.12.14-next.0 → 0.13.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.
- package/CHANGELOG.md +42 -0
- package/dist/alpha.d.ts +62 -1
- package/dist/alpha.esm.js +1 -1
- package/dist/alpha.esm.js.map +1 -1
- package/dist/components/Buttons/index.esm.js +4 -1
- package/dist/components/Buttons/index.esm.js.map +1 -1
- package/dist/components/DefaultImportPage/DefaultImportPage.esm.js +14 -9
- package/dist/components/DefaultImportPage/DefaultImportPage.esm.js.map +1 -1
- package/dist/components/ImportInfoCard/ImportInfoCard.esm.js +17 -18
- package/dist/components/ImportInfoCard/ImportInfoCard.esm.js.map +1 -1
- package/dist/components/ImportStepper/ImportStepper.esm.js +9 -6
- package/dist/components/ImportStepper/ImportStepper.esm.js.map +1 -1
- package/dist/components/ImportStepper/defaults.esm.js +60 -31
- package/dist/components/ImportStepper/defaults.esm.js.map +1 -1
- package/dist/components/StepFinishImportLocation/StepFinishImportLocation.esm.js +15 -13
- package/dist/components/StepFinishImportLocation/StepFinishImportLocation.esm.js.map +1 -1
- package/dist/components/StepInitAnalyzeUrl/StepInitAnalyzeUrl.esm.js +12 -7
- package/dist/components/StepInitAnalyzeUrl/StepInitAnalyzeUrl.esm.js.map +1 -1
- package/dist/components/StepPrepareCreatePullRequest/PreviewPullRequestComponent.esm.js +11 -2
- package/dist/components/StepPrepareCreatePullRequest/PreviewPullRequestComponent.esm.js.map +1 -1
- package/dist/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.esm.js +6 -3
- package/dist/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.esm.js.map +1 -1
- package/dist/components/StepPrepareSelectLocations/StepPrepareSelectLocations.esm.js +13 -5
- package/dist/components/StepPrepareSelectLocations/StepPrepareSelectLocations.esm.js.map +1 -1
- package/dist/components/StepReviewLocation/StepReviewLocation.esm.js +11 -13
- package/dist/components/StepReviewLocation/StepReviewLocation.esm.js.map +1 -1
- package/dist/index.d.ts +9 -2
- package/dist/translation.esm.js +115 -2
- package/dist/translation.esm.js.map +1 -1
- package/package.json +14 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,47 @@
|
|
|
1
1
|
# @backstage/plugin-catalog-import
|
|
2
2
|
|
|
3
|
+
## 0.13.0-next.2
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- e2fd549: **BREAKING**: `generateStepper` and `defaultGenerateStepper` now require a translation argument to be passed through for supporting translations.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 66a1140: Add i18n support for `catalog-import` plugin.
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
- @backstage/integration@1.17.0-next.2
|
|
14
|
+
- @backstage/core-plugin-api@1.10.7-next.0
|
|
15
|
+
- @backstage/config@1.3.2
|
|
16
|
+
- @backstage/core-compat-api@0.4.2-next.2
|
|
17
|
+
- @backstage/core-components@0.17.2-next.1
|
|
18
|
+
- @backstage/frontend-plugin-api@0.10.2-next.1
|
|
19
|
+
- @backstage/integration-react@1.2.7-next.2
|
|
20
|
+
- @backstage/plugin-catalog-react@1.18.0-next.2
|
|
21
|
+
- @backstage/catalog-client@1.10.0-next.0
|
|
22
|
+
- @backstage/catalog-model@1.7.3
|
|
23
|
+
- @backstage/errors@1.2.7
|
|
24
|
+
- @backstage/plugin-catalog-common@1.1.4-next.0
|
|
25
|
+
|
|
26
|
+
## 0.12.14-next.1
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- fb58f20: Internal update to use the new `pluginId` option of `createFrontendPlugin`.
|
|
31
|
+
- Updated dependencies
|
|
32
|
+
- @backstage/core-components@0.17.2-next.0
|
|
33
|
+
- @backstage/frontend-plugin-api@0.10.2-next.0
|
|
34
|
+
- @backstage/core-compat-api@0.4.2-next.1
|
|
35
|
+
- @backstage/integration@1.16.4-next.1
|
|
36
|
+
- @backstage/plugin-catalog-react@1.18.0-next.1
|
|
37
|
+
- @backstage/integration-react@1.2.7-next.1
|
|
38
|
+
- @backstage/catalog-client@1.10.0-next.0
|
|
39
|
+
- @backstage/catalog-model@1.7.3
|
|
40
|
+
- @backstage/config@1.3.2
|
|
41
|
+
- @backstage/core-plugin-api@1.10.6
|
|
42
|
+
- @backstage/errors@1.2.7
|
|
43
|
+
- @backstage/plugin-catalog-common@1.1.4-next.0
|
|
44
|
+
|
|
3
45
|
## 0.12.14-next.0
|
|
4
46
|
|
|
5
47
|
### Patch Changes
|
package/dist/alpha.d.ts
CHANGED
|
@@ -5,8 +5,69 @@ import * as _backstage_core_plugin_api_alpha from '@backstage/core-plugin-api/al
|
|
|
5
5
|
|
|
6
6
|
/** @alpha */
|
|
7
7
|
declare const catalogImportTranslationRef: _backstage_core_plugin_api_alpha.TranslationRef<"catalog-import", {
|
|
8
|
-
readonly
|
|
8
|
+
readonly "buttons.back": "Back";
|
|
9
|
+
readonly "defaultImportPage.headerTitle": "Register an existing component";
|
|
10
|
+
readonly "defaultImportPage.contentHeaderTitle": "Start tracking your component in {{appTitle}}";
|
|
11
|
+
readonly "defaultImportPage.supportTitle": "Start tracking your component in {{appTitle}} by adding it to the software catalog.";
|
|
9
12
|
readonly "importInfoCard.title": "Register an existing component";
|
|
13
|
+
readonly "importInfoCard.deepLinkTitle": "Learn more about the Software Catalog";
|
|
14
|
+
readonly "importInfoCard.linkDescription": "Enter the URL to your source code repository to add it to {{appTitle}}.";
|
|
15
|
+
readonly "importInfoCard.fileLinkTitle": "Link to an existing entity file";
|
|
16
|
+
readonly "importInfoCard.examplePrefix": "Example: ";
|
|
17
|
+
readonly "importInfoCard.fileLinkDescription": "The wizard analyzes the file, previews the entities, and adds them to the {{appTitle}} catalog.";
|
|
18
|
+
readonly "importInfoCard.githubIntegration.label": "GitHub only";
|
|
19
|
+
readonly "importInfoCard.githubIntegration.title": "Link to a repository";
|
|
20
|
+
readonly "importStepper.finish.title": "Finish";
|
|
21
|
+
readonly "importStepper.noLocation.title": "Create Pull Request";
|
|
22
|
+
readonly "importStepper.noLocation.createPr.ownerLabel": "Entity Owner";
|
|
23
|
+
readonly "importStepper.noLocation.createPr.detailsTitle": "Pull Request Details";
|
|
24
|
+
readonly "importStepper.noLocation.createPr.titleLabel": "Pull Request Title";
|
|
25
|
+
readonly "importStepper.noLocation.createPr.titlePlaceholder": "Add Backstage catalog entity descriptor files";
|
|
26
|
+
readonly "importStepper.noLocation.createPr.bodyLabel": "Pull Request Body";
|
|
27
|
+
readonly "importStepper.noLocation.createPr.bodyPlaceholder": "A describing text with Markdown support";
|
|
28
|
+
readonly "importStepper.noLocation.createPr.configurationTitle": "Entity Configuration";
|
|
29
|
+
readonly "importStepper.noLocation.createPr.componentNameLabel": "Name of the created component";
|
|
30
|
+
readonly "importStepper.noLocation.createPr.componentNamePlaceholder": "my-component";
|
|
31
|
+
readonly "importStepper.noLocation.createPr.ownerLoadingText": "Loading groups…";
|
|
32
|
+
readonly "importStepper.noLocation.createPr.ownerHelperText": "Select an owner from the list or enter a reference to a Group or a User";
|
|
33
|
+
readonly "importStepper.noLocation.createPr.ownerErrorHelperText": "required value";
|
|
34
|
+
readonly "importStepper.noLocation.createPr.ownerPlaceholder": "my-group";
|
|
35
|
+
readonly "importStepper.noLocation.createPr.codeownersHelperText": "WARNING: This may fail if no CODEOWNERS file is found at the target location.";
|
|
36
|
+
readonly "importStepper.singleLocation.title": "Select Locations";
|
|
37
|
+
readonly "importStepper.singleLocation.description": "Discovered Locations: 1";
|
|
38
|
+
readonly "importStepper.multipleLocations.title": "Select Locations";
|
|
39
|
+
readonly "importStepper.multipleLocations.description": "Discovered Locations: {{length, number}}";
|
|
40
|
+
readonly "importStepper.analyze.title": "Select URL";
|
|
41
|
+
readonly "importStepper.prepare.title": "Import Actions";
|
|
42
|
+
readonly "importStepper.prepare.description": "Optional";
|
|
43
|
+
readonly "importStepper.review.title": "Review";
|
|
44
|
+
readonly "stepFinishImportLocation.repository.title": "The following Pull Request has been opened: ";
|
|
45
|
+
readonly "stepFinishImportLocation.repository.description": "Your entities will be imported as soon as the Pull Request is merged.";
|
|
46
|
+
readonly "stepFinishImportLocation.backButtonText": "Register another";
|
|
47
|
+
readonly "stepFinishImportLocation.locations.new": "The following entities have been added to the catalog:";
|
|
48
|
+
readonly "stepFinishImportLocation.locations.backButtonText": "Register another";
|
|
49
|
+
readonly "stepFinishImportLocation.locations.existing": "A refresh was triggered for the following locations:";
|
|
50
|
+
readonly "stepFinishImportLocation.locations.viewButtonText": "View Component";
|
|
51
|
+
readonly "stepInitAnalyzeUrl.error.default": "Received unknown analysis result of type {{type}}. Please contact the support team.";
|
|
52
|
+
readonly "stepInitAnalyzeUrl.error.url": "Must start with http:// or https://.";
|
|
53
|
+
readonly "stepInitAnalyzeUrl.error.repository": "Couldn't generate entities for your repository";
|
|
54
|
+
readonly "stepInitAnalyzeUrl.error.locations": "There are no entities at this location";
|
|
55
|
+
readonly "stepInitAnalyzeUrl.urlHelperText": "Enter the full path to your entity file to start tracking your component";
|
|
56
|
+
readonly "stepInitAnalyzeUrl.nextButtonText": "Analyze";
|
|
57
|
+
readonly "stepPrepareCreatePullRequest.nextButtonText": "Create PR";
|
|
58
|
+
readonly "stepPrepareCreatePullRequest.previewPr.title": "Preview Pull Request";
|
|
59
|
+
readonly "stepPrepareCreatePullRequest.previewPr.subheader": "Create a new Pull Request";
|
|
60
|
+
readonly "stepPrepareCreatePullRequest.previewCatalogInfo.title": "Preview Entities";
|
|
61
|
+
readonly "stepPrepareSelectLocations.locations.description": "Select one or more locations that are present in your git repository:";
|
|
62
|
+
readonly "stepPrepareSelectLocations.locations.selectAll": "Select All";
|
|
63
|
+
readonly "stepPrepareSelectLocations.nextButtonText": "Review";
|
|
64
|
+
readonly "stepPrepareSelectLocations.existingLocations.description": "These locations already exist in the catalog:";
|
|
65
|
+
readonly "stepReviewLocation.refresh": "Refresh";
|
|
66
|
+
readonly "stepReviewLocation.import": "Import";
|
|
67
|
+
readonly "stepReviewLocation.catalog.new": "The following entities will be added to the catalog:";
|
|
68
|
+
readonly "stepReviewLocation.catalog.exists": "The following locations already exist in the catalog:";
|
|
69
|
+
readonly "stepReviewLocation.prepareResult.title": "The following Pull Request has been opened: ";
|
|
70
|
+
readonly "stepReviewLocation.prepareResult.description": "You can already import the location and {{appTitle}} will fetch the entities as soon as the Pull Request is merged.";
|
|
10
71
|
}>;
|
|
11
72
|
|
|
12
73
|
/** @alpha */
|
package/dist/alpha.esm.js
CHANGED
|
@@ -49,7 +49,7 @@ const catalogImportApi = ApiBlueprint.make({
|
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
51
|
var alpha = createFrontendPlugin({
|
|
52
|
-
|
|
52
|
+
pluginId: "catalog-import",
|
|
53
53
|
extensions: [catalogImportApi, catalogImportPage],
|
|
54
54
|
routes: {
|
|
55
55
|
importPage: convertLegacyRouteRef(rootRouteRef)
|
package/dist/alpha.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alpha.esm.js","sources":["../src/alpha.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n configApiRef,\n createApiFactory,\n discoveryApiRef,\n fetchApiRef,\n} from '@backstage/core-plugin-api';\nimport {\n compatWrapper,\n convertLegacyRouteRef,\n} from '@backstage/core-compat-api';\nimport {\n createFrontendPlugin,\n PageBlueprint,\n ApiBlueprint,\n} from '@backstage/frontend-plugin-api';\nimport {\n scmAuthApiRef,\n scmIntegrationsApiRef,\n} from '@backstage/integration-react';\nimport { CatalogImportClient, catalogImportApiRef } from './api';\nimport { rootRouteRef } from './plugin';\nimport { catalogApiRef } from '@backstage/plugin-catalog-react';\n\nexport * from './translation';\n\n// TODO: It's currently possible to override the import page with a custom one. We need to decide\n// whether this type of override is typically done with an input or by overriding the entire extension.\nconst catalogImportPage = PageBlueprint.make({\n params: {\n defaultPath: '/catalog-import',\n routeRef: convertLegacyRouteRef(rootRouteRef),\n loader: () =>\n import('./components/ImportPage').then(m =>\n compatWrapper(<m.ImportPage />),\n ),\n },\n});\n\nconst catalogImportApi = ApiBlueprint.make({\n params: {\n factory: createApiFactory({\n api: catalogImportApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n scmAuthApi: scmAuthApiRef,\n fetchApi: fetchApiRef,\n scmIntegrationsApi: scmIntegrationsApiRef,\n catalogApi: catalogApiRef,\n configApi: configApiRef,\n },\n factory: ({\n discoveryApi,\n scmAuthApi,\n fetchApi,\n scmIntegrationsApi,\n catalogApi,\n configApi,\n }) =>\n new CatalogImportClient({\n discoveryApi,\n scmAuthApi,\n scmIntegrationsApi,\n fetchApi,\n catalogApi,\n configApi,\n }),\n }),\n },\n});\n\n/** @alpha */\nexport default createFrontendPlugin({\n
|
|
1
|
+
{"version":3,"file":"alpha.esm.js","sources":["../src/alpha.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n configApiRef,\n createApiFactory,\n discoveryApiRef,\n fetchApiRef,\n} from '@backstage/core-plugin-api';\nimport {\n compatWrapper,\n convertLegacyRouteRef,\n} from '@backstage/core-compat-api';\nimport {\n createFrontendPlugin,\n PageBlueprint,\n ApiBlueprint,\n} from '@backstage/frontend-plugin-api';\nimport {\n scmAuthApiRef,\n scmIntegrationsApiRef,\n} from '@backstage/integration-react';\nimport { CatalogImportClient, catalogImportApiRef } from './api';\nimport { rootRouteRef } from './plugin';\nimport { catalogApiRef } from '@backstage/plugin-catalog-react';\n\nexport * from './translation';\n\n// TODO: It's currently possible to override the import page with a custom one. We need to decide\n// whether this type of override is typically done with an input or by overriding the entire extension.\nconst catalogImportPage = PageBlueprint.make({\n params: {\n defaultPath: '/catalog-import',\n routeRef: convertLegacyRouteRef(rootRouteRef),\n loader: () =>\n import('./components/ImportPage').then(m =>\n compatWrapper(<m.ImportPage />),\n ),\n },\n});\n\nconst catalogImportApi = ApiBlueprint.make({\n params: {\n factory: createApiFactory({\n api: catalogImportApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n scmAuthApi: scmAuthApiRef,\n fetchApi: fetchApiRef,\n scmIntegrationsApi: scmIntegrationsApiRef,\n catalogApi: catalogApiRef,\n configApi: configApiRef,\n },\n factory: ({\n discoveryApi,\n scmAuthApi,\n fetchApi,\n scmIntegrationsApi,\n catalogApi,\n configApi,\n }) =>\n new CatalogImportClient({\n discoveryApi,\n scmAuthApi,\n scmIntegrationsApi,\n fetchApi,\n catalogApi,\n configApi,\n }),\n }),\n },\n});\n\n/** @alpha */\nexport default createFrontendPlugin({\n pluginId: 'catalog-import',\n extensions: [catalogImportApi, catalogImportPage],\n routes: {\n importPage: convertLegacyRouteRef(rootRouteRef),\n },\n});\n\nexport { catalogImportTranslationRef } from './translation';\n"],"names":[],"mappings":";;;;;;;;;;;AA2CA,MAAM,iBAAA,GAAoB,cAAc,IAAK,CAAA;AAAA,EAC3C,MAAQ,EAAA;AAAA,IACN,WAAa,EAAA,iBAAA;AAAA,IACb,QAAA,EAAU,sBAAsB,YAAY,CAAA;AAAA,IAC5C,MAAQ,EAAA,MACN,OAAO,sCAAyB,CAAE,CAAA,IAAA;AAAA,MAAK,OACrC,aAAc,iBAAA,GAAA,CAAC,CAAE,CAAA,UAAA,EAAF,EAAa,CAAE;AAAA;AAChC;AAEN,CAAC,CAAA;AAED,MAAM,gBAAA,GAAmB,aAAa,IAAK,CAAA;AAAA,EACzC,MAAQ,EAAA;AAAA,IACN,SAAS,gBAAiB,CAAA;AAAA,MACxB,GAAK,EAAA,mBAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,YAAc,EAAA,eAAA;AAAA,QACd,UAAY,EAAA,aAAA;AAAA,QACZ,QAAU,EAAA,WAAA;AAAA,QACV,kBAAoB,EAAA,qBAAA;AAAA,QACpB,UAAY,EAAA,aAAA;AAAA,QACZ,SAAW,EAAA;AAAA,OACb;AAAA,MACA,SAAS,CAAC;AAAA,QACR,YAAA;AAAA,QACA,UAAA;AAAA,QACA,QAAA;AAAA,QACA,kBAAA;AAAA,QACA,UAAA;AAAA,QACA;AAAA,OACF,KACE,IAAI,mBAAoB,CAAA;AAAA,QACtB,YAAA;AAAA,QACA,UAAA;AAAA,QACA,kBAAA;AAAA,QACA,QAAA;AAAA,QACA,UAAA;AAAA,QACA;AAAA,OACD;AAAA,KACJ;AAAA;AAEL,CAAC,CAAA;AAGD,YAAe,oBAAqB,CAAA;AAAA,EAClC,QAAU,EAAA,gBAAA;AAAA,EACV,UAAA,EAAY,CAAC,gBAAA,EAAkB,iBAAiB,CAAA;AAAA,EAChD,MAAQ,EAAA;AAAA,IACN,UAAA,EAAY,sBAAsB,YAAY;AAAA;AAElD,CAAC,CAAA;;;;"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { LinkButton } from '@backstage/core-components';
|
|
3
|
+
import { useTranslationRef } from '@backstage/frontend-plugin-api';
|
|
3
4
|
import Button from '@material-ui/core/Button';
|
|
4
5
|
import CircularProgress from '@material-ui/core/CircularProgress';
|
|
5
6
|
import { makeStyles } from '@material-ui/core/styles';
|
|
7
|
+
import { catalogImportTranslationRef } from '../../translation.esm.js';
|
|
6
8
|
|
|
7
9
|
const useStyles = makeStyles((theme) => ({
|
|
8
10
|
wrapper: {
|
|
@@ -40,8 +42,9 @@ const NextButton = (props) => {
|
|
|
40
42
|
] });
|
|
41
43
|
};
|
|
42
44
|
const BackButton = (props) => {
|
|
45
|
+
const { t } = useTranslationRef(catalogImportTranslationRef);
|
|
43
46
|
const classes = useStyles();
|
|
44
|
-
return /* @__PURE__ */ jsx(Button, { variant: "outlined", className: classes.button, ...props, children: props.children || "
|
|
47
|
+
return /* @__PURE__ */ jsx(Button, { variant: "outlined", className: classes.button, ...props, children: props.children || t("buttons.back") });
|
|
45
48
|
};
|
|
46
49
|
const ViewComponentButton = (props) => {
|
|
47
50
|
const classes = useStyles();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../../src/components/Buttons/index.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 { LinkButton } from '@backstage/core-components';\nimport Button from '@material-ui/core/Button';\nimport CircularProgress from '@material-ui/core/CircularProgress';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { ComponentProps } from 'react';\n\nconst useStyles = makeStyles(theme => ({\n wrapper: {\n marginTop: theme.spacing(1),\n marginRight: theme.spacing(1),\n position: 'relative',\n },\n buttonProgress: {\n position: 'absolute',\n top: '50%',\n left: '50%',\n marginTop: -12,\n marginLeft: -12,\n },\n button: {\n marginTop: theme.spacing(1),\n marginRight: theme.spacing(1),\n },\n}));\n\nexport const NextButton = (\n props: ComponentProps<typeof Button> & { loading?: boolean },\n) => {\n const { loading, ...buttonProps } = props;\n const classes = useStyles();\n\n return (\n <div className={classes.wrapper}>\n <Button\n color=\"primary\"\n variant=\"contained\"\n {...buttonProps}\n disabled={props.disabled || props.loading}\n />\n {props.loading && (\n <CircularProgress size=\"1.5rem\" className={classes.buttonProgress} />\n )}\n {props.loading}\n </div>\n );\n};\n\nexport const BackButton = (props: ComponentProps<typeof Button>) => {\n const classes = useStyles();\n\n return (\n <Button variant=\"outlined\" className={classes.button} {...props}>\n {props.children || '
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../src/components/Buttons/index.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 { LinkButton } from '@backstage/core-components';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport Button from '@material-ui/core/Button';\nimport CircularProgress from '@material-ui/core/CircularProgress';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { ComponentProps } from 'react';\n\nimport { catalogImportTranslationRef } from '../../translation';\n\nconst useStyles = makeStyles(theme => ({\n wrapper: {\n marginTop: theme.spacing(1),\n marginRight: theme.spacing(1),\n position: 'relative',\n },\n buttonProgress: {\n position: 'absolute',\n top: '50%',\n left: '50%',\n marginTop: -12,\n marginLeft: -12,\n },\n button: {\n marginTop: theme.spacing(1),\n marginRight: theme.spacing(1),\n },\n}));\n\nexport const NextButton = (\n props: ComponentProps<typeof Button> & { loading?: boolean },\n) => {\n const { loading, ...buttonProps } = props;\n const classes = useStyles();\n\n return (\n <div className={classes.wrapper}>\n <Button\n color=\"primary\"\n variant=\"contained\"\n {...buttonProps}\n disabled={props.disabled || props.loading}\n />\n {props.loading && (\n <CircularProgress size=\"1.5rem\" className={classes.buttonProgress} />\n )}\n {props.loading}\n </div>\n );\n};\n\nexport const BackButton = (props: ComponentProps<typeof Button>) => {\n const { t } = useTranslationRef(catalogImportTranslationRef);\n const classes = useStyles();\n\n return (\n <Button variant=\"outlined\" className={classes.button} {...props}>\n {props.children || t('buttons.back')}\n </Button>\n );\n};\n\nexport const ViewComponentButton = (\n props: ComponentProps<typeof LinkButton>,\n) => {\n const classes = useStyles();\n\n return (\n <LinkButton\n color=\"primary\"\n variant=\"contained\"\n className={classes.button}\n {...props}\n >\n {props.children}\n </LinkButton>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAyBA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,OAAS,EAAA;AAAA,IACP,SAAA,EAAW,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,IAC1B,WAAA,EAAa,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,IAC5B,QAAU,EAAA;AAAA,GACZ;AAAA,EACA,cAAgB,EAAA;AAAA,IACd,QAAU,EAAA,UAAA;AAAA,IACV,GAAK,EAAA,KAAA;AAAA,IACL,IAAM,EAAA,KAAA;AAAA,IACN,SAAW,EAAA,CAAA,EAAA;AAAA,IACX,UAAY,EAAA,CAAA;AAAA,GACd;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,SAAA,EAAW,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,IAC1B,WAAA,EAAa,KAAM,CAAA,OAAA,CAAQ,CAAC;AAAA;AAEhC,CAAE,CAAA,CAAA;AAEW,MAAA,UAAA,GAAa,CACxB,KACG,KAAA;AACH,EAAA,MAAM,EAAE,OAAA,EAAS,GAAG,WAAA,EAAgB,GAAA,KAAA;AACpC,EAAA,MAAM,UAAU,SAAU,EAAA;AAE1B,EAAA,uBACG,IAAA,CAAA,KAAA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portButton } from '@backstage/core-components';
|
|
3
3
|
import { useApi, configApiRef } from '@backstage/core-plugin-api';
|
|
4
|
+
import { useTranslationRef } from '@backstage/frontend-plugin-api';
|
|
4
5
|
import Grid from '@material-ui/core/Grid';
|
|
5
|
-
import useMediaQuery from '@material-ui/core/useMediaQuery';
|
|
6
6
|
import { useTheme } from '@material-ui/core/styles';
|
|
7
|
+
import useMediaQuery from '@material-ui/core/useMediaQuery';
|
|
8
|
+
import { catalogImportTranslationRef } from '../../translation.esm.js';
|
|
7
9
|
import { ImportInfoCard } from '../ImportInfoCard/ImportInfoCard.esm.js';
|
|
8
10
|
import { ImportStepper } from '../ImportStepper/ImportStepper.esm.js';
|
|
9
11
|
import '@material-ui/core/Box';
|
|
@@ -14,11 +16,11 @@ import '@material-ui/core/StepLabel';
|
|
|
14
16
|
import '@material-ui/core/TextField';
|
|
15
17
|
import '@material-ui/core/Typography';
|
|
16
18
|
import '../Buttons/index.esm.js';
|
|
17
|
-
import '@material-ui/icons/LocationOn';
|
|
18
|
-
import '../EntityListComponent/EntityListComponent.esm.js';
|
|
19
|
-
import 'lodash/partition';
|
|
20
19
|
import '@backstage/catalog-model';
|
|
21
20
|
import '@backstage/plugin-catalog-react';
|
|
21
|
+
import '@material-ui/icons/LocationOn';
|
|
22
|
+
import 'lodash/partition';
|
|
23
|
+
import '../EntityListComponent/EntityListComponent.esm.js';
|
|
22
24
|
import 'react';
|
|
23
25
|
import 'react-hook-form';
|
|
24
26
|
import '../../api/CatalogImportApi.esm.js';
|
|
@@ -37,8 +39,6 @@ import '@material-ui/core/ListItem';
|
|
|
37
39
|
import '@material-ui/core/ListItemIcon';
|
|
38
40
|
import '@material-ui/core/ListItemText';
|
|
39
41
|
import '@backstage/errors';
|
|
40
|
-
import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
|
|
41
|
-
import { catalogImportTranslationRef } from '../../translation.esm.js';
|
|
42
42
|
|
|
43
43
|
const DefaultImportPage = () => {
|
|
44
44
|
const { t } = useTranslationRef(catalogImportTranslationRef);
|
|
@@ -46,15 +46,20 @@ const DefaultImportPage = () => {
|
|
|
46
46
|
const configApi = useApi(configApiRef);
|
|
47
47
|
const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
|
|
48
48
|
const appTitle = configApi.getOptionalString("app.title") || "Backstage";
|
|
49
|
-
const supportTitle = `Start tracking your component in ${appTitle} by adding it to the software catalog.`;
|
|
50
49
|
const contentItems = [
|
|
51
50
|
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, md: 4, lg: 6, xl: 8, children: /* @__PURE__ */ jsx(ImportInfoCard, {}) }, 0),
|
|
52
51
|
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, md: 8, lg: 6, xl: 4, children: /* @__PURE__ */ jsx(ImportStepper, {}) }, 1)
|
|
53
52
|
];
|
|
54
53
|
return /* @__PURE__ */ jsxs(Page, { themeId: "home", children: [
|
|
55
|
-
/* @__PURE__ */ jsx(Header, { title: t("
|
|
54
|
+
/* @__PURE__ */ jsx(Header, { title: t("defaultImportPage.headerTitle") }),
|
|
56
55
|
/* @__PURE__ */ jsxs(Content, { children: [
|
|
57
|
-
/* @__PURE__ */ jsx(
|
|
56
|
+
/* @__PURE__ */ jsx(
|
|
57
|
+
ContentHeader,
|
|
58
|
+
{
|
|
59
|
+
title: t("defaultImportPage.contentHeaderTitle", { appTitle }),
|
|
60
|
+
children: /* @__PURE__ */ jsx(SupportButton, { children: t("defaultImportPage.supportTitle", { appTitle }) })
|
|
61
|
+
}
|
|
62
|
+
),
|
|
58
63
|
/* @__PURE__ */ jsx(Grid, { container: true, spacing: 2, children: isMobile ? contentItems : contentItems.reverse() })
|
|
59
64
|
] })
|
|
60
65
|
] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultImportPage.esm.js","sources":["../../../src/components/DefaultImportPage/DefaultImportPage.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 {\n Content,\n ContentHeader,\n Header,\n Page,\n SupportButton,\n} from '@backstage/core-components';\nimport { configApiRef, useApi } from '@backstage/core-plugin-api';\nimport
|
|
1
|
+
{"version":3,"file":"DefaultImportPage.esm.js","sources":["../../../src/components/DefaultImportPage/DefaultImportPage.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 {\n Content,\n ContentHeader,\n Header,\n Page,\n SupportButton,\n} from '@backstage/core-components';\nimport { configApiRef, useApi } from '@backstage/core-plugin-api';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport Grid from '@material-ui/core/Grid';\nimport { useTheme } from '@material-ui/core/styles';\nimport useMediaQuery from '@material-ui/core/useMediaQuery';\n\nimport { catalogImportTranslationRef } from '../../translation';\nimport { ImportInfoCard } from '../ImportInfoCard';\nimport { ImportStepper } from '../ImportStepper';\n\n/**\n * The default catalog import page.\n *\n * @public\n */\nexport const DefaultImportPage = () => {\n const { t } = useTranslationRef(catalogImportTranslationRef);\n const theme = useTheme();\n const configApi = useApi(configApiRef);\n const isMobile = useMediaQuery(theme.breakpoints.down('sm'));\n const appTitle = configApi.getOptionalString('app.title') || 'Backstage';\n\n const contentItems = [\n <Grid key={0} item xs={12} md={4} lg={6} xl={8}>\n <ImportInfoCard />\n </Grid>,\n\n <Grid key={1} item xs={12} md={8} lg={6} xl={4}>\n <ImportStepper />\n </Grid>,\n ];\n\n return (\n <Page themeId=\"home\">\n <Header title={t('defaultImportPage.headerTitle')} />\n <Content>\n <ContentHeader\n title={t('defaultImportPage.contentHeaderTitle', { appTitle })}\n >\n <SupportButton>\n {t('defaultImportPage.supportTitle', { appTitle })}\n </SupportButton>\n </ContentHeader>\n\n <Grid container spacing={2}>\n {isMobile ? contentItems : contentItems.reverse()}\n </Grid>\n </Content>\n </Page>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCO,MAAM,oBAAoB,MAAM;AACrC,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,2BAA2B,CAAA;AAC3D,EAAA,MAAM,QAAQ,QAAS,EAAA;AACvB,EAAM,MAAA,SAAA,GAAY,OAAO,YAAY,CAAA;AACrC,EAAA,MAAM,WAAW,aAAc,CAAA,KAAA,CAAM,WAAY,CAAA,IAAA,CAAK,IAAI,CAAC,CAAA;AAC3D,EAAA,MAAM,QAAW,GAAA,SAAA,CAAU,iBAAkB,CAAA,WAAW,CAAK,IAAA,WAAA;AAE7D,EAAA,MAAM,YAAe,GAAA;AAAA,oBAClB,GAAA,CAAA,IAAA,EAAA,EAAa,IAAI,EAAA,IAAA,EAAC,IAAI,EAAI,EAAA,EAAA,EAAI,CAAG,EAAA,EAAA,EAAI,GAAG,EAAI,EAAA,CAAA,EAC3C,QAAC,kBAAA,GAAA,CAAA,cAAA,EAAA,EAAe,KADP,CAEX,CAAA;AAAA,oBAEC,GAAA,CAAA,IAAA,EAAA,EAAa,IAAI,EAAA,IAAA,EAAC,IAAI,EAAI,EAAA,EAAA,EAAI,CAAG,EAAA,EAAA,EAAI,GAAG,EAAI,EAAA,CAAA,EAC3C,QAAC,kBAAA,GAAA,CAAA,aAAA,EAAA,EAAc,KADN,CAEX;AAAA,GACF;AAEA,EACE,uBAAA,IAAA,CAAC,IAAK,EAAA,EAAA,OAAA,EAAQ,MACZ,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,MAAO,EAAA,EAAA,KAAA,EAAO,CAAE,CAAA,+BAA+B,CAAG,EAAA,CAAA;AAAA,yBAClD,OACC,EAAA,EAAA,QAAA,EAAA;AAAA,sBAAA,GAAA;AAAA,QAAC,aAAA;AAAA,QAAA;AAAA,UACC,KAAO,EAAA,CAAA,CAAE,sCAAwC,EAAA,EAAE,UAAU,CAAA;AAAA,UAE7D,8BAAC,aACE,EAAA,EAAA,QAAA,EAAA,CAAA,CAAE,kCAAkC,EAAE,QAAA,EAAU,CACnD,EAAA;AAAA;AAAA,OACF;AAAA,sBAEA,GAAA,CAAC,IAAK,EAAA,EAAA,SAAA,EAAS,IAAC,EAAA,OAAA,EAAS,GACtB,QAAW,EAAA,QAAA,GAAA,YAAA,GAAe,YAAa,CAAA,OAAA,EAC1C,EAAA;AAAA,KACF,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { InfoCard } from '@backstage/core-components';
|
|
3
3
|
import { useApi, configApiRef } from '@backstage/core-plugin-api';
|
|
4
|
+
import { useTranslationRef } from '@backstage/frontend-plugin-api';
|
|
4
5
|
import Chip from '@material-ui/core/Chip';
|
|
5
6
|
import Typography from '@material-ui/core/Typography';
|
|
6
7
|
import { catalogImportApiRef } from '../../api/CatalogImportApi.esm.js';
|
|
@@ -9,7 +10,6 @@ import 'git-url-parse';
|
|
|
9
10
|
import '@octokit/rest';
|
|
10
11
|
import 'js-base64';
|
|
11
12
|
import { useCatalogFilename } from '../../hooks/useCatalogFilename.esm.js';
|
|
12
|
-
import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
|
|
13
13
|
import { catalogImportTranslationRef } from '../../translation.esm.js';
|
|
14
14
|
|
|
15
15
|
const ImportInfoCard = (props) => {
|
|
@@ -29,33 +29,32 @@ const ImportInfoCard = (props) => {
|
|
|
29
29
|
title: t("importInfoCard.title"),
|
|
30
30
|
titleTypographyProps: { component: "h3" },
|
|
31
31
|
deepLink: {
|
|
32
|
-
title: "
|
|
32
|
+
title: t("importInfoCard.deepLinkTitle"),
|
|
33
33
|
link: "https://backstage.io/docs/features/software-catalog/"
|
|
34
34
|
},
|
|
35
35
|
children: [
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
|
|
38
|
-
appTitle,
|
|
39
|
-
"."
|
|
40
|
-
] }),
|
|
41
|
-
/* @__PURE__ */ jsx(Typography, { component: "h4", variant: "h6", children: "Link to an existing entity file" }),
|
|
36
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body2", paragraph: true, children: t("importInfoCard.linkDescription", { appTitle }) }),
|
|
37
|
+
/* @__PURE__ */ jsx(Typography, { component: "h4", variant: "h6", children: t("importInfoCard.fileLinkTitle") }),
|
|
42
38
|
/* @__PURE__ */ jsxs(Typography, { variant: "subtitle2", color: "textSecondary", paragraph: true, children: [
|
|
43
|
-
"
|
|
39
|
+
t("importInfoCard.examplePrefix"),
|
|
44
40
|
/* @__PURE__ */ jsx("code", { children: exampleLocationUrl })
|
|
45
41
|
] }),
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
"The wizard analyzes the file, previews the entities, and adds them to the ",
|
|
48
|
-
appTitle,
|
|
49
|
-
" catalog."
|
|
50
|
-
] }),
|
|
42
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body2", paragraph: true, children: t("importInfoCard.fileLinkDescription", { appTitle }) }),
|
|
51
43
|
hasGithubIntegration && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
52
44
|
/* @__PURE__ */ jsxs(Typography, { component: "h4", variant: "h6", children: [
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
45
|
+
t("importInfoCard.githubIntegration.title"),
|
|
46
|
+
/* @__PURE__ */ jsx(
|
|
47
|
+
Chip,
|
|
48
|
+
{
|
|
49
|
+
label: t("importInfoCard.githubIntegration.label"),
|
|
50
|
+
variant: "outlined",
|
|
51
|
+
size: "small",
|
|
52
|
+
style: { marginLeft: 8, marginBottom: 0 }
|
|
53
|
+
}
|
|
54
|
+
)
|
|
56
55
|
] }),
|
|
57
56
|
/* @__PURE__ */ jsxs(Typography, { variant: "subtitle2", color: "textSecondary", paragraph: true, children: [
|
|
58
|
-
"
|
|
57
|
+
t("importInfoCard.examplePrefix"),
|
|
59
58
|
/* @__PURE__ */ jsx("code", { children: exampleRepositoryUrl })
|
|
60
59
|
] }),
|
|
61
60
|
/* @__PURE__ */ jsxs(Typography, { variant: "body2", paragraph: true, children: [
|
|
@@ -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 Chip from '@material-ui/core/Chip';\nimport Typography from '@material-ui/core/Typography';\nimport { catalogImportApiRef } from '../../api';\nimport { useCatalogFilename } from '../../hooks';\nimport {
|
|
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 The wizard discovers all <code>{catalogFilename}</code> files in the\n repository, previews the entities, and adds them to the {appTitle}{' '}\n catalog.\n </Typography>\n {catalogImportApi.preparePullRequest && (\n <Typography variant=\"body2\" paragraph>\n If no entities are found, the wizard will prepare a Pull Request\n that adds an example <code>{catalogFilename}</code> and prepares\n the {appTitle} catalog to load all entities as soon as the Pull\n Request is merged.\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;A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ACjD,OAAQ,EAAA,UAAA;AAAA,gBACR,IAAK,EAAA,OAAA;AAAA,gBACL,KAAO,EAAA,EAAE,UAAY,EAAA,CAAA,EAAG,cAAc,CAAE;AAAA;AAAA;AAC1C,WACF,EAAA,CAAA;AAAA,+BACC,UAAW,EAAA,EAAA,OAAA,EAAQ,aAAY,KAAM,EAAA,eAAA,EAAgB,WAAS,IAC5D,EAAA,QAAA,EAAA;AAAA,YAAA,CAAA,CAAE,8BAA8B,CAAA;AAAA,4BACjC,GAAA,CAAC,UAAM,QAAqB,EAAA,oBAAA,EAAA;AAAA,WAC9B,EAAA,CAAA;AAAA,0BACC,IAAA,CAAA,UAAA,EAAA,EAAW,OAAQ,EAAA,OAAA,EAAQ,WAAS,IAAC,EAAA,QAAA,EAAA;AAAA,YAAA,2BAAA;AAAA,4BACX,GAAA,CAAC,UAAM,QAAgB,EAAA,eAAA,EAAA,CAAA;AAAA,YAAO,wEAAA;AAAA,YACE,QAAA;AAAA,YAAU,GAAA;AAAA,YAAI;AAAA,WAEzE,EAAA,CAAA;AAAA,UACC,iBAAiB,kBAChB,oBAAA,IAAA,CAAC,cAAW,OAAQ,EAAA,OAAA,EAAQ,WAAS,IAAC,EAAA,QAAA,EAAA;AAAA,YAAA,wFAAA;AAAA,4BAEf,GAAA,CAAC,UAAM,QAAgB,EAAA,eAAA,EAAA,CAAA;AAAA,YAAO,oBAAA;AAAA,YAC9C,QAAA;AAAA,YAAS;AAAA,WAEhB,EAAA;AAAA,SAEJ,EAAA;AAAA;AAAA;AAAA,GAEJ;AAEJ;;;;"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { InfoCard } from '@backstage/core-components';
|
|
3
3
|
import { useApi } from '@backstage/core-plugin-api';
|
|
4
|
+
import { useTranslationRef } from '@backstage/frontend-plugin-api';
|
|
5
|
+
import { catalogImportTranslationRef } from '@backstage/plugin-catalog-import/alpha';
|
|
4
6
|
import Step from '@material-ui/core/Step';
|
|
5
7
|
import StepContent from '@material-ui/core/StepContent';
|
|
6
8
|
import Stepper from '@material-ui/core/Stepper';
|
|
@@ -20,6 +22,7 @@ const useStyles = makeStyles(() => ({
|
|
|
20
22
|
}
|
|
21
23
|
}));
|
|
22
24
|
const ImportStepper = (props) => {
|
|
25
|
+
const { t } = useTranslationRef(catalogImportTranslationRef);
|
|
23
26
|
const {
|
|
24
27
|
initialUrl,
|
|
25
28
|
generateStepper = defaultGenerateStepper,
|
|
@@ -29,8 +32,8 @@ const ImportStepper = (props) => {
|
|
|
29
32
|
const classes = useStyles();
|
|
30
33
|
const state = useImportState({ initialUrl });
|
|
31
34
|
const states = useMemo(
|
|
32
|
-
() => generateStepper(state.activeFlow, defaultStepper),
|
|
33
|
-
[generateStepper, state.activeFlow]
|
|
35
|
+
() => generateStepper(state.activeFlow, defaultStepper, t),
|
|
36
|
+
[generateStepper, state.activeFlow, t]
|
|
34
37
|
);
|
|
35
38
|
const render = (step) => {
|
|
36
39
|
return /* @__PURE__ */ jsxs(Step, { children: [
|
|
@@ -48,25 +51,25 @@ const ImportStepper = (props) => {
|
|
|
48
51
|
render(
|
|
49
52
|
states.analyze(
|
|
50
53
|
state,
|
|
51
|
-
{ apis: { catalogImportApi } }
|
|
54
|
+
{ apis: { catalogImportApi }, t }
|
|
52
55
|
)
|
|
53
56
|
),
|
|
54
57
|
render(
|
|
55
58
|
states.prepare(
|
|
56
59
|
state,
|
|
57
|
-
{ apis: { catalogImportApi } }
|
|
60
|
+
{ apis: { catalogImportApi }, t }
|
|
58
61
|
)
|
|
59
62
|
),
|
|
60
63
|
render(
|
|
61
64
|
states.review(
|
|
62
65
|
state,
|
|
63
|
-
{ apis: { catalogImportApi } }
|
|
66
|
+
{ apis: { catalogImportApi }, t }
|
|
64
67
|
)
|
|
65
68
|
),
|
|
66
69
|
render(
|
|
67
70
|
states.finish(
|
|
68
71
|
state,
|
|
69
|
-
{ apis: { catalogImportApi } }
|
|
72
|
+
{ apis: { catalogImportApi }, t }
|
|
70
73
|
)
|
|
71
74
|
)
|
|
72
75
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImportStepper.esm.js","sources":["../../../src/components/ImportStepper/ImportStepper.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, InfoCardVariants } from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport Step from '@material-ui/core/Step';\nimport StepContent from '@material-ui/core/StepContent';\nimport Stepper from '@material-ui/core/Stepper';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { useMemo } from 'react';\nimport { catalogImportApiRef } from '../../api';\nimport { ImportFlows, ImportState, useImportState } from '../useImportState';\nimport {\n defaultGenerateStepper,\n defaultStepper,\n StepConfiguration,\n StepperProvider,\n} from './defaults';\n\nconst useStyles = makeStyles(() => ({\n stepperRoot: {\n padding: 0,\n },\n}));\n\n/**\n * Props for {@link ImportStepper}.\n *\n * @public\n */\nexport interface ImportStepperProps {\n initialUrl?: string;\n generateStepper?: (\n flow: ImportFlows,\n defaults: StepperProvider,\n ) => StepperProvider;\n variant?: InfoCardVariants;\n}\n\n/**\n * The stepper that holds the different import stages.\n *\n * @public\n */\nexport const ImportStepper = (props: ImportStepperProps) => {\n const {\n initialUrl,\n generateStepper = defaultGenerateStepper,\n variant,\n } = props;\n\n const catalogImportApi = useApi(catalogImportApiRef);\n const classes = useStyles();\n const state = useImportState({ initialUrl });\n\n const states = useMemo<StepperProvider>(\n () => generateStepper(state.activeFlow, defaultStepper),\n [generateStepper, state.activeFlow],\n );\n\n const render = (step: StepConfiguration) => {\n return (\n <Step>\n {step.stepLabel}\n <StepContent>{step.content}</StepContent>\n </Step>\n );\n };\n\n return (\n <InfoCard variant={variant}>\n <Stepper\n classes={{ root: classes.stepperRoot }}\n activeStep={state.activeStepNumber}\n orientation=\"vertical\"\n >\n {render(\n states.analyze(\n state as Extract<ImportState, { activeState: 'analyze' }>,\n { apis: { catalogImportApi } },\n ),\n )}\n {render(\n states.prepare(\n state as Extract<ImportState, { activeState: 'prepare' }>,\n { apis: { catalogImportApi } },\n ),\n )}\n {render(\n states.review(\n state as Extract<ImportState, { activeState: 'review' }>,\n { apis: { catalogImportApi } },\n ),\n )}\n {render(\n states.finish(\n state as Extract<ImportState, { activeState: 'finish' }>,\n { apis: { catalogImportApi } },\n ),\n )}\n </Stepper>\n </InfoCard>\n );\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ImportStepper.esm.js","sources":["../../../src/components/ImportStepper/ImportStepper.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, InfoCardVariants } from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { TranslationFunction } from '@backstage/core-plugin-api/alpha';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { catalogImportTranslationRef } from '@backstage/plugin-catalog-import/alpha';\nimport Step from '@material-ui/core/Step';\nimport StepContent from '@material-ui/core/StepContent';\nimport Stepper from '@material-ui/core/Stepper';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { useMemo } from 'react';\n\nimport { catalogImportApiRef } from '../../api';\nimport { ImportFlows, ImportState, useImportState } from '../useImportState';\nimport {\n defaultGenerateStepper,\n defaultStepper,\n StepConfiguration,\n StepperProvider,\n} from './defaults';\n\nconst useStyles = makeStyles(() => ({\n stepperRoot: {\n padding: 0,\n },\n}));\n\n/**\n * Props for {@link ImportStepper}.\n *\n * @public\n */\nexport interface ImportStepperProps {\n initialUrl?: string;\n generateStepper?: (\n flow: ImportFlows,\n defaults: StepperProvider,\n t: TranslationFunction<typeof catalogImportTranslationRef.T>,\n ) => StepperProvider;\n variant?: InfoCardVariants;\n}\n\n/**\n * The stepper that holds the different import stages.\n *\n * @public\n */\nexport const ImportStepper = (props: ImportStepperProps) => {\n const { t } = useTranslationRef(catalogImportTranslationRef);\n const {\n initialUrl,\n generateStepper = defaultGenerateStepper,\n variant,\n } = props;\n\n const catalogImportApi = useApi(catalogImportApiRef);\n const classes = useStyles();\n const state = useImportState({ initialUrl });\n\n const states = useMemo<StepperProvider>(\n () => generateStepper(state.activeFlow, defaultStepper, t),\n [generateStepper, state.activeFlow, t],\n );\n\n const render = (step: StepConfiguration) => {\n return (\n <Step>\n {step.stepLabel}\n <StepContent>{step.content}</StepContent>\n </Step>\n );\n };\n\n return (\n <InfoCard variant={variant}>\n <Stepper\n classes={{ root: classes.stepperRoot }}\n activeStep={state.activeStepNumber}\n orientation=\"vertical\"\n >\n {render(\n states.analyze(\n state as Extract<ImportState, { activeState: 'analyze' }>,\n { apis: { catalogImportApi }, t },\n ),\n )}\n {render(\n states.prepare(\n state as Extract<ImportState, { activeState: 'prepare' }>,\n { apis: { catalogImportApi }, t },\n ),\n )}\n {render(\n states.review(\n state as Extract<ImportState, { activeState: 'review' }>,\n { apis: { catalogImportApi }, t },\n ),\n )}\n {render(\n states.finish(\n state as Extract<ImportState, { activeState: 'finish' }>,\n { apis: { catalogImportApi }, t },\n ),\n )}\n </Stepper>\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;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