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/app
David Taylor f7b5ff39cf
DEV: Refactor tag-show route (#16217)
Previously we were loading almost all the data in an afterModel hook, storing it temporarily in route properties, and then passing it to the controller in `setupController`.

This does not follow Ember best-practices, and causes a number of unexpected behaviours. For example, Ember only calls `setupController` **when the model value changes**. Since `model()` was only returning the tag, that meant that category changes and `additionalTag` changes wouldn't always trigger a `setupController` call, and things would get into a very weird state. This is visible when using the 'loading-slider' component because the category navigation dropdown gets 'stuck' when switching categories.

This commit moves all the data-fetching into `model()`. To make things cleaner, it also:
- removes most uses of route-level variables
- introduces async/await in the model() function
- removes some unneeded `get()` usage
- re-uses DiscoverySortableController for queryParam default handling
- Removes override of `renderTemplate()` so that queryParams are correctly passed through to the controller
- Removes some `transitionToRoute` hacks which were working around the queryParams issue
- Switches to `@action`
2022-03-21 12:20:51 +00:00
..
adapters FEATURE: Display pending posts on user’s page 2021-11-29 10:26:33 +01:00
components DEV: Refactor d-section to function correctly with loading-slider (#16216) 2022-03-18 11:47:23 +00:00
controllers DEV: Refactor tag-show route (#16217) 2022-03-21 12:20:51 +00:00
helpers DEV: Add category-color variable (#15807) 2022-02-03 13:16:27 -06:00
initializers DEV: Disallow Ember global usage (#16147) 2022-03-09 17:54:07 +01:00
lib DEV: Add clipboardCopyAsync API to utilities (#16232) 2022-03-21 13:34:01 +10:00
mixins FEATURE: Allow users to paste animated gifs into composer (#16204) 2022-03-17 10:47:54 -03:00
models FIX: Allow admins to change user ignore list (#16129) 2022-03-09 14:51:30 +10:00
pre-initializers DEV: Disallow Ember global usage (#16147) 2022-03-09 17:54:07 +01:00
raw-views DEV: Use method definition syntax consistently (#14915) 2021-11-13 14:01:55 +01:00
routes DEV: Refactor tag-show route (#16217) 2022-03-21 12:20:51 +00:00
services FIX: Better 0 file size detection and logging (#16116) 2022-03-07 12:39:33 +10:00
styles DEV: Migrate to Ember CLI (#11932) 2021-02-03 14:22:20 -05:00
templates DEV: Refactor tag-show route (#16217) 2022-03-21 12:20:51 +00:00
widgets FEATURE: Replace share-popup with share-topic (#16108) 2022-03-15 21:27:18 +02:00
app.js DEV: Improve theme error handling UX 2022-02-14 10:11:19 +00:00
index.html FIX: Ember CLI was always loading the admin payload in dev mode 2021-10-05 08:34:10 -04:00
mapping-router.js DEV: Improve and document __container__ workaround in tests (#15498) 2022-01-10 10:34:08 +00:00