An equivalent of user::isTemp() is needed is JS.
AC
- Create a function that checks if user is a temporary user
- Create tests for the created function
An equivalent of user::isTemp() is needed is JS.
AC
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
mediawiki.user: Add methods for isNamed and isTemp | mediawiki/core | master | +24 -0 |
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
In Progress | • Niharika | T324492 Temporary accounts - MVP | |||
Open | • Niharika | T340001 [Epic] Deployment plan | |||
Open | • Niharika | T348895 [Epic] Temporary accounts testwiki deployment | |||
Resolved | Goal | • Niharika | T300294 [Epic] Temporary account block workflow | ||
Resolved | • TThoabala | T324602 SpecialBlock: Once a temporary account is selected, below the username field display IP addresses associated with the account | |||
Resolved | kostajh | T327317 Create a function that checks if the global session user is a temporary user in JS |
@tstarling Are we correct that this hasn't been implemented yet? We haven't been able to find it.
@tstarling Are we correct that this hasn't been implemented yet? We haven't been able to find it.
Change 882593 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):
[mediawiki/core@master] mediawiki.user: Add methods for isNamed and isTemp
I did not see that either, so added the isTemp/isNamed methods to mediawiki.user in the above patch, as I think we'll be wanting those in GrowthExperiments.
Create tests for the created function
I didn't write any tests though, sorry!
Thank you @kostajh!
@TThoabala I think this task was originally meant for checking whether any user name found in the UI belongs to a named user or a temporary user. The patch does this for the global session user (the user accessing the webpage), and since the task description doesn't differentiate, I think we can just use this task for that instead - so I've updated the title. We do still need this for any user name though, e.g. for T324602: SpecialBlock: Once a temporary account is selected, below the username field display IP addresses associated with the account. Would you be happy to make a task for that?
Change 882593 merged by jenkins-bot:
[mediawiki/core@master] mediawiki.user: Add methods for isNamed and isTemp
I used the browser console to test the three functions on enwiki and dewiki beta:
mw.user.isNamed() mw.user.isTemp() mw.user.isAnon()
for an anonymous user, a temporary user and a logged in user. The functions returned the correct boolean value.
Test environments: