0.0.0-nightly-20220920030005 • Published 4 years ago

@backstage/plugin-tech-insights v0.0.0-nightly-20220920030005

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
4 years ago

Tech Insights

This plugin provides the UI for the @backstage/tech-insights-backend plugin, in order to display results of the checks running following the rules and the logic defined in the @backstage/tech-insights-backend plugin itself.

Main areas covered by this plugin currently are:

  • Providing an overview for default boolean checks in a form of Scorecards.

  • Providing an option to render different custom components based on type of the checks running in the backend.

Installation

Install the plugin

# From your Backstage root directory
yarn add --cwd packages/app @backstage/plugin-tech-insights

Add boolean checks overview (Scorecards) page to the EntityPage:

// packages/app/src/components/catalog/EntityPage.tsx

import { EntityTechInsightsScorecardContent } from '@backstage/plugin-tech-insights';

const serviceEntityPage = (
  <EntityLayoutWrapper>
    <EntityLayout.Route path="/" title="Overview">
      {overviewContent}
    </EntityLayout.Route>
    <EntityLayout.Route path="/ci-cd" title="CI/CD">
      {cicdContent}
    </EntityLayout.Route>
    ...
    <EntityLayout.Route path="/tech-insights" title="Scorecards">
      <EntityTechInsightsScorecardContent
        title="Customized title for the scorecard"
        description="Small description about scorecards"
      />
    </EntityLayout.Route>
    ...
  </EntityLayoutWrapper>
);

It is obligatory to pass title prop to EntityTechInsightsScorecardContent, description prop is optional.

If you like to display multiple cards in a EntityLayout.Route use EntityTechInsightsScorecardCard.

You can pass an array checksId as a prop with the Fact Retrievers ids to limit which checks you want to show in this card. If you don't pass, the default value is show all checks.

<EntityTechInsightsScorecardContent
  title="Show only simpleTestCheck in this card"
  checksId={['simpleTestCheck']}
/>

If you want to show checks in the overview of an entity use EntityTechInsightsScorecardCard.

// packages/app/src/components/catalog/EntityPage.tsx

import { EntityTechInsightsScorecardCard } from '@backstage/plugin-tech-insights';

const overviewContent = (
  <Grid container spacing={3} alignItems="stretch">
    {entityWarningContent}
    <Grid item md={6} xs={12}>
      <EntityAboutCard variant="gridItem" />
    </Grid>
    <Grid item md={6} xs={12}>
      <EntityCatalogGraphCard variant="gridItem" height={400} />
    </Grid>
    ...
    <Grid item md={8} xs={12}>
      <EntityTechInsightsScorecardCard
        title="Customized title for the scorecard"
        description="Small description about scorecards"
        checksId={['simpleTestCheck']}
      />
    </Grid>
  </Grid>
);

Boolean Scorecard Example

If you follow the Backend Example, once the needed facts have been generated the default boolean scorecard will look like this:

Boolean Scorecard Example

Adding custom rendering components

Default scorecard implementation displays only json-rules-engine check results. If you would like to support different types, you need to inject custom rendering components to the TechInsightsClient constructor.

// packages/app/src/apis.ts

export const apis: AnyApiFactory[] = [
...
  createApiFactory({
    api: techInsightsApiRef,
    deps: { discoveryApi: discoveryApiRef, identityApi: identityApiRef },
    factory: ({ discoveryApi, identityApi }) =>
      new TechInsightsClient({
        discoveryApi,
        identityApi,
        renderers: [
          jsonRulesEngineCheckResultRenderer, // default json-rules-engine renderer
          myCustomBooleanRenderer, // custom renderer
        ],
      }),
  }),
...
];
// packages/app/src/components/myCustomBooleanRenderer.tsx

export const myCustomBooleanRenderer: CheckResultRenderer = {
  type: 'boolean',
  component: (checkResult: CheckResult) => (
    <BooleanCheck checkResult={checkResult} />
  ),
};
0.3.27

2 years ago

0.3.26

2 years ago

0.3.26-next.1

2 years ago

0.3.26-next.0

2 years ago

0.3.25

2 years ago

0.3.24

2 years ago

0.3.23

2 years ago

0.3.23-next.2

2 years ago

0.3.23-next.1

2 years ago

0.3.23-next.0

2 years ago

0.3.22

2 years ago

0.3.22-next.3

2 years ago

0.3.22-next.2

2 years ago

0.3.22-next.1

2 years ago

0.3.22-next.0

2 years ago

0.3.21

2 years ago

0.3.21-next.2

2 years ago

0.3.21-next.1

2 years ago

0.3.21-next.0

2 years ago

0.3.20

3 years ago

0.3.20-next.3

3 years ago

0.3.20-next.2

3 years ago

0.3.20-next.1

3 years ago

0.3.13-next.0

3 years ago

0.3.20-next.0

3 years ago

0.3.13-next.1

3 years ago

0.3.13-next.2

3 years ago

0.3.15-next.0

3 years ago

0.3.12-next.1

3 years ago

0.3.12-next.2

3 years ago

0.3.16-next.3

3 years ago

0.3.16-next.2

3 years ago

0.3.16-next.1

3 years ago

0.3.17-next.0

3 years ago

0.3.17-next.1

3 years ago

0.3.17-next.2

3 years ago

0.3.19

3 years ago

0.3.18

3 years ago

0.3.17

3 years ago

0.3.16

3 years ago

0.3.15

3 years ago

0.3.14

3 years ago

0.3.13

3 years ago

0.3.12

3 years ago

0.3.18-next.1

3 years ago

0.3.18-next.0

3 years ago

0.3.18-next.2

3 years ago

0.3.12-next.0

3 years ago

0.3.11-next.2

3 years ago

0.3.11-next.3

3 years ago

0.3.11

3 years ago

0.3.11-next.0

3 years ago

0.3.11-next.1

3 years ago

0.3.10

3 years ago

0.3.10-next.1

3 years ago

0.3.10-next.2

3 years ago

0.3.9-next.3

3 years ago

0.3.9

3 years ago

0.3.10-next.0

3 years ago

0.3.9-next.1

3 years ago

0.3.8-next.1

3 years ago

0.3.9-next.0

3 years ago

0.3.8-next.2

3 years ago

0.3.9-next.2

3 years ago

0.3.8-next.0

3 years ago

0.3.8

3 years ago

0.3.7

3 years ago

0.3.7-next.1

3 years ago

0.3.7-next.0

3 years ago

0.3.7-next.2

3 years ago

0.3.6-next.1

3 years ago

0.3.6-next.2

3 years ago

0.3.6

3 years ago

0.3.6-next.0

3 years ago

0.3.3-next.1

4 years ago

0.3.5

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.4

4 years ago

0.3.3

4 years ago

0.3.4-next.2

4 years ago

0.3.4-next.1

4 years ago

0.3.4-next.4

4 years ago

0.3.2-next.0

4 years ago

0.3.4-next.3

4 years ago

0.3.4-next.0

4 years ago

0.3.1-next.2

4 years ago

0.3.1-next.0

4 years ago

0.3.1-next.1

4 years ago

0.2.5-next.0

4 years ago

0.3.0-next.2

4 years ago

0.3.0-next.1

4 years ago

0.3.0-next.3

4 years ago

0.3.0

4 years ago

0.2.3-next.2

4 years ago

0.2.3-next.1

4 years ago

0.2.3-next.0

4 years ago

0.2.3-next.3

4 years ago

0.2.4-next.0

4 years ago

0.2.4-next.1

4 years ago

0.2.2-next.1

4 years ago

0.2.2-next.0

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.4

4 years ago

0.2.1-next.1

4 years ago

0.2.1-next.2

4 years ago

0.2.1-next.0

4 years ago

0.2.1

4 years ago

0.1.14-next.0

4 years ago

0.2.0-next.1

4 years ago

0.1.12-next.0

4 years ago

0.1.12

4 years ago

0.1.13

4 years ago

0.2.0

4 years ago

0.1.11

4 years ago

0.1.10

4 years ago

0.1.7-next.0

4 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.9

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.8-next.0

4 years ago

0.1.6-next.0

4 years ago

0.1.0

5 years ago