Commit Graph

69 Commits

Author SHA1 Message Date
Gabriel Grubba a1c8f4ee9d
FIX: revert chat-integration move to discourse-automation (#214)
* FIX: revert chat-integration move to discourse-automation

this reverses the changes made in 57b460737c

without deleting the migration.

* Revert "DEV: removing create post for category and tag changes setting (#210)"

This reverts commit 35925c4dac.

* DEV: merge both chat-integration rules and automation rules
2024-08-27 16:24:07 -03:00
Gabriel Grubba 57b460737c
FEATURE: add topic tags changed trigger to chat integration (#208)
* FEATURE: add topic tags changed trigger to chat integration

* FEATURE: add placeholder for reply to topic trigger

add description on how to use the placeholder

* DEV: Move slack message creation to provider

Add tests to new method

* FEATURE: add ${URL} to placeholder replacements and added tags link

If triggered when a topic tag is changed, message behavior will follow what user defined in message.

* DEV: Update tests with tags

* DEV: add post to topic for testing

* DEV: update test strings

* DEV: add early return for topic tags changed trigger

* DEV: move early return to use try/catch

* DEV: update `create_slack_message` to not send a tuple of values

* DEV: refactor method to be more readable

* FEATURE: add `${ADDED_AND_REMOVED}` for default texts

* DEV: Update typo in test

* DEV: Add tests to check when if `create_slack_message` raises an error

* DEV: Remove the `tag_added` from chat-integration filter

Added migration to handle the migration of the `tag_added` filter from the chat-integration plugin.

Only removed the logic from the plugin, data removal will happen in a future PR

* DEV: lint migration file

* DEV: update chat-integration to not show "tag_added" rules

* DEV: update added and missing tags logic

* DEV: update context variable name

* DEV: update migration to include `begin/rescue` block and added a list with available filters
2024-08-13 15:14:35 -03:00
Ted Johansson 4a11d27982
FIX: Move chat integration problem check message to correct locale key (#201)
As part of enhancing problem checks and admin notices, we standardized the location of the problem check messages' locale keys. However, we overlooked this one in the plugin, resulting in a missing translation on the dashboard.

This PR puts the locale key in the place expected by the admin notice system.
2024-06-11 17:42:45 +08:00
Loïc Guitaut a8363fb2fa
DEV: Update rubocop-discourse to version 3.8.0 (#198) 2024-05-28 11:16:00 +02:00
Ted Johansson f0275f1591
DEV: Promote channel error check to ProblemCheck (#190)
We're promoting problem checks to first class citizens in core. This migrates the problem check to the new API.

In the process of adding tests for this check, I discovered what seems like a mistake that likely means this check never worked until now. (See inline comment.)
2024-03-15 13:21:11 +08:00
Jarek Radosz bc81d30dc8
DEV: Update linting (#181) 2023-11-29 23:01:31 +01:00
Mark VanLandingham 9647c7afc0
FIX: stop 'tag_added' rules from firing for normal posts (#165) 2023-04-21 07:30:03 -05:00
Mark VanLandingham 9332d77483
FEATURE: Trigger follow rules when category changes (#164) 2023-04-18 13:27:17 -05:00
Mark VanLandingham a92108b69b
FEATURE: New rule filter to send message when topic tags change (#162) 2023-04-06 06:55:47 -05:00
David Taylor 49956bf829
DEV: Introduce syntax_tree for ruby formatting (#149) 2022-12-29 13:31:05 +01:00
David Taylor 157f3e910d
FIX: Respect core settings when rendering user names/usernames (#129)
This commit centralizes 'display name' generation into a helper, and updates it to respect core preferences for `enable_names` and `prioritize_username_in_ux`.
2022-05-30 17:13:55 +01:00
Mark VanLandingham a8b7e9631b
DEV: Move admin namespace (#87) 2021-08-26 08:52:53 -05:00
Mark VanLandingham a73f5da114
Rename DiscourseChat to DiscourseChatIntegration (#82) 2021-07-13 14:36:16 -05:00
Michael K Johnson da9106127a
FEATURE: Enable optional support for threading slack posts (#38)
When creating a new Discourse post from slack with the `post` feature, record the
slack `ts` thread ID for the resulting topic post using an HTML comment to pass
the `ts` through.

When notifying slack of new Discourse posts, record the slack `ts` thread ID in
the post's topic if it has not yet been recorded. (Normally, this will be done
for the topic post, except where notifications are being posted for old topics
before this feature was created.)

Add a new rule filter `thread` which posts threaded responses to slack if there
is a `ts` recorded for the post topic.

Modify the `trigger_notifications` interface to enable other integrations to
implement similar functionality.

Present the `thread` rule in the help text and admin UI only for the slack
providers.

https://meta.discourse.org/t/optionally-threading-posts-to-parent-topic-in-slack-integration/150759
2020-06-15 16:45:25 +01:00
Sam Saffron b4e6a15ccf DEV: lint file
Corrects rubocop which no longer allows explicit returns
2019-12-10 11:58:07 +11:00
Joffrey JAFFEUX 6540d8b957 DEV: uses Discourse.redis instead of $redis 2019-12-03 10:45:32 +01:00
Krzysztof Kotlarek 154361e22c FIX: Use top-level namespace for base classes (#33) 2019-09-16 13:38:30 -04:00
Krzysztof Kotlarek df44beb9a3 FIX: Save on chat_controller ready for Rails 6.0.0 (#31)
I think that passing attributes to save method is not necessary when the Object was initialized with them.

Problem is that with Rails 6.0.0 (https://github.com/discourse/discourse/pull/8083) this code is not working https://travis-ci.org/discourse/discourse/jobs/582556988
2019-09-10 10:02:24 +10:00
Guo Xiang Tan ac288b9300 Add frozen string literal comment to files. 2019-05-13 10:37:49 +08:00
David Taylor fc721a1768 FEATURE: Improve channel error visibility in the admin panel, stop adding chat integration errors to logs 2018-08-20 12:06:10 +01:00
Guo Xiang Tan c44ac56d32 Make rubocop happy. 2018-06-08 09:52:35 +08:00
Guo Xiang Tan 2c9cdb2ed3 Remove unnecessary logging. 2017-11-09 08:27:10 +08:00
Guo Xiang Tan 0cdb1d6538 FIX: Old channel may be invalid. 2017-10-20 20:21:02 +08:00
Guo Xiang Tan 0e52edd1fd FIX: Ensure that user exists before migrating. 2017-10-10 15:12:10 +08:00
Guo Xiang Tan 6bbac0a1e9 Maintain backwards compatibility with existing slash command. 2017-10-10 13:30:44 +08:00
Guo Xiang Tan 2e69d6a934 FIX: Properly migrate settings from `discourse-slack-official`. 2017-10-04 15:03:23 +08:00
Guo Xiang Tan f836047f90 REFACTOR: Clean up code in plugin. 2017-10-03 17:42:07 +08:00
Guo Xiang Tan 5cfa7f913d Don't migrate categories that do not exists anymore. 2017-10-03 16:33:07 +08:00
Guo Xiang Tan 1a3928b803 More improvements to migration script. 2017-10-03 15:41:27 +08:00
Guo Xiang Tan 2d6737ce5c REFACTOR: Remove hardcoded base `KEY_PREFIX`. 2017-10-03 15:35:44 +08:00
Guo Xiang Tan d77afa4c98 Remove self-explaintory comment. 2017-10-03 15:31:38 +08:00
Guo Xiang Tan 530e715588 STYLE: Shorten long lines. 2017-10-03 15:30:38 +08:00
Guo Xiang Tan f6e9fe9eb7 Remove dev dugging commands. 2017-10-03 15:16:09 +08:00
Guo Xiang Tan b33fb671f2 Filter out invalid tags when migrating. 2017-09-28 17:27:20 +08:00
Guo Xiang Tan 435b1cc9b5 Refactor plugin. 2017-09-28 16:32:38 +08:00
Guo Xiang Tan b0708c1aac Make sure we run the migrations in a transaction. 2017-09-28 16:19:12 +08:00
Guo Xiang Tan 49f58ec190 Fix tests to work with Rails 5.1. (#8) 2017-09-25 11:06:27 +08:00
David Taylor 92e22d65da Fix onceoff job to only run when slack is installed 2017-09-07 22:45:54 +01:00
David Taylor 1e52671c03 Add once-off job to migrate from discourse-slack-official 2017-09-04 13:58:09 +01:00
David Taylor 2251afbac0 Smart_create_rule should only use ‘normal’ rules 2017-09-04 13:14:15 +01:00
David Taylor 4703250c1f Only check channel uniqueness within the same provider 2017-08-23 16:31:47 +01:00
David Taylor c634b3ee65 Only check for mentions on standard posts (not PMs) 2017-08-01 22:15:27 +01:00
David Taylor 6af31bb244 Fix precedence for group-based rules 2017-08-01 21:09:01 +01:00
David Taylor 4f9ad4efef Correct rubocop offenses 2017-08-01 20:53:39 +01:00
David Taylor 01d7fb47ef Display group rules correctly in slash commands 2017-08-01 19:16:47 +01:00
David Taylor 6aa94fcb27 Add once off job to “migrate” the Rule model
We can’t use an actual activerecord migration because everything is JSON serialised :(
2017-08-01 17:12:21 +01:00
David Taylor f3347b0a92 Add support for group mentions 2017-08-01 17:11:34 +01:00
David Taylor 209daf7801 Add group messages support to admin UI, and add a ‘type’ field for further improvements 2017-08-01 15:20:00 +01:00
David Taylor d437634f61 Move rule editing into a modal dialog 2017-07-31 17:09:21 +01:00
David Taylor 4b2e8af711 Backend support for group pms 2017-07-31 14:51:03 +01:00