Page MenuHomePhabricator

Validation for errors in adding in worklists or event page name
Closed, ResolvedPublic3 Estimated Story Points

Description

As an event organizer, I want to be informed if I add in information incorrectly when attempting to generate an Invitation List on Special:GenerateInvitationList, so that I can proceed to generate an invitation list.

Acceptance Criteria

  • Given that an organizer has the Event Organizer right on the wiki,
    • And they are on Special:GenerateInvitationList
Invitation list field
  • And if they enter no text or only spaces in the Invitation list field,
    • They should see the following text:
      • Provide a name for the invitation list.
      • Note: the UI will automatically trim spaces, so you won't actually see this message, and instead you'll get the standard "this field is required" message.
Event page field
  • And if they enter an invalid name for their event page
    • They should see the following validation text:
      • Enter an event page that uses Event Registration.
  • And if they enter an event in which they are not an organizer,
    • They should see the following text:
      • Enter an event page that lists you as an organizer.
  • And if they enter an event that has ended,
    • They should see the following text:
      • This event has ended. Enter an active event.
Worklist field
  • And if they enter 0 articles in the Article list section,
    • They should see the following text:
      • Enter at least one article title.
  • And if they enter over 300 articles in the Article list section,
    • They should see the following text:
      • You have entered [number of articles they entered] articles. Please enter between 1 and 300 articles.
  • And if they enter articles that are not in the mainspace,
    • They should see the following text:
      • The following articles are not in the main namespace. Please enter articles in the main namespace only.
        • [Article 1]
        • [Article 2]
    • And if there's just one article, the text should be:
      • The following article is not in the main namespace. Please enter articles in the main namespace only.
  • And if they enter an invalid article title in the Article list section,
    • They should see the following validation text:
      • The following articles have invalid titles. Please correct the titles and try again.
        • [Article 1]
        • [Article 2]
    • And if there's just one article, the text should be:
      • The following article has an invalid title. Please correct it and try again.
  • And if they enter the name of a page that does not exist,
    • They should see the following validation text:
      • The following articles were not found. Please verify the titles and try again.
        • [Article 1]
        • [Article 2]
    • And if there's just one article, the text should be:
      • The following article was not found. Please verify the title and try again.

Out of scope:

  • Specific messages for different types of invalid titles
  • In the comments below, we discussed only displaying the event pages in which the user is an organizer when they are typing in the event page title and event pages come up as suggestions in the field. This is something we may work on later, but it is out of scope for the MVP.

Event Timeline

Hey @gonyeahialam! I am starting to think of validation text for Event Invitations, so I took a first stab in the acceptance criteria. I think it can be improved, so I am curious about any suggestions you have. Thank you!

Things we are currently checking:

  • article names must be valid (i.e., no special characters that are not allowed in page titles)
  • page must exist
  • page must be in the mainspace

Also, should there be an error if the worklist is empty? Note, this does not necessarily imply that the form field is empty. If you enter just a single page but it's not valid, the form field won't be empty, but still we wouldn't have any pages to check.

@ifried

Acceptance Criteria:

  • Given that an organizer has the Event Organizer right on the wiki,
    • And they are on Special:GenerateInvitationList
      • And if they enter an invalid link for their event page

I believe they aren't adding links but the Name of the event page

  • They should see the following validation text:
    • "Enter an event page that uses Event Registration."

With the component we are going to use for this, where they have to select form a dropdown that appears as they type, is it still possible to input the wrong event page? @Daimona

  • And if they enter an invalid article title for the article list,
    • They should see the following validation text:
      • "Enter articles on this wiki only, with each article on a new line."

The error should be as specific as possible in stating what they did wrong and how to fix it.
This means a different message depending on the error. For example:
Empty Input: Please enter at least one article title.
Exceeding Maximum Limit: You have exceeded the maximum number of articles. Please reduce the list to 300 or fewer articles.
Non-existing or invalid or typo articles: The following articles were not found. Please verify the titles and try again:

  • Article 1
  • Article 2

