Rename files and classes in preparation for adding log-thanks

Bug: T186855
Change-Id: I20f5d200c33e395aca9489b73d0ed9b1d0ad5b8c
This commit is contained in:
Sam Wilson 2018-02-21 11:46:30 +08:00
parent 4f1238604b
commit 78831d2b68
7 changed files with 15 additions and 14 deletions

View file

@ -35,7 +35,7 @@
"thanks/*": "ThanksLogFormatter" "thanks/*": "ThanksLogFormatter"
}, },
"APIModules": { "APIModules": {
"thank": "ApiRevThank" "thank": "ApiCoreThank"
}, },
"MessagesDirs": { "MessagesDirs": {
"Thanks": [ "Thanks": [
@ -47,10 +47,10 @@
}, },
"AutoloadClasses": { "AutoloadClasses": {
"ThanksHooks": "includes/ThanksHooks.php", "ThanksHooks": "includes/ThanksHooks.php",
"EchoThanksPresentationModel": "includes/EchoThanksPresentationModel.php", "EchoCoreThanksPresentationModel": "includes/EchoCoreThanksPresentationModel.php",
"EchoFlowThanksPresentationModel": "includes/EchoFlowThanksPresentationModel.php", "EchoFlowThanksPresentationModel": "includes/EchoFlowThanksPresentationModel.php",
"ApiThank": "includes/ApiThank.php", "ApiThank": "includes/ApiThank.php",
"ApiRevThank": "includes/ApiRevThank.php", "ApiCoreThank": "includes/ApiCoreThank.php",
"ApiFlowThank": "includes/ApiFlowThank.php", "ApiFlowThank": "includes/ApiFlowThank.php",
"ThanksLogFormatter": "includes/ThanksLogFormatter.php", "ThanksLogFormatter": "includes/ThanksLogFormatter.php",
"SpecialThanks": "includes/SpecialThanks.php" "SpecialThanks": "includes/SpecialThanks.php"
@ -64,9 +64,9 @@
"mediawiki.api" "mediawiki.api"
] ]
}, },
"ext.thanks.revthank": { "ext.thanks.corethank": {
"scripts": [ "scripts": [
"ext.thanks.revthank.js" "ext.thanks.corethank.js"
], ],
"messages": [ "messages": [
"thanks-thanked", "thanks-thanked",
@ -85,6 +85,7 @@
"mediawiki.jqueryMsg", "mediawiki.jqueryMsg",
"mediawiki.api", "mediawiki.api",
"jquery.confirmable", "jquery.confirmable",
"jquery.cookie",
"ext.thanks" "ext.thanks"
] ]
}, },

View file

@ -5,7 +5,7 @@
* @ingroup API * @ingroup API
* @ingroup Extensions * @ingroup Extensions
*/ */
class ApiRevThank extends ApiThank { class ApiCoreThank extends ApiThank {
public function execute() { public function execute() {
$this->dieIfEchoNotInstalled(); $this->dieIfEchoNotInstalled();

View file

@ -1,5 +1,5 @@
<?php <?php
class EchoThanksPresentationModel extends EchoEventPresentationModel { class EchoCoreThanksPresentationModel extends EchoEventPresentationModel {
public function canRender() { public function canRender() {
return (bool)$this->event->getTitle(); return (bool)$this->event->getTitle();
} }

View file

@ -136,7 +136,7 @@ class ThanksHooks {
&& $context->getUser()->isLoggedIn() && $context->getUser()->isLoggedIn()
) { ) {
// Load the module for the thank links // Load the module for the thank links
$context->getOutput()->addModules( [ 'ext.thanks.revthank' ] ); $context->getOutput()->addModules( [ 'ext.thanks.corethank' ] );
$context->getOutput()->addJsConfigVars( 'thanks-confirmation-required', $context->getOutput()->addJsConfigVars( 'thanks-confirmation-required',
$wgThanksConfirmationRequired ); $wgThanksConfirmationRequired );
} }
@ -157,7 +157,7 @@ class ThanksHooks {
&& $diff->getUser()->isLoggedIn() && $diff->getUser()->isLoggedIn()
) { ) {
// Load the module for the thank link // Load the module for the thank link
$diff->getOutput()->addModules( [ 'ext.thanks.revthank' ] ); $diff->getOutput()->addModules( [ 'ext.thanks.corethank' ] );
$diff->getOutput()->addJsConfigVars( 'thanks-confirmation-required', $diff->getOutput()->addJsConfigVars( 'thanks-confirmation-required',
$wgThanksConfirmationRequired ); $wgThanksConfirmationRequired );
} }
@ -184,7 +184,7 @@ class ThanksHooks {
'category' => 'edit-thank', 'category' => 'edit-thank',
'group' => 'positive', 'group' => 'positive',
'section' => 'message', 'section' => 'message',
'presentation-model' => 'EchoThanksPresentationModel', 'presentation-model' => 'EchoCoreThanksPresentationModel',
'bundle' => [ 'bundle' => [
'web' => true, 'web' => true,
'expandable' => true, 'expandable' => true,

View file

@ -3,7 +3,7 @@
/** /**
* Integration tests for the Thanks API module * Integration tests for the Thanks API module
* *
* @covers ApiRevThank * @covers ApiCoreThank
* *
* @group Thanks * @group Thanks
* @group Database * @group Database
@ -12,7 +12,7 @@
* *
* @author Addshore * @author Addshore
*/ */
class ApiRevThankIntegrationTest extends ApiTestCase { class ApiCoreThankIntegrationTest extends ApiTestCase {
/** /**
* @var int filled in setUp * @var int filled in setUp

View file

@ -8,12 +8,12 @@
* *
* @author Addshore * @author Addshore
*/ */
class ApiRevThankUnitTest extends MediaWikiTestCase { class ApiCoreThankUnitTest extends MediaWikiTestCase {
protected static $moduleName = 'thank'; protected static $moduleName = 'thank';
protected function getModule() { protected function getModule() {
return new ApiRevThank( new ApiMain(), self::$moduleName ); return new ApiCoreThank( new ApiMain(), self::$moduleName );
} }
/** /**