Description
Follow-up of #4930
With #4256 we've added a protocolHandler and a custom kri protocol to handle links with href of kri://.... This included the registration of an event listener on the document.body element during the initialization of the app. We've not added a removal of that event listener, which can introduce memory leaks.
With #4930 the event handler is moved into XAction so we can easily maintain the lifetime of the event listener with the lifecycle of the component. This solves the issue around potential memory leaks, but introduces another issue. The event handler is now tightly coupled with XAction and this means that there must always be at least one XAction on the page to make this work. This might break if we need to provide a KRI link via locales.
General requirements for linking from KRIs:
- Providing string based KRIs as
href with kri protocol to XAction needs to trigger the KRI protocol handler.
- Clicks on a wrapping element needs to trigger a link inside (basically keep the functionality of
findAnchor).
- Decouple
XAction from global event handling, all of this needs to work without a XAction on the page.
- KRI links are internal links and should not use the browser API but vue router history (no page refresh). We also check for the attribute
x-internal.
- Currently our KRI links link to detail pages, but we also need to support linking to summary views or other types of nested views
Description
Follow-up of #4930
With #4256 we've added a protocolHandler and a custom
kriprotocol to handle links withhrefofkri://.... This included the registration of an event listener on thedocument.bodyelement during the initialization of the app. We've not added a removal of that event listener, which can introduce memory leaks.With #4930 the event handler is moved into
XActionso we can easily maintain the lifetime of the event listener with the lifecycle of the component. This solves the issue around potential memory leaks, but introduces another issue. The event handler is now tightly coupled withXActionand this means that there must always be at least oneXActionon the page to make this work. This might break if we need to provide a KRI link via locales.General requirements for linking from KRIs:
hrefwithkriprotocol toXActionneeds to trigger the KRI protocol handler.findAnchor).XActionfrom global event handling, all of this needs to work without aXActionon the page.x-internal.