How are articles in the wrong format identified by the system e.g Articles are separated by commas instead of newlines? Are they seen as invalid articles?
If an organizer inputs urls instead of title, how is that identified? @cmelo @Daimona

With the component we are going to use for this, where they have to select form a dropdown that appears as they type, is it still possible to input the wrong event page? @Daimona

Yes, they could select an event page that does not use event registration. Which actually makes me think: we should probably also reject event pages that do use event registration, but where the user is not an organizer, right?

How are articles in the wrong format identified by the system e.g Articles are separated by commas instead of newlines? Are they seen as invalid articles?

No, because the comma is a valid title character. But there's a good chance that the resulting page (e.g., "Page 1, Page 2") will not exist.

If an organizer inputs urls instead of title, how is that identified? @cmelo @Daimona

It isn't. But once again, the page will most certainly not exist, and they'll see that.

@gonyeahialam & @Daimona: For the event page title, can we only display the event pages in which the user is an organizer (when the dropdown appears during the time that they are filling in the field)? This seems like a simpler and cleaner user experience. Either way, yes, we should reject page names in which they are not an organizer.

As for the other suggestions offered above, I think they make sense and I will update the AC to reflect them. Thanks!

@gonyeahialam & @Daimona: For the event page title, can we only display the event pages in which the user is an organizer (when the dropdown appears during the time that they are filling in the field)?

It might be doable with some DIY trickery, but it's not supported out of the box and I wouldn't recommend doing it for the MVP.

Okay, thank you, @Daimona! That was exactly what I needed to know. In that case, not required for MVP and we can consider it for later releases, depending on the feedback we receive. I'll make a note in the ticket about this.

ifried updated the task description. (Show Details)

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

[mediawiki/extensions/CampaignEvents@master] Introduce Worklist entity and parser

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

I just realized that this task is now in "Ready for development", but I think the AC are incomplete. Of the validations I listed in T365629#9889879, I only see a message for the "page must exist" one, but not for invalid titles, or for pages outside of the mainspace.

Of the validations I listed in T365629#9889879, I only see a message for the "page must exist" one, but not for invalid titles, or for pages outside of the mainspace.

Thanks for pointing out the missing namespace criteria, @Daimona! As for the invalid titles, I was thinking the final criteria on invalid article titles would suffice. But I suppose that is a bit different, since you are talking about an article having invalid characters rather than the title overall being invalid. Is that correct? If yes, I have updated the AC to explicitly include this behavior. Let me know what you think! also cc @gonyeahialam

I have reordered the AC so that it's easier to see which criteria refer to the event page, and which to the worklist.

A few questions/ideas:

You have exceeded the maximum number of articles. Please reduce the list to a maximum of 300 articles.

Should we include the number of articles currently in the worklist? I'm assuming it might help people know how many they need to remove.

Enter articles in the mainspace only.

I noticed that this message does not list the culprit articles, like the other two do. Should we change that?

The following articles had unsupported special characters. Please remove the special characters and try again.

There are more reasons why a title can be invalid. MW provides a set of error messages with more information about each case, see list. Could we just reuse this? Note, if doing so, we would have to display one error per page (instead of a single error with a list of affected pages). I think this might be fine though, given the average number of errors?

There are more reasons why a title can be invalid. MW provides a set of error messages with more information about each case, see list. Could we just reuse this? Note, if doing so, we would have to display one error per page (instead of a single error with a list of affected pages). I think this might be fine though, given the average number of errors?

