Hello Bartosz Dziewoński, Catrope, jenkins-bot, I'd like you to do a code review. Please visit
https://gerrit.wikimedia.org/r/346334 to review the following change. Change subject: Revert "Do not use fancy styled badge on Modern and CologneBlue" ...................................................................... Revert "Do not use fancy styled badge on Modern and CologneBlue" This reverts commit 08d224e9555e70b101808ae4593447b9e6592657. Causes bugs in Vector when displaying the badges. Bug: T162173 Change-Id: I9e92c304b47ce9204d7a7d2fba67118e67b1bdc9 --- M extension.json D modules/nojs/mw.echo.alert.cologneblue.less M modules/nojs/mw.echo.alert.modern.less A modules/nojs/mw.echo.badge.modern.less M modules/styles/mw.echo.ui.NotificationBadgeWidget.modern.less M modules/ui/mw.echo.ui.NotificationBadgeWidget.js 6 files changed, 31 insertions(+), 42 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo refs/changes/34/346334/1 diff --git a/extension.json b/extension.json index 7e1bb16..2dec0f1 100644 --- a/extension.json +++ b/extension.json @@ -193,8 +193,6 @@ "mediawiki.api.options" ], "messages": [ - "echo-notification-notice", - "echo-notification-alert", "echo-popup-footer-special-page-invitation", "echo-popup-footer-special-page-invitation-link" ], @@ -407,20 +405,19 @@ }, "ext.echo.styles.badge": { "position": "top", + "styles": [ + "nojs/mw.echo.badge.less" + ], "skinStyles": { - "default": [ - "nojs/mw.echo.badge.less" - ], "monobook": [ - "nojs/mw.echo.badge.less", "nojs/mw.echo.badge.monobook.less" ], "vector": [ - "nojs/mw.echo.badge.less", "nojs/mw.echo.badge.vector.less" ], - "cologneblue": [], - "modern": [] + "modern": [ + "nojs/mw.echo.badge.modern.less" + ] }, "targets": [ "desktop", @@ -449,9 +446,6 @@ ], "modern": [ "nojs/mw.echo.alert.modern.less" - ], - "cologneblue": [ - "nojs/mw.echo.alert.cologneblue.less" ] }, "targets": [ diff --git a/modules/nojs/mw.echo.alert.cologneblue.less b/modules/nojs/mw.echo.alert.cologneblue.less deleted file mode 100644 index af97fb6..0000000 --- a/modules/nojs/mw.echo.alert.cologneblue.less +++ /dev/null @@ -1,3 +0,0 @@ -#pt-mytalk a.mw-echo-alert { - padding: 0; -} diff --git a/modules/nojs/mw.echo.alert.modern.less b/modules/nojs/mw.echo.alert.modern.less index 2800940..716369d 100644 --- a/modules/nojs/mw.echo.alert.modern.less +++ b/modules/nojs/mw.echo.alert.modern.less @@ -1,9 +1,3 @@ #pt-mytalk a.mw-echo-alert { border-radius: 0; - display: block; - height: 100%; -} - -#pt-mytalk a.mw-echo-alert:hover { - background-color: #fab951; } diff --git a/modules/nojs/mw.echo.badge.modern.less b/modules/nojs/mw.echo.badge.modern.less new file mode 100644 index 0000000..4848401 --- /dev/null +++ b/modules/nojs/mw.echo.badge.modern.less @@ -0,0 +1,8 @@ +.mw-echo-notifications-badge { + #pt-notifications-alert &, + #pt-notifications-notice & { + &:before { + z-index: 0; + } + } +} diff --git a/modules/styles/mw.echo.ui.NotificationBadgeWidget.modern.less b/modules/styles/mw.echo.ui.NotificationBadgeWidget.modern.less index 96c5a7d..6dc5914 100644 --- a/modules/styles/mw.echo.ui.NotificationBadgeWidget.modern.less +++ b/modules/styles/mw.echo.ui.NotificationBadgeWidget.modern.less @@ -3,15 +3,16 @@ } #p-personal li.mw-echo-ui-notificationBadgeButtonPopupWidget { - .mw-echo-ui-notificationBadgeButtonPopupWidget-popup { - font-variant: normal; - text-transform: none; - font-weight: normal; - - // Popup buttons - .oo-ui-buttonElement-button:hover { - // In modern, the hover color is white, which is unhelpful. - color: #666; - } + font-variant: normal; + text-transform: none; + font-weight: normal; + // Badge + > .oo-ui-buttonElement-button { + border-radius: 0; + } + // Popup buttons + .oo-ui-buttonElement-button:hover { + // In modern, the hover color is white, which is unhelpful. + color: #666; } } diff --git a/modules/ui/mw.echo.ui.NotificationBadgeWidget.js b/modules/ui/mw.echo.ui.NotificationBadgeWidget.js index 46bcbc9..25170f4 100644 --- a/modules/ui/mw.echo.ui.NotificationBadgeWidget.js +++ b/modules/ui/mw.echo.ui.NotificationBadgeWidget.js @@ -24,7 +24,7 @@ */ mw.echo.ui.NotificationBadgeWidget = function MwEchoUiNotificationBadgeButtonPopupWidget( controller, manager, config ) { var buttonFlags, allNotificationsButton, preferencesButton, footerButtonGroupWidget, $footer, - notice, adjustedTypeString, wrappedBadgeLabel; + notice, adjustedTypeString; config = config || {}; config.links = config.links || {}; @@ -45,6 +45,8 @@ this.controller = controller; this.manager = manager; + adjustedTypeString = this.controller.getTypeString() === 'message' ? 'notice' : this.controller.getTypeString(); + // Properties this.types = this.manager.getTypes(); @@ -56,12 +58,9 @@ if ( config.hasUnseen ) { buttonFlags.push( 'unseen' ); } - adjustedTypeString = this.controller.getTypeString() === 'message' ? 'notice' : this.controller.getTypeString(); - // Messages: echo-notification-notice, echo-notification-alert - wrappedBadgeLabel = mw.message( 'echo-notification-' + adjustedTypeString, this.badgeLabel ).text(); this.badgeButton = new mw.echo.ui.BadgeLinkWidget( { - label: wrappedBadgeLabel, + label: this.badgeLabel, type: this.manager.getTypeString(), numItems: this.numItems, flags: buttonFlags, @@ -266,18 +265,14 @@ * Update the badge state and label based on changes to the model */ mw.echo.ui.NotificationBadgeWidget.prototype.updateBadge = function () { - var unreadCount, cappedUnreadCount, badgeLabel, adjustedTypeString, wrappedBadgeLabel; + var unreadCount, cappedUnreadCount, badgeLabel; unreadCount = this.manager.getUnreadCounter().getCount(); cappedUnreadCount = this.manager.getUnreadCounter().getCappedNotificationCount( unreadCount ); cappedUnreadCount = mw.language.convertNumber( cappedUnreadCount ); badgeLabel = mw.message( 'echo-badge-count', mw.language.convertNumber( cappedUnreadCount ) ).text(); - adjustedTypeString = this.controller.getTypeString() === 'message' ? 'notice' : this.controller.getTypeString(); - // Messages: echo-notification-notice, echo-notification-alert - wrappedBadgeLabel = mw.message( 'echo-notification-' + adjustedTypeString, badgeLabel ).text(); - - this.badgeButton.setLabel( wrappedBadgeLabel ); + this.badgeButton.setLabel( badgeLabel ); this.badgeButton.setCount( unreadCount, badgeLabel ); // Update seen state only if the counter is 0 // so we don't run into inconsistencies and have an unseen state -- To view, visit https://gerrit.wikimedia.org/r/346334 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9e92c304b47ce9204d7a7d2fba67118e67b1bdc9 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Echo Gerrit-Branch: master Gerrit-Owner: Mooeypoo <mor...@gmail.com> Gerrit-Reviewer: Bartosz Dziewoński <matma....@gmail.com> Gerrit-Reviewer: Catrope <r...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits