Create a custom default Page

In Workspace v19.0 or later, you can create a custom default Page that users see when they add a Page to their Browser. By default this Page contains a single View, but you can override this configuration with the layout and views your workflow requires.

How it works

An addDefaultPage method is available for the WorkspacePlatformProvider interface. You override this method to provide the details of the default Page your environment requires.

See the API reference for addDefaultPage.

How to do it

import * as WorkspacePlatform from '@openfin/workspace-platform';

const overrideCallback: WorkspacePlatform.WorkspacePlatformOverrideCallback = async (
   WorkspacePlatformProvider
) => 
{
  class Override extends WorkspacePlatformProvider 
  {
    addDefaultPage = async (req: AddDefaultPagePayload): Promise<void> => 
    {
      // Could alter the payload or run your own custom logic and not call super
      const decoratedPayload = decorateAddDefaultPagePayload(req);
      return super.addDefaultPage(decoratedPayload);
    };
  }
  return new Override();
};
await WorkspacePlatform.init(
  {
    browser: 
    {
        title: "My Workspace Platform"
    },
    overrideCallback
  }
);