Page MenuHomePhabricator

Feature: $sdgDisableFilterCollapsible
Open, Needs TriagePublic

Description

Adding $sdgDisableFilterCollapsible = true; will enable this feature.
Filter's will be rendered without the collapsible logic.

Index: SemanticDrilldown.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- SemanticDrilldown.php	(revision 568e428637ec67046562296d204e217002e668b5)
+++ SemanticDrilldown.php	(revision )
@@ -111,6 +111,7 @@
 $sdgMinValuesForComboBox = 40;
 $sdgNumRangesForNumberFilters = 6;
 $sdgHideFiltersWithoutValues = false;
+$sdgDisableFilterCollapsible = false;
 
 
 
Index: specials/SD_BrowseData.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- specials/SD_BrowseData.php	(revision 568e428637ec67046562296d204e217002e668b5)
+++ specials/SD_BrowseData.php	(revision )
@@ -475,8 +475,19 @@
 	 */
 	function printFilterLine( $filterName, $isApplied, $isNormalFilter, $resultsLine ) {
 		global $sdgScriptPath;
+		global $sdgDisableFilterCollapsible;
 
 		$filterLabel = $this->printFilterLabel( $filterName );
+
+		if ($sdgDisableFilterCollapsible) {
+			$text  = '<div class="drilldown-filter">';
+			$text .= '	<div class="drilldown-filter-label">' . $filterLabel . '</div>';
+			$text .= '	<div class="drilldown-filter-values">' . $resultsLine . '</div>';
+			$text .= '</div>';
+
+			return $text;
+		}
+
 		$text = <<<END
 				<div class="drilldown-filter">
 					<div class="drilldown-filter-label">

Event Timeline

Fannon created this task.May 19 2016, 11:01 AM
Restricted Application added subscribers: Zppix, Aklapper. · View Herald TranscriptMay 19 2016, 11:01 AM
Fannon renamed this task from Feature: to Feature: $sdgDisableFilterCollapsible.May 19 2016, 11:01 AM
Fannon assigned this task to Yaron_Koren.

Add CSS classes and visual indication that a filter is applied

Index: skins/SD_main.css
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- skins/SD_main.css	(revision c5eabd49c29cd04298e1297f4a04abf4a5dcb924)
+++ skins/SD_main.css	(revision )
@@ -111,6 +111,10 @@
 }
 
 div.drilldown-filter-values {
+
+}
+.is-applied .drilldown-filter-label {
+	font-style: italic;
 }
 
 .ui-button { margin-left: -1px; }
Index: specials/SD_BrowseData.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- specials/SD_BrowseData.php	(revision c5eabd49c29cd04298e1297f4a04abf4a5dcb924)
+++ specials/SD_BrowseData.php	(revision )
@@ -489,8 +489,16 @@
 			$label = wfMessage( $filter->int )->text();
 		}
 
+		$additionalClasses = '';
+		if ($isApplied) {
+			$additionalClasses .= ' is-applied';
+		}
+		if ($isNormalFilter) {
+			$additionalClasses .= ' is-normal-filter';
+		}
+
 		if ($sdgDisableFilterCollapsible) {
-			$text  = '<div class="drilldown-filter">';
+			$text  = '<div class="drilldown-filter' . $additionalClasses . '">';
 			$text .= '	<div class="drilldown-filter-label">' . $label . '</div>';
 			$text .= '	<div class="drilldown-filter-values">' . $resultsLine . '</div>';
 			$text .= '</div>';
@@ -499,7 +507,7 @@
 		}
 
 		$text = <<<END
-				<div class="drilldown-filter">
+				<div class="drilldown-filter' . $additionalClasses . '">
 					<div class="drilldown-filter-label">
 
 END;

This patch will completely remove the arrows, without adding a config option:

Index: skins/SD_main.css
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- skins/SD_main.css	(date 1462137637000)
+++ skins/SD_main.css	(revision )
@@ -104,6 +104,7 @@
 
 div.drilldown-filter-label {
 	font-weight: bold;
+	font-size: 1.2em;
 }
 
 span.drilldown-filter-notes {
@@ -112,6 +113,10 @@
 
 div.drilldown-filter-values {
 }
+.is-applied .drilldown-filter-label {
+	font-weight: bold;
+}
+
 
 .ui-button { margin-left: -1px; }
 .ui-button-icon-only .ui-button-text { padding: 0.35em; }
Index: libs/SemanticDrilldown.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- libs/SemanticDrilldown.js	(date 1462137637000)
+++ libs/SemanticDrilldown.js	(revision )
@@ -89,21 +89,6 @@
 
 }( jQuery ) );
 
