Commit Graph

54 Commits

Author SHA1 Message Date
David Taylor 2275b048f9 Destroy associated rules when a channel is destroyed 2017-07-18 16:42:05 +01:00
David Taylor bdb81191d7 New admin interface for improved channel definitions 2017-07-18 16:17:03 +01:00
David Taylor 1ef9073027 Make CHANNEL_PARAMETERS a list 2017-07-17 17:53:32 +01:00
David Taylor ebb6fa947d Update slack provider to deal with new channel structure 2017-07-13 23:21:15 +01:00
David Taylor ab2e4c2de8 Allow looking up channel by data attributes (nested json values) 2017-07-13 22:50:14 +01:00
David Taylor e850fb194b Update helper to deal with the new channel structure 2017-07-13 22:13:03 +01:00
David Taylor 246c81ce5c Update manager to deal with new channel structure 2017-07-13 21:47:15 +01:00
David Taylor 4b25dcec8f Allow providers to define a data schema for their channel parameters 2017-07-13 20:50:45 +01:00
David Taylor e07a4da460 Model changes 2017-07-13 16:09:34 +01:00
David Taylor b04b5c22dd Refactor specs to match new directory structure 2017-07-13 14:01:30 +01:00
David Taylor bfb499d4cf Refactor into /app directory, move everything out of plugin.rb 2017-07-13 13:32:11 +01:00
David Taylor 4207456716 Abstract away DiscourseChat::PluginModel to be used for other ActiveRecord models 2017-07-12 23:59:43 +01:00
David Taylor 56da3639ab Use real ActiveRecord for the “Rule” model by extending the PluginStoreRow class.
This gives us all the activerecord awesomeness for free, like validations, safe form params etc.
2017-07-12 18:28:45 +01:00
David Taylor a724463f7c Update docker_patched.rake 2017-07-12 12:27:07 +01:00
David Taylor 688f28262e Add travis badge to README 2017-07-12 12:23:33 +01:00
David Taylor 92dc7ba2b2 Add travis setup 2017-07-12 12:00:18 +01:00
David Taylor f2c5223bc6 Remove accidental dependency on discourse-slack-official 2017-07-12 11:58:19 +01:00
David Taylor e85657181c Add qunit acceptance tests for admin interface 2017-07-11 15:37:44 +01:00
David Taylor bc579fb6e1 Added rspec tests for admin controller 2017-07-10 21:04:37 +01:00
David Taylor ba484dc9a1 Move ‘dummy provider’ logic into a shared context, to allow for use by multiple specs 2017-07-10 18:19:59 +01:00
David Taylor 52b8e3f3a6 Remove unneeded comments 2017-07-07 11:51:19 +01:00
David Taylor 95dd6bc09c Add error handling to the slack API requests, and associated tests 2017-07-07 11:23:25 +01:00
David Taylor f001320574 Add integration tests for slack ‘slash commands’
Adapted from existing slack plugin
2017-07-06 23:30:27 +01:00
David Taylor 062aa8d875 Add create/delete rule functionality to the slack ‘slash commands’ 2017-07-06 21:42:37 +01:00
David Taylor 527063aed0 Add helper function for deleting rules 2017-07-06 21:36:50 +01:00
David Taylor aa6430e23e Add helper method to intelligently create new rules (avoiding duplicates) 2017-07-06 01:11:26 +01:00
David Taylor fd333d59b7 Add basic “slash command” functionality to the slack provider
Based on the existing slack plugin. Currently does not implement creating new rules or deleting rules.
2017-07-05 23:01:46 +01:00
David Taylor e4ff1997c8 Add a helper class for common provider functionality
Initially implemented a ‘status_for_channel’ function, based on the existing slack plugin
2017-07-05 23:00:58 +01:00
David Taylor 95344c348f Allow filtering of rules by channel 2017-07-05 22:38:53 +01:00
David Taylor 2f6d6f0d54 Automatically mount provider’s engines at /chat-integration/{provider_name}
Provider controllers are automatically disabled when the provider is disabled (works the same way as plugin controllers)
2017-07-05 15:03:02 +01:00
David Taylor aaaffdf371 Add ‘send test message’ functionality to the admin interface 2017-07-04 23:35:45 +01:00
David Taylor d97d35fd0d Handle errors on trigger_notification
Providers can define their own errors, and these are presented in the user interface. e.g. Slack can define an error that says “That channel doesn’t exist”.
Errors in the UI disappear once a message has been sent successfully, or the rule is edited.
2017-07-04 19:37:56 +01:00
David Taylor 4be010fd07 Allow providers to specify a regex that the channel identifier is checked against during validation 2017-07-04 00:14:01 +01:00
David Taylor 444e380ca1 Tidy up admin user interface 2017-07-03 22:11:17 +01:00
David Taylor 0547543a1d Add server-side validation to rules 2017-07-03 17:38:13 +01:00
David Taylor f40f602a4f Add validation to slack settings (adapted from old slack plugin) 2017-07-03 16:28:26 +01:00
David Taylor 1c416d5a81 Allow providers to be disabled, and tidy up translations 2017-07-03 15:53:26 +01:00
David Taylor 984211e9ce Fix javascript imports after plugin rename 2017-07-03 12:18:30 +01:00
David Taylor 4643ad255c Rename plugin to discourse-chat-integration 2017-07-03 11:08:14 +01:00
David Taylor b824773a8a Add tests for SlackProvider 2017-06-30 16:39:19 +01:00
David Taylor 0074f90f14 Allow sending by API instead of webhooks for slack 2017-06-30 15:28:44 +01:00
David Taylor 3f0462d40c Implement slack provider, based on existing plugin.
Currently only implements the “Webhook” method, not the “Web API” method
2017-06-30 13:09:36 +01:00
David Taylor 4ad9ad6a7a Move lib files inside a discourse_chat directory, and make the notifications run on a delay after post creation 2017-06-30 11:10:11 +01:00
David Taylor 8d70b4ad46 Allow add, edit & delete in the admin UI 2017-06-29 20:19:40 +01:00
David Taylor 61caca3c5b Use new DiscourseChat::Rule model throughout the backend code 2017-06-29 17:50:54 +01:00
David Taylor cd3bd8d807 Add a “Rule” class, borrowing and extending the ActiveRecord-like design from data-explorer plugin 2017-06-29 17:01:04 +01:00
David Taylor 8b1a065e3d Style categories in list to match rest of Discourse 2017-06-29 13:28:49 +01:00
David Taylor 304d8f962f Refresh the list of rules when the modal dialog closes 2017-06-29 12:56:48 +01:00
David Taylor 8e0bec6e6f Use RestModel and buildPluginAdapter to deal with communication of data models between client and server 2017-06-28 22:32:02 +01:00
David Taylor e067f8611d Add modal dialog for editing rules.
Currently non-functional, work in progress
2017-06-28 18:04:21 +01:00