Page MenuHomePhabricator

Encourage users to log in: wish form
Closed, ResolvedPublic

Description

User story
Given that I am on the wish submission form and am not logged in, I should see a message to log in to submit a wish.

Acceptance criteria

  • When the user is not logged in, on pageload, the user should see a message to log in.
  • The gadget itself should not load either.

Requirement

When a user is not logged in and visits the wish submission form, they should see a message prompting them to log in. The form should not load for logged-out users.

BDD

Given that I am on the wish submission form and am not logged in,
When the page loads,
Then I should see a message prompting me to log in,
And the form should not be displayed.

Test Steps

Test Case 1: Display log-in message for logged-out users

  1. Navigate to the wish submission form without being logged in.
  2. Observe the page content.
  3. AC1: Verify a message prompts the user to log in and does not load.

Test Case 2: Form availability for logged-in users

  1. Log in to the site.
  2. Navigate to the wish submission form.
  3. AC2: Verify the form loads correctly.

QA Results - Patchdemo

ACStatusDetails
1T363221#9907411

Details

TitleReferenceAuthorSource BranchDest Branch
Don't load gadget for logged-out users and show message to log inrepos/commtech/wishlist-intake!69musikanimallogged-out-msgmain
DeploymentCommand: add user-group-css task for user group CSSrepos/commtech/wishlist-intake!57musikanimalanon-textmain
Show codex dialog if user is not logged inrepos/commtech/wishlist-intake!56samtarT363221main
Customize query in GitLab

Event Timeline

JWheeler-WMF raised the priority of this task from Low to Medium.
JWheeler-WMF updated the task description. (Show Details)

I wonder if a dialog is the right approach here. For starters, Codex dialogs evidently are supposed to be dismissable. They also state dialogs should not be used when "the information can be displayed inline within the main interface", which is the case here:

For the gadget

  • We can rely on the fallback text that currently lives at [[Community Requests/Intake]]. Just add the text at the top with a link to login.
  • We can use user group CSS to show different messaging depending on if you're logged in.
    • Wrap text you want only shown to anonymous users with <div class="anonymous-show">
    • Wrap text to be shown only for logged-in users with <div class="user-show">.
  • Change the gadget definition to have rights=editmyusercss so that the gadget only loads for logged-in users. This is better for performance.
  • We can use the title denylist to entirely disable editing of subpages of [[Community Requests]] for anonymous users, and show custom messaging.

For the extension (later)

Even if we kept with the wikitext-based fallbacks (TBD), we should still have a safety net similar to what this task is asking for, but I don't think we should load the form at all for logged in users, if they aren't meant to be able to use it. Instead, we'd likely have wish editing on a Special page, so we just put the normal permission checks behind it with some custom messaging if we want, similar to i.e. https://ee.wikipedia.org/wiki/Special:Block (assuming no one reading this is an admin there).

@JWheeler-WMF any opposition to what I'm proposing at T363221#9849068? The short of is, instead of showing the form with a dialog (not recommended by Codex), we show the message before we even load the Vue application. In fact, the gadget should not run at all for logged out users, as it is only used for editing. This is also better for performance, since we don't want to load the giant JS payload for users who won't be able to make use of it.

So a logged out user would visit i.e. [[Community Requests/Intake]] and see a message like "Sorry, Community Requests requires you be logged in to submit ideas" (or whatever the language is following the naming decision), and a link to login.

That sound okay?

@MusikAnimal Login vs logged out is working as designed. I will move this to Done. Thanks for all your work!

Test Result - Patchdemo

Status: ✅ PASS
Environment: Patchdemo
OS: macOS Sonoma 14.5
Browser: Chrome 126
Device: MBA
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Display log-in message for logged-out users

  1. Navigate to the wish submission form without being logged in (https://patchdemo.wmflabs.org/wikis/780dec507c/wiki/Community_Requests/Intake)
  2. Observe the page content.

✅ AC1: Verify a message prompts the user to log in and does not load.

2024-06-19_08-28-30.png (556×2 px, 96 KB)

Test Case 2: Form availability for logged-in users

  1. Log in to the site (https://patchdemo.wmflabs.org/wikis/780dec507c/wiki/Community_Requests/Intake)
  2. Navigate to the wish submission form.

✅ AC2: Verify the form loads correctly.

2024-06-19_08-29-04.png (1×2 px, 233 KB)