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

View file

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

View file

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

View file

@ -136,7 +136,7 @@ class ThanksHooks {
&& $context->getUser()->isLoggedIn()
) {
// 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',
$wgThanksConfirmationRequired );
}
@ -157,7 +157,7 @@ class ThanksHooks {
&& $diff->getUser()->isLoggedIn()
) {
// 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',
$wgThanksConfirmationRequired );
}
@ -184,7 +184,7 @@ class ThanksHooks {
'category' => 'edit-thank',
'group' => 'positive',
'section' => 'message',
'presentation-model' => 'EchoThanksPresentationModel',
'presentation-model' => 'EchoCoreThanksPresentationModel',
'bundle' => [
'web' => true,
'expandable' => true,

View file

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

View file

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