jenkins-bot has submitted this change and it was merged.
Change subject: Moving mobile notifications overlay to stable
......................................................................
Moving mobile notifications overlay to stable
Also fixing styling of archive link so that it lines up with
notifications in the overlay.
Also fixing flash of archive link in the overlay.
Also hiding notifications icon on the notifications archive page.
Change id to class
Change-Id: I27ab0d8c2ea7423956fa9bf88b48a75ce03b2ea9
---
M includes/Resources.php
M includes/skins/SkinMinerva.php
M less/modules/NotificationsOverlay.less
M templates/modules/notifications/NotificationsOverlay.html
M tests/browser/features/support/pages/home_page.rb
5 files changed, 16 insertions(+), 11 deletions(-)
Approvals:
Jdlrobson: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/Resources.php b/includes/Resources.php
index d1ec534..ae2eaf1 100644
--- a/includes/Resources.php
+++ b/includes/Resources.php
@@ -330,7 +330,6 @@
'scripts' => array(
'javascripts/modules/mf-toggle-dynamic.js',
'javascripts/modules/talk/talk.js',
- 'javascripts/modules/notifications/notifications.js',
'javascripts/modules/search/pageImages.js',
'javascripts/modules/languages/preferred.js',
'javascripts/modules/lastEdited/lastEditedBeta.js',
@@ -346,10 +345,6 @@
// for talk.js
'mobile-frontend-talk-overlay-header',
-
- // notifications.js (defined in Echo)
- 'echo-none',
- 'notifications',
// newbieUploads.js
'mobile-frontend-lead-image-tutorial-summary',
@@ -567,6 +562,7 @@
'javascripts/common/ContentOverlay.js',
'javascripts/modules/tutorials/PageActionOverlay.js',
'javascripts/modules/tutorials/newbieEditor.js',
+ 'javascripts/modules/notifications/notifications.js',
),
'messages' => array(
// for mf-toggle.js
diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index e95b076..d456d82 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -35,14 +35,20 @@
*/
protected function prepareUserButton( BaseTemplate $tpl ) {
$user = $this->getUser();
- if ( class_exists( 'MWEchoNotifUser' ) && $user->isLoggedIn() )
{
+ $currentTitle = $this->getTitle();
+ $notificationsTitle = SpecialPage::getTitleFor( 'Notifications'
);
+ // If Echo is available, the user is logged in, and they are
not already on the
+ // notifications archive, show the notifications icon in the
header.
+ if ( class_exists( 'MWEchoNotifUser' ) && $user->isLoggedIn()
+ && $currentTitle->getPrefixedText() !==
$notificationsTitle->getPrefixedText()
+ ) {
// FIXME: cap higher counts
$count = MWEchoNotifUser::newFromUser( $user
)->getNotificationCount();
$tpl->set( 'secondaryButton',
Html::openElement( 'a', array(
'title' => wfMessage(
'mobile-frontend-user-button-tooltip' ),
- 'href' => SpecialPage::getTitleFor(
'Notifications' )->getLocalURL( array( 'returnto' =>
$this->getTitle()->getPrefixedText() ) ),
+ 'href' =>
$notificationsTitle->getLocalURL( array( 'returnto' =>
$currentTitle->getPrefixedText() ) ),
'class' => 'user-button',
'id'=> 'secondary-button',
) ) .
diff --git a/less/modules/NotificationsOverlay.less
b/less/modules/NotificationsOverlay.less
index 429c453..5034030 100644
--- a/less/modules/NotificationsOverlay.less
+++ b/less/modules/NotificationsOverlay.less
@@ -30,8 +30,11 @@
.mw-echo-linked-notification {
cursor: pointer;
}
- #notifications-archive-link {
+ .notifications-archive-link {
display: block;
- padding: 12px 0 20px 40px;
+ // The 1em bottom whitespace is applied as padding since Chrome
and Safari ignore
+ // it otherwise. The 10px padding corresponds with the icon
margin.
+ margin: 1em 1em 0 1em;
+ padding: 0 0 1em 10px;
}
}
diff --git a/templates/modules/notifications/NotificationsOverlay.html
b/templates/modules/notifications/NotificationsOverlay.html
index 9cc8cdb..6a5ae7f 100644
--- a/templates/modules/notifications/NotificationsOverlay.html
+++ b/templates/modules/notifications/NotificationsOverlay.html
@@ -7,4 +7,4 @@
</li>
{{/notifications}}
</ul>
-<a href="{{archiveLink}}"
id="notifications-archive-link">{{archiveLinkMsg}}</a>
+<a href="{{archiveLink}}"
class="notifications-archive-link">{{archiveLinkMsg}}</a>
diff --git a/tests/browser/features/support/pages/home_page.rb
b/tests/browser/features/support/pages/home_page.rb
index 8a37e9b..ebf921e 100644
--- a/tests/browser/features/support/pages/home_page.rb
+++ b/tests/browser/features/support/pages/home_page.rb
@@ -46,7 +46,7 @@
div(:rl_notification, id:'notifications')
a(:edit_history_link, id:'mw-mf-last-modified')
a(:notification_button, id:'secondary-button')
- a(:notifications_archive_link, id:'notifications-archive-link')
+ a(:notifications_archive_link, class:'notifications-archive-link')
a(:edit_icon_enabled, text:'Edit')
li(:mobile_view, id:'footer-places-mobileview')
end
--
To view, visit https://gerrit.wikimedia.org/r/92586
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I27ab0d8c2ea7423956fa9bf88b48a75ce03b2ea9
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Kaldari <[email protected]>
Gerrit-Reviewer: JGonera <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Kaldari <[email protected]>
Gerrit-Reviewer: MaxSem <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits