When a documentation topic is viewed, corresponding TopicViewItem and TopicUser should be created.
A method from a TopicController is called, however, specs should warn us if ever that core method would change.
Core made buttons to use flexbox recently, which changed the behavior of
the go back button on Docs topics. The local justify-content declaration
overrides the core declaration causing problems.
After internal discussion, the team decided to rename this plugin to `discourse-docs`. No substantial changes made here aside from a settings migration.
We recently merged a Discourse core's PR to replace usages of Ember's debounce and discourseDebounce with a new debounce wrapper. The new wrapper works exactly like Ember's debounce but internally calls "run" when called in test mode.
This PR replaces all usages of other debounce functions with the new wrapper and fallbacks to Ember's debounce for backward-compatibility.
There was a weird case where when filtering topics by solved status did not properly show the count of filtered topics. I took this opportunity to lightly refactor the backend. There was a duplicate size operation when we searched and when calculating pagination. I've eliminated the second size call and refactored the front end to be a little bit simpler while solving the bug.
Pre-loading/pre-assigning isn't necessary. `Topic.category` uses `Category.findById` which in turn uses an identity map, so there are no N+1 calls to the backend.
When using a single Ember route, the query param filters did not
properly reset when, for example, clicking the Knowledge Explorer link
in the hamburger menu.
This commit introduces a subroute where most of the logic takes place.
We needed a subroute so that refresh doesn't take out the entire UI part.
This allows us to use the `refreshModel` option for query params on the
route and remove the refresh controller action. Doing so also retains
state of the search field instead of fully reloading the parent route.
Previously you had to clear the search results out by deleting them.
This introduces a friendlier way to clear the search UX, especially if
you didn't find what you're looking for.
Currently linking directly to Knowledge Explorer topics shows a generic onebox, which isn't super helpful in some cases.
This commit mimics how the theme creator plugin handles adding metadata to special occurrences. However, to get this to work, how the plugin handles showing topic contents needed to be refactored. Instead of hitting the existing topic route, the plugin implements its own version of this, including adding restrictions for topics that are not in a selected Knowledge Explorer category or tag.