entity page UI and workflow fix

This commit is contained in:
Med Mouine 2024-05-24 09:08:37 -04:00
parent c4c33cae7f
commit ee4e7b4cf3
22 changed files with 1564 additions and 783 deletions

View File

@ -1,17 +1,11 @@
app:
title: Scaffolded Backstage App
title: Sreez Portal
baseUrl: http://localhost:3000
organization:
name: Sreez
backend:
# Used for enabling authentication, secret is shared by all backend plugins
# See https://backstage.io/docs/auth/service-to-service-auth for
# information on the format
# auth:
# keys:
# - secret: ${BACKEND_SECRET}
baseUrl: http://localhost:7007
listen:
port: 7007
@ -89,8 +83,6 @@ integrations:
apps:
- $include: github-app-backstage-sreez-credentials.yaml
scaffolder:
# see https://backstage.io/docs/features/software-templates/configuration for software template options
events:
modules:
github:
@ -120,71 +112,27 @@ catalog:
# Local example data, file locations are relative to the backend process, typically `packages/backend`
- type: file
target: ../../examples/entities.yaml
# Local example template
- type: file
target: ../../examples/template/template.yaml
rules:
- allow: [ Template ]
- type: url
target: https://github.com/backstage/backstage/blob/master/packages/catalog-model/examples/all.yaml
# Local example organizational data
# - type: file
# target: ../../examples/org.yaml
# rules:
# - allow: [User, Group]
# - type: github-org
# target: https://github.com/kheops-org
# rules:
# - allow: [User, Group]
# - type: file
# target: ./examples/entities.yaml
# - type: file
# target: ./examples/template/template.yaml
# rules:
# - allow: [Template]
# - type: file
# target: ./examples/org.yaml
# rules:
# - allow: [User, Group]
- type: url
target: https://github.com/backstage/backstage/raw/master/packages/catalog-model/examples/apis/petstore-api.yaml
- type: url
target: https://github.com/Kheops-org/backstage-templates/blob/main/templates.yaml
rules:
- allow: [ Template ]
# - type: file
# target: ../../../../backstage-templates/templates.yaml
# rules:
# - allow: [Template]
- type: url
target: https://github.com/redhat-developer/red-hat-developer-hub-software-templates/blob/main/templates.yaml
rules:
- allow: [ Template ]
## Uncomment these lines to add more example data
# - type: url
# target: https://github.com/backstage/backstage/blob/master/packages/catalog-model/examples/all.yaml
## Uncomment these lines to add an example org
# - type: url
# target: https://github.com/backstage/backstage/blob/master/packages/catalog-model/examples/acme-corp.yaml
# rules:
# - allow: [User, Group]
devTools:
externalDependencies:
endpoints:
- name: "Google"
type: "fetch"
target: "https://google.ca"
- name: "Google Public DNS"
type: "ping"
target: "8.8.8.8"
permission:
enabled: true
notifications:
# curl -X POST http://localhost:7007/api/notifications/notifications -H "Content-Type: application/json" -H "notifications-secret: your-secret-token-shared-with-external-services" -d '{"title":"my-title","origin":"my-origin","message":"message one","topic":"my-topic"}'
externalCallerSecret: notifications-secret
iframe:
allowList: [ "sreez.nationtech.io", "www.hyperdx.io", "http://localhost:8080" ]

View File

@ -45,7 +45,10 @@
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@roadiehq/backstage-plugin-argo-cd": "^2.6.4",
"@roadiehq/backstage-plugin-github-insights": "^2.3.29",
"@roadiehq/backstage-plugin-github-pull-requests": "^2.5.25",
"@roadiehq/backstage-plugin-iframe": "^1.3.17",
"@rsc-labs/backstage-changelog-plugin": "^0.5.0",
"@veecode-platform/backstage-plugin-github-workflows": "^0.2.70",
"add": "^2.0.6",
"history": "^5.0.0",

View File

