Page MenuHomePhabricator

Pagination for Event Registration List
Closed, ResolvedPublic2 Estimated Story Points

Description

In scope:

  • Making the "Your Events" table functional, as shown in wireframe
  • Sorting (noted that we should get this "for free" using standard pagination logic)

Screen Shot 2022-05-13 at 10.59.38 AM.png (1ร—2 px, 213 KB)

Out of scope (these are separate subtasks of T308279)

  • Styling
  • Filters
  • Actions for 3 dots (edit, view close, delete)

Event Timeline

ldelench_wmf set the point value for this task to 2.

@gonyeahialam Are the three dots an OOUI icon? I can't find it in the list.

@gonyeahialam Are the three dots an OOUI icon? I can't find it in the list.

I just noticed that. But it is in the Design system Icon library. Let me reach out to the team and get back to you. @Daimona

Change 776981 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/extensions/CampaignEvents@master] [WIP] Create the MyEvents special page

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

@gonyeahialam Are the three dots an OOUI icon? I can't find it in the list.

@Daimona It isn't in OOUI. This icon is currently used on mobile event pages but it turns out it is just the horizontal ellipsis rotated to an angle of 90.

Noting here that we decided to use the horizontal version, at least in the desktop version.

Change 776981 merged by jenkins-bot:

[mediawiki/extensions/CampaignEvents@master] Create the MyEvents special page

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

Additional testing notes
  • Make sure that sorting works for all column where it's enabled, in both directions
  • Ensure that it works with JS disabled
  • Ensure that the pagination stuff is working correctly (you can use a lower limit by manually changing the limit query param)
  • Ensure that pagination and sorting work well together

@Daimona

  1. When sorting by event name or date, it functions correctly, but when sorting by number of partipants, only the one page of results will display.
  2. When changing the filter, current sort is discarded and it defaults back to date.

This occurs with JS and also with JS disabled. see the video for both examples

Screen Recording 2022-07-01 at 2.49.07 PM.mov-C45FA51B-5AAE-4AFF-A0F0-107013F6EB93.gif (392ร—720 px, 2 MB)

Change 810416 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/extensions/CampaignEvents@master] Preserve sorting when filtering the list of events

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

@Daimona

  1. When sorting by event name or date, it functions correctly, but when sorting by number of partipants, only the one page of results will display.

I cannot reproduce this by following these steps:

  • Click "next page" until the last page
  • Sort by number of participants
  • Click "next page"

I'm still seeing all the results. I'm not sure what's going on, and I can't think of any schema modifications that could result in this bug. @cmelo Can you reproduce it on your local? Also, @vaughnwalters, can you reproduce it on patchdemo? I can't reproduce there as well. If not, you could try to enable the debug toolbar and see which queries are executed (search for "EventsPager"). That could give us some hints.

  1. When changing the filter, current sort is discarded and it defaults back to date.

Thanks, fixed.

Change 810416 merged by jenkins-bot:

[mediawiki/extensions/CampaignEvents@master] Preserve sorting when filtering the list of events

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

@Daimona

  1. When sorting by event name or date, it functions correctly, but when sorting by number of partipants, only the one page of results will display.

I cannot reproduce this by following these steps:

  • Click "next page" until the last page
  • Sort by number of participants
  • Click "next page"

I'm still seeing all the results. I'm not sure what's going on, and I can't think of any schema modifications that could result in this bug. @cmelo Can you reproduce it on your local? Also, @vaughnwalters, can you reproduce it on patchdemo? I can't reproduce there as well. If not, you could try to enable the debug toolbar and see which queries are executed (search for "EventsPager"). That could give us some hints.

@Daimona I am not able to reproduce it on patch demo either. I installed the debug toolbar on my local though and for the following call:
IndexPager::buildQueryInfo (MediaWiki\Extension\CampaignEvents\Pager\EventsPager):

it returned the query:

unknown: SELECT event_id,event_name,event_status,event_start,event_meeting_type,num_participants FROM (SELECT event_id,event_name,event_status,event_start,event_meeting_type,COUNT(cep_id) AS "num_participants" FROM campaign_events LEFT JOIN ce_participants ON ((event_id=cep_event_id)) LEFT JOIN ce_organizers ON ((event_id=ceo_event_id)) WHERE event_deleted_at IS NULL AND cep_unregistered_at IS NULL AND ceo_user_id = 3 GROUP BY cep_event_id,event_id,event_name,event_status,event_start,event_meeting_type ) "tmp" WHERE (((num_participants<='0')) OR ((num_participants='0') AND (event_start<='20220704154646')) OR ((num_participants='0') AND (event_start='20220704154646') AND (event_id<='50'))) ORDER BY num_participants DESC,event_start DESC,event_id DESC LIMIT 1

and here is a video from the exact event where I copied the above query:

EventsPager.mov-03BEA1A9-DAE0-4905-8E84-B542DF4D1BCC.gif (392ร—720 px, 2 MB)

unknown: SELECT event_id,event_name,event_status,event_start,event_meeting_type,num_participants FROM (SELECT event_id,event_name,event_status,event_start,event_meeting_type,COUNT(cep_id) AS "num_participants" FROM campaign_events LEFT JOIN ce_participants ON ((event_id=cep_event_id)) LEFT JOIN ce_organizers ON ((event_id=ceo_event_id)) WHERE event_deleted_at IS NULL AND cep_unregistered_at IS NULL AND ceo_user_id = 3 GROUP BY cep_event_id,event_id,event_name,event_status,event_start,event_meeting_type ) "tmp" WHERE (((num_participants<='0')) OR ((num_participants='0') AND (event_start<='20220704154646')) OR ((num_participants='0') AND (event_start='20220704154646') AND (event_id<='50'))) ORDER BY num_participants DESC,event_start DESC,event_id DESC LIMIT 1

