Commit Graph

15 Commits

Author SHA1 Message Date
RazeSoldier 91f285127e Use . operator instead of + operator
String concatenation should use . operator, not +, otherwise it will
report some Warning

Bug: T195645
Change-Id: Id27c981622e5ed87519324193abd2249aa1df7b6
2018-05-26 16:37:41 +08:00
Kunal Mehta 4da5567bd9 Simplify SkinUserPageHelper constructor
Instead of requiring a full IContextSource object and only using the
Title, only ask for the Title in the first place.

Change-Id: I33034193140ca53919f29f847a03caf26250ce54
2018-04-15 16:38:50 -07:00
Kunal Mehta 1b1c56c862 Fix some file names to match their class names
Change-Id: Ib1a12f8073a2d737c40c0b4d1dd64f9e55738019
2018-04-15 16:12:45 -07:00
libraryupgrader c4eb15654e build: Updating mediawiki/mediawiki-codesniffer to 16.0.0
Change-Id: Ibb3b0d2f4713609cd43d8c411561ab0bcdf941ce
2018-02-15 17:17:29 +00:00
Timo Tijhof d5145178b9 Hygiene: Replace QuickTemplate test subclass with mock
Change-Id: I32aa9d5103f4b6790a5118d5cad2cd91d3ddc459
2018-02-03 03:11:14 +00:00
petarpetkovic 413fcc12f6 Fix seen notifications appearing as unseen on mobile
Important note: Make sure to distinguish unseen from unread

One way to reproduce minerva and non-minerva notification inconsistencies:
- Have all your alerts and notices seen. This is displayed with grayed out
number on vector skin or no number at all, if you have (marked as) read.
- Generate new alert or notice (one is enough) in your preferred way.
- You can check minerva and non-minerva at this step. Both should be in sync.
But don't perform any additional action.
- Open the notification popup in some non-minerva skin (I have tried with
vector and monobook), marking it as seen.
- Check the notification icon in minerva. At this point, you should see
notification displayed as unseen.

The reason bug appeared in the first place is that alert/notice timestamps
were mixed up when seen time is obtained. We get seen time from
EchoSeenTime class, where we get smaller of the two timestamps,
using PHP method `min()`. See I27109ee6a248. Then, we get last unread
notification timestamp (which can be either alert or notice), and compare
that to seen time. That leads to the situation when you have only one of
alerts or notices with unread items, smaller timestamp is used for seen,
and most recent for unread, at which point we compare timestamps for
two separate things.

Previous behavior of getting seen timestamps (using max instead of min) would
probably solve the problem, but some other inconsistencies might arrise.
This should prevent any weird and unpredictable behavior to happen.

Bug: T183076
Change-Id: I20bbd6c590086b1c3eccf82983aad59eb3144a7a
2018-01-18 14:18:56 +01:00
Umherirrender bf974861a2 Fix spacing of @covers
Change-Id: I61d2cd2cb4523433bda37f349cf5327bfb4c1b66
2017-12-29 21:26:59 +01:00
jdlrobson d3318a9f85 Remove MobileFrontend's font changing code from Minerva
Fontchanger code now runs on all skins under the `mobile` target.
All the code will now live in MobileFrontend meaning developers
can operate inside one code base.

Depends-On: I857cfe2d9be9fe49c04c860bc234384c787239b2
Change-Id: I2759455cb6d7ddf13798e94452cb74baf502bafe
2017-10-30 19:11:16 +00:00
jdlrobson 12b49a70ad Notification icon should not show NaN for persian Wikipedia
Bug: T172755
Change-Id: I2884c8daed3fe0e0d05c746ec6319956b7426957
2017-10-26 20:27:12 +00:00
jdlrobson 0dd994edda Prepare to break the server side MobileFrontend dependency on Minerva
Changes:
* Minerva now maintains a MinervaUI - a simplified version of
MobileUI that provides iconClass and buttonClass helpers.
* Minerva now maintains its own ResourceLoaderParserMessageModule

Remaining issues:
* Main menu links to '#'
* Unknown dependency errors are thrown due to the missing
JS libraries e.g. mobile.watchstar
thus JS based UI components are unusable e.g. search autocomplete,
and edit button
* Language button navigates to a missing special page without
MobileFrontend (see T104660)

Bug: T169569
Change-Id: I89e2e15faabab73b0cba91afc2f2c5e785edef29
2017-09-27 21:21:59 +00:00
jdlrobson 47546207ad Hygiene: Remove and update references to MobileFrontend
Changes:
* Update docs
* Update browser test artifacts
* Update comments
* Update phpunit test groups
* Update phpunit test namespace
* Update `die` when MobileFrontend not installed
* Remove the migrate script which is no longer needed

Change-Id: I83432b3f7f0bcd07ed08259972b8ff89147104b6
2017-07-19 14:21:50 -07:00
Piotr Miazga 7536ca089a Enable PHPCS and lint checks via `composer test`
Sniffs that are currently failing are disabled in phpcs.xml.

Additional changes:
* Fix problem in test file

Change-Id: I53642e9d7bc1ef96e359cfe04a8f93dabbc977eb
2017-07-17 22:20:29 +00:00
Piotr Miazga d5461f55a1 Fix failing SkinMinerva unit test
Bug: T170624
Change-Id: I13fff8eba06abad43291e481f32d9eb30c0f031b
2017-07-17 23:39:53 +02:00
Piotr Miazga 9d90df7b0b SkinMinerva testGetContextSpecificModule test might use undefined title
Test scenario for getContextSpecificModules() mocks only Skin->getTitle()
behavior, but while executing isAllowedPageAction() Skin will create a
UserPageHelper with default RequestContext. As RequestContext is not mocked,
$context->getTitle() will return undefined what could lead to tests crash

Changes:
 - instead of mocking SkinMinerva::getTitle() pass test context with injected
title. Other tests will work properly as MediaWikiTestCase::tearDown() always
restes RequestContext to default

Bug: T170624
Change-Id: I872fddf8d9c52a6875bb6c69a12407a8125fba4c
2017-07-17 21:40:34 +02:00
jdlrobson 2cc9516cde Minerva is its own skin
This is programmatic output from python3 scripts/migrate.py

This will result in a Minerva skin dependent on MobileFrontend.

Post merge we will rename message keys to have minerva- prefix

Bug: T166748
Change-Id: Iff1f7e63e796cc5d4a6d2ab0370e0c33248d2fce
2017-07-12 08:12:40 -07:00