From 37a3045f62914ccf989b1ace8cd39384f9be38d2 Mon Sep 17 00:00:00 2001 From: jdlrobson Date: Tue, 14 May 2019 11:01:04 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Bug:=20Make=20the=20history=20ac?= =?UTF-8?q?tion's=20filters=20form=20toggleable=20again?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this commit, the filters form would stay collapsed and the user couldn't toggle the visibility of the form. This commit fixes that by loading the necessary modules for the history action to make the form toggleable again: - mediawiki.page.ready - jquery.makeCollapsible - jquery.makeCollapsible.styles Additional Changes: - The explicit addition of the 'mediawiki.action.history' module to the defaultModules array in SkinMinerva was removed because this module should already be added by HistoryAction.php and all we are doing with Minerva is styling it differently. - The styling to hide the filter revisions box in skinStyles/mediawiki.action.history.styles.less was removed now that this functionality should work again Bug: T223204 Change-Id: Icf4a22a62228aca5a120bcdf3d6fede35b3c928e --- includes/skins/SkinMinerva.php | 22 +++++++++++-------- .../mediawiki.action.history.styles.less | 5 ----- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php index 4cc1c61..b2f51d7 100644 --- a/includes/skins/SkinMinerva.php +++ b/includes/skins/SkinMinerva.php @@ -911,7 +911,6 @@ class SkinMinerva extends SkinTemplate { $modules = []; $user = $this->getUser(); $title = $this->getTitle(); - $action = Action::getActionName( $this->getContext() ); if ( !$title->isSpecialPage() && $this->isAllowedPageAction( 'watch' ) ) { // Explicitly add the mobile watchstar code. @@ -938,10 +937,6 @@ class SkinMinerva extends SkinTemplate { $modules[] = 'skins.minerva.share'; } - if ( $action === 'history' ) { - $modules[] = 'mediawiki.action.history'; - } - return $modules; } @@ -952,10 +947,19 @@ class SkinMinerva extends SkinTemplate { */ public function getDefaultModules() { $modules = parent::getDefaultModules(); - // dequeue default content modules (toc, sortable, collapsible, etc.) - $modules['content'] = []; - // dequeue styles associated with `content` key. - $modules['styles']['content'] = []; + + // FIXME: T223204: Dequeue default content modules except for the history + // action. Allow default history action content modules + // (mediawiki.page.ready, jquery.makeCollapsible, + // jquery.makeCollapsible.styles, etc) in order to enable toggling of the + // filters. Long term this won't be necessary when T111565 is resolved and a + // more general solution can be used. + if ( Action::getActionName( $this->getContext() ) !== 'history' ) { + // dequeue default content modules (toc, sortable, collapsible, etc.) + $modules['content'] = []; + // dequeue styles associated with `content` key. + $modules['styles']['content'] = []; + } $modules['styles']['core'] = $this->getSkinStyles(); // dequeue default watch module (not needed, no watchstar in this skin) $modules['watch'] = []; diff --git a/skinStyles/mediawiki.action.history.styles.less b/skinStyles/mediawiki.action.history.styles.less index 52db3a8..44bf728 100644 --- a/skinStyles/mediawiki.action.history.styles.less +++ b/skinStyles/mediawiki.action.history.styles.less @@ -8,11 +8,6 @@ margin: 0; } - // TODO: Show the filters when show/hide functionality is enabled on Minerva. - .oo-ui-panelLayout-padded.oo-ui-panelLayout-framed { - display: none; - } - #pagehistory { padding: 0;