Commit Graph

289 Commits

Author SHA1 Message Date
Discourse Translator Bot 7782de1558
Update translations (#51) 2021-06-01 15:11:37 +02:00
Discourse Translator Bot e76f7fff62
Update translations (#50) 2021-05-18 15:07:35 +02:00
Penar Musaraj b985ebad4c
DEV: Remove SCSS color vars fallbacks (#49) 2021-05-12 16:17:44 -04:00
dependabot[bot] 7433305f44
Build(deps): Bump lodash from 4.17.20 to 4.17.21 (#48)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.20 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.20...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-10 13:40:21 -04:00
dependabot[bot] 071128fa55
Build(deps): Bump handlebars from 4.7.6 to 4.7.7 (#47)
Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.7.6 to 4.7.7.
- [Release notes](https://github.com/wycats/handlebars.js/releases)
- [Changelog](https://github.com/handlebars-lang/handlebars.js/blob/master/release-notes.md)
- [Commits](https://github.com/wycats/handlebars.js/compare/v4.7.6...v4.7.7)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-10 10:48:24 +10:00
Discourse Translator Bot 4cc5e8780b
Update translations (#46) 2021-05-05 13:23:09 +02:00
Jarek Radosz 378f8d24f4
FIX: Correctly trigger actions (#45)
Fixes a regression introduced in #32. Reported in https://meta.discourse.org/t/meta-discourse-org-docs-sidebar-filter-doesnt-work/188350/2

Included:
* DEV: Use `query` helper
* DEV: Simplify the Docs model
* DEV: Add a test
* FIX: Correctly trigger actions
* DEV: Use `count` instead of `queryAll`
2021-04-29 16:36:14 +02:00
discoursebot f75c9d5e32
DEV: Update CI workflows, fix linting issues (#32)
Included:

* DEV: Update CI workflows
* DEV: Update the plugin URL
* DEV: Update Gemfile.lock
* DEV: Remove an old rubocop artifact
* DEV: Add .prettierrc
* DEV: Clean up .gitignore
* DEV: Add license
* DEV: Update package.json
* DEV: Fix template issues
* DEV: Re-format code
* DEV: Use `@action`
* DEV: `inject as controller`
* DEV: Use `@computed`
* DEV: Avoid naming collision and extra indirection
* DEV: Use `discourse-common/utils/decorators`
* DEV: Use `role="button"`

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
Co-authored-by: jjaffeux <j.jaffeux@gmail.com>
2021-04-27 20:49:34 +02:00
Discourse Translator Bot 50f7c25de2
Update translations (#43) 2021-04-20 15:30:54 +02:00
Discourse Translator Bot 67a8f5b59c
DEV: Add Crowdin support (#42) 2021-04-15 22:03:56 +02:00
Osama Sayegh 312cafe9d7
DEV: Compatibility with Discourse on Rails 6.1 (#41)
Related to https://github.com/discourse/discourse/pull/12688.

The tags and categories count queries are failing on Rails 6.1 with `ERROR:  column "topics.bumped_at" must appear in the GROUP BY clause or be used in an aggregate function`. The reason these queries didn't fail prior to 6.1 was because Active Record would automatically drop the `ORDER BY` clause from the queries when we called `count` on them. This behavior has been [changed](5812feffe3) in 6.1 so now Active Record only drops the `ORDER BY` clause if there is no `GROUP BY` clause. Our queries do have `GROUP BY` clauses, so we need to drop the `ORDER BY` clauses ourselves before we call `count` to make them work on 6.1.
2021-04-15 19:17:26 +03:00
dependabot[bot] 2ab4e13892
Build(deps): Bump y18n from 4.0.0 to 4.0.1 (#39)
Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-01 10:03:11 +02:00
Jordan Vidrine a5bd6954c0
FEATURE: Add `selectTag`, `tags`, and `categories` to plugin outlet. (#38) 2021-03-23 08:50:44 -05:00
Justin DiRose f61de2d871
DEV: Add parameter to plugin outlet (#37)
This adds a parameters to the args hash of the before-docs-search plugin outlet so we can access tags via theme components using this outlet.
2021-03-15 11:23:37 -05:00
Penar Musaraj c7376c243d
UX: Fix two small mobile styling issues (#36) 2021-02-24 11:40:32 -05:00
Justin DiRose 34f84d0d83
Add missing README (#35) 2021-02-23 19:10:37 +01:00
Justin DiRose 2ee446b1fa
FEATURE: Add link to Docs in top menu (#34)
Added a plugin setting so admins have the choice of including a link to Docs in the top menu.
2021-02-18 15:24:52 -06:00
Justin DiRose 2835500c62
FEATURE: Make Docs compatible with inline oneboxes (#33)
Linking directly to a Docs item like so `http://localhost:3000/docs?topic=16` would result in a generic inline onebox link. This adds logic to the Rails view so a proper title is rendered when the `InlineOneboxer` in core queries the route.
2021-02-16 15:09:45 -06:00
Justin DiRose 399fbec04f
FIX: Back button out of alignment (#31)
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.
2021-02-01 09:53:38 -06:00
Joffrey JAFFEUX ce005939c1
DEV: prettier 2.2.1 (#30) 2021-01-27 10:37:03 +01:00
Justin DiRose b13abb992c
FIX: Compute topic title correctly (#29)
Was using `unicode_title` but not all topics return a unicode_title
attribute. So need to instead do this.
2021-01-19 12:16:20 -06:00
Justin DiRose 68a7243a66
FIX: Account for not having a unicode_title (#28)
Mistakenly forgot to check for presence of unicode title and use the appropriate one.
2021-01-18 12:17:29 -06: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 cb7c12defe
FIX: Show unicode title in topic view (#26) 2021-01-13 13:27:10 -06:00
Justin DiRose a82db01108
FEATURE: Show topic title and category in site title (#25) 2021-01-13 13:26:52 -06:00
discoursebot 0d396f921e
DEV: Update CI workflows (#23)
Updates CI from discourse/.github

Co-authored-by: justindirose <justindirose@users.noreply.github.com>
2021-01-11 14:45:20 -06:00
Osama Sayegh 25d3fbdfed
FIX: debounce search correctly (#24)
Signed-off-by: OsamaSayegh <asooomaasoooma90@gmail.com>
2021-01-05 15:16:44 +03:00
Roman Rizzi 3da00ddaa1
DEV: Use the new discourseDebounce function wrapper. (#22)
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.
2020-12-22 14:45:33 -03: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
Justin DiRose 0e610cf504
FIX: Show muted topics (#19)
In many cases it makes sense to show muted topics in the Knowledge Explorer view. One such case might be if a user mutes a documentation category, but wants to be able to search them via this plugin.

To implement this, I've called TopicQuery.default_results via an added class method, which does the same thing as latest_results except skips the muted topics removal.

One issue I ran into with this is with the no_definitions option set to true, the query was not able to see the categories table. This appears to work correctly in core as I dug into it, but was not able to root out the source of the issue in the plugin. Everything seems to be generated correctly compared to how core methods use TopicQuery, but this issue remained. This is the reason for the results.references(:categories) call on line 25 of query.rb, as then the query can properly access the categories table.
2020-11-16 13:43:48 -06:00
Jarek Radosz 731c2451cd
DEV: Add a js smoke test (#20)
One test is infinitely better than zero. The math checks out.
2020-11-16 18:30:40 +01:00
Jarek Radosz 019591c995
FIX: Don't overwrite Topic.category computed prop (#18)
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.
2020-11-11 22:14:38 +01:00
Mark VanLandingham 23ed78cc87
DEV: Use html-safe for no_topics translation (#17) 2020-11-11 09:01:59 -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 dd55d165cd
FIX: Filters did not reset when visiting route (#14)
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.
2020-11-04 12:02:05 -06:00
Justin DiRose aac4af9d96
DEV: Fix deprecated object creation methods (#13)
This commit makes sure we're using the up to date methods to create Ember classes and objects.
2020-10-27 11:31:09 -05:00
Discourse CI cf7adc61d4 DEV: Update CI workflows 2020-10-14 16:27:49 +00: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
Discourse CI 500ccf9656 DEV: Update CI workflows 2020-10-12 08:16:49 +00:00
Discourse CI 09d541a431 DEV: Update CI workflows 2020-10-09 19:03:15 +00:00
Discourse CI 77b6a69b99 DEV: Update CI workflows 2020-10-09 16:15:07 +00:00
Discourse CI d30d3a8a0a DEV: Update CI workflows 2020-10-09 15:09:46 +00:00
Justin DiRose bfc812ca9c
DEV: Linting 2020-10-06 12:36:08 -05:00
Justin DiRose e6e302782b
DEV: Add new plugin outlet 2020-10-06 12:13:31 -05:00
Justin DiRose e3be3fbb77
FEATURE: Add clear button to search bar
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.
2020-10-06 12:08:28 -05:00
Justin DiRose abb9047d29
FIX: Ignore canonical URL on /docs
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)
2020-10-06 11:22:18 -05:00
Justin DiRose 310f2f142c
FIX: Handle encoding on onebox excerpt
Oneboxes were breaking with bad encoding using the out of the box
excerpt on the topic. Mimicked core behaviors instead.
2020-10-05 16:17:38 -05:00
Justin DiRose 30aa6230c5
DEV: Add args to plugin outlet 2020-10-05 15:16:14 -05:00