Page MenuHomePhabricator

Improve showing of success message
Closed, ResolvedPublic2 Estimated Story Points

Description

Motivation
Currently, we provide a success page for the FileImporter. It has two purposes: Announcing that the move was successful, and asking the user to inform the source wiki about the move. Since we are automizing the information of the source wiki, the success page is not really necessary anymore.

Acceptance Criteria

  • Never show the success page anymore, but redirect users after a successful move directly to the target wiki file page.
  • If the source wiki was informed automatically, display the following success message: The file has been successfully imported to <target wiki name>.
  • If the source wiki was not informed automatically, show the success message: The import was successful. To declare that the file is now on <target wiki name>, please return to [[the original file]] and add this template: {{<template name>}}. [original file is link to source wiki]

Notes

  • For now we are ok with the success message disappearing rather quickly (if people switch tabs or close browsers)
  • For now we don't need a user setting that people can set their preferences

Event Timeline

Restricted Application added a subscriber: Liuxinyu970226. · View Herald Transcript
Lea_WMDE set the point value for this task to 8.

Breadcrumb to self: I'm trying to find some precedents for how this is done in MediaWiki. Keeping the default solution of an URL parameter and hook in mind, but I'm hoping there's something we can do with leaving notice HTML in the session.

Change 518011 had a related patch set uploaded (by Awight; owner: Awight):
[mediawiki/extensions/FileImporter@master] [WIP] Show success notice on target file page

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

@Lea_WMDE We're doing these tasks in a slightly different order than expected, so the success message has been embedded on the target file page but without including the changes from T225617 because that's not implemented yet. Shall we decouple these tasks or block this on editing the source wiki?

The way I've implemented this might end up being a little too sticky. The user is redirected to an URL like http://commons.wikimedia.org/w/index.php?title=File:%D4%B6%D5%A1%D5%A2%D5%A5%D5%AC.jpg&fileimporter_success=1 , and they will see the success message any time they have this fileimporter_success parameter during the next 24 hours. This includes browser navigation history, etc. After a day, that link will behave like the normal File link.

Change 518011 merged by jenkins-bot:
[mediawiki/extensions/FileImporter@master] Show success notice on target file page

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

Amazing testing prep, thanks! What is not working for me yet is:

  • The messaging is not what is described in the acceptance criteria
  • The font color is green, which is rather unexpected. or is this a mediawiki standard setting?

Bildschirmfoto 2019-06-25 um 14.24.02.png (236×2 px, 63 KB)

Once this works I'm ok with decoupling the two tasks.

  • The messaging is not what is described in the acceptance criteria

That's due to the reversed order I was mentioning in T226075#5271466, we cannot match the text in this acceptance criteria because the feature it depends on isn't implemented yet. Replacing the success text is defined in the other (source wiki edit) task.

The font color is green, which is rather unexpected. or is this a mediawiki standard setting?

+1 that's horrible and goes against accessibility guidelines, I'll fix it.

  • The messaging is not what is described in the acceptance criteria

That's due to the reversed order I was mentioning in T226075#5271466, we cannot match the text in this acceptance criteria because the feature it depends on isn't implemented yet. Replacing the success text is defined in the other (source wiki edit) task.

I'm wrong about that—we can match the text just fine, will do.

I realized, there's a third case not documented in the acceptance criteria: we do not know which template to add. Interpolating from the acceptance criteria and the existing message, maybe something like:

The import was successful. To declare that the file is now on {{SITENAME}}, please return to [$1 the original file] and add a template.

Change 519030 had a related patch set uploaded (by Awight; owner: Awight):
[mediawiki/core@master] Remove colored text from legacy styles

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

Change 519032 had a related patch set uploaded (by Awight; owner: Awight):
[mediawiki/extensions/FileImporter@master] Fix up success text

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

The fix for black text is pending T225571, so we might go ahead and hack some inline CSS, or wait a couple of weeks.

Updated patch overrides whatever is happening in mediawiki-core, so we can continue without blocking.

Change 519032 merged by jenkins-bot:
[mediawiki/extensions/FileImporter@master] Fix up success text

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

The font looks good now, but the messaging is a bit confusing, since it is both the variants we described, and not just the one where we know how the template is called:

Bildschirmfoto 2019-06-27 um 10.41.01.png (242×2 px, 62 KB)

Change 519362 had a related patch set uploaded (by Awight; owner: Awight):
[mediawiki/extensions/FileImporter@master] Removes an accidental, redundant message

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

The font looks good now, but the messaging is a bit confusing, since it is both the variants we described, and not just the one where we know how the template is called:

Thanks! A new patch is pushed which should take care of this.

Change 519362 merged by jenkins-bot:
[mediawiki/extensions/FileImporter@master] Removes an accidental, redundant message

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

WMDE-Fisch changed the point value for this task from 8 to 2.Jun 27 2019, 11:52 AM
WMDE-Fisch moved this task from Review to Demo on the WMDE-QWERTY-Sprint-2019-06-26 board.

Change 519030 abandoned by Awight:
Remove colored text from legacy styles

Reason:
I'd prefer the changes in Ifd01161f718f35fb3cce94efdad43a069ae8ae13

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

This looks great now! I just could not test yet, what text appears if the source wiki was automatically informed. So I'm keeping the ticket open as a reminder to check once we have that functionality.

thiemowmde updated the task description. (Show Details)

Change 604651 had a related patch set uploaded (by Thiemo Kreuz (WMDE); owner: Thiemo Kreuz (WMDE)):
[mediawiki/extensions/FileImporter@master] Use MessageLocalizer in ImportSuccessSnippet

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

Change 604651 merged by jenkins-bot:
[mediawiki/extensions/FileImporter@master] Use MessageLocalizer in ImportSuccessSnippet

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