Socket
Book a DemoInstallSign in
Socket

@premise/plugin-dynamic-pick-extension

Package Overview
Dependencies
Maintainers
5
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@premise/plugin-dynamic-pick-extension

Dynamic Data Form Extension (Frontend and Backend Plugins)

0.2.2
latest
Source
npmnpm
Version published
Maintainers
5
Created
Source

dynamic-pick-extension

Welcome to the dynamic-pick-extension plugin! This plugin is a Custom Field Extension that allow you to create <Select> components that fetches data dynamically from an endpoint. This can be used together with the form-data-backend plugin to write custom logic to fill the field.

Installation

cd packages/app/
yarn add @premise/plugin-dynamic-pick-extension

Configuration

Add the import to your packages/app/src/App.tsx on the frontend package of your backstage instance:

import { DynamicPickFieldExtension } from '@premise/plugin-dynamic-pick-extension';
import { ScaffolderFieldExtensions } from '@backstage/plugin-scaffolder-react';

Then add the imported field extension as a child of ScaffolderFieldExtensions inside Route

<Route path="/create" element={<ScaffolderPage />}>
  <ScaffolderFieldExtensions>
    <DynamicPickFieldExtension />
  </ScaffolderFieldExtensions>
</Route>

You should now see the custom filed DynamicPickExtension clicking "Custom field explored" here http://localhost:3000/create/edit.

Usage

To use the extension on a Backstage Template Action just add the ui-field and ui-options fields to the parameter

Basic usage:

parameters:
    - category:
        title: Category
        type: string
        ui:field: DynamicPickExtension
        ui:options:
            # IMPORTANT: The endpoint needs to return a JSON array of strings.
            external_data: https://dummyjson.com/products/categories

Using the form-data-backend plugin:

parameters:
    - team:
        title: Github Team to add as admin of the repository
        type: string
        ui:field: DynamicPickExtension
        ui:options:
            # This is a provider added on the form-data-backend plugin
            form_data: github/teams

Options

`no_options_text``: string - Text to show when no options are available - Default: "No options"

parameters:
    - team:
        title: Github Team to add as admin of the repository
        type: string
        ui:field: DynamicPickExtension
        ui:options:
            # This is a provider added on the form-data-backend plugin
            form_data: github/teams
            no_options_text: "No teams available"

Keywords

backstage

FAQs

Package last updated on 04 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.