Commit Graph

14 Commits

Author SHA1 Message Date
Krzysztof Kotlarek 72cdd8d415
FIX: ignore category filter when incorrect param (#59)
Category filter accepts ids of categories. If value is manipulated, we should ignore it.
2021-09-27 14:52:27 +10:00
Justin DiRose f32aebdba0
FEATURE: Rename from Knowledge Explorer to Docs (#27)
After internal discussion, the team decided to rename this plugin to `discourse-docs`. No substantial changes made here aside from a settings migration.
2021-01-18 10:38:09 -06:00
Justin DiRose 63a8181fa4
FIX: Results count not always properly shown (#21)
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.
2020-12-01 13:51:42 -06:00
Krzysztof Kotlarek ab66d70fdd
FIX: flaky order in spec (#16)
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.
2020-11-05 14:48:02 +11:00
Justin DiRose 6e974250f9
FIX: Sort query was ambiguous (#15)
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.
2020-11-04 16:46:55 -06:00
Justin DiRose 7959355159
FIX: Query name collision with multiple filters (#12)
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.
2020-10-14 09:27:19 -05:00
Justin DiRose 22c2387b76
FIX: Topics not always properly shown (#11)
There was a bug with the logic in how we were checking for matching tags
and categories in KE settings. If only tags were set, topics would not
show.
2020-10-13 10:32:22 -05:00
Justin DiRose 0e1c7c7216
FEATURE: Add onebox metadata (#10)
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.
2020-10-01 09:32:28 -05:00
Justin DiRose 14861e3321
FEATURE: Move route to /docs
After further discussion about the route, we landed on /docs as a better
choice. This commit makes that change.
2020-07-14 10:07:18 -05:00
Justin DiRose 25ca793555
FEATURE: Move to '/e'
'/knowledge-explorer' was proving a bit too verbose, so we're changing
it to '/e'. The former route should redirect to the new one.
2020-07-13 10:23:21 -05:00
Sam Saffron 80da6a5620 FEATURE: search entire knowledge base body as well as title
Previously search was only searching through the title of topics

This introduces full text search.

It also means we get automatic stemming which gives far better results.
2020-02-07 11:53:13 +11:00
Justin DiRose 10ec8b47a8 FEATURE: Category filtering 2019-11-06 11:27:30 -06:00
Justin DiRose a34e4468c1
REFACTOR: Handle queries in more robust, customizable way
* Create custom query lib file

* Get topic list by category

* Get topic list with both categories and tags

* Count tags and pass back to controller in object

* Filter topic list by param-passed tag list

* FIX: Correctly serialize topic list data

* Filter results by search term (title only

* Debug commit

* Working multi-tag filtering

* FIX: case insensitive search terms

* Begin refactor of front end for new api changes

* REFACTOR: Use model for refreshing data
Instead of just using a route, which introduces full page refreshes, use
the route to pull the data initially, then update it using a model as to
refresh only the relevant parts of the page.

* Working topic load

* FIX: Visual alignment

* Refactor tests to follow new patterns

* Fixes suggested by eviltrout

* FEATURE: Load more topics

* FIX: Paginate records on return to the front end in a better fashion

* FIX: Prevent loadMore while loading more

* Fix pagination of topics to truncate list properly

* Inherit rubocop from discourse

* Make rubocop happynated

* Set list to unordered
2019-10-31 15:09:50 -05:00
Justin DiRose 5d0da1fe0a Spec tests & minor refactors 2019-10-02 16:24:40 -05:00