@ -1,143 +1,126 @@
import React from 'react';
import { Navigate, Route } from 'react-router-dom';
import { apiDocsPlugin, ApiExplorerPage } from '@backstage/plugin-api-docs';
import {
CatalogEntityPage,
CatalogIndexPage,
catalogPlugin,
} from '@backstage/plugin-catalog';
import {
CatalogImportPage,
catalogImportPlugin,
} from '@backstage/plugin-catalog-import';
import { ScaffolderPage, scaffolderPlugin } from '@backstage/plugin-scaffolder';
import { orgPlugin } from '@backstage/plugin-org';
import { SearchPage } from '@backstage/plugin-search';
import { TechRadarPage } from '@backstage/plugin-tech-radar';
import {
TechDocsIndexPage,
techdocsPlugin,
TechDocsReaderPage,
} from '@backstage/plugin-techdocs';
import { TechDocsAddons } from '@backstage/plugin-techdocs-react';
import { ReportIssue } from '@backstage/plugin-techdocs-module-addons-contrib';
import { UserSettingsPage } from '@backstage/plugin-user-settings';
import { apis } from './apis';
import { entityPage } from './components/catalog/EntityPage';
import { searchPage } from './components/search/SearchPage';
import { Root } from './components/Root';
import {Navigate, Route} from 'react-router-dom';
import {apiDocsPlugin, ApiExplorerPage} from '@backstage/plugin-api-docs';
import {CatalogEntityPage, CatalogIndexPage, catalogPlugin,} from '@backstage/plugin-catalog';
import {CatalogImportPage, catalogImportPlugin,} from '@backstage/plugin-catalog-import';
import {ScaffolderPage, scaffolderPlugin} from '@backstage/plugin-scaffolder';
import {orgPlugin} from '@backstage/plugin-org';
import {SearchPage} from '@backstage/plugin-search';
import {TechRadarPage} from '@backstage/plugin-tech-radar';
import {TechDocsIndexPage, techdocsPlugin, TechDocsReaderPage,} from '@backstage/plugin-techdocs';
import {TechDocsAddons} from '@backstage/plugin-techdocs-react';
import {ReportIssue} from '@backstage/plugin-techdocs-module-addons-contrib';
import {UserSettingsPage} from '@backstage/plugin-user-settings';
import {apis} from './apis';
import {entityPage} from './components/catalog/EntityPage';
import {searchPage} from './components/search/SearchPage';
import {Root} from './components/Root';
import {
AlertDisplay,
OAuthRequestDialog,
SignInPage,
} from '@backstage/core-components';
import { createApp } from '@backstage/app-defaults';
import { AppRouter, FlatRoutes } from '@backstage/core-app-api';
import { CatalogGraphPage } from '@backstage/plugin-catalog-graph';
import { RequirePermission } from '@backstage/plugin-permission-react';
import { catalogEntityCreatePermission } from '@backstage/plugin-catalog-common/alpha';
import { githubAuthApiRef } from '@backstage/core-plugin-api';
import { DevToolsPage } from '@backstage/plugin-devtools';
import { UnifiedThemeProvider } from '@backstage/theme';
import { SreezCustomTheme } from './theme/custom';
import {AlertDisplay, OAuthRequestDialog, SignInPage,} from '@backstage/core-components';
import {createApp} from '@backstage/app-defaults';
import {AppRouter, FlatRoutes} from '@backstage/core-app-api';
import {CatalogGraphPage} from '@backstage/plugin-catalog-graph';
import {RequirePermission} from '@backstage/plugin-permission-react';
import {catalogEntityCreatePermission} from '@backstage/plugin-catalog-common/alpha';
import {githubAuthApiRef} from '@backstage/core-plugin-api';
import {UnifiedThemeProvider} from '@backstage/theme';
import {SreezCustomTheme} from './theme/custom';
import LightIcon from '@material-ui/icons/WbSunny';
const app = createApp({
themes: [{
id: 'my-theme',
title: 'My Custom Theme',
variant: 'dark',
icon: <LightIcon />,
Provider: ({ children }) => (
<UnifiedThemeProvider theme={SreezCustomTheme} children={children} />
)
}],
apis,
bindRoutes({ bind }) {
bind(catalogPlugin.externalRoutes, {
createComponent: scaffolderPlugin.routes.root,
viewTechDoc: techdocsPlugin.routes.docRoot,
createFromTemplate: scaffolderPlugin.routes.selectedTemplate,
});
bind(apiDocsPlugin.externalRoutes, {
registerApi: catalogImportPlugin.routes.importPage,
});
bind(scaffolderPlugin.externalRoutes, {
registerComponent: catalogImportPlugin.routes.importPage,
viewTechDoc: techdocsPlugin.routes.docRoot,
});
bind(orgPlugin.externalRoutes, {
catalogIndex: catalogPlugin.routes.catalogIndex,
});
},
components: {
SignInPage: props => (
<SignInPage
{...props}
auto
providers={[
'guest',
{
id: 'github-auth-provider',
title: 'GitHub',
message: 'Sign in using GitHub',
apiRef: githubAuthApiRef,
}]}
/>
),
},
themes: [{
id: 'sreez-theme',
title: 'Sreez Default Theme',
variant: 'dark',
icon: <LightIcon/>,
Provider: ({children}) => (
<UnifiedThemeProvider theme={SreezCustomTheme} children={children}/>
)
}],
apis,
bindRoutes({bind}) {
bind(catalogPlugin.externalRoutes, {
createComponent: scaffolderPlugin.routes.root,
viewTechDoc: techdocsPlugin.routes.docRoot,
createFromTemplate: scaffolderPlugin.routes.selectedTemplate,
});
bind(apiDocsPlugin.externalRoutes, {
registerApi: catalogImportPlugin.routes.importPage,
});
bind(scaffolderPlugin.externalRoutes, {
registerComponent: catalogImportPlugin.routes.importPage,
viewTechDoc: techdocsPlugin.routes.docRoot,
});
bind(orgPlugin.externalRoutes, {
catalogIndex: catalogPlugin.routes.catalogIndex,
});
},
components: {
SignInPage: props => (
<SignInPage
{...props}
auto
providers={[
'guest',
{
id: 'github-auth-provider',
title: 'GitHub',
message: 'Sign in using GitHub',
apiRef: githubAuthApiRef,
}]}
/>
),
},
});
const routes = (
<FlatRoutes>
<Route path="/devtools" element={<DevToolsPage />} />
<Route path="/" element={<Navigate to="catalog" />} />
<Route path="/catalog" element={<CatalogIndexPage />} />
<Route
path="/catalog/:namespace/:kind/:name"
element={<CatalogEntityPage />}
>
{entityPage}
</Route>
<Route path="/docs" element={<TechDocsIndexPage />} />
<Route
path="/docs/:namespace/:kind/:name/*"
element={<TechDocsReaderPage />}
>
<TechDocsAddons>
<ReportIssue />
</TechDocsAddons>
</Route>
<Route path="/create" element={<ScaffolderPage />} />
<Route path="/api-docs" element={<ApiExplorerPage />} />
<Route
path="/tech-radar"
element={<TechRadarPage width={1500} height={800} />}
/>
<Route
path="/catalog-import"
element={
<RequirePermission permission={catalogEntityCreatePermission}>
<CatalogImportPage />
</RequirePermission>
}
/>
<Route path="/search" element={<SearchPage />}>
{searchPage}
</Route>
<Route path="/settings" element={<UserSettingsPage />} />
<Route path="/catalog-graph" element={<CatalogGraphPage />} />
</FlatRoutes>
<FlatRoutes>
<Route path="/" element={<Navigate to="catalog"/>}/>
<Route path="/catalog" element={<CatalogIndexPage/>}/>
<Route
path="/catalog/:namespace/:kind/:name"
element={<CatalogEntityPage/>}
>
{entityPage}
</Route>
<Route path="/docs" element={<TechDocsIndexPage/>}/>
<Route
path="/docs/:namespace/:kind/:name/*"
element={<TechDocsReaderPage/>}
>
<TechDocsAddons>
<ReportIssue/>
</TechDocsAddons>
</Route>
<Route path="/create" element={<ScaffolderPage/>}/>
<Route path="/api-docs" element={<ApiExplorerPage/>}/>
<Route
path="/tech-radar"
element={<TechRadarPage width={1500} height={800}/>}
/>
<Route
path="/catalog-import"
element={
<RequirePermission permission={catalogEntityCreatePermission}>
<CatalogImportPage/>
</RequirePermission>
}
/>
<Route path="/search" element={<SearchPage/>}>
{searchPage}
</Route>
<Route path="/settings" element={<UserSettingsPage/>}/>
<Route path="/catalog-graph" element={<CatalogGraphPage/>}/>
</FlatRoutes>
);
export default app.createRoot(
<>
<AlertDisplay />
<OAuthRequestDialog />
<AppRouter>
<Root>{routes}</Root>
</AppRouter>
</>,
<>
<AlertDisplay/>
<OAuthRequestDialog/>
<AppRouter>
<Root>{routes}</Root>
</AppRouter>
</>,
);

View File

@ -1,442 +1,22 @@
import React from 'react';
import { Button, Grid } from '@material-ui/core';
import {
EntityApiDefinitionCard,
EntityConsumedApisCard,
EntityConsumingComponentsCard,
EntityHasApisCard,
EntityProvidedApisCard,
EntityProvidingComponentsCard,
} from '@backstage/plugin-api-docs';
import {
EntityAboutCard,
EntityDependsOnComponentsCard,
EntityDependsOnResourcesCard,
EntityHasComponentsCard,
EntityHasResourcesCard,
EntityHasSubcomponentsCard,
EntityHasSystemsCard,
EntityLayout,
EntityLinksCard,
EntitySwitch,
EntityOrphanWarning,
EntityProcessingErrorsPanel,
isComponentType,
isKind,
hasCatalogProcessingErrors,
isOrphan,
hasRelationWarnings,
EntityRelationWarning,
} from '@backstage/plugin-catalog';
import {
isGithubActionsAvailable,
EntityGithubActionsContent,
} from '@backstage-community/plugin-github-actions';
import {
EntityUserProfileCard,
EntityGroupProfileCard,
EntityMembersListCard,
EntityOwnershipCard,
} from '@backstage/plugin-org';
import { EntityTechdocsContent } from '@backstage/plugin-techdocs';
import { EmptyState } from '@backstage/core-components';
import {
Direction,
EntityCatalogGraphCard,
} from '@backstage/plugin-catalog-graph';
import {
RELATION_API_CONSUMED_BY,
RELATION_API_PROVIDED_BY,
RELATION_CONSUMES_API,
RELATION_DEPENDENCY_OF,
RELATION_DEPENDS_ON,
RELATION_HAS_PART,
RELATION_PART_OF,
RELATION_PROVIDES_API,
} from '@backstage/catalog-model';
import { TechDocsAddons } from '@backstage/plugin-techdocs-react';
import { ReportIssue } from '@backstage/plugin-techdocs-module-addons-contrib';
import {
EntityArgoCDOverviewCard,
isArgocdAvailable,
} from '@roadiehq/backstage-plugin-argo-cd';
import {
GithubWorkflowsCard,
GithubWorkflowsList,
isGithubAvailable,
isGithubWorkflowsAvailable,
} from '@veecode-platform/backstage-plugin-github-workflows';
import {
EntityGithubPullRequestsContent,
EntityGithubPullRequestsOverviewCard,
} from '@roadiehq/backstage-plugin-github-pull-requests';
const techdocsContent = (
<EntityTechdocsContent>
<TechDocsAddons>
<ReportIssue />
</TechDocsAddons>
</EntityTechdocsContent>
);
const cicdContent = (
<EntitySwitch>
<EntitySwitch.Case if={isGithubActionsAvailable}>
<EntityGithubActionsContent />
</EntitySwitch.Case>
<EntitySwitch.Case>
<EmptyState
title="No CI/CD available for this entity"
missing="info"
description="You need to add an annotation to your component if you want to enable CI/CD for it. You can read more about annotations in Backstage by clicking the button below."
action={
<Button
variant="contained"
color="primary"
href="https://backstage.io/docs/features/software-catalog/well-known-annotations"
>
Read more
</Button>
}
/>
</EntitySwitch.Case>
</EntitySwitch>
);
const workflowsContent = (
<EntitySwitch>
<EntitySwitch.Case if={isGithubActionsAvailable}>
<GithubWorkflowsList />
</EntitySwitch.Case>
<EntitySwitch.Case>
<EmptyState
title="No CI/CD available for this entity"
missing="info"
description="You need to add an annotation to your component if you want to enable CI/CD for it. You can read more about annotations in Backstage by clicking the button below."
action={
<Button
variant="contained"
color="primary"
href="https://backstage.io/docs/features/software-catalog/well-known-annotations"
>
Read more
</Button>
}
/>
</EntitySwitch.Case>
</EntitySwitch>
);
const entityWarningContent = (
<>
<EntitySwitch>
<EntitySwitch.Case if={isOrphan}>
<Grid item xs={12}>
<EntityOrphanWarning />
</Grid>
</EntitySwitch.Case>
</EntitySwitch>
<EntitySwitch>
<EntitySwitch.Case if={hasRelationWarnings}>
<Grid item xs={12}>
<EntityRelationWarning />
</Grid>
</EntitySwitch.Case>
</EntitySwitch>
<EntitySwitch>
<EntitySwitch.Case if={hasCatalogProcessingErrors}>
<Grid item xs={12}>
<EntityProcessingErrorsPanel />
</Grid>
</EntitySwitch.Case>
</EntitySwitch>
</>
);
const overviewContent = (
<Grid container spacing={1} alignItems="stretch">
{entityWarningContent}
<Grid item md={6} xs={12}>
<EntityAboutCard variant="gridItem" />
</Grid>
<EntitySwitch>
<EntitySwitch.Case if={isArgocdAvailable}>
<Grid item md={6} xs={12}>
<EntityArgoCDOverviewCard />
</Grid>
</EntitySwitch.Case>
</EntitySwitch>
<EntitySwitch>
<EntitySwitch.Case if={isGithubWorkflowsAvailable}>
<Grid item md={6} xs={12}>
<GithubWorkflowsCard />
</Grid>
</EntitySwitch.Case>
</EntitySwitch>
<Grid item md={6}>
<EntityGithubPullRequestsOverviewCard />
</Grid>
<Grid item md={6} xs={12}>
<EntityHasSubcomponentsCard variant="gridItem" />
</Grid>
<Grid item md={6} xs={12}>
<EntityCatalogGraphCard variant="gridItem" height={400} />
</Grid>
<Grid item md={6} xs={12}>
<EntityLinksCard />
</Grid>
</Grid>
);
const serviceEntityPage = (
<EntityLayout>
<EntityLayout.Route path="/" title="Overview">
{overviewContent}
</EntityLayout.Route>
<EntityLayout.Route path="/pull-requests" title="Pull Requests">
<EntityGithubPullRequestsContent />
</EntityLayout.Route>
<EntityLayout.Route path="/ci-cd" title="CI/CD">
{cicdContent}
</EntityLayout.Route>
<EntityLayout.Route
if={isGithubAvailable}
path="/workflows"
title="Workflows"
>
{workflowsContent}
</EntityLayout.Route>
<EntityLayout.Route path="/api" title="API">
<Grid container spacing={3} alignItems="stretch">
<Grid item md={6}>
<EntityProvidedApisCard />
</Grid>
<Grid item md={6}>
<EntityConsumedApisCard />
</Grid>
</Grid>
</EntityLayout.Route>
<EntityLayout.Route path="/dependencies" title="Dependencies">
<Grid container spacing={3} alignItems="stretch">
<Grid item md={6}>
<EntityDependsOnComponentsCard variant="gridItem" />
</Grid>
<Grid item md={6}>
<EntityDependsOnResourcesCard variant="gridItem" />
</Grid>
</Grid>
</EntityLayout.Route>
<EntityLayout.Route path="/docs" title="Docs">
{techdocsContent}
</EntityLayout.Route>
</EntityLayout>
);
const websiteEntityPage = (
<EntityLayout>
<EntityLayout.Route path="/" title="Overview">
{overviewContent}
</EntityLayout.Route>
<EntityLayout.Route path="/dependencies" title="Dependencies">
<Grid container spacing={3} alignItems="stretch">
<Grid item md={6}>
<EntityDependsOnComponentsCard variant="gridItem" />
</Grid>
<Grid item md={6}>
<EntityDependsOnResourcesCard variant="gridItem" />
</Grid>
</Grid>
</EntityLayout.Route>
<EntityLayout.Route path="/docs" title="Docs">
{techdocsContent}
</EntityLayout.Route>
</EntityLayout>
);
/**
* NOTE: This page is designed to work on small screens such as mobile devices.
* This is based on Material UI Grid. If breakpoints are used, each grid item must set the `xs` prop to a column size or to `true`,
* since this does not default. If no breakpoints are used, the items will equitably share the available space.
* https://material-ui.com/components/grid/#basic-grid.
*/
const defaultEntityPage = (
<EntityLayout>
<EntityLayout.Route path="/" title="Overview">
{overviewContent}
</EntityLayout.Route>
<EntityLayout.Route path="/docs" title="Docs">
{techdocsContent}
</EntityLayout.Route>
</EntityLayout>
);
const componentPage = (
<EntitySwitch>
<EntitySwitch.Case if={isComponentType('service')}>
{serviceEntityPage}
</EntitySwitch.Case>
<EntitySwitch.Case if={isComponentType('website')}>
{websiteEntityPage}
</EntitySwitch.Case>
<EntitySwitch.Case>{defaultEntityPage}</EntitySwitch.Case>
</EntitySwitch>
);
const apiPage = (
<EntityLayout>
<EntityLayout.Route path="/" title="Overview">
<Grid container spacing={3}>
{entityWarningContent}
<Grid item md={6}>
<EntityAboutCard />
</Grid>
<Grid item md={6} xs={12}>
<EntityCatalogGraphCard variant="gridItem" height={400} />
</Grid>
<Grid item md={4} xs={12}>
<EntityLinksCard />
</Grid>
<Grid container item md={12}>
<Grid item md={6}>
<EntityProvidingComponentsCard />
</Grid>
<Grid item md={6}>
<EntityConsumingComponentsCard />
</Grid>
</Grid>
</Grid>
</EntityLayout.Route>
<EntityLayout.Route path="/definition" title="Definition">
<Grid container spacing={3}>
<Grid item xs={12}>
<EntityApiDefinitionCard />
</Grid>
</Grid>
</EntityLayout.Route>
</EntityLayout>
);
const userPage = (
<EntityLayout>
<EntityLayout.Route path="/" title="Overview">
<Grid container spacing={3}>
{entityWarningContent}
<Grid item xs={12} md={6}>
<EntityUserProfileCard variant="gridItem" />
</Grid>
<Grid item xs={12} md={6}>
<EntityOwnershipCard variant="gridItem" />
</Grid>
</Grid>
</EntityLayout.Route>
</EntityLayout>
);
const groupPage = (
<EntityLayout>
<EntityLayout.Route path="/" title="Overview">
<Grid container spacing={3}>
{entityWarningContent}
<Grid item xs={12} md={6}>
<EntityGroupProfileCard variant="gridItem" />
</Grid>
<Grid item xs={12} md={6}>
<EntityOwnershipCard variant="gridItem" />
</Grid>
<Grid item xs={12} md={6}>
<EntityMembersListCard />
</Grid>
<Grid item xs={12} md={6}>
<EntityLinksCard />
</Grid>
</Grid>
</EntityLayout.Route>
</EntityLayout>
);
const systemPage = (
<EntityLayout>
<EntityLayout.Route path="/" title="Overview">
<Grid container spacing={3} alignItems="stretch">
{entityWarningContent}
<Grid item md={6}>
<EntityAboutCard variant="gridItem" />
</Grid>
<Grid item md={6} xs={12}>
<EntityCatalogGraphCard variant="gridItem" height={400} />
</Grid>
<Grid item md={4} xs={12}>
<EntityLinksCard />
</Grid>
<Grid item md={8}>
<EntityHasComponentsCard variant="gridItem" />
</Grid>
<Grid item md={6}>
<EntityHasApisCard variant="gridItem" />
</Grid>
<Grid item md={6}>
<EntityHasResourcesCard variant="gridItem" />
</Grid>
</Grid>
</EntityLayout.Route>
<EntityLayout.Route path="/diagram" title="Diagram">
<EntityCatalogGraphCard
variant="gridItem"
direction={Direction.TOP_BOTTOM}
title="System Diagram"
height={700}
relations={[
RELATION_PART_OF,
RELATION_HAS_PART,
RELATION_API_CONSUMED_BY,
RELATION_API_PROVIDED_BY,
RELATION_CONSUMES_API,
RELATION_PROVIDES_API,
RELATION_DEPENDENCY_OF,
RELATION_DEPENDS_ON,
]}
unidirectional={false}
/>
</EntityLayout.Route>
</EntityLayout>
);
const domainPage = (
<EntityLayout>
<EntityLayout.Route path="/" title="Overview">
<Grid container spacing={3} alignItems="stretch">
{entityWarningContent}
<Grid item md={6}>
<EntityAboutCard variant="gridItem" />
</Grid>
<Grid item md={6} xs={12}>
<EntityCatalogGraphCard variant="gridItem" height={400} />
</Grid>
<Grid item md={6}>
<EntityHasSystemsCard variant="gridItem" />
</Grid>
</Grid>
</EntityLayout.Route>
</EntityLayout>
);
import {EntitySwitch, isKind,} from '@backstage/plugin-catalog';
import {componentPage} from "./entities/ComponentEntity";
import {apiPage} from "./entities/ApiEntity";
import {groupPage} from "./entities/Group";
import {userPage} from "./entities/User";
import {systemPage} from "./entities/System";
import {domainPage} from "./entities/Domain";
import {defaultEntityPage} from "./entities/DefaultEntityPage";
export const entityPage = (
<EntitySwitch>
<EntitySwitch.Case if={isKind('component')} children={componentPage} />
<EntitySwitch.Case if={isKind('api')} children={apiPage} />
<EntitySwitch.Case if={isKind('group')} children={groupPage} />
<EntitySwitch.Case if={isKind('user')} children={userPage} />
<EntitySwitch.Case if={isKind('system')} children={systemPage} />
<EntitySwitch.Case if={isKind('domain')} children={domainPage} />
<EntitySwitch>
<EntitySwitch.Case if={isKind('component')} children={componentPage}/>
<EntitySwitch.Case if={isKind('api')} children={apiPage}/>
<EntitySwitch.Case if={isKind('group')} children={groupPage}/>
<EntitySwitch.Case if={isKind('user')} children={userPage}/>
<EntitySwitch.Case if={isKind('system')} children={systemPage}/>
<EntitySwitch.Case if={isKind('domain')} children={domainPage}/>
<EntitySwitch.Case>{defaultEntityPage}</EntitySwitch.Case>
</EntitySwitch>
<EntitySwitch.Case>{defaultEntityPage}</EntitySwitch.Case>
</EntitySwitch>
);

