!!THIS TICKET IN PROGRESS. DO NOT READ YET. !!
Where Grant Metrics provided only one downloadable report, users of Event Metrics will be able to download numerous reports in both Wikitext and csv format. To enable this, we will put a Download menu on two pages (see design below). There will also be some refinements to how the updating process works for various reports.
|**The Download menu**|
|{F27266932}|
Once the user selects the desired report, she will next be presented with a Popup Selector that invites her to select her preferred format, Wikitext or csv (see design below).
|**The Popup Selector menu**|
|{F27266910}|
- **[[ https://prtksxna.github.io/wmf-prototype-gm/event.html | Here is a prototype ]]** that shows these tools in action: to see the (correct) popup select __Pages Improved__
=Download menu labeling and behavior
- **Pages the menu is located on:** The Download menu will be available from the Event Summary and the Event Edit List pages.
- **Download button label** "Download reports" [with a downward-facing menu triangle]
- **Download Menu contents** The menu will eventually contain 6 or 7 reports.When users Update date or Download reports, To begin with it will contain three reports, as follows:an intricate dance takes place among various back-end processes and the interface elements defined in T213470 and in this ticket This ticket describes that dance and the parts all the elements play.
=Understanding the difference between 'Updating' and 'Fetching'
- Event summary [defined at T205561 and T206692]**'Updating' defined:** for our purposes, Updating is the process of finding new page IDs and calculating/looking up the top-line figures presented in the Event Summary report. Updating is triggered when the user clicks the Update button or requests a report (unless an update occurred during the caching period—see below). Updating causes the system to display a new timestamp.
- Pages created [defined at T205502 and T206058]
- Event edit list [this is the existing "all data" report]
- **Download Menu hover states** When the user hovers over menu items**'Fetching' defined:** Fetching is a more limited process. Because Updating, as above, they highlight with a darker shade of gray (use the available Bootstrap style).
=Popup Selector labeling and behavior
- **Title: **the popup has a title in the following format: 'Reportname' report (e.g.calculates only a small subset of all available metrics, many metrics are calculated or retrieved only when a relevant report is requested. This is Fetching. Crucially, 'Pages improved' report) [yes,Fetching does not gather new page IDs; please include the figures are Fetched usingle quotes] page IDs from the last Update.
- **Instruction text:** Instruction text in the middle area reads: Please select a format for the report
- **Button labels: **
- Get Wikitext
- Download CSV
- **Timestamp** in same format as on the page,**Triggering Update vs. Last updated //yyyy-mm-dd hh:mm//
- If the date is within the same calendar day as the downloadTriggering Fetch: ** Fetching and Updating often occur together, omit the date,but not always. as follows: Last updated //hh:mm//
- **Button hover:** Buttons turn a darker shade of grayThe exceptions are when 1) a report is requested during the Caching period, or 2)
=What does and doesn't initiate update (and refresh timestamp)**Fetching and timestamp: ** (see below). In such cases, Because the page IDs in a Fetch come from the last update, Fetching does not cause the timestamp to update; the timestamp remains that of the last Update. This causes the potential for the metrics to be out of synch with the timestamp: the Edit List, for example, would track only those pages that existed as of the timestamp, but it could show edits that occurred after the timestamp. To prevent this, Fetched reports will look up or present (whichever is easiest) figures only up until the timestamp, as described in !!ADD TICKET NUMBER HERE!!.
**Triggering an Update and the Caching Period: **As a general rule, Updates are triggered by 1) clicking the Update button or 2) Downloading a report. Not all download requests trigger an update, however. There is a Caching Period of approximately 10 minutes during which data is deemed to be still Fresh. During that period,
Going to the Edit Summary page does not cause an Update. The data and time stamp are stored and displayed as of the last update. The user initiates Update either by 1) pressing the update button or 2) initiating a report download.
- If the user requests download of a report during the approx 10-minute interval after a previous update, during which all data is deemed to be still "fresh," the system a) does not initiate update and b) does not change the dateline.
- If the user requests download of a report during the time when some data is deemed fresh but other data requires updating, then a) the system goes into the "Updating" state (see below) and b) the dateline is refreshed for all data.
- If the user __clicks the Update button__ during the approx 10-minute interval after a previous update, during which all data is deemed to be still "fresh," a) the system goes into the "Updating" state (see below) and b) the dateline is refreshed for all data.
====The Edit List is special case
- Every time you navigate to Edit List page—by using the breadcrumbs or the View Edit List button—the system must fetch edits to display (because these are not stored).
- BUT doing this does NOT constitute a page Update. The page IDs will not be queried, the timestamp will not change, and no other reports will update. The system will fetch the Edit List data based on the stored page IDs as of the last update (which corresponds with the current timestamp).
- Moreover, although new edits might be available since the last update and stored page IDs, we will NOT fetch (or display, whichever is easiest) any Edit List data that occurred subsequent to the update/timestamp. In this way, the timestamp and edit data will remain in synch.
- So, although the Edit List page is functionally distinct, from a UX perspective it the same as the Edit Summary page: if you want the updated version, you must either press Update or Download a report.
- Updating the Edit List data may take some time. When the user navigates to the Edit List page, the system will first loads the page, along with the summary data at the top of the page, then fetches and displays the edit list data. I.e., we will not wait for the fetch to complete to load the page (as I think happens now).
- Pagination: If a user on pg 1 of the Edit List navigates to pg 2, pg 3, etc, the system has to fetch the data each time, but, as above, a) it does not query or change the page IDs and b) it shows data for the new page only up until the timestamp. So the timestamp remains the same for all pages as the user navigates.
- If I’m on the Edit List page and I download the Edit list report, a full update of all reports and data will be triggered (unless I’m in the cache period) and the Edit List page will be refreshed -- as on the Summary page.
=The updating sequence
There are essentially two possible states for the Update button and download menu: "Available" and "Updating."
==='Available' state
In this state, Update and Download are available. This is the default state.
- **Update button ** is blue and turns a darker shade of blue on hover; clicking will initiate update.
- **On-page message:** "Last updated 2018-10-29 18:49 (Africa/Accra)" [The time and date of the last update. Note: this is the existing message]
- **Download menu:** is available.
- **View Edit List button** is its normal color and turns a darker shade of gray on hover. It is available for noavigation
==='Updating' state
When the user initiates update by clicking the button or downloading a report, the Update state commences.
- **The 'Working" indicator** shows, as specified in T207776
- **Update button: **the button is grayed out and unavailable
- **On-page message:** "Please wait, currently crunching the numbers...." [Note: this is the existing message]
- **Download button/menu:** is grayed out and unavailable
- **View Edit List button** is grayed out and unavailable
- **Leaving the page:** During Update the user can navigate to the Setup Page or to another Web site—or close the browser entirely. When he comes back to the Edit Summary page, the process will either still be running (and the appropriate messaging displayed) or Update will be complete and the new timestamp shown.
===When Update completes...
When the Update completes, the following things happen:
- **The "Working" indicator** (T207776) disappears
- **The page refreshes **and onscreen metrics update to show new values.
- **The on-page message** refreshes to display the timestamp as of update completion.
- **The Update button** returns to its available state.
- **Download button/menu** returns to its available state.
- **View Edit List button** returns to its available state.
=Getting the files
When the user makes her selection, behavior is the same as for the existing Grant Metrics reports. Which is to say
- **Get Wikitext:** pops open a new tab that presents the wikitext of the table--defined in T205502
- **Download CSV** commences download of the comma-delimited file, as defined in T205363 and T206058