Markus Johansson
04/05/2024, 7:39 AMUmbModalRouteRegistrationController
) to a element on this route:
section/newsletter-studio/workspace/campaign/edit/ACA0F7A1-9AD5-4318-B1FB-A04A5CCCAE75/test
Use this code to open the modal:
<a href=${this._routeBuilder?.({myId:'123',workspaceKey : this.workspaceKey})??""}>Route 123</a>
The modal is opened, looks fine and the route now looks like this.
/section/newsletter-studio/workspace/campaign/edit/:workspaceKey/test/modal/ns-modal-campaign-emailsection/foo-2bar/123/
The problem is when I close the modal (submit or reject does not matter), the route is changed to:
section/newsletter-studio/workspace/campaign/edit/:workspaceKey/test
Note that the GUID is gone and replaced with :workspaceKey (the name of the route parameter). Like it's loosing the :workspaceKey that used to be in the route. I have similar (almost the exact code) mounted in a workspaceView inside the content-section and in that there everything works just fine, the route changes back to the previous view.
I think I'm missing something here but I've sent 3-4 hours trying to understand what I'm doing wrong =/. Any pointers or ideas? Anyone seen something similar? Would it be that the routed modal requires something like a workspaceView? Like mentioned I use element()
on the workspace extension definition:
.... {
type: "workspace",
....
element : () => import("./ns-campaign-workspace.element.js"), // <<<<< This is the element with <umb-router-slot/>
};
Then inside ns-campaign-workspace.element.js
I have one route (that displays well) where the UmbModalRouteRegistrationController
is added.
The fact that I manually need to pass the "workspaceKey" like so <a href=${this._routeBuilder?.({myId:'123',workspaceKey : this.workspaceKey})??""}>Route 123</a>
was the first thing that felt strange,Markus Johansson
04/05/2024, 12:29 PMNiels Lyngsø
04/08/2024, 6:59 AMNiels Lyngsø
04/08/2024, 7:04 AM