Modify

Opened 15 years ago

Closed 14 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)

TicketNotifications.png (40.2 KB) - added by Ryan J Ollos 15 years ago.
LegacyTicketSubscriber.diff (1.2 KB) - added by dbely 14 years ago.

Download all attachments as: .zip

Change History (16)

Changed 15 years ago by Ryan J Ollos

Attachment: TicketNotifications.png added

comment:1 Changed 15 years ago by Ryan J Ollos

Here is an image of what I was referring to:

comment:2 Changed 15 years ago by J Evan S

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 Ryan J Ollos

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 Changed 15 years ago by J Evan S

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 in reply to:  4 Changed 15 years ago by Ryan J Ollos

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 14 years ago by Robert Corsaro

Status: newassigned

This used to work :( I wonder how I fudged it up. Looking into it.

comment:7 Changed 14 years ago by Robert Corsaro

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 14 years ago by Ryan J Ollos

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 14 years ago by Ryan J Ollos

Bad link ... should have been http://trac.edgewall.org/prefs/pygments

comment:10 Changed 14 years ago by Robert Corsaro

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 14 years ago by Robert Corsaro

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 14 years ago by Robert Corsaro

Resolution: fixed
Status: assignedclosed

(In [7147]) User ticket notification settings display defaults on first display fixes #5572

comment:13 Changed 14 years ago by dbely

Resolution: fixed
Status: closedreopened

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 14 years ago by dbely

Attachment: LegacyTicketSubscriber.diff added

comment:14 Changed 14 years ago by Robert Corsaro

Resolution: fixed
Status: reopenedclosed

(In [7575]) User ticket notification settings display defaults on first display

fixes #5572 merge -r7147

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Robert Corsaro.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.