discourse/app/assets
David Taylor 575c2c8573
DEV: Update homepage URL handling (#24373)
We want / to display one of our discovery routes/controllers, but we don't want to register it as `discovery.index` because that would break themes/plugins which check the route name. Previously, this was handled using a variety of approaches throughout the codebase (in discourse-location, discourse-url and mapping-router). But even then, it didn't work consistently. For example, if you used an Ember method like `router.transitionTo("/")`, an empty `discovery.index` page would be rendered.

This commit switches up the approach. `discovery.index` is now defined as a real route, and redirects to the desired homepage. To preserve the `/` as a 'vanity url', we patch the method on the router responsible for persisting URLs to the Ember Router and the browser. The patch identifies a relevant transition by looking for a magic query parameter.

In an ideal world, we wouldn't be patching the router at all. But at least with this commit, the workaround is all in one place, and works consistently for all navigation methods. The new strategy is also much better tested.
2023-11-16 11:58:04 +00:00
..
images FIX: Use correct location for wizard background image (#24183) 2023-10-31 15:57:47 +00:00
javascripts DEV: Update homepage URL handling (#24373) 2023-11-16 11:58:04 +00:00
stylesheets UX: fix reply-where category display (#24389) 2023-11-15 11:48:44 -05:00