Skip to content

Conversation

@arnaugiralt
Copy link
Member

This PR adds several things to allow Connect Portal navigation from an extension:

  • The injector factory function now returns a new method, navigateTo, that can be used to emit events to the Connect Portal to perform navigation.
  • The new connectPortalRoutes and connectPortalRoutesDict constants map several SPA routes
  • The new processRoute is able to process routes defined in the connectPortalRoutesDict

In short, we can perform navigation in several ways:

  • Plain string: navigateTo('/marketplaces/MP-123')
  • Route object: navigateTo({ name: 'marketplaces.details, params: { id: 'MP-123' } })
  • connectPortalRoutesDict: navigateTo(connectPortalRoutesDict.marketplaceDetails, 'MP-123')

Having these options allows us to have great level of flexibility, without adding much complexity:

  • Users that are not familiar with the Connect Portal, or for simple routes, connectPortalRoutesDict can be used.
  • Vue route objects allow us to have a clean syntax for routes not registered in the connectPortalRoutesDict.
  • Plain strings can be used as well for unregistered routes if a user is not familiar with the Vue route object syntax.

Let me know if you have any comments or suggestions :)

irinanic88
irinanic88 previously approved these changes Jan 26, 2024
@arnaugiralt arnaugiralt force-pushed the LITE-29284-add-connect-portal-navigation-from-extension branch from 331a141 to da6b72f Compare January 26, 2024 15:40
nerimartinez
nerimartinez previously approved these changes Jan 29, 2024
@arnaugiralt arnaugiralt marked this pull request as ready for review January 29, 2024 10:21
@arnaugiralt arnaugiralt force-pushed the LITE-29284-add-connect-portal-navigation-from-extension branch from da6b72f to 470cfc6 Compare January 29, 2024 10:24
@arnaugiralt arnaugiralt force-pushed the LITE-29284-add-connect-portal-navigation-from-extension branch from 470cfc6 to 8e6acf0 Compare January 29, 2024 10:32
@sonarqubecloud
Copy link

@arnaugiralt arnaugiralt merged commit 6792416 into master Jan 29, 2024
@arnaugiralt arnaugiralt deleted the LITE-29284-add-connect-portal-navigation-from-extension branch January 29, 2024 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants