Matthias Mullie has submitted this change and it was merged.

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
* Hide content when AFTv5 isn't active on any namespace
* Offset 0 is also valid; only false should not set offset
* Improved display of "Hide my post"
* Fix typo "usepful"

Change-Id: I16491a1af5c460a72481d32cfc7fbd44ecb9d836
---
M ArticleFeedbackv5.activity.php
M ArticleFeedbackv5.i18n.php
M api/ApiAddFlagNoteArticleFeedbackv5.php
M data/DataModel.php
M modules/ext.articleFeedbackv5/ext.articleFeedbackv5.dashboard.js
M modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.css
M modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js
M modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.utils.js
8 files changed, 53 insertions(+), 34 deletions(-)

Approvals:
  Lwelling: Looks good to me, but someone else must approve
  Matthias Mullie: Verified; Looks good to me, approved
  jenkins-bot: Checked



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..3ce5745 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',
@@ -344,8 +345,8 @@
        'articlefeedbackv5-permalink-status-flag' => 
'{{GENDER:$1|<strong>Flagged</strong> by $1}} $2',
        'articlefeedbackv5-permalink-status-unflag' => 
'{{GENDER:$1|<strong>Unflagged</strong> by $1}} $2',
        'articlefeedbackv5-permalink-status-autoflag' => 
'{{GENDER:$1|<strong>Auto-flagged</strong> by $1}} $2',
-       'articlefeedbackv5-permalink-status-feature' => 
'{{GENDER:$1|<strong>Marked as usepful</strong> by $1}} $2',
-       'articlefeedbackv5-permalink-status-unfeature' => 
'{{GENDER:$1|<strong>Un-marked as usepful</strong> by $1}} $2',
+       'articlefeedbackv5-permalink-status-feature' => 
'{{GENDER:$1|<strong>Marked as useful</strong> by $1}} $2',
+       'articlefeedbackv5-permalink-status-unfeature' => 
'{{GENDER:$1|<strong>Un-marked as useful</strong> by $1}} $2',
        'articlefeedbackv5-permalink-status-resolve' => 
'{{GENDER:$1|<strong>Marked as resolved</strong> by $1}} $2',
        'articlefeedbackv5-permalink-status-unresolve' => 
'{{GENDER:$1|<strong>Un-marked as resolved</strong> by $1}} $2',
        'articlefeedbackv5-permalink-status-noaction' => 
'{{GENDER:$1|<strong>Marked as non-actionable</strong> by $1}} $2',
@@ -483,7 +484,7 @@
 * [//en.wikipedia.org/wiki/Wikipedia:Oversight#Policy other criteria for 
oversight]',
        'articlefeedbackv5-noteflyover-request-label' => 'Add a note to explain 
why you are requesting oversight',
        'articlefeedbackv5-noteflyover-request-placeholder' => 'Why did you 
request oversight?',
-       'articlefeedbackv5-noteflyover-request-submit' => 'Add note',
+       'articlefeedbackv5-noteflyover-request-submit' => 'Request oversight',
        'articlefeedbackv5-noteflyover-request-help' => 'Learn more',
        'articlefeedbackv5-noteflyover-request-help-link' => 
'#oversight-request',
 
@@ -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..cc9b12a 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 other than 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/data/DataModel.php b/data/DataModel.php
index 4ebb1e5..e76abbe 100644
--- a/data/DataModel.php
+++ b/data/DataModel.php
@@ -315,7 +315,7 @@
 
                                // build list object
                                $list = new DataModelList( $partial, 
get_called_class() );
-                               if ( $nextOffset ) {
+                               if ( $nextOffset !== false ) {
                                        $list->setNextOffset( $nextOffset );
                                }
 
diff --git a/modules/ext.articleFeedbackv5/ext.articleFeedbackv5.dashboard.js 
b/modules/ext.articleFeedbackv5/ext.articleFeedbackv5.dashboard.js
index efc41bf..c322b53 100644
--- a/modules/ext.articleFeedbackv5/ext.articleFeedbackv5.dashboard.js
+++ b/modules/ext.articleFeedbackv5/ext.articleFeedbackv5.dashboard.js
@@ -5,10 +5,11 @@
 
 /*** Main entry point ***/
 jQuery( function( $ ) {
-
        var showError = function( message ) {
                var warning = $( '#articlefeedbackv5-header-message' ).text( 
message );
-               $( '#articleFeedbackv5-special-wrap' ).empty().append( warning 
);
+               $( '#articleFeedbackv5-special-wrap' )
+                       .hide()
+                       .after( warning );
        };
 
        // AFT is enabled
@@ -26,5 +27,4 @@
                        showError( mw.msg( 'articlefeedbackv5-page-disabled' ) 
);
                }
        }
-
 } );
diff --git 
a/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.css 
b/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.css
index 97bfac8..169cb9d 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 {
@@ -349,22 +351,24 @@
 .articleFeedbackv5-feedback:hover .articleFeedbackv5-feedback-tools 
p.articleFeedbackv5-form-toolbox-label {
        display: block;
 }
-.articleFeedbackv5-comment-foot-hide,
+.articleFeedbackv5-comment-foot-hide a,
 .articleFeedbackv5-feedback-tools li a {
        display: inline-block;
-       margin-left: 35px;
+       position: relative;
+       padding-left: 35px;
        height: 25px;
        line-height: 25px;
 }
-.articleFeedbackv5-comment-foot-hide {
+.articleFeedbackv5-comment-foot-hide a {
        height: 20px;
+       padding-left: 25px;
 }
  .articleFeedbackv5-hide-own-link:before,
 .articleFeedbackv5-unhide-own-link:before,
 .articleFeedbackv5-feedback-tools li a:before {
        display: block;
        position: absolute;
-       left: 10px;
+       left: 0;
        width: 25px;
        height: 25px;
        margin: 0 5px;
@@ -736,8 +740,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 +756,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' ),
                                                '',
diff --git a/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.utils.js 
b/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.utils.js
index 65c9651..55b11c4 100644
--- a/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.utils.js
+++ b/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.utils.js
@@ -44,6 +44,9 @@
                // supported browser
                enable &= $.aftUtils.useragent();
 
+               // if AFTv5 is not enabled on any namespace, it does not make 
sense to display it at all
+               enable &= mw.config.get( 'wgArticleFeedbackv5Namespaces', [] 
).length > 0;
+
                if ( location != 'special' || article.id != 0 ) {
                        // only on pages in namespaces where it is enabled
                        enable &= $.inArray( article.namespace, mw.config.get( 
'wgArticleFeedbackv5Namespaces', [] ) ) > -1;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I16491a1af5c460a72481d32cfc7fbd44ecb9d836
Gerrit-PatchSet: 7
Gerrit-Project: mediawiki/extensions/ArticleFeedbackv5
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <mmul...@wikimedia.org>
Gerrit-Reviewer: Lwelling <lwell...@wikimedia.org>
Gerrit-Reviewer: Matthias Mullie <mmul...@wikimedia.org>
Gerrit-Reviewer: Siebrand <siebr...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to