4Science / dspace-angular

Angular UI for DSpace and DSpace-CRIS. In the dspace-cris-7 branch you can find the extension to support DSpace-CRIS
BSD 3-Clause "New" or "Revised" License
13 stars 28 forks source link

counters component struggles with internal link with parameters #72

Open floriangantner opened 5 months ago

floriangantner commented 5 months ago

Describe the bug The counters-section component (recently refactored with the internal-link-service) can only handle links/paths without parameters. If they contain some parameter it will lead to broken links. This might be the case, when you want to link to some search configuration.

To Reproduce Steps to reproduce the behavior:

  1. configure in cris-sections.xml some counter element linking to some search configuration.
    <bean
    class="org.dspace.layout.CrisLayoutCountersComponent.CounterSettings">
    <property name="discoveryConfigurationName"
        value="orgunits" />
    <property name="label" value="orgunits" />
    <property name="icon" value="fas fa-body fa-3x" />
    <property name="link" value="/search?configuration=orgunits" />
    </bean>
  2. The link on the counters-section component (hovering the link in the browser) seems to be correct, but
  3. The search ends at search%3Fconfiguration%3Dorgunits

Expected behavior We expect the counter component to render links with parameters correctly and set these as [queryParams].

Related work Some solution could be to let the internal-link.service.ts parse the router and take the queryparams from there, as previously suggested in https://github.com/4Science/dspace-angular/pull/26/files#diff-069da7b29cd19e55cfa6983bf87a194e1af5f2cae79a012e222e03817df93212L69.