What DBMS are you using? Is it SQLite? That could perhaps explain it, e.g. something like T253199.

unknown: SELECT event_id,event_name,event_status,event_start,event_meeting_type,num_participants FROM (SELECT event_id,event_name,event_status,event_start,event_meeting_type,COUNT(cep_id) AS "num_participants" FROM campaign_events LEFT JOIN ce_participants ON ((event_id=cep_event_id)) LEFT JOIN ce_organizers ON ((event_id=ceo_event_id)) WHERE event_deleted_at IS NULL AND cep_unregistered_at IS NULL AND ceo_user_id = 3 GROUP BY cep_event_id,event_id,event_name,event_status,event_start,event_meeting_type ) "tmp" WHERE (((num_participants<='0')) OR ((num_participants='0') AND (event_start<='20220704154646')) OR ((num_participants='0') AND (event_start='20220704154646') AND (event_id<='50'))) ORDER BY num_participants DESC,event_start DESC,event_id DESC LIMIT 1

What DBMS are you using? Is it SQLite? That could perhaps explain it, e.g. something like T253199.

Yes, it is SQLite. I am not sure how to proceed or if this is actually a bug then, or just an issue in local envs?

unknown: SELECT event_id,event_name,event_status,event_start,event_meeting_type,num_participants FROM (SELECT event_id,event_name,event_status,event_start,event_meeting_type,COUNT(cep_id) AS "num_participants" FROM campaign_events LEFT JOIN ce_participants ON ((event_id=cep_event_id)) LEFT JOIN ce_organizers ON ((event_id=ceo_event_id)) WHERE event_deleted_at IS NULL AND cep_unregistered_at IS NULL AND ceo_user_id = 3 GROUP BY cep_event_id,event_id,event_name,event_status,event_start,event_meeting_type ) "tmp" WHERE (((num_participants<='0')) OR ((num_participants='0') AND (event_start<='20220704154646')) OR ((num_participants='0') AND (event_start='20220704154646') AND (event_id<='50'))) ORDER BY num_participants DESC,event_start DESC,event_id DESC LIMIT 1

What DBMS are you using? Is it SQLite? That could perhaps explain it, e.g. something like T253199.

Yes, it is SQLite. I am not sure how to proceed or if this is actually a bug then, or just an issue in local envs?

It is most certainly an actual issue for wikis using SQLite. I'm not sure how to fix it though, especially because we're not writing the query directly. The problem seems to be that num_participants is a number (result of COUNT), but it's used as a string in the query (num_participant='0'). See fiddle which reproduces the issue. I've filed T312054 and will get back to it at some point.

unknown: SELECT event_id,event_name,event_status,event_start,event_meeting_type,num_participants FROM (SELECT event_id,event_name,event_status,event_start,event_meeting_type,COUNT(cep_id) AS "num_participants" FROM campaign_events LEFT JOIN ce_participants ON ((event_id=cep_event_id)) LEFT JOIN ce_organizers ON ((event_id=ceo_event_id)) WHERE event_deleted_at IS NULL AND cep_unregistered_at IS NULL AND ceo_user_id = 3 GROUP BY cep_event_id,event_id,event_name,event_status,event_start,event_meeting_type ) "tmp" WHERE (((num_participants<='0')) OR ((num_participants='0') AND (event_start<='20220704154646')) OR ((num_participants='0') AND (event_start='20220704154646') AND (event_id<='50'))) ORDER BY num_participants DESC,event_start DESC,event_id DESC LIMIT 1

What DBMS are you using? Is it SQLite? That could perhaps explain it, e.g. something like T253199.

Yes, it is SQLite. I am not sure how to proceed or if this is actually a bug then, or just an issue in local envs?

It is most certainly an actual issue for wikis using SQLite. I'm not sure how to fix it though, especially because we're not writing the query directly. The problem seems to be that num_participants is a number (result of COUNT), but it's used as a string in the query (num_participant='0'). See fiddle which reproduces the issue. I've filed T312054 and will get back to it at some point.

Ahhh yes okay I see what you mean in the fiddle. I'll move this to product sign off since you have the bug ticket filed for it. Everything else looks good.

@Daimona - How can I reach this page for testing within the UI/user flow? Right now, when I click 'Manage Event,' it brings me to the UI to edit the event, so I don't know how I would find the event registration list page.

@Daimona - How can I reach this page for testing within the UI/user flow? Right now, when I click 'Manage Event,' it brings me to the UI to edit the event, so I don't know how I would find the event registration list page.

I don't think there's any entry point in the UI at the moment. You'd have to browse to Special:MyEvents directly.

@Daimona - How can I reach this page for testing within the UI/user flow? Right now, when I click 'Manage Event,' it brings me to the UI to edit the event, so I don't know how I would find the event registration list page.

I don't think there's any entry point in the UI at the moment. You'd have to browse to Special:MyEvents directly.

You are supposed to access it through the Event center. And in the Edit event page, you can navigate to "my events" @gonyeahialam for confirmation,

โ€ข vyuen changed the task status from Open to In Progress.Aug 25 2022, 12:51 PM
  • Columns are sortable
  • Pagination exists for events table (see screenshot examples below)

I'm marking this ticket as Done.

Screen Shot 2022-08-30 at 12.25.40 PM.png (1ร—2 px, 205 KB)

Screen Shot 2022-08-30 at 12.25.49 PM.png (1ร—2 px, 179 KB)