-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable optional support for threading slack posts #38
Conversation
8ed672f
to
c6d8d33
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the design here - just added a few specific comments.
A few other general questions/concerns:
- How does this work for non-slack providers? I don't think we want them to have 'thread' rules, because it won't do anything. Maybe we need a boolean on each Provider implementation?
- I don't see any javascript changes here. How does this look in the admin UI?
If I instead implemented a whole new
No idea yet. Still draft PR because I haven't done anything more than get unit tests going; draft PR because I was looking for feedback before going further. I also haven't touched the help message that shows up from Thank you so much! |
6c2e86b
to
875637e
Compare
To implement I have tested this successfully on a live site in production use; screen shots on the meta thread. I doubt it's perfect but I think it is usable now. Thank you so much for the help! |
This is looking great!
Agreed, I like having Can we hide this filter from the UI for non-slack providers? |
This is where I admit openly to being a back end engineer. I'm sure all things are possible, but I might need a pointer for how to go about implementing this restriction. I intentionally didn't add it to the help messages for providers other than slack, and had honestly forgotten that there even was a UI in the admin console until you asked about it earlier. Is there an example in the plugin somewhere of restricting UI elements by provider type from which I can learn? |
I see that you added some available_filters: [
...
], we would have @computed('channel.provider')
available_filters(provider){
const available = [];
if(provider === 'slack'){
available.push({
id: "thread",
name: I18n.t("chat_integration.filter.thread"),
icon: "chevron-right"
});
}
available.push({
// Watch
},
{
// Follow
},
{
//Mute
});
return available;
} (not tested, there may be some syntax errors) Let me know if that approach doesn't work - I'm happy to take a look in more detail and get it sorted. |
313664f
to
b8ef729
Compare
|
b8ef729
to
8de75f5
Compare
Great! At a glance, the error is not directly related to your change. But now that we're depending on |
8c87993
to
dc9f58f
Compare
I looked (thank you
|
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
dc9f58f
to
9b2a490
Compare
Tests pass. I have re-deployed on my live site and confirm UI is still working. As far as I know, this is ready to merge. 🎉 |
@davidtaylorhq — github still shows "1 change requested" which seems to be from your overall comment in your initial review, and I can't find a way to mark it responded to, even though both of those points have definitely been addressed in following commits. I don't know whether you need to do something to clear that status. |
Yeah that is leftover from the previous review. This is all looking great - thanks for all your work. Will merge it in now 😁 |
In general, this is meant to implement the feature described at https://meta.discourse.org/t/optionally-threading-posts-to-parent-topic-in-slack-integration/150759 but also includes some cleanups. A few lines of unused or redundant code are cleaned up, and the slack API tests are cleaned up to more accurately reflect the slack API. Requesting a thread does not return arbitrary messages outside the thread; the tests have been modified to more accurately represent this.
ts
values are promised to be unique within a channel, so a repetition is changed to follow this contract.