[go: nahoru, domu]

Page MenuHomePhabricator

Implement 'Create a newsletter' feature for Newsletter extension
Closed, ResolvedPublic

Description

( Pasting Quim's comment )

Workflow

  1. Publisher creates the main page of the newsletter as a plain wiki page somewhere (for the MVP just this, we might offer templates etc in the future).
  2. As logged in user, Publisher goes to Special:NewsletterCreate and sees a form to create a newsletter with these required fields:
    • Name of newsletter.
    • Short description.
    • Frequency (weekly, monthly, quarterly, other).
    • Page title of the newsletter main page.
  3. After clicking the "Create" button, the data gets added to the database, and the new newsletter is listed in the list of newsletters.

Related Patchset
https://gerrit.wikimedia.org/r/#/c/216546/

End result

To view the implementation, go here

Related Objects

Event Timeline

Tinaj1234 claimed this task.
Tinaj1234 raised the priority of this task from to Medium.
Tinaj1234 updated the task description. (Show Details)
Tinaj1234 added subscribers: 01tonythomas, Qgil, Quiddity, Legoktm.
Tinaj1234 set Security to None.
Tinaj1234 updated the task description. (Show Details)

From today morning meeting, I think the plan did change drastically, Beware!

Create a newsletter main/home page

Problem: We do not have a mechanism to catch in the page_id once the page is created using some form + wiki way, as of course - the page id exists only after the user clicks on 'Save Page' on the newly formed wiki page.
Solution: The random publisher creates in a new wiki page in some random namespace or whatever and saves it. The extension doesnt know about this one yet. The publisher wants this page to be a newsletter, and of course, go to the Special:Newsletter and happens to see an HTMLForm ( yeah you should be using HTMLForm according to @Bawolff and not Inputbox ). There he will be asked to provide trivial things like:

  1. Newsletter name
  2. Newsletter description
  3. Newsletter language
  4. Newsletter main page link ( where he should somehow point to the main page that he created earlier )

anything more can be trivial, and can be saved for further use.
The publisher creates the newsletter with a button, and - we save it in the Database.

A very good approach indeed. Adding a bit more ambition, how about we have the following in Special:Newsletter:

  1. Newsletter name
  2. Name of Homepage
  3. Contents of Homepage ( a text box at this point )
  4. Create page button ( this is for creating and checking if a page with same name already exists. If yes, a popup shows up suggesting a change of name)
  5. Create newsletter button.

Create page button should do all that is done when a wiki page is created like adding to 'page' table. If this can be done flawlessly, then adding entries to newsletter table should be easy with all necessary details in hand. But ofcourse, this approach can be dropped if it's too much ambition :)

To be clear, we are leaving the creation of the newslettter main page out of the scope of the Newsletter extension, at least for now. This is how we see it:

  1. Publisher creates the main page of the newsletter as a plain wiki page somewhere (for the MVP just this, we might offer templates etc in the future).
  2. As logged in user, Publisher goes to Special:NewsletterPublishers and sees a form to create a newsletter with these required fields:
    • Name of newsletter.
    • Short description.
    • Frequency (weekly, monthly, quarterly, other).
    • Page title of the newsletter main page.
    • Users allowed to publish new issues (the creator of the newsletter is assumed).
  3. After clicking the "Create" button, the data gets added to the database, and the new newsletter is listed in the list of newsletters.

Special:NewsletterPublishers is a page for creating new newsletters and announcing new issues of existing newsletters. This is how we think it should be organized:

Top: Announce new issue

This will be the more frequent action, so it will be at the top of the page. Users will have an option to announce new issues for the newsletters they have permissions to publish. If they are not publishers of any newsletter, they will not see anything here.

Next: Create newsletter

The form described in my comment above, visible to autoconfirmed users only (users that just created an account will not be able to create new newsletters, which is fair to prevent spam etc).

Tina asked about

Users allowed to publish new issues (the creator of the newsletter is assumed).

We discussed in Lyon. If we consider that only the author can publish new issues, that person might become a bottleneck or even block the newsletter if they don't show up. In order to avoid this, we need to allow the nomination of more users with permission to send notifications.

For the MVP we can keep it simple: only the wiki admins and the creator of a newsletter can grant the permissions to send notifications for new issues. Then we'll see.

Tinaj1234 raised the priority of this task from Medium to High.Jun 5 2015, 10:46 AM

@Tinaj1234 uploaded a patch at https://gerrit.wikimedia.org/r/216546 but for some reason the automatic notification didn't appear here.

@Tinaj1234 uploaded a patch at https://gerrit.wikimedia.org/r/216546 but for some reason the automatic notification didn't appear here.

Is that a draft? They're only visible to the reviewers of the change...

Yup ! Its a draft, and I've added @Legoktm as a reviewer!

In 'Announce Issue' section:
It would be great if you can implement a drop down list of available newsletters for that wiki in 'Announce Issue' section so that the publisher need not get tired entering the Newsletter name. Next to that, you can show which issue number you are creating as of now ( selectRowCount, +1 ) so that we can save that to the db too.

Tinaj1234 updated the task description. (Show Details)

Not anymore for the MVP as, according to https://gerrit.wikimedia.org/r/#/c/216546/, we have splitted the forms to two special Pages - which seems apt as the bug T102114 still exists and we might get stuck in between. Once the MVP is out, we can get it back to one page, if necessary.

Tinaj1234 lowered the priority of this task from High to Low.Jun 18 2015, 10:45 AM

Change 216546 merged by 01tonythomas:
Implement 'Create a newsletter' and 'Announce issue' feature for Newsletter extension

https://gerrit.wikimedia.org/r/216546

01tonythomas added a subscriber: siebrand.

I would mark this as resolved. Thanks @siebrand for the help. Great work people!

Is this the page to test this feature? http://newsletter-test.wmflabs.org/wiki/Special:NewsletterPublishers

Doesn't look resolved to me.

The description says Special:NewsletterCreate, but http://newsletter-test.wmflabs.org/wiki/Special:NewsletterCreate doesn't work.

Beign such a small project and team, I think it is better to mark tasks as resolved only when we give a chance to test them. Reopening for now.

Is this the page to test this feature? http://newsletter-test.wmflabs.org/wiki/Special:NewsletterPublishers

Doesn't look resolved to me.

The description says Special:NewsletterCreate, but http://newsletter-test.wmflabs.org/wiki/Special:NewsletterCreate doesn't work.

Beign such a small project and team, I think it is better to mark tasks as resolved only when we give a chance to test them. Reopening for now.

I couldn't deploy it yet as I couldn't ssh into newsletter-test . if someone can, a simple $git pull --rebase would do the trick.
The code is good and we'll in github repo

@01tonythomas, being a mentor you don't have to deploy it, this is still the student's work. Tina, this is nothing personal with you. :) Just reminding our roles. We mentors need to be proactive and help wherever we can, but the core tasks (like deploying a new version) need to be performed by the students.

