RCFilters UI: Unbreak limit and days widgets in non-experimental mode
authorRoan Kattouw <roan.kattouw@gmail.com>
Wed, 26 Jul 2017 00:40:47 +0000 (17:40 -0700)
committerRoan Kattouw <roan.kattouw@gmail.com>
Wed, 26 Jul 2017 00:40:47 +0000 (17:40 -0700)
Don't treat all views as experimental, only the namespace and tag ones.

Change-Id: I1ec014314217b52cdfd71ccfcf10d549bea55f6c

resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js

index a602c32..3281735 100644 (file)
                } );
 
                // Collect views
-               allViews = {
+               allViews = $.extend( true, {
                        'default': {
                                title: mw.msg( 'rcfilters-filterlist-title' ),
                                groups: filterGroups
                        }
-               };
-
-               if ( views && mw.config.get( 'wgStructuredChangeFiltersEnableExperimentalViews' ) ) {
-                       // If we have extended views, add them in
-                       $.extend( true, allViews, views );
-               }
+               }, views );
 
                // Go over all views
                $.each( allViews, function ( viewName, viewData ) {
index 5ebec27..3b8ebbd 100644 (file)
@@ -35,6 +35,7 @@
                        items = [],
                        uri = new mw.Uri(),
                        $changesList = $( '.mw-changeslist' ).first().contents(),
+                       experimentalViews = mw.config.get( 'wgStructuredChangeFiltersEnableExperimentalViews' ),
                        createFilterDataFromNumber = function ( num, convertedNumForLabel ) {
                                return {
                                        name: String( num ),
@@ -43,7 +44,7 @@
                        };
 
                // Prepare views
-               if ( namespaceStructure ) {
+               if ( namespaceStructure && experimentalViews ) {
                        items = [];
                        $.each( namespaceStructure, function ( namespaceID, label ) {
                                // Build and clean up the individual namespace items definition
@@ -74,7 +75,7 @@
                                } ]
                        };
                }
-               if ( tagList ) {
+               if ( tagList && experimentalViews ) {
                        views.tags = {
                                title: mw.msg( 'rcfilters-view-tags' ),
                                trigger: '#',