-
Notifications
You must be signed in to change notification settings - Fork 64
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
GH-88 Add settings command to toggle daily reminders #90
Conversation
Codecov Report
@@ Coverage Diff @@
## master #90 +/- ##
=========================================
+ Coverage 0.00% 3.81% +3.81%
=========================================
Files 8 8
Lines 861 918 +57
=========================================
+ Hits 0 35 +35
- Misses 861 883 +22
Continue to review full report at Codecov.
|
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.
Two small requests. The rest looks good. 👍
server/command.go
Outdated
if args[1] == "on" { | ||
err = p.saveReminderPreference(extra.UserId, true) | ||
} else if args[1] == "off" { | ||
err = p.saveReminderPreference(extra.UserId, false) | ||
} |
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.
Using a switch
here would make the code cleaner and would make it easy to add a default
path.
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.
Changed to switch model.
server/command.go
Outdated
@@ -276,6 +308,9 @@ func getAutocompleteData() *model.AutocompleteData { | |||
send.AddTextArgument("Todo message", "[message]", "") | |||
todo.AddCommand(send) | |||
|
|||
settings := model.NewAutocompleteData("settings", "summary [on] [off]", "Sets the user preference on daily reminder") |
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.
Maybe out of scope of the PR: It would be great if there are autocomplete options for on
and off
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.
Sure, I can cover in this PR.
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.
looks good in general, please add a test
|
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.
Awesome 👍
@hanzei or @aaronrothschild The 3.0 release is about ready now. I can test this today if you confirm we want it in the release. |
It would be quite awesome to get this into the release. |
@asaadmahmood @aaronrothschild What do you think about along the daily reminder show a message to tell how to stop the daily reminder? Something like: |
@larkox my personal opinion on this is that since the feature will be included in 3.0, the message should go along with. Regarding testing progress I'm starting now by figuring out how I can trigger the reminder on demand. But I don't see this addition as invalidating much testing so I am not opposed to including it now. |
Can you please see if you can repro and resolve this? |
@DHaussermann If I understand correctly the underlying logic, you should be able to trigger the daily summary by:
If you were not to refresh the page, you may have to wait for 1 hour before the daily reminder get's checked again. |
Thanks @larkox I will try this again shortly. After team discussion, this will be moved to next release so we can ship this now. Adjusting milestone. |
Sure I will check it out. |
/update-branch |
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.
Tested and passed
- When setting is True user continues to receive reminder DMs as ususal
- When False the reminder DMs are not received regardless of how long ago last reminder was sent
- Build issue mentioned above has been resolved
This is working as expected.
LGTM!
Huge thanks @openmohan for this enhancement! This makes for a very a very nice improvement.
Added release test to cover this feature.
Thanks @larkox for help with testing. (I think the vlue I was setting was just too large. 0 worked fine :) )
Summary
The TODO bot reminds the user with the list of issue daily if it is not empty. With this feature added the reminder preference can be set, so the user can turn
off
oron
the daily reminder functionality. By default, the value will be set as true.Ticket Link
https://github.com/openmohan/mattermost-plugin-todo/tree/GH-88
####Usage
/todo settings summary on
or/todo settings summary off