Merge pull request #22633 from backstage/philipph/di-org-plugin
Initial migration of org plugin to new frontend system
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-org': patch
|
||||
---
|
||||
|
||||
Added basic support for the new frontend system, exported from the `/alpha` subpath.
|
||||
@@ -5,6 +5,7 @@ app:
|
||||
bindings:
|
||||
catalog.viewTechDoc: techdocs.docRoot
|
||||
catalog.createComponent: catalog-import.importPage
|
||||
org.catalogIndex: catalog.catalogIndex
|
||||
|
||||
extensions:
|
||||
# - apis.plugin.graphiql.browse.gitlab: true
|
||||
@@ -26,6 +27,12 @@ app:
|
||||
- entity-content:azure-devops/pull-requests
|
||||
- entity-content:azure-devops/git-tags
|
||||
|
||||
# Org Plugin
|
||||
- entity-card:org/group-profile
|
||||
- entity-card:org/members-list
|
||||
- entity-card:org/ownership
|
||||
- entity-card:org/user-profile
|
||||
|
||||
# scmAuthExtension: >-
|
||||
# createScmAuthExtension({
|
||||
# id: 'apis.scmAuth.addons.ghe',
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
## API Report File for "@backstage/plugin-org"
|
||||
|
||||
> 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';
|
||||
import { ExternalRouteRef } from '@backstage/frontend-plugin-api';
|
||||
|
||||
// @alpha (undocumented)
|
||||
const _default: BackstagePlugin<
|
||||
{},
|
||||
{
|
||||
catalogIndex: ExternalRouteRef<undefined, false>;
|
||||
}
|
||||
>;
|
||||
export default _default;
|
||||
|
||||
// (No @packageDocumentation comment for this package)
|
||||
```
|
||||
@@ -4,11 +4,24 @@
|
||||
"version": "0.6.20-next.1",
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"exports": {
|
||||
".": "./src/index.ts",
|
||||
"./alpha": "./src/alpha.tsx",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"typesVersions": {
|
||||
"*": {
|
||||
"alpha": [
|
||||
"src/alpha.tsx"
|
||||
],
|
||||
"package.json": [
|
||||
"package.json"
|
||||
]
|
||||
}
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"main": "dist/index.esm.js",
|
||||
"types": "dist/index.d.ts"
|
||||
"access": "public"
|
||||
},
|
||||
"backstage": {
|
||||
"role": "frontend-plugin"
|
||||
@@ -31,8 +44,10 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/catalog-model": "workspace:^",
|
||||
"@backstage/core-compat-api": "workspace:^",
|
||||
"@backstage/core-components": "workspace:^",
|
||||
"@backstage/core-plugin-api": "workspace:^",
|
||||
"@backstage/frontend-plugin-api": "workspace:^",
|
||||
"@backstage/plugin-catalog-common": "workspace:^",
|
||||
"@backstage/plugin-catalog-react": "workspace:^",
|
||||
"@material-ui/core": "^4.12.2",
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* 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 {
|
||||
compatWrapper,
|
||||
convertLegacyRouteRefs,
|
||||
} from '@backstage/core-compat-api';
|
||||
import { createPlugin } from '@backstage/frontend-plugin-api';
|
||||
import React from 'react';
|
||||
import { catalogIndexRouteRef } from './routes';
|
||||
import { createEntityCardExtension } from '@backstage/plugin-catalog-react/alpha';
|
||||
|
||||
/** @alpha */
|
||||
const EntityGroupProfileCard = createEntityCardExtension({
|
||||
name: 'group-profile',
|
||||
filter: 'kind:group',
|
||||
loader: async () =>
|
||||
import('./components/Cards/Group/GroupProfile/GroupProfileCard').then(m =>
|
||||
compatWrapper(<m.GroupProfileCard />),
|
||||
),
|
||||
});
|
||||
|
||||
/** @alpha */
|
||||
const EntityMembersListCard = createEntityCardExtension({
|
||||
name: 'members-list',
|
||||
filter: 'kind:group',
|
||||
loader: async () =>
|
||||
import('./components/Cards/Group/MembersList/MembersListCard').then(m =>
|
||||
compatWrapper(<m.MembersListCard />),
|
||||
),
|
||||
});
|
||||
|
||||
/** @alpha */
|
||||
const EntityOwnershipCard = createEntityCardExtension({
|
||||
name: 'ownership',
|
||||
filter: 'kind:group,user',
|
||||
loader: async () =>
|
||||
import('./components/Cards/OwnershipCard/OwnershipCard').then(m =>
|
||||
compatWrapper(<m.OwnershipCard />),
|
||||
),
|
||||
});
|
||||
|
||||
/** @alpha */
|
||||
const EntityUserProfileCard = createEntityCardExtension({
|
||||
name: 'user-profile',
|
||||
filter: 'kind:user',
|
||||
loader: async () =>
|
||||
import('./components/Cards/User/UserProfileCard/UserProfileCard').then(m =>
|
||||
compatWrapper(<m.UserProfileCard />),
|
||||
),
|
||||
});
|
||||
|
||||
/** @alpha */
|
||||
export default createPlugin({
|
||||
id: 'org',
|
||||
extensions: [
|
||||
EntityGroupProfileCard,
|
||||
EntityMembersListCard,
|
||||
EntityOwnershipCard,
|
||||
EntityUserProfileCard,
|
||||
],
|
||||
externalRoutes: convertLegacyRouteRefs({
|
||||
catalogIndex: catalogIndexRouteRef,
|
||||
}),
|
||||
});
|
||||
@@ -7867,9 +7867,11 @@ __metadata:
|
||||
"@backstage/catalog-model": "workspace:^"
|
||||
"@backstage/cli": "workspace:^"
|
||||
"@backstage/core-app-api": "workspace:^"
|
||||
"@backstage/core-compat-api": "workspace:^"
|
||||
"@backstage/core-components": "workspace:^"
|
||||
"@backstage/core-plugin-api": "workspace:^"
|
||||
"@backstage/dev-utils": "workspace:^"
|
||||
"@backstage/frontend-plugin-api": "workspace:^"
|
||||
"@backstage/plugin-catalog": "workspace:^"
|
||||
"@backstage/plugin-catalog-common": "workspace:^"
|
||||
"@backstage/plugin-catalog-react": "workspace:^"
|
||||
|
||||
Reference in New Issue
Block a user