SCION Workbench Client - v1.0.0-beta.35
    Preparing search index...

    Interface WorkbenchViewCapability

    A view is a visual element of the workbench layout for displaying content stacked or side-by-side.

    A view capability can be opened via WorkbenchRouter or added to a perspective in a WorkbenchPartCapability.

    The microfrontend can inject the WorkbenchView handle to interact with the view.

    WorkbenchView

    interface WorkbenchViewCapability {
        params?: ViewParamDefinition[];
        properties: {
            closable?: boolean;
            cssClass?: string | string[];
            heading?: string;
            lazy?: boolean;
            path: string;
            resolve?: { [name: string]: string };
            showSplash?: boolean;
            title?: string;
            [key: string]: unknown;
        };
        qualifier: Qualifier;
        type: View;
    }

    Hierarchy

    • Capability
      • WorkbenchViewCapability
    Index

    Properties

    Specifies parameters required by the view.

    Parameters can be read in the microfrontend by injecting the WorkbenchView handle, or referenced in path, title and resolvers using the colon syntax.

    properties: {
        closable?: boolean;
        cssClass?: string | string[];
        heading?: string;
        lazy?: boolean;
        path: string;
        resolve?: { [name: string]: string };
        showSplash?: boolean;
        title?: string;
        [key: string]: unknown;
    }

    Type Declaration

    • [key: string]: unknown

      Arbitrary metadata associated with the capability.

    • Optionalclosable?: boolean

      Controls if to display a close button in the view tab. Defaults to true.

    • OptionalcssClass?: string | string[]

      Specifies CSS class(es) to add to the view, e.g., to locate the view in tests.

    • Optionalheading?: string

      Specifies the subtitle of the view tab.

      Can be text or a translation key. A translation key starts with the percent symbol (%) and may include parameters in matrix notation for text interpolation.

      Text and interpolation parameters can reference capability parameters and resolvers using the colon syntax. See resolve for defining resolvers.

      {
      "params": [
      {"name": "id", "required": true}
      ],
      "properties": {
      "heading": ":productCategory", // `:productCategory` references a resolver
      "resolve": {
      "productCategory": "products/:id/category" // `:id` references a capability parameter
      }
      }
      }
      {
      "params": [
      {"name": "id", "required": true}
      ],
      "properties": {
      "heading": "%product_category.title;category=:productCategory", // `:productCategory` references a resolver
      "resolve": {
      "productCategory": "products/:id/category" // `:id` references a capability parameter
      }
      }
      }
    • Optionallazy?: boolean

      Controls if to load the microfrontend only when activating the view tab.

      Requires configuration of title and heading in the manifest.

      Defaults to true.

    • path: string

      Specifies the path to the microfrontend.

      The path is relative to the base URL given in the application manifest, or to the origin of the manifest file if no base URL is specified.

      Path segments can reference capability parameters using the colon syntax.

      {
      "params": [
      {"name": "id", "required": true}
      ],
      "properties": {
      "path": "products/:id", // `:id` references a capability parameter
      }
      }
    • Optionalresolve?: { [name: string]: string }

      Defines resolvers for use in the view title and heading.

      A resolver defines a topic where a request is sent to resolve text or a translation key, typically based on capability parameters. Topic segments can reference capability parameters using the colon syntax.

      The application can respond to resolve requests by installing a message listener in the activator. Refer to ActivatorCapability for registering an activator.

      import {Beans} from '@scion/toolkit/bean-manager';
      import {MessageClient} from '@scion/microfrontend-platform';

      Beans.get(MessageClient).onMessage('products/:id/name', message => {
      const id = message.params.get('id');
      return `Product ${id}`;
      });
    • OptionalshowSplash?: boolean

      Instructs the workbench to show a splash, such as a skeleton or loading indicator, until the view microfrontend signals readiness.

      By default, the workbench shows a loading indicator. A custom splash can be configured in the workbench host application.

      WorkbenchView.signalReady

    • Optionaltitle?: string

      Specifies the title of the view tab.

      Can be text or a translation key. A translation key starts with the percent symbol (%) and may include parameters in matrix notation for text interpolation.

      Text and interpolation parameters can reference capability parameters and resolvers using the colon syntax. See resolve for defining resolvers.

      {
      "params": [
      {"name": "id", "required": true}
      ],
      "properties": {
      "title": ":productName", // `:productName` references a resolver
      "resolve": {
      "productName": "products/:id/name" // `:id` references a capability parameter
      }
      }
      }
      {
      "params": [
      {"name": "id", "required": true}
      ],
      "properties": {
      "title": "%product.title;name=:productName", // `:productName` references a resolver
      "resolve": {
      "productName": "products/:id/name" // `:id` references a capability parameter
      }
      }
      }
    qualifier: Qualifier

    Qualifies this view. The qualifier is required for a view.

    type: View