Show warnings in HTMLForm and warnings as warnings on Login/Signup form
authorFlorian <florian.schmidt.stargatewissen@gmail.com>
Fri, 1 Jul 2016 16:26:20 +0000 (18:26 +0200)
committerBartosz Dziewoński <matma.rex@gmail.com>
Sat, 17 Sep 2016 14:33:39 +0000 (16:33 +0200)
commit3706dcb5c712bfe7d93d7aa472be1139a2a5022a
tree49a7fbba9887dc4da01c638d2675e33f8260f624
parent544561106282ea6cfcd472d460c879fe92f40007
Show warnings in HTMLForm and warnings as warnings on Login/Signup form

This commit changes the way how HTMLForm handles a Status object
when executed from a request. It now handles, beside the errors,
also the warnings of a Status object and prints them out, wrapped
in a warning box.

The LoginSignupPage uses this feature to show informative warnings
actually as warnings and not as more disturbing error messages.
Error messages should be reserved for errors and only for erros. An
AuthenticationProvider, which returns an UI AuthenticationResponse
can choose, if the given message is an error or a warning message.

This commit also addds a new function to Status, which allows a
developer to split the object into two new Status objects, where one only
contains the errors and the other only the warnings of the origin
Status object (splitByErrorType). StatusValue also has a new function,
splitByErrorType(), to support this.

Bug: T139179
Change-Id: I9a27911613e62b5c4cb86bea40696cb37c4f49c2
12 files changed:
includes/Status.php
includes/auth/AuthenticationResponse.php
includes/auth/ConfirmLinkSecondaryAuthenticationProvider.php
includes/auth/ResetPasswordSecondaryAuthenticationProvider.php
includes/htmlform/HTMLForm.php
includes/htmlform/OOUIHTMLForm.php
includes/libs/StatusValue.php
includes/specialpage/LoginSignupSpecialPage.php
resources/src/mediawiki.less/mediawiki.ui/variables.less
resources/src/mediawiki.ui/components/forms.less
tests/phpunit/includes/StatusTest.php
tests/phpunit/includes/auth/AuthenticationResponseTest.php