Matthias Mullie has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/53738


Change subject: High priority fixes
......................................................................

High priority fixes

* Helpful/unhelpful did not work; JS error (var id was not set)
* Renamed "Hide" to "Hide this post"
* Autohide did not trigger mask and had some missing i18n
* Unrequest oversight should not trigger tipsy

Change-Id: I16491a1af5c460a72481d32cfc7fbd44ecb9d836
---
M ArticleFeedbackv5.activity.php
M ArticleFeedbackv5.i18n.php
M api/ApiAddFlagNoteArticleFeedbackv5.php
M modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.css
M modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js
5 files changed, 37 insertions(+), 23 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ArticleFeedbackv5 
refs/changes/38/53738/1

diff --git a/ArticleFeedbackv5.activity.php b/ArticleFeedbackv5.activity.php
index 728e50f..61d6fd1 100644
--- a/ArticleFeedbackv5.activity.php
+++ b/ArticleFeedbackv5.activity.php
@@ -389,29 +389,32 @@
                        if ( $cache !== false ) {
                                $activity[$feedback->aft_id] = $cache;
                        } else {
+                               $actions = array();
+
                                // we know exactly which status entry we want 
to fetch
                                if ( $feedback->isOversighted() ) {
-                                       $action = 'oversight';
+                                       $actions[] = 'oversight';
                                } elseif ( $feedback->isHidden() ) {
-                                       $action = 'hide';
+                                       $actions[] = 'hide';
+                                       $actions[] = 'autohide';
                                } elseif ( $feedback->isArchived() ) {
-                                       $action = 'archive';
+                                       $actions[] = 'archive';
                                } elseif ( $feedback->isResolved() ) {
-                                       $action = 'resolve';
+                                       $actions[] = 'resolve';
                                } elseif ( $feedback->isFeatured() ) {
-                                       $action = 'feature';
+                                       $actions[] = 'feature';
                                } elseif ( $feedback->isNonActionable() ) {
-                                       $action = 'noaction';
+                                       $actions[] = 'noaction';
                                } elseif ( $feedback->isInappropriate() ) {
-                                       $action = 'inappropriate';
+                                       $actions[] = 'inappropriate';
                                } else {
                                        continue;
                                }
 
-                               $action = self::buildWhereActions( array(), 
array( $action ) );
-                               if ( $action ) {
+                               $actions = self::buildWhereActions( array(), 
$actions );
+                               if ( $actions ) {
                                        $title = self::buildWhereFeedback( 
$feedback );
-                                       $where[] = 'log_title = 
'.$dbr->addQuotes( $title ).' AND '.$action;
+                                       $where[] = 'log_title = 
'.$dbr->addQuotes( $title ).' AND '.$actions;
                                }
                        }
                }
diff --git a/ArticleFeedbackv5.i18n.php b/ArticleFeedbackv5.i18n.php
index dec5063..0c8f894 100644
--- a/ArticleFeedbackv5.i18n.php
+++ b/ArticleFeedbackv5.i18n.php
@@ -175,7 +175,8 @@
        'articlefeedbackv5-status-unarchive' => 'This post was un-archived by 
$1 on $2 at $3',
        'articlefeedbackv5-new-marker' => 'New',
        'articlefeedbackv5-oversight-marker' => 'Oversighted',
-       'articlefeedbackv5-hide-marker' => 'Hide',
+       'articlefeedbackv5-autohide-marker' => 'Hidden',
+       'articlefeedbackv5-hide-marker' => 'Hidden',
        'articlefeedbackv5-feature-marker' => 'Useful',
        'articlefeedbackv5-resolve-marker' => 'Resolved',
        'articlefeedbackv5-noaction-marker' => 'No action needed',
@@ -191,7 +192,7 @@
        'articlefeedbackv5-form-unnoaction' => 'Undo',
        'articlefeedbackv5-form-inappropriate' => 'Inappropriate',
        'articlefeedbackv5-form-uninappropriate' => 'Undo',
-       'articlefeedbackv5-form-hide' => 'Hide',
+       'articlefeedbackv5-form-hide' => 'Hide this post',
        'articlefeedbackv5-form-unhide' => 'Undo',
        'articlefeedbackv5-form-hide-own' => 'Hide my post',
        'articlefeedbackv5-form-unhide-own' => 'Show my post',
@@ -981,6 +982,7 @@
        'articlefeedbackv5-new-marker' => 'The marker that appears on a comment 
is new and highlighted.
 {{Identical|New}}',
        'articlefeedbackv5-oversight-marker' => 'The marker that appears on a 
comment if it has been oversighted (deleted).',
+       'articlefeedbackv5-autohide-marker' => 'The marker that appears on a 
comment if it has been auto-hidden.',
        'articlefeedbackv5-hide-marker' => 'The marker that appears on a 
comment if it has been hidden.',
        'articlefeedbackv5-feature-marker' => 'The marker that appears on a 
comment if it has been marked as useful.
 {{Identical|Featured}}',