-jQuery.fn.toggleValuesDisplay = function() {
-	jQuery.valuesDiv = jQuery(this).closest(".drilldown-filter")
-		.find(".drilldown-filter-values");
-	if ( jQuery.valuesDiv.css("display") === "none" ) {
-		jQuery.valuesDiv.css("display", "block");
-		var downArrowImage = mediaWiki.config.get( 'sdgDownArrowImage' );
-		this.find("img").attr( "src", downArrowImage );
-	} else {
-		jQuery.valuesDiv.css("display", "none");
-		var rightArrowImage = mediaWiki.config.get( 'sdgRightArrowImage' );
-		this.find("img").attr( "src", rightArrowImage );
-	}
-};
-
 jQuery(document).ready(function() {
 	jQuery(".semanticDrilldownCombobox").combobox();
-	jQuery(".drilldown-values-toggle").click( function() {jQuery(this).toggleValuesDisplay();} );
 });
Index: specials/SD_BrowseData.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- specials/SD_BrowseData.php	(date 1462137637000)
+++ specials/SD_BrowseData.php	(revision )
@@ -470,42 +470,28 @@
 	 * Create the full display of the filter line, once the text for
 	 * the "results" (values) for this filter has been created.
 	 */
-	function printFilterLine( $filterName, $isApplied, $isNormalFilter, $resultsLine ) {
-		global $sdgScriptPath;
+	function printFilterLine( $filterName, $isApplied, $isNormalFilter, $resultsLine, $filter ) {
 
 		$filterLabel = $this->printFilterLabel( $filterName );
-		$text = <<<END
-				<div class="drilldown-filter">
-					<div class="drilldown-filter-label">
 
-END;
-		// No point showing arrow if it's just a
-		// single text or date input.
-		if ( $isNormalFilter ) {
-			if ( $isApplied ) {
-				$arrowImage = "$sdgScriptPath/skins/right-arrow.png";
-			} else {
-				$arrowImage = "$sdgScriptPath/skins/down-arrow.png";
+		$label = $filterLabel;
+		if ( isset( $filter->int ) ) {
+			$label = wfMessage( $filter->int )->text();
-			}
+		}
-			$text .= <<<END
-					<a class="drilldown-values-toggle" style="cursor: default;"><img src="$arrowImage" /></a>
 
-END;
-		}
-		$text .= "\t\t\t\t\t$filterLabel:";
+		$additionalClasses = '';
-		if ( $isApplied ) {
+		if ($isApplied) {
-			$add_another_str = wfMessage( 'sd_browsedata_addanothervalue' )->text();
-			$text .= " <span class=\"drilldown-filter-notes\">($add_another_str)</span>";
+			$additionalClasses .= ' is-applied';
 		}
-		$displayText = ( $isApplied ) ? 'style="display: none;"' : '';
-		$text .= <<<END
+		if ($isNormalFilter) {
+			$additionalClasses .= ' is-normal-filter';
+		}
 
-					</div>
-					<div class="drilldown-filter-values" $displayText>$resultsLine
-					</div>
-				</div>
+		$text  = '<div class="drilldown-filter' . $additionalClasses . '">';
+		$text .= '	<div class="drilldown-filter-label">' . $label . '</div>';
+		$text .= '	<div class="drilldown-filter-values">' . $resultsLine . '</div>';
+		$text .= '</div>';
 
-END;
 		return $text;
 	}
Aklapper removed Yaron_Koren as the assignee of this task.Jun 19 2020, 4:15 PM
Aklapper added a subscriber: Yaron_Koren.

This task has been assigned to the same task owner for more than two years. Resetting task assignee due to inactivity, to decrease task cookie-licking and to get a slightly more realistic overview of plans. Please feel free to assign this task to yourself again if you still realistically work or plan to work on this task - it would be welcome!

For tips how to manage individual work in Phabricator (noisy notifications, lists of task, etc.), see https://phabricator.wikimedia.org/T228575#6237124 for available options.
(For the records, two emails were sent to assignee addresses before resetting assignees. See T228575 for more info and for potential feedback. Thanks!)