Commit Graph

10 Commits

Author SHA1 Message Date
Ted Johansson 7228882378
FIX: Don't error out on non-stringy tags parameter (#180)
We're expecting the tags parameter to be a string. But the client can send an array or a nested parameter (thanks to the Rack protocol.) We're seeing exceptions in logs where the application is erroring out because of this.

As of this commit we raise a Discourse::InvalidParameters exception if we get a non-stringy tags parameter.
2024-10-21 14:13:21 +08:00
Martin Brennan 7721b1646d
DEV: Update defer_track_visit method in line with core (#174)
When https://github.com/discourse/discourse/pull/27761 is
merged in core the v2 method name is obsolete and we
can call `defer_track_visit` once more.
2024-07-08 16:37:25 +10:00
Martin Brennan 0d9365571b
DEV: Use new core code API for topic view tracking (#173)
Brings this plugin into line with the changes at
https://github.com/discourse/discourse/pull/27533,
where we have split the topic view tracking into
2 controller functions.
2024-07-08 10:14:50 +10:00
Renato Atilio 025bf46f8d
FEATURE: add local onebox handler for /docs urls (#145) 2023-07-14 10:35:11 -03:00
Jordan Vidrine 06f6d00ba1
FEATURE: Use the same structure as core topic-list-item and add topic excerpts to docs index (#140)
* FEATURE: Optionally show topic excerpts in docs index

This commit adds a new docs_show_topic_excerpts site setting
which, when enabled and used in conjunction either with the
always_include_topic_excerpts site setting or the
serialize_topic_excerpts theme modifier.

For the theme modifier, this commit also fixes an issue
with the Docs::Query class. Since we were re-initializing
Guardian within the class (rather than using the guardian
passed down from the controller), we did not have the request
information needed to determine theme_id, which meant that
the theme modifier had no effect. We now pass down guardian
from the controller instead. In general guardian is almost
always better than a user object, since we can always just
call guardian.user.

Adds a simple system spec as well.

---

We now check both the serialize_topic_excerpts theme modifier
and the always_include_topic_excerpts site setting server-side
within Docs::Query, and use that on the client to determine
whether or not to show the excerpts for docs. This is because if
someone sets one of those values it's logical to think it will
apply everywhere there is a topic list.

Also include a system spec to test whether the theme modifier
works to show the excerpts.

---------

Co-authored-by: Martin Brennan <martin@discourse.org>
2023-06-15 12:44:44 -05:00
Jarek Radosz d4ecda50ff
FIX: Incorrect plugin name in `requires_plugin` (#133)
This resulted in `Required plugin 'docs' not found` warnings in logs
2023-05-12 12:54:29 +02:00
David Taylor 724100044c
DEV: Introduce syntax_tree for ruby formatting (#118) 2022-12-29 13:31:34 +01:00
Krzysztof Kotlarek 7c54952414
FIX: TopicViewItem and TopicUser for doc topics (#80)
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.
2022-02-01 16:38:54 +11: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 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