Opened 15 years ago
Closed 15 years ago
#5572 closed enhancement (fixed)
Ability to specify defaults for Ticket Notifications options
Reported by: | Ryan J Ollos | Owned by: | Robert Corsaro |
---|---|---|---|
Priority: | normal | Component: | AnnouncerPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
Under my installation, the following options are always unselected as the default:
- Notify me of changes to tickets that belong to components that I own.
- Notify me of changes to tickets that I own.
- Notify me of changes to tickets that I reported.
- Never notify me of my own changes to tickets.
It would be nice to have the option to specify those options as selected (true) by default.
Attachments (2)
Change History (16)
Changed 15 years ago by
Attachment: | TicketNotifications.png added |
---|
comment:1 Changed 15 years ago by
comment:2 Changed 15 years ago by
Ideally reflect the current condition (i.e. defaults) when user hasn't saved preferences using the always_notify_* settings in the ini.
comment:3 Changed 15 years ago by
My thought was to have a number of default options in the announcer section:
[announcer] default_notify_changes_owner = {true/false} default_notify_changes_reporter = {true/false} default_notify_changes_component_owner = {true/false} default_notify_changes_self = {true/false}
For the screen capture I showed, assuming the selections reflect the defaults, I would have:
[announcer] default_notify_changes_owner = true default_notify_changes_reporter = true default_notify_changes_component_owner = true default_notify_changes_self = false
The defaults could used when the user has not specified otherwise in preferences.
See also #4781.
comment:4 follow-up: 5 Changed 15 years ago by
If I understand correctly, with the LegacyTicketSubscriber enabled, the always_notify_*
settings control behavior until a user makes his own choices. Makes sense to me to have the check boxes reflect those settings the first time the user displays them.
comment:5 Changed 15 years ago by
Replying to jevans:
If I understand correctly, with the LegacyTicketSubscriber enabled, the
always_notify_*
settings control behavior until a user makes his own choices. Makes sense to me to have the check boxes reflect those settings the first time the user displays them.
That would make sense based on some of the behavior I have seen. But yes, the check boxes are definitely 'out of sync', initially. So perhaps this is an easier fix than I had thought?
comment:6 Changed 15 years ago by
Status: | new → assigned |
---|
This used to work :( I wonder how I fudged it up. Looking into it.
comment:7 Changed 15 years ago by
Ok, after looking at the code I realize why this is difficult. There are actually three states (on off and default). So when a user saves their preferences, how do we know if they want to stick with the default, or explicitly set it the same as the default? But I agree that it should match the defaults on the first view.
comment:8 Changed 15 years ago by
You might take a look at how the code is implemented for the Pygments theme preference http://trac.edgewall.org/prefs/pygments in Trac. It seems to exhibit the ideal behavior with regard to handling a user preference and a default value for that preference.
For example, I recently changed the trac.ini parameter default_syntax_coloring
, which determines the default value for the Theme. What I found was that, for an account where I had previously accessed the Pygments theme preference and set a syntax coloring preference, this setting was preserved. However, for an account were I had not set this preference, the specified default value was set (it was set to Colorful, whereas when default_syntax_coloring
is unspecified, the default is Trac).
comment:9 Changed 15 years ago by
Bad link ... should have been http://trac.edgewall.org/prefs/pygments
comment:10 Changed 15 years ago by
The complication is that the entire announcer preferences panel is sent and we don't know which was the one the user actually choose. I still think the best we can do is as described above though.
comment:11 Changed 15 years ago by
Alright, I looked some more and this is how it works:
If the setting is set to false globally then the user can not set it to true for himself. The user can only opt-out of global settings. I think this doesn't make much sense. I don't see why the admin would want to disallow ppl from subscribing to events like component, author, owner etc.. Therefore I'm going to change the behavior in trunk.
The global settings in trac.ini will act as the default settings (as we expected it to work). Users will be able to override any of them with their won setting.
comment:12 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:13 Changed 15 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
r7141 is incorrect. You are checking announcer_legacy_notify_component_owner, announcer_legacy_notify_owner, announcer_legacy_notify_reporter, announcer_legacy_notify_updater for "True" value while they are set to "true"|"false" (note the register difference). Due to that they are always shown disabled in preferences. The patch fixing that is attached.
Changed 15 years ago by
Attachment: | LegacyTicketSubscriber.diff added |
---|
comment:14 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Here is an image of what I was referring to: