Commit graph

20 commits

Author SHA1 Message Date
jenkins-bot b08643cbab Merge "Fix undefined NS issue with @coversDefaultClass" 2018-11-01 14:22:48 +00:00
Alangi Derick 679a45677e Explicitly use "MediaWiki\Minerva\SkinUserPageHelper;" on-top of file
To make things neat, use "MediaWiki\Minerva\SkinUserPageHelper;" at the top
of the file and then mock class directly (shorter and easily readable).

Change-Id: Ie2ee64e75c38fff77d41af20bdea01015ed39a87
2018-11-01 14:35:57 +01:00
Alangi Derick e2e5cbc3d7 Fix undefined NS issue with @coversDefaultClass
In skin MinervaNeue, correctly cover SkinUserPageHelper
namespace in SkilUserPageHelperTest.php

Change-Id: I8c8bd9986c2b3989f093bfb585d90647e8da60ef
2018-11-01 14:28:20 +01:00
Alangi Derick a2fd0b3c1f Add "Discussion" button to Main page on Mobile View
* Enable discussion button on main page in mobile view so users
  can view discussion topics related to the main page on mobile.
* Update test to make sure only 'talk' and 'switch-language' actions are
  enabled on the main page and 'edit' and 'watch' are disabled on the main
  page.
* Minor typo fix for doc type. Use "array" instead of "Array" and CSS
  alignment fix issue with Discussion button when displayed together with
  Language selector button.
* [Suggested by: @Jdlrobson] Use a generic "a" CSS selector to style the ".talk"
  and ".language-selector" classes on the main page. This also avoids fixing the
  CSS for future buttons if added (future proofing the code), so if any other
  button is added in the future, the same css rule will be applied to it at once.
  Very wise idea from @Jdlrobson, thanks!

Bug: T206406
Change-Id: Iedce84595adc357f3a707f8b94d23b2ffea3476c
2018-10-23 19:59:22 +01:00
jdlrobson cbad0bd363 Merge skin option modules into a single ResourceLoader module and move enabled logic to client
It's presumed that skin options will eventually become the default or be removed from the skin.
While they are not the default, it would be helpful to package them in one single module - as ResourceLoader
modules are costly bloating the dependency graph in the MediaWiki startup module.

In T167713 we talked about grouping our entry points by page rather than feature, which this seems consistent
with. A page with special options enabled is different from a page without.

Change-Id: Id948f913d4743532ba3442d2059a03c122419ff2
2018-10-12 10:18:21 -07:00
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