Fix file tree search missing relative URL root

What does this MR do and why?

Fixes the follow-up from !258829 (merged). The file tree search built its request URL as a root-relative path, so it returned a 404 on instances with a relative URL root. It now builds the URL from the projectPath() path helper, which already includes the relative URL root and the organization prefix. A Jest test covers the relative-root case.

References

How to set up and validate locally

  1. Serve GDK under a relative URL root, then restart:

    gdk config set relative_url_root /gitlab
    gdk reconfigure
    gdk restart
  2. Open any repository and open the file tree browser.

  3. Click the file search box and type a file name.

  4. The results should populate. Before this fix the request to /<group>/<project>/-/files/<ref> dropped the /gitlab prefix and returned a 404, so no results showed.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading
Loading