View File

@ -0,0 +1,45 @@
import {EntityAboutCard, EntityLayout, EntityLinksCard} from "@backstage/plugin-catalog";
import {Grid} from "@material-ui/core";
import {entityWarningContent} from "../tabs/EntityWarningContent";
import {EntityCatalogGraphCard} from "@backstage/plugin-catalog-graph";
import {
EntityApiDefinitionCard,
EntityConsumingComponentsCard,
EntityProvidingComponentsCard
} from "@backstage/plugin-api-docs";
import React from "react";
export const apiPage = (
<EntityLayout>
<EntityLayout.Route path="/" title="Overview">
<Grid container spacing={3}>
{entityWarningContent}
<Grid item md={6}>
<EntityAboutCard/>
</Grid>
<Grid item md={6} xs={12}>
<EntityCatalogGraphCard variant="gridItem" height={400}/>
</Grid>
<Grid item md={4} xs={12}>
<EntityLinksCard/>
</Grid>
<Grid container item md={12}>
<Grid item md={6}>
<EntityProvidingComponentsCard/>
</Grid>
<Grid item md={6}>
<EntityConsumingComponentsCard/>
</Grid>
</Grid>
</Grid>
</EntityLayout.Route>
<EntityLayout.Route path="/definition" title="Definition">
<Grid container spacing={3}>
<Grid item xs={12}>
<EntityApiDefinitionCard/>
</Grid>
</Grid>
</EntityLayout.Route>
</EntityLayout>
);

View File

@ -0,0 +1,17 @@
import {EntitySwitch, isComponentType} from "@backstage/plugin-catalog";
import {serviceEntityPage} from "./ServiceComponent";
import {websiteEntityPage} from "./WebsiteComponent";
import {defaultEntityPage} from "./DefaultEntityPage";
import React from "react";
export const componentPage = (
<EntitySwitch>
<EntitySwitch.Case if={isComponentType('service')}>
{serviceEntityPage}
</EntitySwitch.Case>
<EntitySwitch.Case if={isComponentType('website')}>
{websiteEntityPage}
</EntitySwitch.Case>
<EntitySwitch.Case>{defaultEntityPage}</EntitySwitch.Case>
</EntitySwitch>
);

View File

@ -0,0 +1,21 @@
/**
* NOTE: This page is designed to work on small screens such as mobile devices.
* This is based on Material UI Grid. If breakpoints are used, each grid item must set the `xs` prop to a column size or to `true`,
* since this does not default. If no breakpoints are used, the items will equitably share the available space.
* https://material-ui.com/components/grid/#basic-grid.
*/
import {EntityLayout} from "@backstage/plugin-catalog";
import React from "react";
import {overviewContent} from "../tabs/OverviewContent";
import {techdocsContent} from "../tabs/TechdocsContent";
export const defaultEntityPage = (
<EntityLayout>
<EntityLayout.Route path="/" title="Overview">
{overviewContent}
</EntityLayout.Route>
<EntityLayout.Route path="/docs" title="Docs">
{techdocsContent}
</EntityLayout.Route>
</EntityLayout>
);

View File

@ -0,0 +1,24 @@
import {EntityAboutCard, EntityHasSystemsCard, EntityLayout} from "@backstage/plugin-catalog";
import {Grid} from "@material-ui/core";
import {EntityCatalogGraphCard} from "@backstage/plugin-catalog-graph";
import React from "react";
import {entityWarningContent} from "../tabs/EntityWarningContent";
export const domainPage = (
<EntityLayout>
<EntityLayout.Route path="/" title="Overview">
<Grid container spacing={3} alignItems="stretch">
{entityWarningContent}
<Grid item md={6}>
<EntityAboutCard variant="gridItem"/>
</Grid>
<Grid item md={6} xs={12}>
<EntityCatalogGraphCard variant="gridItem" height={400}/>
</Grid>
<Grid item md={6}>
<EntityHasSystemsCard variant="gridItem"/>
</Grid>
</Grid>
</EntityLayout.Route>
</EntityLayout>
);

View File

@ -0,0 +1,27 @@
import {EntityLayout, EntityLinksCard} from "@backstage/plugin-catalog";
import {Grid} from "@material-ui/core";
import {entityWarningContent} from "../tabs/EntityWarningContent";
import {EntityGroupProfileCard, EntityMembersListCard, EntityOwnershipCard} from "@backstage/plugin-org";
import React from "react";
export const groupPage = (
<EntityLayout>
<EntityLayout.Route path="/" title="Overview">
<Grid container spacing={3}>
{entityWarningContent}
<Grid item xs={12} md={6}>
<EntityGroupProfileCard variant="gridItem"/>
</Grid>
<Grid item xs={12} md={6}>
<EntityOwnershipCard variant="gridItem"/>
</Grid>
<Grid item xs={12} md={6}>
<EntityMembersListCard/>
</Grid>
<Grid item xs={12} md={6}>
<EntityLinksCard/>
</Grid>
</Grid>
</EntityLayout.Route>
</EntityLayout>
);

View File

@ -0,0 +1,72 @@
import {EntityDependsOnComponentsCard, EntityDependsOnResourcesCard, EntityLayout} from "@backstage/plugin-catalog";
import {EntityIFrameContent} from "@roadiehq/backstage-plugin-iframe";
import {EntityGithubInsightsContent} from "@roadiehq/backstage-plugin-github-insights";
import {EntityGithubPullRequestsContent} from "@roadiehq/backstage-plugin-github-pull-requests";
import {Grid} from "@material-ui/core";
import {EntityConsumedApisCard, EntityProvidedApisCard} from "@backstage/plugin-api-docs";
import React from "react";
import {overviewContent} from "../tabs/OverviewContent";
import {buildsContent} from "../tabs/BuildsContent";
import {workflowsContent} from "../tabs/WorkflowsContent";
import {techdocsContent} from "../tabs/TechdocsContent";
export const serviceEntityPage = (
<EntityLayout>
<EntityLayout.Route path="/" title="Overview">
{overviewContent}
</EntityLayout.Route>
<EntityLayout.Route
path="/logs"
title="Logs">
<EntityIFrameContent title={" "} iframe={{
src: 'https://sreez.nationtech.io',
// src: 'http://localhost:8080/search',
title: " ",
width: "100%",
height: "1000px"
}}/>
</EntityLayout.Route>
<EntityLayout.Route
path="/code-insights"
title="Code Insights">
<EntityGithubInsightsContent/>
</EntityLayout.Route>
<EntityLayout.Route path="/pull-requests" title="Pull Requests">
<EntityGithubPullRequestsContent/>
</EntityLayout.Route>
<EntityLayout.Route path="/github-actions" title="Builds">
{buildsContent}
</EntityLayout.Route>
<EntityLayout.Route
path="/workflows"
title="Workflows"
>
{workflowsContent}
</EntityLayout.Route>
<EntityLayout.Route path="/api" title="API">
<Grid container spacing={3} alignItems="stretch">
<Grid item md={6}>
<EntityProvidedApisCard/>
</Grid>
<Grid item md={6}>
<EntityConsumedApisCard/>
</Grid>
</Grid>
</EntityLayout.Route>
<EntityLayout.Route path="/dependencies" title="Dependencies">
<Grid container spacing={3} alignItems="stretch">
<Grid item md={6}>
<EntityDependsOnComponentsCard variant="gridItem"/>
</Grid>
<Grid item md={6}>
<EntityDependsOnResourcesCard variant="gridItem"/>
</Grid>
</Grid>
</EntityLayout.Route>
<EntityLayout.Route path="/docs" title="Docs">
{techdocsContent}
</EntityLayout.Route>
</EntityLayout>
);

View File

@ -0,0 +1,69 @@
import {
EntityAboutCard,
EntityHasComponentsCard,
EntityHasResourcesCard,
EntityLayout,
EntityLinksCard
} from "@backstage/plugin-catalog";
import {Grid} from "@material-ui/core";
import {Direction, EntityCatalogGraphCard} from "@backstage/plugin-catalog-graph";
import {EntityHasApisCard} from "@backstage/plugin-api-docs";
import {
RELATION_API_CONSUMED_BY,
RELATION_API_PROVIDED_BY,
RELATION_CONSUMES_API,
RELATION_DEPENDENCY_OF,
RELATION_DEPENDS_ON,
RELATION_HAS_PART,
RELATION_PART_OF,
RELATION_PROVIDES_API
} from "@backstage/catalog-model";
import React from "react";
import {entityWarningContent} from "../tabs/EntityWarningContent";
export const systemPage = (
<EntityLayout>
<EntityLayout.Route path="/" title="Overview">
<Grid container spacing={3} alignItems="stretch">
{entityWarningContent}
<Grid item md={6}>
<EntityAboutCard variant="gridItem"/>
</Grid>
<Grid item md={6} xs={12}>
<EntityCatalogGraphCard variant="gridItem" height={400}/>
</Grid>
<Grid item md={4} xs={12}>
<EntityLinksCard/>
</Grid>
<Grid item md={8}>
<EntityHasComponentsCard variant="gridItem"/>
</Grid>
<Grid item md={6}>
<EntityHasApisCard variant="gridItem"/>
</Grid>
<Grid item md={6}>
<EntityHasResourcesCard variant="gridItem"/>
</Grid>
</Grid>
</EntityLayout.Route>
<EntityLayout.Route path="/diagram" title="Diagram">
<EntityCatalogGraphCard
variant="gridItem"
direction={Direction.TOP_BOTTOM}
title="System Diagram"
height={700}
relations={[
RELATION_PART_OF,
RELATION_HAS_PART,
RELATION_API_CONSUMED_BY,
RELATION_API_PROVIDED_BY,
RELATION_CONSUMES_API,
RELATION_PROVIDES_API,
RELATION_DEPENDENCY_OF,
RELATION_DEPENDS_ON,
]}
unidirectional={false}
/>
</EntityLayout.Route>
</EntityLayout>
);

View File

@ -0,0 +1,21 @@
import {EntityLayout} from "@backstage/plugin-catalog";
import {Grid} from "@material-ui/core";
import {EntityOwnershipCard, EntityUserProfileCard} from "@backstage/plugin-org";
import React from "react";
import {entityWarningContent} from "../tabs/EntityWarningContent";
export const userPage = (
<EntityLayout>
<EntityLayout.Route path="/" title="Overview">
<Grid container spacing={3}>
{entityWarningContent}
<Grid item xs={12} md={6}>
<EntityUserProfileCard variant="gridItem"/>
</Grid>
<Grid item xs={12} md={6}>
<EntityOwnershipCard variant="gridItem"/>
</Grid>
</Grid>
</EntityLayout.Route>
</EntityLayout>
);

View File

@ -0,0 +1,28 @@
import {EntityDependsOnComponentsCard, EntityDependsOnResourcesCard, EntityLayout} from "@backstage/plugin-catalog";
import {Grid} from "@material-ui/core";
import React from "react";
import {overviewContent} from "../tabs/OverviewContent";
import {techdocsContent} from "../tabs/TechdocsContent";
export const websiteEntityPage = (
<EntityLayout>
<EntityLayout.Route path="/" title="Overview">
{overviewContent}
</EntityLayout.Route>
<EntityLayout.Route path="/dependencies" title="Dependencies">
<Grid container spacing={3} alignItems="stretch">
<Grid item md={6}>
<EntityDependsOnComponentsCard variant="gridItem"/>
</Grid>
<Grid item md={6}>
<EntityDependsOnResourcesCard variant="gridItem"/>
</Grid>
</Grid>
</EntityLayout.Route>
<EntityLayout.Route path="/docs" title="Docs">
{techdocsContent}
</EntityLayout.Route>
</EntityLayout>
);

View File

@ -0,0 +1,29 @@
import {EntitySwitch} from "@backstage/plugin-catalog";
import {EntityGithubActionsContent, isGithubActionsAvailable} from "@backstage-community/plugin-github-actions";
import {EmptyState} from "@backstage/core-components";
import {Button} from "@material-ui/core";
import React from "react";
export const buildsContent = (
<EntitySwitch>
<EntitySwitch.Case if={isGithubActionsAvailable}>
<EntityGithubActionsContent/>
</EntitySwitch.Case>
<EntitySwitch.Case>
<EmptyState
title="No CI/CD available for this entity"
missing="info"
description="You need to add an annotation to your component if you want to enable CI/CD for it. You can read more about annotations in Backstage by clicking the button below."
action={
<Button
variant="contained"
color="primary"
href="https://backstage.io/docs/features/software-catalog/well-known-annotations"
>
Read more
</Button>
}
/>
</EntitySwitch.Case>
</EntitySwitch>
);

