Commit Graph

109 Commits

Author SHA1 Message Date
Bianca Nenciu b558caff37
PERF: Use UserAction to count accepted answers (#162)
The previous query which used custom fields performed a much more
complex and slower search.
2021-09-13 19:26:43 +03:00
Martin Brennan cf368c19cb
FIX: Stop register_topic_list_preload_user_ids from breaking old versions (#160)
We need a proper fix, but this stops the bleeding for now.
Wrapped code related to `register_topic_list_preload_user_ids` in
a `respond_to?(:register_topic_list_preload_user_ids)` block because
this API is not available in beta or stable versions of Discourse.
2021-08-31 13:30:17 +10:00
Bianca Nenciu f20274f44a
FIX: Correctly serialize accepted_answers (#158) 2021-08-26 16:16:22 +03:00
Bianca Nenciu fafa1c22b0
FEATURE: Show number of accepted answers on user card (#154) 2021-08-26 14:25:39 +03:00
Bianca Nenciu 184d2e6137
FEATURE: Show user who posted accepted answer second (#156)
The user who posts the accepted answer will show as the second poster
in the list of posters from topics list.
2021-08-26 12:53:46 +03:00
Osama Sayegh 6123f22412
Revert "FEATURE: Show user who posted accepted answer second (#153)" (#155)
This reverts commit 556f402db8.
2021-08-26 01:05:01 +03:00
Bianca Nenciu 556f402db8
FEATURE: Show user who posted accepted answer second (#153)
The user who posts the accepted answer will show as the second poster
in the list of posters from topics list.
2021-08-25 23:33:28 +03:00
Arpit Jalan 13168027eb
UX: do not show composer education message if the post is whisper (#152) 2021-08-19 09:33:00 +05:30
Vinoth Kannan 5e0ef4bd36
DEV: create a sample solved topic for `dev:populate` rake task. (#149)
Solved feature will be enabled on a random category and a random post will get marked as "accepted answer" on it.
2021-07-15 19:04:28 +05:30
Martin Brennan af0d3aca61
DEV: Remove fallback to TopicTimer close type (#144)
We've been past the 2.7 release for a while now and silent_close
is in core; time to remove this fallback.
2021-06-28 15:33:25 +10:00
Mark VanLandingham eac6539c46
FIX: Backwards compatibility for older Discourse versions (#143) 2021-06-24 12:11:51 +05:30
Mark VanLandingham 52d4656011
Re-add usage of `add_directory_column` for user directory table solutions count (#140) 2021-06-22 13:18:23 -05:00
communiteq ca0dbd6d4c
Two extra options (#138)
* Make it possible to disallow topic starters to accept a solution

* Make adding QAPage schema markup optional

* Address @eviltrout's comments

Co-authored-by: Richard <richard@communiteq.com>
2021-06-17 16:12:33 -04:00
Mark VanLandingham 7351882171
Revert "Use `add_directory_column` API to add solutions count to user directory (#137)" (#139)
This reverts commit 58c594fdda.
2021-06-17 12:37:29 -05:00
Mark VanLandingham 58c594fdda
Use `add_directory_column` API to add solutions count to user directory (#137) 2021-06-17 09:31:11 -05:00
Arpit Jalan bbbd13de85
FEATURE: show education message in composer when replying on solved topic (#135) 2021-06-14 16:06:55 +05:30
Jarek Radosz ce63d80abb
DEV: Avoid nil custom fields (#128) 2021-05-05 12:19:00 +02:00
Martin Brennan c722b94a97
FIX: Update set_or_create_topic_timer to use duration_minutes keyword
See https://github.com/discourse/discourse/pull/11961
2021-02-05 15:33:09 +10:00
Bianca Nenciu 6d91419caf
FIX: Refresh whole post stream when category changes (#111)
Only if the old and new category have different 'solved' settings.
2021-01-20 12:26:37 +02:00
Krzysztof Kotlarek 5840601025
FEATURE: silently auto close solved topic (#104)
Topic solved should be closed silently as system user involvement may be confusing.

In addition, old rescue block was dropped.

Meta: https://meta.discourse.org/t/discourse-encrypt-unable-to-see-close-message/135235
2020-12-03 15:01:42 +11:00
Vinoth Kannan f04ccbd4e6
FEATURE: send notification to OP when staff marked a post as solution. (#97)
Previously, we won't send any notification to the original poster when a staff user marked a post as the solution on behalf of OP.
2020-10-30 22:01:27 +05:30
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