Ticket #10675 (assigned defect)

Opened 6 months ago

Last modified 6 months ago

General Wiki Announcements box should not be shown when user has not set their email

Reported by: rjollos Assigned to: rjollos (accepted)
Priority: normal Component: AnnouncerPlugin
Severity: normal Keywords:
Cc: hasienda Trac Release:

Description

The General Wiki Announcements box should not be shown when the user has not set their email.

Screen capture of Announcer panel when email has not been set:

Screen capture of Announcer panel after email has been set:

Attachments

EmailNotSet.png (22.4 kB) - added by rjollos on 12/04/12 04:27:19.
EmailSet.png (36.1 kB) - added by rjollos on 12/04/12 04:27:58.
t10675-r12359-1.patch (0.5 kB) - added by rjollos on 12/04/12 04:43:59.
EmailNotSet-AfterPatch.png (19.6 kB) - added by rjollos on 12/04/12 04:44:58.
EmailNotSet-AfterPatch-2.png (23.2 kB) - added by rjollos on 12/04/12 05:44:27.
t10675-r12359-2.patch (0.7 kB) - added by rjollos on 12/04/12 05:45:57.
EmailNotSet-AfterPatch-3.png (23.8 kB) - added by rjollos on 12/04/12 06:00:15.
t10675-r12359-3.patch (4.9 kB) - added by rjollos on 12/05/12 03:26:11.

Change History

12/04/12 04:27:19 changed by rjollos

  • attachment EmailNotSet.png added.

12/04/12 04:27:58 changed by rjollos

  • attachment EmailSet.png added.

12/04/12 04:43:59 changed by rjollos

  • attachment t10675-r12359-1.patch added.

12/04/12 04:44:58 changed by rjollos

  • attachment EmailNotSet-AfterPatch.png added.

12/04/12 04:49:48 changed by rjollos

  • status changed from new to assigned.

The patch is simple. After the patch we see:

I can think of two options to improve on the behavior following the patch:

  • Hide the Announcer panel when there are no boxes present.
  • Show a message to indicate that the user needs to set an email to reveal preference boxes.

12/04/12 05:44:27 changed by rjollos

  • attachment EmailNotSet-AfterPatch-2.png added.

12/04/12 05:45:57 changed by rjollos

  • attachment t10675-r12359-2.patch added.

12/04/12 06:00:15 changed by rjollos

  • attachment EmailNotSet-AfterPatch-3.png added.

12/04/12 06:03:00 changed by rjollos

t10675-r12359-2.patch causes the following message to be displayed when there are no preference boxes to display (e.g. when the email address has not been set):

I prefer the way the patch is currently implemented, but a variation of the patch would show the following:

Some considerations:

  • Later on, when distributors other than email exist, we'll have to change the 'email' not in req.session logic to extend to other distributors. Since that will require major changes to the codebase, it doesn't seem like we need to address that at the moment.
  • It appears that it would make sense to also show a similar message when there are no subscribers listed under the Subscription panel, and that some of the existing notify rules should first be checking that the email has been set for user anonymous. That could also be addressed in a follow-on ticket.

12/05/12 03:26:11 changed by rjollos

  • attachment t10675-r12359-3.patch added.

12/05/12 03:28:46 changed by rjollos

t10675-r12359-3.patch implements a functional test harness, and adds functional tests for the two issues addressed in this ticket. I attempted to use as much of Trac's existing functional test infrastructure as possible, which leaves a TODO since I'm not sure yet how inject a derived instance of FunctionalTester into the FunctionalTestSuite class. I suspect we will need to move towards overriding the setUp and tearDown methods of FunctionalTestSuite (which is what the XmlRpcPlugin and AccountManagerPlugin have done - those are the only two plugins on trac-hacks that I can find which have implemented functional tests).

Since the implementation makes use of FunctionalTestEnvironment.post_create, the tests can only be run under Trac 0.11.5dev or later. There is a check in the code to disable the functional tests when the minimum version of Trac is not met. I don't think the version restriction will significantly hinder development, but let's discuss if you think this will be an issue.

12/05/12 03:30:48 changed by rjollos

All the work that I have planned for this ticket has been posted, so this ticket just needs review of the 3 patches.


Add/Change #10675 (General Wiki Announcements box should not be shown when user has not set their email)




Change Properties
Action