Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/343452 )

Change subject: RCFilters UI: Followup Ic97c7c6aae7: Only add state message if 
item is selected
......................................................................

RCFilters UI: Followup Ic97c7c6aae7: Only add state message if item is selected

Unselected items are highlighted, and hence are not in actual conflict
or coverage or inclusion states.

Bug: T156427
Change-Id: Ie8b6020e6dc93b46e94d2bc2bebb71b56f1e3645
---
M resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterItem.js
1 file changed, 30 insertions(+), 28 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/52/343452/1

diff --git a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterItem.js 
b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterItem.js
index 5f406bd..a066d9e 100644
--- a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterItem.js
+++ b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterItem.js
@@ -161,35 +161,37 @@
                var messageKey, details, superset,
                        affectingItems = [];
 
-               if ( this.isConflicted() ) {
-                       // First look in filter's own conflicts
-                       details = this.getConflictDetails( 
this.getOwnConflicts() );
-                       if ( !details.message ) {
-                               // Fall back onto conflicts in the group
-                               details = this.getConflictDetails( 
this.getGroupModel().getConflicts() );
+               if ( this.isSelected() ) {
+                       if ( this.isConflicted() ) {
+                               // First look in filter's own conflicts
+                               details = this.getConflictDetails( 
this.getOwnConflicts() );
+                               if ( !details.message ) {
+                                       // Fall back onto conflicts in the group
+                                       details = this.getConflictDetails( 
this.getGroupModel().getConflicts() );
+                               }
+
+                               messageKey = details.message;
+                               affectingItems = details.names;
+                       } else if ( this.isIncluded() ) {
+                               superset = this.getSuperset();
+                               // For this message we need to collect the 
affecting superset
+                               affectingItems = 
this.getGroupModel().getSelectedItems( this )
+                                       .filter( function ( item ) {
+                                               return superset.indexOf( 
item.getName() ) !== -1;
+                                       } )
+                                       .map( function ( item ) {
+                                               return mw.msg( 
'quotation-marks', item.getLabel() );
+                                       } );
+
+                               messageKey = 'rcfilters-state-message-subset';
+                       } else if ( this.isFullyCovered() ) {
+                               affectingItems = 
this.getGroupModel().getSelectedItems( this )
+                                       .map( function ( item ) {
+                                               return mw.msg( 
'quotation-marks', item.getLabel() );
+                                       } );
+
+                               messageKey = 
'rcfilters-state-message-fullcoverage';
                        }
-
-                       messageKey = details.message;
-                       affectingItems = details.names;
-               } else if ( this.isIncluded() ) {
-                       superset = this.getSuperset();
-                       // For this message we need to collect the affecting 
superset
-                       affectingItems = this.getGroupModel().getSelectedItems( 
this )
-                               .filter( function ( item ) {
-                                       return superset.indexOf( item.getName() 
) !== -1;
-                               } )
-                               .map( function ( item ) {
-                                       return mw.msg( 'quotation-marks', 
item.getLabel() );
-                               } );
-
-                       messageKey = 'rcfilters-state-message-subset';
-               } else if ( this.isFullyCovered() ) {
-                       affectingItems = this.getGroupModel().getSelectedItems( 
this )
-                               .map( function ( item ) {
-                                       return mw.msg( 'quotation-marks', 
item.getLabel() );
-                               } );
-
-                       messageKey = 'rcfilters-state-message-fullcoverage';
                }
 
                if ( messageKey ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie8b6020e6dc93b46e94d2bc2bebb71b56f1e3645
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to