Skip to content

Improve content library routing #17338

@TomasEng

Description

@TomasEng

Currently, the content library uses a query parameter named currentLibraryRoute for the navigation. All the words in this name are redundant. A name like "element type" or "page" would be more appropriate. We may also consider to use the path instead of query parameters. That is more appropriate if we also want to add a route for each element.

The code is using and mutating the global window.location and window.history variables directly, while we are using React Router in the rest of the code to handle this complexity. It seems to me like the internal QueryParamsRouterImpl class is a temporary placeholder and that it's meant to be provided from the outside of the ContentLibrary component, implementing the current routing tools from each use case. As a part of this issue, we should fix this, either by implementing the routing specifically for each of the two use cases, or solve it internally in the package by adding a dependency to React Router.

Definition of done

  • The content library uses appropriate URLs as described above
  • All routing in both instances of the library (in dashboard and app-development) is managed using React Router

Metadata

Metadata

Assignees

Labels

area/content-libraryArea: Related to library for shared resourcesfrontendsquad/dataIssues that belongs to the named squad.

Type

Projects

Status

No status

Status

👷 In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions