Skip to content

Commit

Permalink
Merge branch 'dev-#2773' into dev-cake45
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuring committed Oct 28, 2023
2 parents 85b47ab + b4a8217 commit f955e1e
Show file tree
Hide file tree
Showing 18 changed files with 45 additions and 31 deletions.
4 changes: 2 additions & 2 deletions plugins/baser-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<a href="LICENSE" target="_blank">
<img alt="Software License" src="https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square">
</a>
<a href="https://github.com/baserproject/ucmitz/actions/workflows/test.yml" target="_blank">
<img alt="Build Status" src="https://github.com/baserproject/ucmitz/actions/workflows/test.yml/badge.svg?branch=dev">
<a href="https://github.com/baserproject/basercms/actions/workflows/test.yml" target="_blank">
<img alt="Build Status" src="https://github.com/baserproject/basercms/actions/workflows/test.yml/badge.svg?branch=dev-5">
</a>
</p>

Expand Down
22 changes: 11 additions & 11 deletions plugins/baser-core/src/Controller/Admin/SitesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
use BaserCore\Service\Admin\SitesAdminServiceInterface;
use BaserCore\Service\SiteConfigsServiceInterface;
use BaserCore\Service\SitesServiceInterface;
use BaserCore\Service\ThemesServiceInterface;
use BaserCore\Utility\BcSiteConfig;
use Cake\Core\Exception\Exception;
use BaserCore\Annotation\Note;
use BaserCore\Annotation\NoTodo;
use BaserCore\Annotation\Checked;
use BaserCore\Annotation\UnitTest;
use Cake\Http\Exception\NotFoundException;
use Cake\ORM\Exception\PersistenceFailedException;
use Psr\Http\Message\ResponseInterface;

/**
Expand Down Expand Up @@ -66,11 +68,15 @@ public function index(SitesAdminServiceInterface $service)
* サイト追加
*
* @param SiteConfigsServiceInterface $service
* @return void|ResponseInterface
* @checked
* @unitTest
* @note(value="インストーラーを実装してからテーマの保有するプラグインをインストールする処理を追加する")
* @noTodo
*/
public function add(SitesAdminServiceInterface $service)
public function add(
SitesAdminServiceInterface $service,
ThemesServiceInterface $themesService
)
{
if ($this->request->is('post')) {

Expand All @@ -84,26 +90,20 @@ public function add(SitesAdminServiceInterface $service)

try {
$site = $service->create($this->request->getData());

// EVENT Sites.afterAdd
$this->dispatchLayerEvent('afterAdd', [
'data' => $site
]);

// TODO ucmitz 未実装のためコメントアウト
/* >>>
if (!empty($site->theme)) {
$this->BcManager->installThemesPlugins($site->theme);
}
<<< */

if ($site->theme) $themesService->installThemesPlugins($site->theme);
$this->BcMessage->setSuccess(sprintf(__d('baser_core', 'サイト「%s」を追加しました。'), $site->display_name));
return $this->redirect(['action' => 'edit', $site->id]);
} catch (\Cake\ORM\Exception\PersistenceFailedException $e) {
} catch (PersistenceFailedException $e) {
$site = $e->getEntity();
$this->BcMessage->setError(__d('baser_core', '入力エラーです。内容を修正してください。'));
}
}

$this->set($service->getViewVarsForAdd($site ?? $service->getNew()));
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/baser-core/src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ public function services(ContainerInterface $container): void
* @param CommandCollection $commands
* @return CommandCollection
* @checked
* @checked
* @noTodo
*/
public function console(CommandCollection $commands): CommandCollection
{
Expand Down
4 changes: 2 additions & 2 deletions plugins/baser-core/src/Service/ThemesService.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,11 @@ private function getThemesDefaultDataInfo(string $theme, array $info = [])
* @unitTest
* @noTodo
*/
private function installThemesPlugins(string $theme)
public function installThemesPlugins(string $theme)
{
/* @var PluginsService $pluginsService */
$pluginsService = $this->getService(PluginsServiceInterface::class);
$plugins = BcUtil::getCurrentThemesPlugins();
$plugins = BcUtil::getThemesPlugins($theme);
// テーマ梱包のプラグインをインストール
foreach($plugins as $plugin) {
$pluginsService->install($plugin);
Expand Down
16 changes: 8 additions & 8 deletions plugins/baser-core/src/Utility/BcAgent.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace BaserCore\Utility;
use BaserCore\Annotation\Checked;
use BaserCore\Annotation\UnitTest;
use BaserCore\Annotation\NoTodo;

/**
* Class BcAgent
Expand Down Expand Up @@ -48,7 +49,7 @@ class BcAgent extends BcAbstractDetector
*
* @checked
* @unitTest
* @noTodo
*/
protected function _setConfig(array $config)
{
Expand All @@ -58,11 +59,11 @@ protected function _setConfig(array $config)

/**
* デフォルトの設定値を取得
* @checked
* @unitTest
*
* @return array
* @checked
* @unitTest
* @noTodo
*/
protected function _getDefaultConfig()
{
Expand All @@ -75,10 +76,10 @@ protected function _getDefaultConfig()
/**
* ユーザーエージェントの判定用正規表現を取得
*
* @return string
* @checked
* @unitTest
*
* @return string
* @noTodo
*/
public function getDetectorRegex()
{
Expand All @@ -89,10 +90,9 @@ public function getDetectorRegex()
/**
* ユーザーエージェントがキーワードを含むかどうかを判定
*
* @return bool
* @checked
* @unitTest
*
* @return bool
*/
public function isMatchDecisionKey()
{
Expand Down
3 changes: 2 additions & 1 deletion plugins/baser-core/src/Utility/BcUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ static public function includePluginClass($pluginName)
* @return void
* @checked
* @unitTest
* @note(value="viewキャッシュ/dataキャッシュ実装時に対応")
* @noTodo
*/
public static function clearAllCache(): void
{
Expand Down Expand Up @@ -1081,6 +1081,7 @@ public static function getContentsItem(): array
* baserCMSのインストールが完了しているかチェックする
* @return boolean
* @checked
* @noTodo
*/
public static function isInstalled()
{
Expand Down
1 change: 1 addition & 0 deletions plugins/baser-core/src/View/BcFrontEmailView.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class BcFrontEmailView extends View
*
* @checked
* @unitTest
* @noTodo
*/
public function initialize(): void
{
Expand Down
5 changes: 3 additions & 2 deletions plugins/baser-core/src/View/Helper/BcBaserHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,7 @@ public function contentsName($detail = false, $options = [])
* @return string
* @checked
* @unitTest
* @noTodo
* @doc
*/
public function getContentsName($detail = false, $options = [])
Expand Down Expand Up @@ -794,7 +795,7 @@ public function getContentsName($detail = false, $options = [])
* @return string URL
* @checked
* @unitTest
* @note(value="$sessionId について実装検討要")
* @noTodo
*/
public function getUrl($url = null, $full = false)
{
Expand Down Expand Up @@ -2025,10 +2026,10 @@ public function isCategoryTop()
* - `recursive` : 固定ページ読み込みを再帰的に読み込むかどうか(初期値 : true)
* - `checkExists` : 固定ページの存在判定をするかどうか(初期値 : true)
* @return void
* @todo ucmitz loadHelpersが利用されていないのをなんとかする
*/
public function page($url, $params = [], $options = [])
{
// TODO ucmitz loadHelpersが利用されていないのをなんとかする
if (!empty($this->_View->get('pageRecursive')) && !$this->_View->get('pageRecursive')) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/baser-core/src/View/Helper/BcFormHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class BcFormHelper extends FormHelper
* @param string $type フォームのタイプ タイプごとにイベントの登録ができる
* @return string 行データ
* @checked
* @note(value="フォームの最後のフィールドの後に発動するイベント")
* @noTodo
*/
public function dispatchAfterForm($type = ''): string
{
Expand Down
1 change: 0 additions & 1 deletion plugins/baser-core/tests/Fixture/ContentsFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ public function init(): void
'description' => '',
'eyecatch' => '00000006_eyecatch.gif',
'author_id' => 1,
// NOTE ucmitz: layout templateテスト用
'layout_template' => 'serviceTemplate',
'status' => true,
'publish_begin' => null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,11 @@ public function testGetCurrentLoginUrl()
/**
* Test getCurrentUserPrefixes
* @return void
* @todo ucmitz getCurrentUserPrefixSettings() の実装が完了したら別パターンのテストを追加する
* @
*/
public function testGetCurrentUserPrefixes()
{
// TODO getCurrentUserPrefixSettings() の実装が完了したら別パターンのテストを追加する
$this->loginAdmin($this->getRequest('/baser/admin'));
$result = $this->BcAuth->getCurrentUserPrefixes();
$this->assertEquals(['Admin', 'Api/Admin'], $result);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public function initialize(): void
* @return void|ResponseInterface
* @checked
* @unitTest
* @noTodo
*/
public function edit(BlogContentsAdminServiceInterface $service, int $id)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class CustomContentsTable extends AppTable
* @param array $config テーブル設定
* @checked
* @unitTest
* @noTodo
*/
public function initialize(array $config): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
use BaserCore\Annotation\UnitTest;
use BaserCore\Annotation\NoTodo;
use BaserCore\Annotation\Checked;
use Psr\Http\Message\ResponseInterface;

/**
* Class InstallationsController
Expand All @@ -46,6 +47,7 @@ class InstallationsController extends BcAdminAppController
*
* @return void
* @checked
* @noTodo
*/
public function beforeFilter(EventInterface $event)
{
Expand Down Expand Up @@ -138,8 +140,9 @@ public function step3(InstallationsAdminServiceInterface $service)
* Step 4: データベース生成/管理者ユーザー作成
*
* @param InstallationsAdminService $service
* @return void
* @return void|ResponseInterface
* @checked
* @noTodo
*/
public function step4(InstallationsAdminServiceInterface $service)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ public function getDefaultValuesStep4(ServerRequest $request): array
* @param array $data
* @return void
* @checked
* @noTodo
*/
public function writeDbSettingToSession(ServerRequest $request, array $data): void
{
Expand Down Expand Up @@ -330,6 +331,7 @@ public function login(ServerRequest $request, Response $response): void
*
* @param ServerRequest $request
* @checked
* @noTodo
*/
public function initDb(ServerRequest $request): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ public static function checkdate($value){
* @param array $context
* @return bool
* @checked
* @noTodo
*/
public static function checkSame(string $value, string $target, array $context)
{
Expand Down
1 change: 1 addition & 0 deletions plugins/bc-mail/src/Service/MailContentsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ public function getList()
* @return EntityInterface $result
* @checked
* @unitTest
* @noTodo
*/
public function copy($postData)
{
Expand Down
2 changes: 2 additions & 0 deletions plugins/bc-widget-area/src/Service/WidgetAreasService.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ public function delete(int $id)
* @return array
* @checked
* @unitTest
* @noTodo
*/
public function getTitlesById(array $ids): array
{
Expand All @@ -150,6 +151,7 @@ public function getTitlesById(array $ids): array
* @return bool
* @checked
* @unitTest
* @noTodo
*/
public function batch(string $method, array $ids): bool
{
Expand Down

0 comments on commit f955e1e

Please sign in to comment.