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

    Class WorkbenchViewAbstract

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

    Users can drag views from one part to another, even across windows, or place them side-by-side, horizontally and vertically.

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

    WorkbenchViewCapability

    Index

    Constructors

    Properties

    active$: Observable<boolean>

    Indicates whether this view is active.

    Upon subscription, emits the active state of this view, and then emits continuously when it changes. The Observable completes when navigating to a microfrontend of another application, but not when navigating to a different microfrontend of the same application.

    capability$: Observable<WorkbenchViewCapability>

    Capability of the microfrontend loaded into the view.

    Upon subscription, emits the microfrontend's capability, and then emits continuously when navigating to a different microfrontend of the same application. It completes when navigating to a microfrontend of another application.

    focused$: Observable<boolean>

    Indicates whether this view has the focus.

    Upon subscription, emits the focused state of this view, and then emits continuously when it changes. The Observable completes when navigating to a microfrontend of another application, but not when navigating to a different microfrontend of the same application.

    id: `view.${string}`

    Unique identity of this view.

    params$: Observable<ReadonlyMap<string, any>>

    Parameters of the microfrontend loaded into the view.

    Upon subscription, emits the microfrontend's parameters, and then emits continuously when the parameters change. The Observable completes when navigating to a microfrontend of another application, but not when navigating to a different microfrontend of the same application.

    partId$: Observable<`part.${string}`>

    Gets the identity of the part that contains this view.

    Upon subscription, emits the identity of this view's part, and then emits continuously when it changes. The Observable completes when navigating to a microfrontend of another application, but not when navigating to a different microfrontend of the same application.

    snapshot: ViewSnapshot

    The current snapshot of this view.

    Methods

    • Registers a guard to confirm closing the view, replacing any previous guard.

      Example:

      Beans.get(WorkbenchView).canClose(async () => {
      const action = await Beans.get(WorkbenchMessageBoxService).open('Do you want to save changes?', {
      actions: {
      yes: 'Yes',
      no: 'No',
      cancel: 'Cancel'
      }
      });

      switch (action) {
      case 'yes':
      // Store changes ...
      return true;
      case 'no':
      return true;
      default:
      return false;
      }
      });

      Parameters

      • canClose: CanCloseFn

        Callback to confirm closing the view.

      Returns CanCloseRef

      Reference to the CanClose guard, which can be used to unregister the guard.

    • Sets whether this view is dirty or pristine. When navigating to another microfrontend, the view's dirty state is set to pristine.

      You can provide the dirty/pristine state either as a boolean or as Observable. If you pass an Observable, it will be unsubscribed when navigating to another microfrontend, whether from the same app or a different one.

      If not passing an argument, the view is marked as dirty. To mark it as pristine, you need to pass false.

      Parameters

      • Optionaldirty: boolean | Observable<boolean>

      Returns void

    • Controls whether the user should be allowed to close this workbench view.

      You can provide either a boolean or Observable. If you pass an Observable, it will be unsubscribed when navigating to another microfrontend, whether from the same app or a different one.

      Parameters

      • closable: boolean | Observable<boolean>

      Returns void

    • Sets the subtitle to be displayed in 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.

      Parameters

      • heading: string

      Returns void

    • Sets the subtitle to be displayed in the view tab.

      Parameters

      • heading: Observable<string>

      Returns void

      since version 1.0.0-beta.31. To migrate, pass a translatable and provide the text using a text provider registered in WorkbenchClient.registerTextProvider.

    • Sets the title to be displayed in 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.

      Parameters

      • title: string

      Returns void

    • Sets the title to be displayed in the view tab.

      Parameters

      • title: Observable<string>

      Returns void

      since version 1.0.0-beta.31. To migrate, pass a translatable and provide the text using a text provider registered in WorkbenchClient.registerTextProvider.

    • Signals readiness, notifying the workbench that this view has completed initialization.

      If showSplash is set to true on the view capability, the workbench displays a splash until the view microfrontend signals readiness.

      Returns void

      WorkbenchViewCapability.properties.showSplash