diff --git a/api/ApiAddFlagNoteArticleFeedbackv5.php 
b/api/ApiAddFlagNoteArticleFeedbackv5.php
index c6b45a7..52311d6 100644
--- a/api/ApiAddFlagNoteArticleFeedbackv5.php
+++ b/api/ApiAddFlagNoteArticleFeedbackv5.php
@@ -45,6 +45,8 @@
                                array( 'log_comment' => $notes ),
                                array(
                                        'log_id' => $logId,
+                                       // failsafe, making sure this can't be 
gamed to add comments to anything to AFTv5 entries
+                                       'log_type' => 
ArticleFeedbackv5Activity::$actions[$action]['log_type'],
                                        'log_action' => $action,
                                        // failsafe, making sure this can't be 
gamed to add comments to other users' feedback
                                        'log_user' => $wgUser->getId(),
diff --git 
a/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.css 
b/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.css
index 97bfac8..caa5697 100644
--- a/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.css
+++ b/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.css
@@ -271,6 +271,7 @@
        /* @embed */
        background-image: linear-gradient(transparent, transparent), 
url(images/toolbox_inappropriate.svg);
 }
+.articleFeedbackv5-feedback .articleFeedbackv5-autohide-marker,
 .articleFeedbackv5-feedback .articleFeedbackv5-hide-marker {
        /* @embed */
        background: url(images/toolbox_hide.png);
@@ -295,6 +296,7 @@
 .articleFeedbackv5-feedback .articleFeedbackv5-resolve-marker,
 .articleFeedbackv5-feedback .articleFeedbackv5-noaction-marker,
 .articleFeedbackv5-feedback .articleFeedbackv5-inappropriate-marker,
+.articleFeedbackv5-feedback .articleFeedbackv5-autohide-marker,
 .articleFeedbackv5-feedback .articleFeedbackv5-hide-marker,
 .articleFeedbackv5-feedback .articleFeedbackv5-archive-marker,
 .articleFeedbackv5-feedback .articleFeedbackv5-oversight-marker {
@@ -736,8 +738,14 @@
        color: red;
 }
 
-/** Screen for hidden/deleted **/
+/* Don't show mask by default */
 .articleFeedbackv5-post-screen {
+       display: none;
+}
+/* Only display the mask for posts marked as hidden/oversighted */
+.articleFeedbackv5-feedback-hide .articleFeedbackv5-post-screen,
+.articleFeedbackv5-feedback-oversight .articleFeedbackv5-post-screen {
+       display: block;
        z-index: 99;
        position: absolute;
        top: 0;
@@ -746,10 +754,6 @@
        right: 0;
        background-color: #dae2eb;
        padding: 10px 30px;
-}
-/* No mask should be displayed for posts marked as inappropriate (only for 
hide/oversight) */
-.articleFeedbackv5-feedback-inappropriate .articleFeedbackv5-post-screen {
-       display: none;
 }
 .articleFeedbackv5-post-screen .articleFeedbackv5-mask-text-wrapper {
        width: 100%;
diff --git 
a/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js 
b/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js
index d5e18a3..c412b05 100644
--- a/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js
+++ b/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js
@@ -1035,9 +1035,7 @@
                                .data( 'action', 'unflag' );
                }
 
-               /**
-                * If the user already requested oversight, change action to 
unoversight.
-                */
+               // if the user already requested oversight, change action to 
unrequest
                if ( $.articleFeedbackv5special.getActivityFlag( id, 'request' 
) ) {
                        var $link = $( '#articleFeedbackv5-request-link-' + id 
);
 
@@ -1047,7 +1045,8 @@
                                        .text( mw.msg( 
'articlefeedbackv5-form-unrequest' ) )
                                        .data( 'action', 'unrequest' )
                                        .removeClass( 
'articleFeedbackv5-request-link' )
-                                       .addClass( 
'articleFeedbackv5-unrequest-link' );
+                                       .addClass( 
'articleFeedbackv5-unrequest-link' )
+                                       .removeClass( 
'articleFeedbackv5-tipsy-link' );
                        } else {
                                // oversight request has been declined - mark 
as such
                                $link
@@ -1254,8 +1253,10 @@
 
                                var $container = $( e.target ).closest( 
'.articleFeedbackv5-feedback' );
                                if ( $.articleFeedbackv5special.canBeFlagged( 
$container ) ) {
+                                       var id = $container.data( 'id' );
+
                                        $.articleFeedbackv5special.flagFeedback(
-                                               $container.data( 'id' ),
+                                               id,
                                                $container.data( 'pageid' ),
                                                $( e.target ).data( 'action' ),
                                                '',
@@ -1304,8 +1305,10 @@
 
                                var $container = $( e.target ).closest( 
'.articleFeedbackv5-feedback' );
                                if ( $.articleFeedbackv5special.canBeFlagged( 
$container ) ) {
+                                       var id = $container.data( 'id' );
+
                                        $.articleFeedbackv5special.flagFeedback(
-                                               $container.data( 'id' ),
+                                               id,
                                                $container.data( 'pageid' ),
                                                $( e.target ).data( 'action' ),
                                                '',

-- 
To view, visit https://gerrit.wikimedia.org/r/53738
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I16491a1af5c460a72481d32cfc7fbd44ecb9d836
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ArticleFeedbackv5
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <mmul...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to