Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface StoreRegistration

Response from store registration which includes metadata and a function to update app cards buttons.

Hierarchy

Index

Properties

clientAPIVersion: string
workspaceVersion: string

Methods

  • Function to updates app card button config.

    example

    Updating primary button title and disabled flag.

    Parameters

    • request: UpdateButtonConfigRequest

      object that contains primary button and secondary buttons configs that will be used to update button configuration returned by provider for an app.

       let storeRegistration: StoreRegistration | undefined;

      await WorkspacePlatform.init({
      customActions: {
      storeButtonCustomActionHandler: async (payload: StoreCustomButtonActionPayload) => {
      if (storeRegistration) {
      await storeRegistration.updateAppCardButtons({
      appId: payload.appId,
      primaryButton: {
      ...payload.primaryButton,
      title: 'Disabled Button',
      disabled: true,
      },
      secondaryButtons: payload.secondaryButtons
      });
      }
      }
      }
      });

      const sampleApp: App = {
      title: 'Sample Application',
      addId: 'sampleAppId',
      icons: [],
      publisher: 'Sample',
      primaryButton: {
      title: 'Sample Button',
      action: {
      id: 'storeButtonCustomActionHandler',
      }
      }
      },

      const storefrontProvider: StorefrontProvider = {
      title: 'Sample Store',
      id: 'sampleStoreId',
      icon: {...},
      getApps: () => Promise.resolve([sampleApp]),
      getLandingPage: {...},
      getNavigation: {...},
      getFooter: {...},
      launchApp: (app: App) => WR.getCurrentSync().launchApp({app})
      };

      storeRegistration = await Store.register(storefrontProvider);
      await Store.show();

    Returns Promise<void>

Generated using TypeDoc