Page MenuHomePhabricator

Convert action=protect to OOUI (protect form is unusable on mobile)
Closed, ResolvedPublic

Description

Hi,
when I go to protect page on phone, there are missing boxes when administrator choose settings (like allow editing only for some users/like moving pages only for some users)…

See video: https://streamable.com/p7fiq

Too after protecting of page, administrator should get a pop-up about successful action.

enwiki example: https://en.wikipedia.org/wiki/Front_end?action=protect

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

@Zoranzoki21 could you specify what exactly is missing? Do you mean that some content is missing, or just a border around some controls.

image.png (804×750 px, 69 KB)

If I get it right, the only missing part is the border/box around "Edit", "Move" and "Pending Changes" controls, on mobile everything looks like one form that has no separation, just all controls one below another. Am I right?
(and the second missing part, the confirmation on successful action).

@Zoranzoki21 could you specify what exactly is missing? Do you mean that some content is missing, or just a border around some controls.

image.png (804×750 px, 69 KB)

If I get it right, the only missing part is the border/box around "Edit", "Move" and "Pending Changes" controls, on mobile everything looks like one form that has no separation, just all controls one below another. Am I right?
(and the second missing part, the confirmation on successful action).

I mean on border. Confirmation too, you are right.

/cc @alexhollender @ovasileva this is most probably something we can do under the AMC work, not sure if we have time for it.

@Volker_E looks like this needs OOUI... This page has a lot of problems. Page issues is also running on this page.

Screenshot 2019-10-15 at 9.07.16 AM.png (762×541 px, 104 KB)

Jdlrobson renamed this task from Missing boxes in action=protect on mobile to Convert action=protect to OOUI (protect form is unusable on mobile.Oct 15 2019, 7:06 PM
Jdlrobson added a project: OOUI.

Btw, why non-admins can access to action=protect? It should show just a warning. No and warning and options. Is it expected behaviour?

Screenshot_20191016-121757.jpg (1×720 px, 163 KB)

Masumrezarock100 renamed this task from Convert action=protect to OOUI (protect form is unusable on mobile to Convert action=protect to OOUI (protect form is unusable on mobile).Oct 22 2019, 10:39 PM
Masumrezarock100 subscribed.

Change 545417 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/core@master] WIP: Protection form built in OOUI

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

Jdlrobson added subscribers: Esanders, matmarex.

@Volker_E i've done most of the legwork here and have 3 open questions, that I'll need support from you and @matmarex (2 TODO notes on the patch around the PHP) and possible @Esanders (for help upgrading resources/src/mediawiki.legacy/protect.js).

TODO:

  • Need help with upgrading resources/src/mediawiki.legacy/protect.js
  • Is it possible to retain IDS?
  • Why are the fieldset labels not translating properly?

Also FYI we'll need to remove and add a hook to help with this migration. See: T236218

Feel free to amend this patch as necessary or provide guidance on how to fix the remaining issues as I'm stuck on this now!

Change 545417 abandoned by Jdlrobson:
WIP: Protection form built in OOUI

Reason:
Not working on this for now. Conversation will continue on phab ticket.

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

  • Why are the fieldset labels not translating properly?!

Because the messagePrefix is set to an empty string, but HTMLForm is still adding the dash (see T248063). The solution is to use restriction as the prefix (4th parameter of HTMLForm::factory) and to not add restriction- to $section.

Change 581878 had a related patch set uploaded (by BrandonXLF; owner: BrandonXLF):
[mediawiki/core@master] Use OOUI for protection form

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

I tested patch on my test wiki.

image.png (787×1 px, 46 KB)

Just to note, I changed zoom to be 90% so everything can fit in the screenshot.
Design looks good for me, but for "Other time" maybe we should make it like "Expiration" on Special:Block.

image.png (787×1 px, 54 KB)

Before:

Screen Shot 2020-07-07 at 3.10.15 PM.png (856×2 px, 111 KB)

After:

Screen Shot 2020-07-07 at 3.10.20 PM.png (1×2 px, 112 KB)

The create fieldset styling seems problematic to me. Should there be an indent or margin here or some kind of messaging under confirm protection @Volker_E ?

We could consider doing away with the extra indentation and all, but the bottom border for the fieldset > fieldset…?

Design looks good for me, but for "Other time" maybe we should make it like "Expiration" on Special:Block.

image.png (787×1 px, 54 KB)

Agreed - is this easy to re-use?

The issue is that when "infinite" is selected (or any of the options in the dropdown) the other textbox is hidden, making it harder to set a custom expiry and making it so the input is only half the width of the form.

The issue is that when "infinite" is selected (or any of the options in the dropdown) the other textbox is hidden, making it harder to set a custom expiry and making it so the input is only half the width of the form.

Are this issues specific to this use case, or general issues you have with the widget? Are custom expirations more likely on unprotect vs block?

Unlike the block form, the protect form has "infinite" selected by default whereas the block form has "other" selected, meaning the other textbox is immediately visible on the block form but it wouldn't be if the widget was used on the protect form.

Current look:

image.png (1×1 px, 226 KB)

I still think this:

Design looks good for me, but for "Other time" maybe we should make it like "Expiration" on Special:Block.

You can use https://srwiki-dev.wmcloud.org for testing if needed.

On my Honor 8A phone with Microsoft Edge 45.12.2.5137 looks good too.

Screenshot_20210202_153953_com.microsoft.emmx.jpg (3×720 px, 352 KB)

Change 581878 merged by jenkins-bot:
[mediawiki/core@master] Use OOUI for protection form

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

Not sure if it's related to ?action=protect or Pending changes, but the pending changes part of https://en.wikipedia.beta.wmflabs.org/wiki/Main_Page?action=protect isn't in OOUI.

Not sure if it's related to ?action=protect or Pending changes, but the pending changes part of https://en.wikipedia.beta.wmflabs.org/wiki/Main_Page?action=protect isn't in OOUI.

That is covered by the child task T236218.

Not sure if it's related to ?action=protect or Pending changes, but the pending changes part of https://en.wikipedia.beta.wmflabs.org/wiki/Main_Page?action=protect isn't in OOUI.

Ah, thanks.

Can no longer prefill the mwProtect-reason input field. Prefilling the mwProtect-edit-expires input field populates both the fields with the same value instead.

Also, prefilling mwProtect-level-move checks the mwProtect-cascade checkbox for some reason, while prefilling any value checks the mwProtectUnchained checkbox.

@Sakretsu: Hi, please file a separate follow-up task. Thanks a lot.

T274980: Protect Page form leaves the Watch page checkbox unfilled leading to unwatching the page on protect might also be a potential regression from this.

Jdlrobson closed this task as Resolved.EditedFeb 18 2021, 11:46 PM

The issue with prefilled content is tracked in T275018 and a patch is awaiting review. Page protection can now be used on mobile with this change 🎉.

Change 705130 had a related patch set uploaded (by DannyS712; author: DannyS712):

[mediawiki/core@master] Remove the `mediawiki.legacy.protect` ResourceLoader module

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

Change 705130 merged by jenkins-bot:

[mediawiki/core@master] Remove the 'mediawiki.legacy.protect' ResourceLoader module

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