1.0.7 • Published 4 months ago

@terasky/backstage-plugin-entity-scaffolder-content v1.0.7

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

entity-scaffolder-content

Welcome to the entity-scaffolder-content plugin!

npm latest version

Description

The entity-scaffolder-content plugin for Backstage allows embedding a tab with scaffolder templates on a component. This can also populate the list of templates and data in the templates based on the context from which it is run.

example1 example2

Installation

To install and configure the entity-scaffolder-content plugin in your Backstage instance, follow these steps:

  • Add the package
    yarn --cwd packages/app add @terasky/backstage-plugin-entity-scaffolder-content
  • Add to Entity Page (packages/app/src/components/catalog/EntityPage.tsx)

    import { EntityScaffolderContent } from '@terasky/backstage-plugin-entity-scaffolder-content';
    
    ...
    
    const systemPage = (
    <EntityLayout>
      ...
      
      <EntityLayout.Route path="/scaffolder" title="Crossplane Scaffolder">
          <EntityScaffolderContent
            templateGroupFilters={[
              {
                title: 'Crossplane Claims',
                filter: (entity, template) =>
                  template.metadata?.labels?.forEntity === 'system' &&
                  entity.spec?.type === 'kubernetes-namespace',
              },
            ]}
            buildInitialState={entity => ({
                xrNamespace: entity.metadata.name,
                clusters: [entity.metadata?.annotations?.['backstage.io/managed-by-location']?.split(": ")[1] ?? '']
              }
            )}
          />
      </EntityLayout.Route>
    
      ...
    </EntityLayout>
    );

Usage

Once installed and configured, the entity-scaffolder-content plugin will provide components for embedding scaffolder templates on a component in the Backstage UI.

Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.

License

This project is licensed under the Apache-2.0 License.