Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Event

Payload

Description

kam-mf-selected

Code Block
languagejs
{
  microFrontendName: string;
}

Event emitted by the shell application, when a micro frontend is selected in the navbar.

kam-shell-context-changed

Code Block
languagejs
{
  userContext: {
    careTeamName: string | null;
    careTeamReference: string | null;
    organizationName: string;
    organizationReference: string;
    isCurrent: boolean;
    oioRoles: string[];
  }
}

Event emitted when the user context in the toolbar changes.

Info

Coming in a future release

In a coming release it will be possible to ask the user before navigating away from the current micro frontend in the shell application. Today a navigation in the shell will occur instantly without the possibility to ask the micro frontend if the navigation away should be allowed.

Shell

When the current page in the shell application is a micro frontend and the user clicks on another page in the shell application, the shell application will dispatch a custom event.

Custom Event from the shell application:

  • Name: “kam-is-shell-allowed-to-leave-mf”

  • detail: {microFrontendName: <nameOfTheMicroFrontend> }

The shell application will listen for the event “kam-leaving-mf-allowed”. When receiving the custom event the shell application will navigate to the page previously requested.

Micro frontend

The micro frontend must listen to the custom event “kam-is-shell-allowed-to-leave-mf”. When the micro frontend receives the event and the property microFrontendName matches the name of the micro frontend, the micro frontend must determine if the user is allowed to leave the micro frontend. The micro frontend must be able to determine if the user is for instance filling in a form(dirty form) and then ask the user if user wants to leave the page with unsaved changes. If the user click yes to leave the page a custom event must be dispatched. If the user has no unsaved changes a custom event must be sent without asking the user.

Custom Event from the micro frontend:

  • Name: “kam-leaving-mf-allowed”

  • detail: {microFrontendName: <nameOfTheMicroFrontend> }

Routing
Anchor
Routing
Routing

...