Page MenuHomePhabricator

In readonly mode edit icon should show as locked
Closed, ResolvedPublic2 Story Points

Description

A wiki can be made readonly like so:

$wgReadOnly = true;

When true the edit icon should appear as locked and when clicked should display the toast message "apierror-readonly": "The wiki is currently in read-only mode.",

Precursor

Make sure T197499 is also on the sprint board! You'll want to do that task in close proximity to this one.

acceptance criteria

  • Use same icon as the protected icon when wiki is in read only mode
  • Icon should be changed in JavaScript not PHP to ensure that HTML is not cached inside the locked state

qa steps

  • Make sure you are an anonymous user and on a page with an edit icon that is clickable.
  • Ask an engineer to set staging to read only mode
  • Verify that after doing so, the edit icon displays as locked, and that there are no edit icons in the section headings
  • Ask an engineer to set staging to write mode
  • Verify on same page the edit icon displays as unlocked

Details

Related Gerrit Patches:
mediawiki/skins/MinervaNeue : masterHide section edit icons when unable to edit
mediawiki/skins/MinervaNeue : masterDisable edit icon in read-only mode

Event Timeline

Jdlrobson removed Jdrewniak as the assignee of this task.Jun 15 2018, 10:06 PM
Jdlrobson triaged this task as Medium priority.
Jdlrobson created this task.
Jdlrobson moved this task from Incoming to Triaged but Future on the Readers-Web-Backlog board.
Jdlrobson updated the task description. (Show Details)Jun 15 2018, 10:21 PM
D3r1ck01 added a subscriber: D3r1ck01.
Vvjjkkii renamed this task from In readonly mode edit icon should show as locked to ataaaaaaaa.Jul 1 2018, 1:04 AM
Vvjjkkii raised the priority of this task from Medium to High.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
CommunityTechBot renamed this task from ataaaaaaaa to In readonly mode edit icon should show as locked.Jul 2 2018, 12:06 PM
CommunityTechBot lowered the priority of this task from High to Medium.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added a subscriber: Aklapper.

@alexhollender - is it okay to use the same icon here as in protected articles?

ovasileva set the point value for this task to 2.Jul 4 2018, 4:50 PM

I think so, assuming we consider read-only mode to be a measure of protection. I'm unfamiliar with the taxonomy here but let me know if there are any reasons why you think using the protected articles icon might be confusing.

Jdlrobson updated the task description. (Show Details)Jul 5 2018, 4:17 PM

Can you confirm me that there won't be cache problems ? As I know desktop site doesn't change the read page (link to edit page is still present), only blocks the edit form when the edit page is loaded.

Jdlrobson updated the task description. (Show Details)Jul 26 2018, 10:53 AM

@Framawiki have updated A/C to make sure.
@ovasileva I'm pushing this back to the backlog as I don't think it makes sense to do this without also doing T197499 around the same time. Both are extremely similar and there will be less context switching if we do them together. Let me know what you think.

Jdlrobson updated the task description. (Show Details)Jul 26 2018, 10:58 AM
Restricted Application added a project: Readers-Web-Backlog. · View Herald TranscriptAug 1 2018, 12:55 AM

Change 452380 had a related patch set uploaded (by Jdrewniak; owner: Jdrewniak):
[mediawiki/skins/MinervaNeue@master] Disable edit icon in read-only mode

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

Jdlrobson updated the task description. (Show Details)Aug 15 2018, 8:45 PM

Change 452380 merged by jenkins-bot:
[mediawiki/skins/MinervaNeue@master] Disable edit icon in read-only mode

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

Since some developer intervention is required to QA this, I went ahead and looked at the changes in browserstack since I had that site open anyway.

Tested on http://reading-web-staging.wmflabs.org/ in readonly mode.

The edit icon appeared as "locked" on the page. Clicking the edit icon revealed a toast with the notice "This wiki is currently in read-only mode".

When trying to visit the edit URL (url ending in "#/editor/0") directly in readonly mode, the editor does not appear (I think this is expected behaviour).

I did notice that while the page-edit icon appears as locked, the section-edit icons don't. However when clicking on them, the toast with the error message still appears. Not sure if this needs to be addressed @Jdlrobson, @ovasileva.

Jdrewniak removed Jdrewniak as the assignee of this task.Aug 23 2018, 11:56 AM

Edit section icons should not show if the wiki is in read only mode. Cc @alexhollender

Change 454908 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/skins/MinervaNeue@master] Hide section edit icons when unable to edit

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

Jdlrobson updated the task description. (Show Details)

Change 454908 merged by jenkins-bot:
[mediawiki/skins/MinervaNeue@master] Hide section edit icons when unable to edit

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

Verify section headings are hidden in read only mode.

Please specifically test section heading edit icon behaviour this time round. I've updated staging and enabled read only mode.

Verify section headings are hidden in read only mode.

Please specifically test section heading edit icon behaviour this time round. I've updated staging and enabled read only mode.

@Jdlrobson: I don't see the edit icon appearing as locked in staging, not even for section headings. Is it not set to read only anymore?

Checked that when the wiki is editable, the edit icon was clickable. And when its set to read mode the edit icon for the article is locked and there is no section heading edit icon appearing.

While testing I ran into a weird anomaly where part of the article shows up on the login overlay while switching back and forth between read only and editable mode . But it was intermittent and probably not relevant. Showed the issue to @Jdlrobson, maybe we can debug this later if it turns out to be happening more frequently.

Adding a screenshot of that issue:

Anyways, since the original issue seems to be working fine. It's verified from my side.

ovasileva closed this task as Resolved.Sep 5 2018, 2:07 PM

looks good, thanks @Ryasmeen