UNPKG

@roadiehq/backstage-plugin-github-pull-requests

Version:
72 lines (69 loc) 2.9 kB
import { createRouteRef, createPlugin, createApiFactory, configApiRef, createRoutableExtension, createComponentExtension } from '@backstage/core-plugin-api'; import { createCardExtension } from '@backstage/plugin-home-react'; import { githubPullRequestsApiRef } from './api/GithubPullRequestsApi.esm.js'; import { GithubPullRequestsClient } from './api/GithubPullRequestsClient.esm.js'; import { scmAuthApiRef } from '@backstage/integration-react'; const entityContentRouteRef = createRouteRef({ id: "github-pull-requests" }); const githubPullRequestsPlugin = createPlugin({ id: "github-pull-requests", apis: [ createApiFactory({ api: githubPullRequestsApiRef, deps: { configApi: configApiRef, scmAuthApi: scmAuthApiRef }, factory: ({ configApi, scmAuthApi }) => new GithubPullRequestsClient({ configApi, scmAuthApi }) }) ], routes: { entityContent: entityContentRouteRef } }); const EntityGithubPullRequestsContent = githubPullRequestsPlugin.provide( createRoutableExtension({ name: "EntityGithubPullRequestsContent", component: () => import('./components/Router.esm.js').then((m) => m.Router), mountPoint: entityContentRouteRef }) ); const EntityGithubPullRequestsOverviewCard = githubPullRequestsPlugin.provide( createComponentExtension({ name: "EntityGithubPullRequestsOverviewCard", component: { lazy: () => import('./components/PullRequestsStatsCard/index.esm.js').then( (m) => m.PullRequestsStatsCard ) } }) ); const EntityGithubPullRequestsTable = githubPullRequestsPlugin.provide( createComponentExtension({ name: "EntityGithubPullRequestsTable", component: { lazy: () => import('./components/PullRequestsTable/index.esm.js').then((m) => m.PullRequestsTable) } }) ); const HomePageRequestedReviewsCard = githubPullRequestsPlugin.provide( createCardExtension({ name: "HomePageRequestedReviewsCard", title: "Review requests", components: () => import('./components/Home/RequestedReviewsCard/index.esm.js') }) ); const HomePageYourOpenPullRequestsCard = githubPullRequestsPlugin.provide( createCardExtension({ name: "YourOpenPullRequestsCard", title: "Your open pull requests", components: () => import('./components/Home/YourOpenPullRequestsCard/index.esm.js') }) ); const EntityGithubGroupPullRequestsCard = githubPullRequestsPlugin.provide( createCardExtension({ name: "EntityGithubGroupPullRequestsCard", title: "Team Assigned Review requests", components: () => import('./components/GroupPullRequestsCard/index.esm.js') }) ); export { EntityGithubGroupPullRequestsCard, EntityGithubPullRequestsContent, EntityGithubPullRequestsOverviewCard, EntityGithubPullRequestsTable, HomePageRequestedReviewsCard, HomePageYourOpenPullRequestsCard, entityContentRouteRef, githubPullRequestsPlugin }; //# sourceMappingURL=plugin.esm.js.map