Merge pull request #22040 from awanlin/topic/azure-devops-alpha-di

[Azure DevOps] Added alpha support for the New Frontend System
This commit is contained in:
Fredrik Adelöw
2024-02-06 11:30:38 +01:00
committed by GitHub
8 changed files with 188 additions and 3 deletions
+13
View File
@@ -0,0 +1,13 @@
## API Report File for "@backstage/plugin-azure-devops"
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
import { BackstagePlugin } from '@backstage/frontend-plugin-api';
// @alpha (undocumented)
const _default: BackstagePlugin<{}, {}>;
export default _default;
// (No @packageDocumentation comment for this package)
```
+18 -3
View File
@@ -5,9 +5,22 @@
"types": "src/index.ts",
"license": "Apache-2.0",
"publishConfig": {
"access": "public",
"main": "dist/index.esm.js",
"types": "dist/index.d.ts"
"access": "public"
},
"exports": {
".": "./src/index.ts",
"./alpha": "./src/alpha.ts",
"./package.json": "./package.json"
},
"typesVersions": {
"*": {
"alpha": [
"src/alpha.ts"
],
"package.json": [
"package.json"
]
}
},
"backstage": {
"role": "frontend-plugin"
@@ -30,9 +43,11 @@
},
"dependencies": {
"@backstage/catalog-model": "workspace:^",
"@backstage/core-compat-api": "workspace:^",
"@backstage/core-components": "workspace:^",
"@backstage/core-plugin-api": "workspace:^",
"@backstage/errors": "workspace:^",
"@backstage/frontend-plugin-api": "workspace:^",
"@backstage/plugin-azure-devops-common": "workspace:^",
"@backstage/plugin-catalog-react": "workspace:^",
"@material-ui/core": "^4.12.2",
+18
View File
@@ -0,0 +1,18 @@
/*
* Copyright 2023 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export * from './alpha/index';
export { default } from './alpha/index';
+17
View File
@@ -0,0 +1,17 @@
/*
* Copyright 2023 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { default } from './plugin';
+111
View File
@@ -0,0 +1,111 @@
/*
* Copyright 2023 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
import {
createApiExtension,
createApiFactory,
createPageExtension,
createPlugin,
discoveryApiRef,
identityApiRef,
} from '@backstage/frontend-plugin-api';
import { azureDevOpsApiRef, AzureDevOpsClient } from '../api';
import {
compatWrapper,
convertLegacyRouteRef,
} from '@backstage/core-compat-api';
import {
createEntityCardExtension,
createEntityContentExtension,
} from '@backstage/plugin-catalog-react/alpha';
import { azurePullRequestDashboardRouteRef } from '../routes';
/** @alpha */
export const azureDevOpsApi = createApiExtension({
factory: createApiFactory({
api: azureDevOpsApiRef,
deps: { discoveryApi: discoveryApiRef, identityApi: identityApiRef },
factory: ({ discoveryApi, identityApi }) =>
new AzureDevOpsClient({ discoveryApi, identityApi }),
}),
});
/** @alpha */
export const azureDevOpsPullRequestPage = createPageExtension({
defaultPath: '/azure-pull-requests',
routeRef: convertLegacyRouteRef(azurePullRequestDashboardRouteRef),
loader: () =>
import('../components/PullRequestsPage').then(m =>
compatWrapper(<m.PullRequestsPage />),
),
});
/** @alpha */
export const azureDevOpsPipelinesEntityContent = createEntityContentExtension({
name: 'pipelines',
defaultPath: '/pipelines',
defaultTitle: 'Pipelines',
loader: () =>
import('../components/EntityPageAzurePipelines').then(m =>
compatWrapper(<m.EntityPageAzurePipelines />),
),
});
/** @alpha */
export const azureDevOpsGitTagsEntityContent = createEntityContentExtension({
name: 'git-tags',
defaultPath: '/git-tags',
defaultTitle: 'Git Tags',
loader: () =>
import('../components/EntityPageAzureGitTags').then(m =>
compatWrapper(<m.EntityPageAzureGitTags />),
),
});
/** @alpha */
export const azureDevOpsPullRequestsEntityContent =
createEntityContentExtension({
name: 'pull-requests',
defaultPath: '/pull-requests',
defaultTitle: 'Pull Requests',
loader: () =>
import('../components/EntityPageAzurePullRequests').then(m =>
compatWrapper(<m.EntityPageAzurePullRequests />),
),
});
/** @alpha */
export const azureDevOpsReadmeEntityCard = createEntityCardExtension({
name: 'readme',
loader: async () =>
import('../components/ReadmeCard').then(m =>
compatWrapper(<m.ReadmeCard />),
),
});
/** @alpha */
export default createPlugin({
id: 'azure-devops',
extensions: [
azureDevOpsApi,
azureDevOpsReadmeEntityCard,
azureDevOpsPipelinesEntityContent,
azureDevOpsGitTagsEntityContent,
azureDevOpsPullRequestsEntityContent,
azureDevOpsPullRequestPage,
],
});