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/tests/unit
Sam 0df7743d78
FIX: tag dropdown not working with default_list_filter (#20608)
If you set a category to `default_list_filter` none. Information
was not passed to the tag route and routing was incorrect.

This patch fails, cause on reload route does not point to the right place.


```
-- a/app/assets/javascripts/discourse/app/routes/tag-show.js
+++ b/app/assets/javascripts/discourse/app/routes/tag-show.js
@@ -89,6 +89,8 @@ export default DiscourseRoute.extend(FilterModeMixin, {
       filter = `tag/${tagId}/l/${topicFilter}`;
     }
     const list = await findTopicList(
       this.store,
       this.topicTrackingState,
@@ -123,7 +125,7 @@ export default DiscourseRoute.extend(FilterModeMixin, {
   },

   setupController(controller, model) {
-    const noSubcategories =
+    this.noSubcategories =
       this.noSubcategories === undefined
         ? model.category?.default_list_filter === NONE
         : this.noSubcategories;
@@ -133,7 +135,7 @@ export default DiscourseRoute.extend(FilterModeMixin, {
       ...model,
       period: model.list.for_period,
       navMode: this.navMode,
-      noSubcategories,
+      noSubcategories: this.noSubcategories,
       loading: false,
     });
 ```

Long term we don't want to hide this logic from the routing (even in
the category case) it just cause unneeded confusion and fragility.
2023-03-10 11:37:55 +11:00
..
controllers DEV: Deprecate create-store test helper (#19021) 2022-11-16 10:54:46 +01:00
ember DEV: Support theme/plugin overrides of colocated component templates (#19237) 2022-11-30 14:14:38 +00:00
lib FIX: tag dropdown not working with default_list_filter (#20608) 2023-03-10 11:37:55 +11:00
mixins DEV: Deprecate assert.not() (#15595) 2022-02-09 18:49:05 +01:00
models FIX: Don't set categoryId on PM drafts (#20475) 2023-03-01 11:32:12 +01:00
routes DEV: Add tests for review-index route (#18415) 2022-10-05 12:39:35 +08:00
services FIX: Don't spam presence requests when getting 429 (#20084) 2023-01-31 09:49:23 +01:00
utils DEV: Support @debounce decorator in native class syntax (#20521) 2023-03-03 11:48:58 +00:00
localization-test.js FIX: Overriding text with admin_js.* keys didn't work (#18281) 2022-09-20 10:47:57 +10:00