Looks like the issue is elsewhere. She'd been complaining to me about not able to ssh to the labs machine for days. Just took it to Cloud-Services. Looks like something is broke inside

Like Tony said I had trouble logging into the vagrant and thus couldn't update it. 01tonythomas just informed that the labs are up again and I've git pulled all the latest updates. Both http://newsletter-test.wmflabs.org/wiki/Special:NewsletterCreate andhttp://newsletter-test.wmflabs.org/wiki/Special:NewsletterManage should work now.

Like Tony said I had trouble logging into the vagrant and thus couldn't update it. 01tonythomas just informed that the labs are up again and I've git pulled all the latest updates. Both http://newsletter-test.wmflabs.org/wiki/Special:NewsletterCreate andhttp://newsletter-test.wmflabs.org/wiki/Special:NewsletterManage should work now.

Yup. Looks good! Something NFS broke in labs before couple of days, it seems.

@Qgil, please close this once you feel we're done with this.

Frequency (weekly, monthly, quarterly, other).

"quarterly" is missing
"other" provides a blank field to define which periodicity (good!) but only 10 characters are allowed, which is very short. Can we add more? Say 50 characters.

After clicking "Create newsletter" the user ends up in an empty page, without any confirmation that the newsletter has been created, nor with a link to where the existing newsletters can be found. As a user (and as a tester) I have no idea that the newsletter has been created.

If I go back and submit exactly the same information, there is no message saying that such newsletter already exists.

For the MVP, the only required improvement would be the confirmation message that the newsletter has been created, with a link where such new newsletter can be seen. I can file bugs for the rest, to be solved after the MVP is complete.

Now I see that my newly created newsletter appears in the dropdown of http://newsletter-test.wmflabs.org/wiki/Special:NewsletterManage (so it has been created) and only one time (which at least shows that I didn't create a bunch newsletters by introducing the same info several times, although I still could not check whether the newsletter offered was the one I introduced or the last one).

Also, an important feature that I forgot to mention:

Users allowed to publish new issues (the creator of the newsletter is assumed).

This is missing.

Above said points noted and will fix these glitches in a while !

Good! Bringing back the conversation about the scope of patches, each of these bugfixes / features should be solved in its own patch, as opposed to i.e. trying to squeeze all these fixes in a single patch.

Change 219608 had a related patch set uploaded (by Tinaj1234):
Add confirmation message for creation of a newsletter

https://gerrit.wikimedia.org/r/219608

Change 219608 abandoned by Tinaj1234:
Add confirmation message for creation of a newsletter

Reason:
Unable to remove unwanted files from commit.

https://gerrit.wikimedia.org/r/219608

Change 219609 had a related patch set uploaded (by Tinaj1234):
Add confirmation message for creation of newsletters and announcing of issues

https://gerrit.wikimedia.org/r/219609

Change 219609 merged by jenkins-bot:
Add confirmation message for creation of newsletters and announcing of issues

https://gerrit.wikimedia.org/r/219609

Change 219611 had a related patch set uploaded (by Tinaj1234):
Add error message for duplicate newsletters

https://gerrit.wikimedia.org/r/219611

Change 219611 merged by jenkins-bot:
Add error message for duplicate newsletters

https://gerrit.wikimedia.org/r/219611

Users allowed to publish new issues (the creator of the newsletter is assumed).

This is missing.

I think we agreed in T99784#1348731 to leave this for Manage Newsletters, which was outside MVP.

Oops ! I had created T101832 few weeks back which explicitly says the same :D

Tinaj1234 updated the task description. (Show Details)

Great progress! Just checking, are these patches merged making it to the Labs instance as well, for testing? If so, I will test everything tonight.

Great progress! Just checking, are these patches merged making it to the Labs instance as well, for testing?

Yes! You can find the page here. I've also updated the tasks of all features that are merged with the link to corresponding pages on instance.

OK, good for a start!