This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse
Osama Sayegh a742952c8d
FIX: Client should be able to route ID-less topic URLs (#15697)
The topic ID portion of the topic URL is optional in Discourse as long as the topic slug is unique across the site. If you navigate to a topic without the ID in the URL, Discourse will redirect you to the canonical version of the URL that includes the ID.

However, we have a now regression where the client app doesn't correctly handle ID-less topic URLs displays an error message when the user clicks on such URL. The regression was introduced b537d591b3 when we switched from `DiscourseURL.routeTo` to using Ember's router to perform the redirecting to the canonical version of the URL, but the problem is that the canonical version comes from the server and it contains the hostname which the Ember router doesn't understand because it expects a relative URL.

This PR fixes the problem by constructing a relative URL that contains the topic slug and ID and passing that to the Ember route.
2022-01-24 23:19:35 +03:00
..
app FIX: Client should be able to route ID-less topic URLs (#15697) 2022-01-24 23:19:35 +03:00
config DEV: Allow ember server --environment production to be used (#15431) 2021-12-31 12:26:23 +00:00
lib DEV: Update plugin JS loading in Ember CLI testem environment 2022-01-18 10:16:29 +00:00
public/assets/scripts DEV: Support for running theme test with Ember CLI (third attempt) 2022-01-13 16:02:07 -05:00
tests DEV: use query() instead of queryAll() in tests (#15681) 2022-01-24 11:27:58 +11:00
.ember-cli REFACTOR: Sync up master with changes for Ember-CLI (#11671) 2021-01-12 10:13:21 -05:00
.npmrc DEV: Prevent npm usage (#13945) 2021-08-04 22:04:58 +02:00
ember-cli-build.js DEV: Fix missing test paths for Ember CLI (#15578) 2022-01-14 11:53:52 +10:00
package.json DEV: Support for running theme test with Ember CLI (third attempt) 2022-01-13 16:02:07 -05:00
testem.js DEV: Update plugin JS loading in Ember CLI testem environment 2022-01-18 10:16:29 +00:00