In Spec we were creating two topics:
```ruby
fab!(:topic) { Fabricate(:topic, category: category) }
fab!(:topic2) { Fabricate(:topic, category: category) }
```
Because we didn't set title explicitly it was using sequence from Fabricator
```ruby
title { sequence(:title) { |i| "This is a test topic #{i}" } }
```
If you have two titles `This is a test topic 9` and `This is a test topic 10` Spec testing if topics are sorted will fail. Therefore, we should explicitly set topic title when creating test instances to avoid that randomness.
After implementing changes to tagging, this introduced ambiguity in the SQL query for sorting by activity. This commit fixes the ambiguity by explicitly defining the table from where the columns are used. Also adds tests to check for regressions in the future.
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.
If using more than two tags to filter, we'd run into an SQL alias
collision on a few joins. Resolved by ensuring unique names are used across the query.
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.
When trying to onebox topics, the canonical URL overrides the generated
OpenGraph tags, causing a less than ideal onebox for a linked KE
article.
This commit uses the existing options for the `crawlable_meta_data`
method to generate the `og:ignore_canonical` tag.
1504fe7231/app/helpers/application_helper.rb (L267-L269)
Logic was not properly checking if there was a topic selected or not. As a result, the template for onebox data was still being loaded, causing an error. Also changed the order around TopicView to avoid unwanted effects.
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.
This fixes an edge case, such as when browsing directly into a topic in the
Knowledge Explorer view, where when you click the back button and the list
model is not generated.
The event listener function was running on the incorrect lifecycle hook.
Should've been didRender.
This commit also fixes a small bug where in some cases the screen would
not scroll all the way to the top.