View File

@ -0,0 +1,39 @@
import {
EntityOrphanWarning,
EntityProcessingErrorsPanel,
EntityRelationWarning,
EntitySwitch,
hasCatalogProcessingErrors,
hasRelationWarnings,
isOrphan
} from "@backstage/plugin-catalog";
import {Grid} from "@material-ui/core";
import React from "react";
export const entityWarningContent = (
<>
<EntitySwitch>
<EntitySwitch.Case if={isOrphan}>
<Grid item xs={12}>
<EntityOrphanWarning/>
</Grid>
</EntitySwitch.Case>
</EntitySwitch>
<EntitySwitch>
<EntitySwitch.Case if={hasRelationWarnings}>
<Grid item xs={12}>
<EntityRelationWarning/>
</Grid>
</EntitySwitch.Case>
</EntitySwitch>
<EntitySwitch>
<EntitySwitch.Case if={hasCatalogProcessingErrors}>
<Grid item xs={12}>
<EntityProcessingErrorsPanel/>
</Grid>
</EntitySwitch.Case>
</EntitySwitch>
</>
);

View File

@ -0,0 +1,68 @@
import {Grid} from "@material-ui/core";
import {EntityAboutCard} from "@backstage/plugin-catalog";
import React from "react";
import {entityWarningContent} from "./EntityWarningContent";
import {GithubWorkflowsCard} from "@veecode-platform/backstage-plugin-github-workflows";
import {LatestWorkflowRunCard} from "@backstage-community/plugin-github-actions";
import {EntityGithubInsightsContent} from "@roadiehq/backstage-plugin-github-insights";
import {EntityArgoCDOverviewCard} from "@roadiehq/backstage-plugin-argo-cd";
export const overviewContent = (
<Grid container spacing={1} alignItems={'stretch'} justifyContent={'flex-start'}>
<Grid item xs={12}>
{entityWarningContent}
</Grid>
<Grid item xs={3}>
<EntityAboutCard variant={'fullHeight'}/>
</Grid>
<Grid item xs={9}>
<Grid container>
<Grid item xs={4}>
<LatestWorkflowRunCard branch={'master'} variant="flex"/>
</Grid>
<Grid item xs={8}>
<EntityArgoCDOverviewCard/>
</Grid>
</Grid>
<GithubWorkflowsCard/>
{/*<EntityGithubInsightsReadmeCard maxHeight={300}/>*/}
</Grid>
<Grid item xs={9}>
<EntityGithubInsightsContent/>
</Grid>
{/*<Grid item md={8} xs={12}>*/}
{/* <EntitySwitch>*/}
{/* <EntitySwitch.Case if={isGithubWorkflowsAvailable}>*/}
{/* </EntitySwitch.Case>*/}
{/* </EntitySwitch>*/}
{/*</Grid>*/}
{/*<Grid item md={4}>*/}
{/* <EntitySwitch>*/}
{/* <EntitySwitch.Case if={isGithubInsightsAvailable}>*/}
{/* </EntitySwitch.Case>*/}
{/* </EntitySwitch>*/}
{/*</Grid>*/}
{/*/!*<EntitySwitch>*!/*/}
{/*/!* <EntitySwitch.Case if={isArgocdAvailable}>*!/*/}
{/*/!* <Grid item md={4} xs={12}>*!/*/}
{/*<EntityArgoCDOverviewCard/>*/}
{/*/!* </Grid>*!/*/}
{/*/!* </EntitySwitch.Case>*!/*/}
{/*/!*</EntitySwitch>*!/*/}
{/*<Grid item md={4}>*/}
{/* <EntityGithubPullRequestsOverviewCard/>*/}
{/*</Grid>*/}
{/*<Grid item md={4} xs={12}>*/}
{/* <EntityHasSubcomponentsCard variant="gridItem"/>*/}
{/*</Grid>*/}
{/*<Grid item md={4} xs={12}>*/}
{/* <EntityCatalogGraphCard variant="gridItem" height={400}/>*/}
{/*</Grid>*/}
{/*<Grid item md={4} xs={12}>*/}
{/* <EntityLinksCard/>*/}
{/*</Grid>*/}
</Grid>
);

View File

@ -0,0 +1,12 @@
import {EntityTechdocsContent} from "@backstage/plugin-techdocs";
import {TechDocsAddons} from "@backstage/plugin-techdocs-react";
import {ReportIssue} from "@backstage/plugin-techdocs-module-addons-contrib";
import React from "react";
export const techdocsContent = (
<EntityTechdocsContent>
<TechDocsAddons>
<ReportIssue/>
</TechDocsAddons>
</EntityTechdocsContent>
);

View File

@ -0,0 +1,30 @@
import {EntitySwitch} from "@backstage/plugin-catalog";
import {isGithubActionsAvailable} from "@backstage-community/plugin-github-actions";
import {GithubWorkflowsList} from "@veecode-platform/backstage-plugin-github-workflows";
import {EmptyState} from "@backstage/core-components";
import {Button} from "@material-ui/core";
import React from "react";
export const workflowsContent = (
<EntitySwitch>
<EntitySwitch.Case if={isGithubActionsAvailable}>
<GithubWorkflowsList/>
</EntitySwitch.Case>
<EntitySwitch.Case>
<EmptyState
title="No CI/CD available for this entity"
missing="info"
description="You need to add an annotation to your component if you want to enable CI/CD for it. You can read more about annotations in Backstage by clicking the button below."
action={
<Button
variant="contained"
color="primary"
href="https://backstage.io/docs/features/software-catalog/well-known-annotations"
>
Read more
</Button>
}
/>
</EntitySwitch.Case>
</EntitySwitch>
);

View File

