Commit Graph

138 Commits

Author SHA1 Message Date
Régis Hanol 9ecac7a3e2 FIX: add mutex around un/mark as solved
To prevent any race conditions when two users toggle the state of a reply.

(cf. https://meta.discourse.org/161104)
2020-08-17 16:33:24 +02:00
jbrw 6f1cf5a779
FEATURE - Category group moderators can (un)accept solutions, if enabled (#89) 2020-07-27 17:42:42 -04:00
Krzysztof Kotlarek 36579b774f FIX: check if add_post_custom_fields_allowlister exisits 2020-07-27 12:04:28 +10:00
Krzysztof Kotlarek 57a8ec8a06 FIX: remove empty line 2020-07-15 09:44:32 +10:00
Krzysztof Kotlarek 10c31ffbd5 FIX: compatibility after allowlist rewording in Discourse 2020-07-15 09:34:02 +10:00
Krzysztof Kotlarek 922b4c3907
FIX: plugin backwards compatibility with Discourse 2.4 (#87)
Duration is a new keyword argument on Topic#set_or_create_timer and is not yet available in stable Discourse
2020-04-27 13:01:01 +10:00
Dan Ungureanu dc87d34594
FEATURE: Add include_subcategories report filter
Follow up to dafb1d7c7f.
2020-04-24 13:16:15 +03:00
Dan Ungureanu dafb1d7c7f
FIX: Include subcategories in report (#86) 2020-04-10 12:50:44 +03:00
Vinoth Kannan 329d8aff30 FIX: use the new duration attribute in `set_or_create_timer` method.
aad12822b7
2020-03-19 22:53:17 +05:30
Blake Erickson 8d883fba93
FEATURE: Publish WebHook event when solving/unsolving (#85)
* FEATURE: Publish WebHook event when solving/unsolving

This feature will publish a post edit webhook event whenever a solution
is accepted or unaccepted.

I went ahead and used the existing post-edit webhook because all the
post custom fields for the solved plugin are already included in the
post-edit serializer.

* Create Solved Event Webhook

This commit adds a solved event webhook that will only trigger when an
answer has been marked as accepted or unaccepted.

It uses 100 as the webhook ID. This way any new webhooks in core can
keep using lower numbers like 11, 12, 13, but plugins can use 101, 102,
etc.

* Removed functionality that was added to core

This [PR][1] to discourse core adds what what removed in this commit.

It is better to have this logic in core so that it is discoverable and
future webhooks won't end up accidentally using the same ID.

[1]: https://github.com/discourse/discourse/pull/9110

* UX: Add "solved" status filter in advanced search page.

And rename `in:solved` to `status:solved`.

* FEATURE: Publish WebHook event when solving/unsolving

This feature will publish a post edit webhook event whenever a solution
is accepted or unaccepted.

I went ahead and used the existing post-edit webhook because all the
post custom fields for the solved plugin are already included in the
post-edit serializer.

* Create Solved Event Webhook

This commit adds a solved event webhook that will only trigger when an
answer has been marked as accepted or unaccepted.

It uses 100 as the webhook ID. This way any new webhooks in core can
keep using lower numbers like 11, 12, 13, but plugins can use 101, 102,
etc.

* Removed functionality that was added to core

This [PR][1] to discourse core adds what what removed in this commit.

It is better to have this logic in core so that it is discoverable and
future webhooks won't end up accidentally using the same ID.

[1]: https://github.com/discourse/discourse/pull/9110

Co-authored-by: Vinoth Kannan <vinothkannan@vinkas.com>
2020-03-06 11:28:29 -07:00
Vinoth Kannan f4aea44db8 UX: Add "solved" status filter in advanced search page.
And rename `in:solved` to `status:solved`.
2020-03-06 08:57:38 +05:30
Sam Saffron e5b08c71c4
FIX: do not allow whispers to be accepted as answers
This also cleans up the guardian so it is easier to reason about
2020-02-23 19:16:31 +11:00
Krzysztof Kotlarek 230c2071ea
FEATURE: Add helpdesk and tech support badges (#84)
* FEATURE: Add helpdesk and tech support badges

When plugin is installed, we should create helpdesk and tech support
badges.

Both badges should be disabled by default
2020-02-05 11:14:12 +11:00
Vinoth Kannan 27da70052f FIX: keep quoted content in schema data if post excerpt is empty. 2020-01-04 19:25:42 +05:30
Sam Saffron 4c0545a827 DEV: lint files
This removes explicit return where not needed per rubocop rule
2019-12-10 12:01:54 +11:00
Joffrey JAFFEUX 15bc64bbc9 DEV: uses Discourse.redis instead of $redis 2019-12-03 10:49:58 +01:00
Vinoth Kannan 797d450b73 FIX: keep onebox body content in post excerpts for schema data. 2019-11-02 17:31:38 +05:30
romanrizzi 747a2e5167 DEV: Remove old backward-compatibility code 2019-10-09 15:56:55 -03:00
David Taylor 486f343b09 FIX: Include previously solved topics in auto-bump
Null values can happen when a post is removed as the solution. We already filter for NOT NULL in the topic_query and search filters. This commit adds the same logic to the auto-bump filter.
2019-08-06 11:19:33 +01:00
Sam Saffron 0fa0e7fd53 DEV: support running plugin without db
This is required for asset precompile
2019-06-13 16:33:03 +10:00
Guo Xiang Tan 75046f1d92 Add frozen string literal comment to files. 2019-05-13 11:04:27 +08:00
Bianca Nenciu 44e832813c FIX: Align checked icon in title. 2019-05-10 14:07:00 +03:00
Maja Komel db35674cc4 FIX: show solved icon on categories with featured topics page 2019-05-10 10:43:11 +02:00
Joffrey JAFFEUX 9f27caf39c FIX: adds support for new filter syntax 2019-05-01 22:24:09 +02:00
Joffrey JAFFEUX c6926f647b FIX: removes legacy code 2019-04-01 15:31:20 +02:00
Bianca Nenciu 3297d152a7 FIX: Staff users can accept posts in deleted topics. (#75) 2019-03-18 16:27:29 +01:00
Vinoth Kannan ca2d537665 PERF: Remove N+1 queries on search topic list item serializer. 2019-03-17 23:20:05 +05:30
Vinoth Kannan 8b8512e73e DEV: Use core method to preload category custom fields for site serializer 2019-03-16 23:27:31 +05:30
Vinoth Kannan 8beaa6c1d9 PERF: Remove N+1 queries on basic category serializer. 2019-03-15 18:53:22 +05:30
Vinoth Kannan 0fa41a8b38 PERF: Remove N+1 queries on site serializer. 2019-03-15 17:25:17 +05:30
Guo Xiang Tan 818bff2b30 FIX: Remove topic answer mixin from category detailed serializer. 2019-03-14 05:31:51 +08:00
Vinoth Kannan 5ddd644e00 FEATURE: Show dropdown to filter topic lists by solved status 2019-03-14 00:41:07 +05:30
Vinoth Kannan 6fb6f8849b Revert "REVERT: 'FEATURE: Add solved icon for topic titles in search results and other topic lists'"
This reverts commit 6dbd420c9e.
2019-03-13 22:40:54 +05:30
Vinoth Kannan 6dbd420c9e REVERT: 'FEATURE: Add solved icon for topic titles in search results and other topic lists' 2019-03-13 19:38:31 +05:30
Vinoth Kannan e9be43becd FEATURE: Add solved icon for topic titles in search results and other topic lists 2019-03-13 15:59:07 +05:30
Vinoth Kannan 3b7baa1a51 FIX: Don't use topic reply count as answer count in 'Question' schema 2019-02-20 00:35:07 +05:30
Michael Howell 684df58437 Move the QAPage Question into mainEntity
Fixes
https://meta.discourse.org/t/support-schema-org-qapage-and-google-rich-results/33813/14?u=notriddle
2018-12-04 20:04:54 +00:00
Penar Musaraj 7745adb6eb Add FA5 icon support 2018-11-07 21:08:46 -05:00
Sam 7673ed2480 FIX: in some cases first_post could be missing 2018-11-05 10:21:10 +11:00
Sam 54dc2b06ca clean up previous commit that adds answer metadata 2018-11-02 10:15:05 +11:00
Michael Howell 4e00693c76 Add schema.org QAPage metadata (#69)
* Add schema.org QAPage metadata

This is an SEO trick, intended to make results from Discourse forms more
"clickable" by promising a solution at the other end of the link.

https://meta.discourse.org/t/suggestion-add-checkmark-for-solved-threads-to-the-topic-title-as-well/33813

* Use final before-head-close-crawler that got merged

* Fix Sam's problems

* Fix linter errors
2018-11-02 09:38:16 +11:00
Guo Xiang Tan 46258a5b11 FIX: Remove auto-close topic timer on unsolved.
https://meta.discourse.org/t/unsolving-a-topic-does-not-remove-autoclose/94907
2018-08-31 12:03:42 +08:00
Guo Xiang Tan 93a64c4aa1 Prefer `destroy!` over `destroy` when not checking for return value. 2018-08-31 09:52:10 +08:00
Sam 5b81cc9293 FEATURE: if auto bump is enabled, do not bump solved 2018-07-18 10:56:56 +10:00
Sam 9aeb9df26f move to new db exec pattern 2018-06-21 12:23:50 +10:00
Joffrey JAFFEUX ef87bdc129 FIX: keep emoji images in solved excerpt 2017-09-04 14:07:21 +02:00
Neil Lalonde 38208b4600 fix broken build 2017-08-11 15:36:38 -04:00
Kyle Zhao 9104e2292c FEATURE: hide excerpt if 'solved_quote_length' is set to zero 2017-08-06 17:22:30 -04:00
Guo Xiang Tan 639784ec81 Fix rubocop offenses. 2017-08-02 15:09:07 +09:00
Guo Xiang Tan 17dda66400 PERF: N+1 queries when loading categories with featured topics. 2017-08-01 17:28:02 +09:00
jomaxro 1607b4e107 FIX: Don't open a topic to set an auto-close timer when marking as solved.
Fixes this issue: https://meta.discourse.org/t/marking-closed-topic-solved-with-solve-topics-auto-close-hours-set-causes-topic-to-be-reopened/63593?u=jomaxro

Topics that were closed before being marked as solved would be reopened and have an auto-close timer set.  If a topic is already closed, marking as solved should not cause it to re-open.
2017-06-12 22:29:53 +02:00
Guo Xiang Tan ed8b0103f6 FEATURE: Add `solved_topics_auto_close_hours` site setting.
https://meta.discourse.org/t/automatically-close-solved-topics-after-n-hours/58383
2017-05-22 20:03:49 +08:00
jomaxro f71c3370b2 Add URL to plugin.rb 2017-04-26 00:40:03 -04:00
Rafael dos Santos Silva 1b4242320e Require the serializer before patching 2017-04-19 01:03:50 -03:00
Rafael dos Santos Silva 92784c5f2c FIX: Show solved status on category lists too 2017-04-19 00:55:15 -03:00
David Taylor f66da5be15 Check postInfo exists 2017-03-08 15:47:18 +00:00
David Taylor 8b03c459f8 Only select required columns, and don't call excerpt twice 2017-03-08 15:42:41 +00:00
David Taylor e20104919a UX: Show configurable length excerpt when quoting the solution 2017-03-08 15:21:41 +00:00
David Taylor 4aaeee8aec Remove excerpt stuff, only show quote once clicked 2017-03-08 00:43:22 +00:00
David Taylor f38c7a3991 Initial work on getting answer quoted under question 2017-03-07 23:33:10 +00:00
David Taylor 5b8985f297 Remove empty checkbox for closed/archived topics 2017-03-06 01:34:29 +00:00
Sam fcd5a06e69 Merge pull request #45 from davidtaylorhq/filter_parameters
Change parameters from true/false to solved/unsolved.
2017-02-28 10:40:06 -05:00
David Taylor 889aeb5b6e Changed strings to yes/no 2017-02-28 15:22:07 +00:00
David Taylor 0da5124f77 Change parameters from true/false to solved/unsolved.
https://discuss.emberjs.com/t/boolean-query-params/4301
2017-02-27 22:49:53 +00:00
Sam d4348f4581 Merge pull request #40 from davidtaylorhq/icon_on_unsolved
Added empty box icon to unsolved topics
2017-02-27 16:29:38 -05:00
David Taylor dd37edf49d Only include can_have_answer if empty_box_on_unsolved is true. Thanks @SamSaffron 2017-02-27 21:26:09 +00:00
David Taylor d8f0b310f7 Revert "Only send can_have_answer attribute if empty_box_on_unsolved is true"
This reverts commit ea8c94681b.
2017-02-27 21:19:58 +00:00
David Taylor e3cf14016f Check discourse version before adding TopicQuery filters 2017-02-27 20:46:07 +00:00
David Taylor 2e4a7bc482 Allow filtering by solved or unsolved 2017-02-27 18:19:21 +00:00
David Taylor ea8c94681b Only send can_have_answer attribute if empty_box_on_unsolved is true 2017-02-27 17:40:51 +00:00
David Taylor 726b9a460d Added empty box icon to unsolved topics 2017-02-27 15:00:04 +00:00
Sam bf113f47b0 FEATURE: add solved enabled key 2017-02-02 12:20:40 -05:00
Sam 026f7a3ab0 FEATURE: support listing user solutions in user page 2017-02-02 12:20:40 -05:00
Angus McLeod 1c7a4e4178 Add accept and unaccept solution events 2017-01-20 09:13:58 -05:00
Arpit Jalan 6177d2e164 unsolving a topic does not remove the icon in the topic list 2016-05-03 00:40:01 +05:30
Sam afb1c91c11 Allow TL4 users to accept answers (configurable via site setting) 2016-03-31 12:06:03 +11:00
Robin Ward 8085462c00 Upgrade to new Plugin API + backwards compatibility 2016-02-17 16:23:42 -05:00
Sam f183671365 FEATURE: use new clean pattern for preloading fields
FIX: work around concurrency bug
FIX: add rate limits on accepting / unaccepting (20 an hour, 4 per 30 secs)
2015-08-05 16:21:16 +10:00
Régis Hanol e321c12ff7 FEATURE: accepted solutions admin report 2015-06-25 02:41:24 +02:00
Sam 8011731aa0 FEATURE: in:unsolved filter 2015-06-23 12:56:22 +10:00
Sam 7ebd56665b FEATURE: search all solved topics with in:solved 2015-06-23 12:31:47 +10:00
Sam 944ff5a70f FIX: yank existing notification when unaccepted 2015-06-22 10:18:50 +10:00
Sam d8705a278b FEATURE: site setting to enable solved globally 2015-06-19 16:08:43 +10:00
Sam 57b4cb853f FEATURE: display icon on front page 2015-06-15 16:26:40 +10:00
Sam 76e3b44cf5 FEATURE: add notification when an answer is accepted
Cleanup terminology (use solved vs accepted-answer)
Cleanup styling, get rid of green box
2015-06-15 14:24:49 +10:00
Sam Saffron 09292d6ff9 - Add security
- Add configuration option on categories to enable
2015-06-10 06:09:20 +10:00
Sam a4e9ee4552 first proof of concept, security still missing 2015-05-19 16:26:22 +10:00
Sam 43f40c9825 work in progress 2015-05-19 15:45:19 +10:00