jenkins-bot has submitted this change and it was merged.

Change subject: Hygiene: Split SpecialGather resource loader modules
......................................................................


Hygiene: Split SpecialGather resource loader modules

Organize better based on routes.

This is part of ongoing T93309.

Bug: T97456
Change-Id: Ib1912f67b13a19ea058b548c6e7beb035021a88f
---
M includes/specials/SpecialGather.php
M resources/Resources.php
R resources/ext.gather.special.collection/init.js
3 files changed, 26 insertions(+), 10 deletions(-)

Approvals:
  Jhernandez: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/specials/SpecialGather.php 
b/includes/specials/SpecialGather.php
index 0246c9a..be8c327 100644
--- a/includes/specials/SpecialGather.php
+++ b/includes/specials/SpecialGather.php
@@ -42,9 +42,7 @@
         */
        public function execute( $subpage ) {
                $out = $this->getOutput();
-               $out->addModules( array(
-                       'ext.gather.special',
-               ) );
+               $out->addModules( array( 'ext.gather.special' ) );
                $out->addModuleStyles( array(
                        'mediawiki.ui.anchor',
                        'mediawiki.ui.icon',
@@ -64,7 +62,6 @@
                        // User's collections
                        // /by/:user = /by/:user/
                        $user = User::newFromName( $matches['user'] );
-
                        if ( !( $user && $user->getId() ) ) {
                                // Invalid user
                                $this->renderError( new views\NotFound() );
@@ -78,10 +75,10 @@
                        $this->renderUserCollection( $id );
                } elseif ( preg_match( '/^by\/(?<user>[^\/]+)\/(?<id>\d+)$/', 
$subpage, $matches ) ) {
                        // Collection page
+                       // FIXME: Redirect this location to /id/:id and get rid 
of all this
                        // /by/:user/:id
                        $id = (int)$matches['id'];
                        $user = User::newFromName( $matches['user'] );
-
                        if ( !( $user && $user->getId() ) ) {
                                // Invalid user
                                $this->renderError( new views\NotFound() );
diff --git a/resources/Resources.php b/resources/Resources.php
index fa7d929..b1e3e0f 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -360,22 +360,41 @@
                'scripts' => array(
                        'ext.gather.routes/routes.js',
                ),
+               'messages' => array(
+                       'gather-no-such-action',
+                       'gather-unknown-error',
+               ),
        ),
 
-       'ext.gather.special' => $wgGatherMobileSpecialPageResourceBoilerplate + 
array(
+       'ext.gather.special.base' => 
$wgGatherMobileSpecialPageResourceBoilerplate + array(
                'dependencies' => array(
                        'ext.gather.alerts.init',
                        'ext.gather.collection.editor',
                        'ext.gather.routes',
+               ),
+       ),
+
+       'ext.gather.special.usercollections' => 
$wgGatherMobileSpecialPageResourceBoilerplate + array(
+               'dependencies' => array(
+                       'ext.gather.special.base',
+               ),
+       ),
+
+       'ext.gather.special.collection' => 
$wgGatherMobileSpecialPageResourceBoilerplate + array(
+               'dependencies' => array(
+                       'ext.gather.special.base',
                        'ext.gather.collection.flag',
                        'ext.gather.moderation',
                ),
                'scripts' => array(
-                       'ext.gather.special/init.js',
+                       'ext.gather.special.collection/init.js',
                ),
-               'messages' => array(
-                       'gather-no-such-action',
-                       'gather-unknown-error',
+       ),
+
+       'ext.gather.special' => $wgGatherMobileSpecialPageResourceBoilerplate + 
array(
+               'dependencies' => array(
+                       'ext.gather.special.collection',
+                       'ext.gather.special.usercollections',
                ),
        ),
 
diff --git a/resources/ext.gather.special/init.js 
b/resources/ext.gather.special.collection/init.js
similarity index 100%
rename from resources/ext.gather.special/init.js
rename to resources/ext.gather.special.collection/init.js

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib1912f67b13a19ea058b548c6e7beb035021a88f
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Gather
Gerrit-Branch: master
Gerrit-Owner: Jhernandez <jhernan...@wikimedia.org>
Gerrit-Reviewer: Jdlrobson <jrob...@wikimedia.org>
Gerrit-Reviewer: Jhernandez <jhernan...@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