@ -1,47 +1,77 @@
import {
createBaseThemeOptions,
createUnifiedTheme,
palettes,
} from '@backstage/theme';
import {createBaseThemeOptions, createUnifiedTheme, genPageTheme, palettes, shapes,} from '@backstage/theme';
export const SreezCustomTheme = createUnifiedTheme({
...createBaseThemeOptions({
palette: {
...palettes.light,
primary: {
main: '#4E8479',
},
secondary: {
main: '#794e84',
},
error: {
main: '#d32f2f',
},
warning: {
main: '#ed6c02',
},
info: {
main: '#0288d1',
},
success: {
main: '#2e7d32',
},
banner: {
info: '#34548a',
error: '#8c4351',
text: '#343b58',
link: '#565a6e',
},
errorBackground: '#8c4351',
warningBackground: '#8f5e15',
infoBackground: '#343b58',
navigation: {
background: '#121212',
indicator: '#8f5e15',
color: '#d5d6db',
selectedColor: '#ffffff',
},
...createBaseThemeOptions({
palette: {
...palettes.light,
primary: {
main: '#0664c1',
},
secondary: {
main: '#d6589f',
},
error: {
main: '#d32f2f',
},
warning: {
main: '#ed6c02',
},
info: {
main: '#0288d1',
},
success: {
main: '#2e7d32',
},
banner: {
info: '#34548a',
error: '#8c4351',
text: '#343b58',
link: '#565a6e',
},
errorBackground: '#8c4351',
warningBackground: '#8f5e15',
infoBackground: '#343b58',
navigation: {
background: '#2F323A',
indicator: '#8f5e15',
color: '#d5d6db',
selectedColor: '#ffffff',
},
},
}),
defaultPageTheme: 'home',
pageTheme: {
home: genPageTheme({
colors: [
'#5006c1',
'#06c1ae',
'#0664c1',
],
shape: shapes.wave
}),
documentation: genPageTheme({
colors: ['#2F323A'],
shape: shapes.wave2,
}),
tool: genPageTheme({colors: ['#8c4351', '#343b58'], shape: shapes.round}),
service: genPageTheme({
colors: [
'#5006c1',
'#06c1ae',
'#0664c1',
],
shape: shapes.wave,
}),
website: genPageTheme({
colors: ['#8c4351', '#343b58'],
shape: shapes.wave,
}),
library: genPageTheme({
colors: ['#8c4351', '#343b58'],
shape: shapes.wave,
}),
other: genPageTheme({colors: ['#8c4351', '#343b58'], shape: shapes.wave}),
app: genPageTheme({colors: ['#8c4351', '#343b58'], shape: shapes.wave}),
apis: genPageTheme({colors: ['#8c4351', '#343b58'], shape: shapes.wave}),
},
}),
defaultPageTheme: 'home',
});

View File

@ -17,8 +17,8 @@
},
"dependencies": {
"@backstage/backend-common": "^0.21.7",
"@backstage/backend-defaults": "^0.2.17",
"@backstage/backend-plugin-api": "^0.6.17",
"@backstage/backend-defaults": "^0.2.18",
"@backstage/backend-plugin-api": "^0.6.18",
"@backstage/backend-tasks": "^0.5.22",
"@backstage/config": "^1.2.0",
"@backstage/integration": "^1.10.0",
@ -51,6 +51,7 @@
"@muvaf/create-argocd-application": "^0.4.1",
"@muvaf/kubernetes-apply": "^0.1.0",
"@roadiehq/scaffolder-backend-argocd": "^1.1.26",
"@rsc-labs/backstage-changelog-plugin-backend": "^0.3.1",
"app": "link:../app",
"better-sqlite3": "^9.0.0",
"dockerode": "^3.3.1",

View File

@ -6,16 +6,16 @@
* Happy hacking!
*/
import { createBackend } from '@backstage/backend-defaults';
import { eventsModuleGithubEventRouter } from '@backstage/plugin-events-backend-module-github/alpha';
import { eventsModuleGithubWebhook } from '@backstage/plugin-events-backend-module-github/alpha';
import { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha';
import {createBackend} from '@backstage/backend-defaults';
import {
createBackendModule,
} from '@backstage/backend-plugin-api';
import { createNewFileAction } from './plugins/scaffolder/actions/custom';
import { kubernetesApply } from "@muvaf/kubernetes-apply";
import { createArgoProjectAction } from './plugins/scaffolder/actions/argo';
eventsModuleGithubEventRouter,
eventsModuleGithubWebhook
} from '@backstage/plugin-events-backend-module-github/alpha';
import {scaffolderActionsExtensionPoint} from '@backstage/plugin-scaffolder-node/alpha';
import {createBackendModule,} from '@backstage/backend-plugin-api';
import {createNewFileAction} from './plugins/scaffolder/actions/custom';
import {kubernetesApply} from "@muvaf/kubernetes-apply";
import {createArgoProjectAction} from './plugins/scaffolder/actions/argo';
const backend = createBackend();
@ -34,7 +34,7 @@ backend.add(import('@backstage/plugin-auth-backend-module-github-provider'));
// catalog plugin
backend.add(import('@backstage/plugin-catalog-backend/alpha'));
backend.add(
import('@backstage/plugin-catalog-backend-module-scaffolder-entity-model'),
import('@backstage/plugin-catalog-backend-module-scaffolder-entity-model'),
);
backend.add(import('@backstage/plugin-scaffolder-backend-module-github'));
backend.add(import('@backstage/plugin-catalog-backend-module-github/alpha'));
@ -46,7 +46,7 @@ backend.add(eventsModuleGithubWebhook());
// permission plugin
backend.add(import('@backstage/plugin-permission-backend/alpha'));
backend.add(
import('@backstage/plugin-permission-backend-module-allow-all-policy'),
import('@backstage/plugin-permission-backend-module-allow-all-policy'),
);
// search plugin
@ -57,23 +57,23 @@ backend.add(import('@backstage/plugin-search-backend/alpha'));
backend.add(import('@backstage/plugin-devtools-backend'));
const scaffolderModuleCustomExtensions = createBackendModule({
pluginId: 'scaffolder', // name of the plugin that the module is targeting
moduleId: 'custom-extensions',
register(env) {
env.registerInit({
deps: {
scaffolder: scaffolderActionsExtensionPoint,
// ... and other dependencies as needed
},
async init({ scaffolder /* ..., other dependencies */ }) {
// Here you have the opportunity to interact with the extension
// point before the plugin itself gets instantiated
scaffolder.addActions(createNewFileAction()); // just an example
scaffolder.addActions(createArgoProjectAction()); // just an example
scaffolder.addActions(kubernetesApply());
},
});
},
pluginId: 'scaffolder', // name of the plugin that the module is targeting
moduleId: 'custom-extensions',
register(env) {
env.registerInit({
deps: {
scaffolder: scaffolderActionsExtensionPoint,
// ... and other dependencies as needed
},
async init({scaffolder /* ..., other dependencies */}) {
// Here you have the opportunity to interact with the extension
// point before the plugin itself gets instantiated
scaffolder.addActions(createNewFileAction()); // just an example
scaffolder.addActions(createArgoProjectAction()); // just an example
scaffolder.addActions(kubernetesApply());
},
});
},
});
backend.add(scaffolderModuleCustomExtensions());

File diff suppressed because it is too large Load Diff