One thing to point out: those messages do not include the page title itself, so we'd have to show it separately somehow. If this proves to be challenging from a design perspective, we could maybe go with a single standardized message for now, like in the AC. However, I'm not sure if we should be as explicit as the current proposal (because again, there's more to this than just unsupported characters).

There are more reasons why a title can be invalid. MW provides a set of error messages with more information about each case, see list. Could we just reuse this? Note, if doing so, we would have to display one error per page (instead of a single error with a list of affected pages). I think this might be fine though, given the average number of errors?

One thing to point out: those messages do not include the page title itself, so we'd have to show it separately somehow. If this proves to be challenging from a design perspective, we could maybe go with a single standardized message for now, like in the AC. However, I'm not sure if we should be as explicit as the current proposal (because again, there's more to this than just unsupported characters).

I think we should go with a single standardized message for now, just like the one in the AC.
What do you think @ifried

Hi @ifried, I have a couple of questions on the Event page field.

Are we allowing organizers to create invitation lists for ended events?
Are we allowing organizers to create invitation lists for closed events?

There are more reasons why a title can be invalid. MW provides a set of error messages with more information about each case, see list. Could we just reuse this? Note, if doing so, we would have to display one error per page (instead of a single error with a list of affected pages). I think this might be fine though, given the average number of errors?

One thing to point out: those messages do not include the page title itself, so we'd have to show it separately somehow. If this proves to be challenging from a design perspective, we could maybe go with a single standardized message for now, like in the AC. However, I'm not sure if we should be as explicit as the current proposal (because again, there's more to this than just unsupported characters).

If we don't show the affected page titles how would organizers know what to fix across the many articles they added.

ifried updated the task description. (Show Details)

Hello, @cmelo, @Daimona, and @gonyeahialam:

I have updated the AC to have just one error message for all types of invalid article titles, and we will include the list of articles below. This way, we have a more simplified implementation that does not require logic for specific types of title errors, while still giving the user helpful information on which articles have errors in the titles.

Meanwhile, regarding this question:

Are we allowing organizers to create invitation lists for ended events?

Good question! I don't know why someone would want to create an invitation list for an ended event. For the MVP, I don't think there is necessarily harm in allowing this behavior. I also do think it may be a bit odd to restrict users who have organized ended events that we can track (since they use event registration) from using the feature, but we would not enforce the same restriction on events that do not use event registration (since we have no way of knowing). On the other hand, I do think that a) it could be confusing if we do invitation lists for ended events, since it may give mixed or confusing messaging to users on how to use the tool, and b) this could be a problem post-MVP if we implement messaging support, since we would be creating a user flow that just doesn't make much sense.

For these reasons, I have updated the AC to have prevent this behavior and display an error message.

Are we allowing organizers to create invitation lists for closed events?

Yes, I think we should. For example, an organizer may choose to close registration during the planning phases and they may want some time to decide who to invite before opening registration. As long as the event is active and not ended, I think we should allow invitation lists to be generated.

Change #1047567 merged by jenkins-bot:

[mediawiki/extensions/CampaignEvents@master] Introduce Worklist entity and parser

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

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

[mediawiki/extensions/CampaignEvents@master] Introduce InvitationListGenerator

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

I have updated the AC to have just one error message for all types of invalid article titles, and we will include the list of articles below. This way, we have a more simplified implementation that does not require logic for specific types of title errors, while still giving the user helpful information on which articles have errors in the titles.

I see that the error message for non-existent pages was removed. Was that an intentional change made as part of the above? If so, I'd rather restore it, since we already have a copy, as well as code to detect that scenario. Non-existent pages are not necessarily invalid titles.

Also wondering about

The following articles had invalid titles.

  1. I'm curious about the past tense usage here, as opposed to the present tense used for the mainspace error. Should they be the same?
  2. What should this message become when there's just one invalid title? I'm assuming something along the lines of The following article has an invalid title.; or what else? Or should it remain unchanged? Same for the other messages, but those seem easier to adapt.

@Daimona:

  • Language corrected to present tense. Thanks for the catch!
  • Yes, it should be "article" if there is only article.

Question on invalid articles vs. non-existent articles: How would we know what is invalid vs. non-existent? Wouldn't an article that is invalid be treated the way as a non-existent article (i.e., not recognized)? To clarify, I am okay with keeping language for non-existent articles, but I am seeking some conceptual clarification in how we identify the difference.

  • Language corrected to present tense. Thanks for the catch!
  • Yes, it should be "article" if there is only article.

Thanks. Can you please check the following variants I wrote? I can add them to the AC if they're OK. I'm also making a mental note to identify this kind of things earlier in future tasks.

  • The following articles are not in the mainspace. Please enter articles in the mainspace only.
  • The following article is not in the mainspace. Please enter articles in the mainspace only.
  • The following articles have invalid titles. Please correct the titles and try again.
  • The following article has an invalid title. Please correct it and try again.
  • The following articles were not found. Please verify the titles and try again.
  • The following article was not found. Please verify the title and try again.

Question on invalid articles vs. non-existent articles: How would we know what is invalid vs. non-existent? Wouldn't an article that is invalid be treated the way as a non-existent article (i.e., not recognized)? To clarify, I am okay with keeping language for non-existent articles, but I am seeking some conceptual clarification in how we identify the difference.

Invalid means that the supplied string can never be a page title. For example, [|#|] is not a valid title string, and a page with that name can't ever exist (ex). The other scenario is for valid page titles that, however, correspond to a page that does not currently exist (but might exist in the future if someone creates it).

Ahhh, yes, that makes sense regarding how invalid vs. non-existent articles are checked. Thanks for clarifying, @Daimona!

And, yes, the text you wrote above looks good. Thank you!

@ifried One more question. I assume we want to also display an error if the invitation list name is empty, or it contains only spaces. I wrote the following message for this:

Provide a name for the invitation list.

WDYT?

ifried updated the task description. (Show Details)

Note that we discussed the fact that 'main namespace' is more commonly used than 'mainspace'

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

[mediawiki/extensions/CampaignEvents@master] Add i18n for validation errors in WorklistParser

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

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

[mediawiki/extensions/CampaignEvents@master] Add validation for all fields in SpecialGenerateInvitationList

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

Change #1049990 merged by jenkins-bot:

[mediawiki/extensions/CampaignEvents@master] Introduce InvitationListGenerator

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

Change #1050465 merged by jenkins-bot:

[mediawiki/extensions/CampaignEvents@master] Add i18n for validation errors in WorklistParser

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

Change #1050660 merged by jenkins-bot:

[mediawiki/extensions/CampaignEvents@master] Add validation for all fields in SpecialGenerateInvitationList

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

vaughnwalters subscribed.

Acceptance Criteria

  • Given that an organizer has the Event Organizer right on the wiki,
    • And they are on Special:GenerateInvitationList
Invitation list field
  • And if they enter no text or only spaces in the Invitation list field,
    • They should see the following text:
      • Provide a name for the invitation list.
      • Note: the UI will automatically trim spaces, so you won't actually see this message, and instead you'll get the standard "this field is required" message.
      • ✅ Currently getting the standard "This value is required."
        Screenshot 2024-07-10 at 3.33.29 PM.png (214×1 px, 27 KB)
Event page field
  • And if they enter an invalid name for their event page
    • They should see the following validation text:
      • ✅ Enter an event page that uses Event Registration.
      • Screenshot 2024-07-11 at 3.26.48 PM.png (224×1 px, 27 KB)
  • And if they enter an event in which they are not an organizer,
    • They should see the following text:
      • ✅ Enter an event page that lists you as an organizer.
      • Screenshot 2024-07-11 at 2.12.49 PM.png (212×1 px, 28 KB)
  • And if they enter an event that has ended,
    • They should see the following text:
      • ✅ This event has ended. Enter an active event.
      • Screenshot 2024-07-11 at 2.57.00 PM.png (238×1 px, 25 KB)
Worklist field
  • And if they enter 0 articles in the Article list section,
    • They should see the following text:
      • ✅ Enter at least one article title.
      • Screenshot 2024-07-10 at 4.38.19 PM.png (676×1 px, 51 KB)
  • And if they enter over 300 articles in the Article list section,
    • They should see the following text:
      • ✅ You have entered [number of articles they entered] articles. Please enter between 1 and 300 articles.
      • Screenshot 2024-07-09 at 5.17.47 PM.png (824×1 px, 92 KB)
  • And if they enter articles that are not in the mainspace,
    • They should see the following text:
      • ✅ The following articles are not in the main namespace. Please enter articles in the main namespace only.
        • [Article 1]
        • [Article 2]
        • Screenshot 2024-07-11 at 2.41.24 PM.png (738×1 px, 86 KB)
    • And if there's just one article, the text should be:
      • ✅ The following article is not in the main namespace. Please enter articles in the main namespace only.
      • Screenshot 2024-07-11 at 2.41.44 PM.png (722×1 px, 73 KB)
  • And if they enter an invalid article title in the Article list section,
    • They should see the following validation text:
      • ✅ The following articles have invalid titles. Please correct the titles and try again.
        • [Article 1]
        • [Article 2]
        • Screenshot 2024-07-11 at 3.30.06 PM.png (734×1 px, 81 KB)
    • And if there's just one article, the text should be:
      • ✅ The following article has an invalid title. Please correct it and try again.
      • Screenshot 2024-07-11 at 3.28.22 PM.png (818×1 px, 80 KB)
  • And if they enter the name of a page that does not exist,
    • They should see the following validation text:
      • ✅ The following articles were not found. Please verify the titles and try again.
        • [Article 1]
        • [Article 2]
        • Screenshot 2024-07-11 at 3.31.35 PM.png (852×1 px, 74 KB)
    • And if there's just one article, the text should be:
      • ✅ The following article was not found. Please verify the title and try again.
      • Screenshot 2024-07-11 at 3.32.04 PM.png (792×1 px, 70 KB)

All AC met.

❓ Noting that Events in the article list get the "The following articles are not in the main namespace." error while other pages that are not in the main namespace (such as Special:EditEventRegistration in this example) get a different error. I think this is probably fine since it does still display an error, but just calling it out here because it is inconsistent. Is this something we would want to fix? It not, we can move this to design sign off.

Screenshot 2024-07-11 at 3.37.02 PM.png (956×1 px, 113 KB)

❓ Noting that Events in the article list get the "The following articles are not in the main namespace." error while other pages that are not in the main namespace (such as Special:EditEventRegistration in this example) get a different error. I think this is probably fine since it does still display an error, but just calling it out here because it is inconsistent. Is this something we would want to fix? It not, we can move this to design sign off.

I think that's a consequence of special pages not being real pages. It'd probably be non-trivial to fix, so I'd vote for leaving it as-is if possible.

If the user enters a Wikidata item name or Category page name, what will be the error?

❓ Noting that Events in the article list get the "The following articles are not in the main namespace." error while other pages that are not in the main namespace (such as Special:EditEventRegistration in this example) get a different error. I think this is probably fine since it does still display an error, but just calling it out here because it is inconsistent. Is this something we would want to fix? It not, we can move this to design sign off.

I think that's a consequence of special pages not being real pages. It'd probably be non-trivial to fix, so I'd vote for leaving it as-is if possible.

If the user enters a Wikidata item name or Category page name, what will be the error?

Wikidata item names would be treated as normal page titles, so most likely you'd get the "page does not exist" error. For categories, you'd get "The following article is not in the main namespace".

❓ Noting that Events in the article list get the "The following articles are not in the main namespace." error while other pages that are not in the main namespace (such as Special:EditEventRegistration in this example) get a different error. I think this is probably fine since it does still display an error, but just calling it out here because it is inconsistent. Is this something we would want to fix? It not, we can move this to design sign off.

I think that's a consequence of special pages not being real pages. It'd probably be non-trivial to fix, so I'd vote for leaving it as-is if possible.

I wonder if users will often make the mistake of entering special pages, if they do then the invalid message will not help them identify and solve the problem.

❓ Noting that Events in the article list get the "The following articles are not in the main namespace." error while other pages that are not in the main namespace (such as Special:EditEventRegistration in this example) get a different error. I think this is probably fine since it does still display an error, but just calling it out here because it is inconsistent. Is this something we would want to fix? It not, we can move this to design sign off.

I think that's a consequence of special pages not being real pages. It'd probably be non-trivial to fix, so I'd vote for leaving it as-is if possible.

I wonder if users will often make the mistake of entering special pages, if they do then the invalid message will not help them identify and solve the problem.

TBH, I don't see why someone might do that. I might happen occasionally, but I don't see it being a common mistake.

This looks good; I'm marking this as Done.

On the topic of Wikidata items, we can see what feedback we get when we get users trying it out on real worklists.