Page MenuHomePhabricator

Add date range options to ArticleInfo
Closed, ResolvedPublic

Description

The live ArticleInfo (aka "Page History") tool on Wikimedia Cloud Services is at https://xtools.wmflabs.org/articleinfo

Example result: https://xtools.wmflabs.org/articleinfo/en.wikipedia.org/Hanksy

The XTools code repository: https://github.com/x-tools/xtools

We would like to add date range filtering options to the ArticleInfo tool. Start and end dates are optional, and you should be able to use one and not the other, or both.

The API endpoint does not need to be updated.

The required code changes are somewhat similar to T172003 but considerably more busy work.

Files that need updating:

  • The ArticleInfo form (see AutoEdits form for example usage of start/end dates)
  • The resultAction of the ArticleInfoController. This includes:
  • The ArticleInfo model, which needs new class properties for start/end dates.
    • Here we also want to update the getPageviews to compute pageviews for the requested date range. This is called from the ArticleInfo result page, that part I don't think needs to be changed. Instead, in the model we'll check if either start or end dates are set on the instance, and if so use Page::getPageviews, otherwise do the same as we are now by calling getLastPageviews with the number passed in from the view.
  • The queries in the ArticleInfoRepository, and the getRevisions, getRevisionsStmt and getNumRevisions actions of PageRepository. Note start/end dates are optional, so if the parameters to these actions are blank or null they should not add any clauses to the underlying SQL query.
  • The ArticleInfo result page. Here if applicable, we can indicate the requested date range in the heading.
    • Certain things don't apply if the "end date" is not the current date. These would include the "Assessments" and "Bugs" sections.
    • Within the "General Statistics" section, we also want to hide the "Assessment" and "Bugs" fields, along with the "Edits in the past..." fields. I guess we should also hide "Average edits per month" and "per year", since they may not apply to smaller date ranges. The "per day" would always apply, however.
    • The "Pageviews (60 days)" should just say "Pageviews" if we're working with a date range.
  • The ArticleInfoTest and probably also the PageTest. I can help with these, if need be.

I'm probably forgetting other things... but we can figure it out as we go along.

Event Timeline

MusikAnimal moved this task from Backlog to Other on the XTools board.
MusikAnimal added a subscriber: MusikAnimal.

Not trivial work, but it's doable. Thanks for the fine suggestion!

It is used for listing all contributors to a WikiJournal article (e.g. Rotavirus journal article) using a hyperlinked "et al" in the author list.

MusikAnimal renamed this task from Date range request to Add date range options to ArticleInfo.Nov 30 2017, 5:13 AM

Although requested for distinctly self-serving reasons, I think date ranges will be generally useful in the same way that they are in the pageviews tool.

Albert221 moved this task from Complete to Working on the XTools board.