From 5af168e1fa9f0f30648a253b4c89f98da3d88353 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Wed, 6 Jan 2021 10:42:30 +0900 Subject: [PATCH 01/28] =?UTF-8?q?fix:=20=E8=A1=A8=E7=A4=BA=E9=A0=86(sort)?= =?UTF-8?q?=E3=81=8C=E6=8C=87=E5=AE=9A=E3=81=95=E3=82=8C=E3=81=A6=E3=81=84?= =?UTF-8?q?=E3=81=A6=E3=80=81=E3=82=BD=E3=83=BC=E3=83=88=E6=96=B9=E6=B3=95?= =?UTF-8?q?(direction)=E3=81=AE=E5=90=8D=E5=89=8D=E4=BB=98=E3=81=8D?= =?UTF-8?q?=E3=83=91=E3=83=A9=E3=83=A1=E3=83=BC=E3=82=BF=E3=81=8C=E3=81=AA?= =?UTF-8?q?=E3=81=84=E3=81=A8=E3=81=8DNotice=E3=81=8C=E7=99=BA=E7=94=9F?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=81=9F=E3=82=81=E4=BF=AE=E6=AD=A3=20https:?= =?UTF-8?q?//github.com/researchmap/RmNetCommons3/issues/1970?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controller/CircularNoticesController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Controller/CircularNoticesController.php b/Controller/CircularNoticesController.php index ec6f921..59a049c 100644 --- a/Controller/CircularNoticesController.php +++ b/Controller/CircularNoticesController.php @@ -89,7 +89,7 @@ public function beforeFilter() { * index action * * @return void - * + * * 速度改善の修正に伴って発生したため抑制 * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) @@ -139,7 +139,7 @@ public function index() { $currentSort = isset($this->params['named']['sort']) ? $this->params['named']['sort'] : 'CircularNoticeContent.modified'; - $currentDirection = isset($this->params['named']['sort']) + $currentDirection = isset($this->params['named']['direction']) ? $this->params['named']['direction'] : 'desc'; if (! isset($sortOptions[$currentSort . '.' . $currentDirection])) { From 0ceda0da852ddb0754c5c69657af57ce636bda3a Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 23 Jan 2021 13:53:40 +0900 Subject: [PATCH 02/28] =?UTF-8?q?add:=20release=E3=82=BF=E3=82=B0=E4=BB=98?= =?UTF-8?q?=E3=81=91=E3=81=AEgithub=20action=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/NetCommons3/NetCommons3/issues/1619 --- .github/workflows/release.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a3225bc --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,28 @@ +on: + push: + # Sequence of patterns matched against refs/tags + tags: + - '3*' + +name: Create Release + +jobs: + build: + name: Create Release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + body: | + NetCommons ${{ github.ref }} released. + draft: false + prerelease: false From 5389949656776a9d757319093200e132ad10ccf2 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 23 Jan 2021 13:53:45 +0900 Subject: [PATCH 03/28] change: Version number to 3.3.3 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index 4772543..619b537 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -3.3.2 +3.3.3 From 4604b791fd935a3785dd235d94fc6cd464e505a7 Mon Sep 17 00:00:00 2001 From: ryu818 Date: Tue, 16 Feb 2021 07:48:24 +0900 Subject: [PATCH 04/28] =?UTF-8?q?fix:=20=E4=B8=8D=E8=A6=81=E3=81=AA?= =?UTF-8?q?=E3=82=A8=E3=83=A9=E3=83=BC=E3=83=AD=E3=82=B0=E5=87=BA=E5=8A=9B?= =?UTF-8?q?=E3=82=92=E5=89=8A=E9=99=A4=20https://github.com/researchmap/Rm?= =?UTF-8?q?NetCommons3/issues/2404?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Model/CircularNoticeTargetUser.php | 1 - 1 file changed, 1 deletion(-) diff --git a/Model/CircularNoticeTargetUser.php b/Model/CircularNoticeTargetUser.php index 375f713..f9f0846 100644 --- a/Model/CircularNoticeTargetUser.php +++ b/Model/CircularNoticeTargetUser.php @@ -56,7 +56,6 @@ public function beforeValidate($options = array()) { * @return bool */ public function validateNotEmptyReplyValue($check) { - CakeLog::error(var_export($this->data['CircularNoticeTargetUser'], true)); if (! $this->data['CircularNoticeTargetUser']['reply_text_value'] && ! $this->data['CircularNoticeTargetUser']['reply_selection_value'] ) { From 60ce1d6768944f2acf46593328a9b64ca4e7e3eb Mon Sep 17 00:00:00 2001 From: RikaFujiwara Date: Fri, 7 May 2021 19:52:29 +0900 Subject: [PATCH 05/28] =?UTF-8?q?fix:=20=E5=9B=9E=E8=A6=A7=E6=9D=BF?= =?UTF-8?q?=E3=81=AE=E5=9B=9E=E7=AD=94CSV=E3=81=AE=E9=81=B8=E6=8A=9E?= =?UTF-8?q?=E8=82=A2=E3=81=8C=E3=83=A9=E3=83=99=E3=83=AB=E3=81=A7=E3=81=AA?= =?UTF-8?q?=E3=81=8FID=E3=81=A7=E5=87=BA=E5=8A=9B=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=81=A6=E3=80=81=E4=BD=95=E3=81=8C=E9=81=B8=E3=81=B0=E3=82=8C?= =?UTF-8?q?=E3=81=9F=E3=81=AE=E3=81=8B=E3=82=8F=E3=81=8B=E3=82=89=E3=81=AA?= =?UTF-8?q?=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NetCommons3/NetCommons3/issues/1641 --- Controller/CircularNoticesController.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Controller/CircularNoticesController.php b/Controller/CircularNoticesController.php index 59a049c..925a2f3 100644 --- a/Controller/CircularNoticesController.php +++ b/Controller/CircularNoticesController.php @@ -506,9 +506,13 @@ public function download() { $csvFile->add($header); // 回答データ整形 + $choices = array(); + foreach ($content['CircularNoticeChoice'] as $choice) { + $choices[$choice['id']] = $choice; + } $content = $content['CircularNoticeContent']; foreach ($targetUsers as $targetUser) { - $answer = $this->__parseAnswer($content['reply_type'], $targetUser); + $answer = $this->__parseAnswer($content['reply_type'], $targetUser, $choices); $readDatetime = __d('circular_notices', 'Unread'); if ($targetUser['CircularNoticeTargetUser']['read_datetime']) { @@ -550,9 +554,10 @@ public function download() { * * @param string $replyType 回答種別 * @param array $targetUser 回答者 + * @param array $choices 選択肢情報 * @return null|string */ - private function __parseAnswer($replyType, $targetUser) { + private function __parseAnswer($replyType, $targetUser, $choices) { $answer = null; switch ($replyType) { case CircularNoticeComponent::CIRCULAR_NOTICE_CONTENT_REPLY_TYPE_TEXT: @@ -562,6 +567,10 @@ private function __parseAnswer($replyType, $targetUser) { case CircularNoticeComponent::CIRCULAR_NOTICE_CONTENT_REPLY_TYPE_MULTIPLE_SELECTION: $selectionValues = explode(CircularNoticeComponent::SELECTION_VALUES_DELIMITER, $targetUser['CircularNoticeTargetUser']['reply_selection_value']); + // 取り出したreply_selection_valueの値を選択肢のラベルに変換する + foreach ($selectionValues as &$selectVal) { + $selectVal = $choices[$selectVal]['value'] ?? ''; + } $answer = implode(__d('circular_notices', 'Answer separator'), $selectionValues); break; } From f375d2a1ac107421c650288dc5b8a772161ec103 Mon Sep 17 00:00:00 2001 From: RikaFujiwara Date: Mon, 10 May 2021 10:37:47 +0900 Subject: [PATCH 06/28] fix: phpunit error --- .../CircularNoticesController/ParseAnswerTest.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Test/Case/Controller/CircularNoticesController/ParseAnswerTest.php b/Test/Case/Controller/CircularNoticesController/ParseAnswerTest.php index 8741440..a458e11 100644 --- a/Test/Case/Controller/CircularNoticesController/ParseAnswerTest.php +++ b/Test/Case/Controller/CircularNoticesController/ParseAnswerTest.php @@ -65,6 +65,7 @@ public function dataProviderParseAnswer() { 'reply_text_value' => 'Lorem ipsum dolor sit amet' ), ), + 'choices' => array() ), 'assert' => 'Lorem ipsum dolor sit amet' ); @@ -78,8 +79,14 @@ public function dataProviderParseAnswer() { 'reply_selection_value' => '1|3', ), ), + 'choices' => array( + 1 => array('id' => 1, 'value' => 'AAA'), + 2 => array('id' => 2, 'value' => 'BBB'), + 3 => array('id' => 3, 'value' => 'CCC'), + 4 => array('id' => 4, 'value' => 'DDD') + ) ), - 'assert' => '1、3' + 'assert' => 'AAA、CCC' ); return $results; @@ -103,7 +110,8 @@ public function testParseAnswer($data, $assert, $exception = null) { $result = $method->invoke( $stub, $data['CircularNoticeContent']['reply_type'], - $data['CircularNoticeTargetUser'] + $data['CircularNoticeTargetUser'], + $data['choices'] ); $this->assertEquals($result, $assert); } From 3fb2c3fd15b19b47b026da0ed9343cda90a0ee85 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 30 Jul 2021 19:34:28 +0900 Subject: [PATCH 07/28] =?UTF-8?q?change:=20test:=20TravisCI=E3=81=8B?= =?UTF-8?q?=E3=82=89GithubAction=E3=81=AB=E5=A4=89=E6=9B=B4=20https://gith?= =?UTF-8?q?ub.com/NetCommons3/NetCommons3/issues/1650?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tests.yml | 137 ++++++++++++++++++++++++++++++++++++ .travis.yml | 42 ----------- README.md | 14 +--- phpunit.xml.dist | 4 +- 4 files changed, 141 insertions(+), 56 deletions(-) create mode 100644 .github/workflows/tests.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..d6bd01e --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,137 @@ +on: + push: + branches: + - main + - master + - availability + pull_request: + branches: + - main + - master + - availability + +name: tests + +jobs: + tests: + name: tests + runs-on: ubuntu-18.04 + strategy: + matrix: + php: [ '7.1', '7.2', '7.3', '7.4' ] + + env: + NC3_BUILD_DIR: "/opt/nc3" + NC3_DOCKER_DIR: "/opt/docker" + NC3_GIT_URL: "git://github.com/NetCommons3/NetCommons3.git" + NC3_GIT_BRANCH: "master" + PLUGIN_BUILD_DIR: ${{ github.workspace }} + PHP_VERSION: ${{ matrix.php }} + MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: cakephp_test + + steps: + - uses: actions/checkout@v2 + + - name: environment + run: | + echo "GITHUB_WORKSPACE=${GITHUB_WORKSPACE}" + echo "PLUGIN_BUILD_DIR=${PLUGIN_BUILD_DIR}" + echo "PHP_VERSION=${PHP_VERSION}" + ls -al ${PLUGIN_BUILD_DIR} + + - name: docker-compose install + run: | + curl -L https://github.com/docker/compose/releases/download/1.11.2/docker-compose-`uname -s`-`uname -m` > ~/docker-compose + chmod +x ~/docker-compose + sudo mv ~/docker-compose /usr/local/bin/docker-compose + docker-compose --version + + - name: git clone nc3 + run: git clone -b ${NC3_GIT_BRANCH} ${NC3_GIT_URL} ${NC3_BUILD_DIR} + + - name: git clone nc3_docker + run: git clone https://github.com/NetCommons3/nc3app-docker.git ${NC3_DOCKER_DIR} + + - name: docker-compose start + run: | + cd ${NC3_DOCKER_DIR} + docker-compose up -d + docker-compose start + + - run: docker ps + + - name: check libraries + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/start-on-docker.sh + + - name: nc3 build + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/app-build.sh + + - name: phpcs (PHP CodeSniffer) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/phpcs.sh + + - name: phpmd (PHP Mess Detector) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/phpmd.sh + + - name: phpcpd (PHP Copy/Paste Detector) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/phpcpd.sh + + - name: gjslint (JavaScript Style Check) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/gjslint.sh + + - name: phpdoc (PHP Documentor) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/phpdoc.sh + + - name: phpunit (PHP UnitTest) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/phpunit.sh + sudo -s chmod a+w -R ${NC3_BUILD_DIR}/build + + - name: push coveralls + env: + COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COVERALLS_FLAG_NAME: ${{ matrix.php }} + run: | + cd ${NC3_BUILD_DIR} + ls -la ${NC3_BUILD_DIR} + vendors/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v + + - name: docker-compose remove + run: | + cd ${NC3_DOCKER_DIR} + docker-compose rm -f + + # テスト成功時はこちらのステップが実行される + - name: Slack Notification on Success + if: success() + uses: rtCamp/action-slack-notify@v2.2.0 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + SLACK_CHANNEL: notify-netcommons3 + SLACK_TITLE: "${{ github.repository }}(${{ matrix.php }})" + SLACK_COLOR: good + + # テスト失敗時はこちらのステップが実行される + - name: Slack Notification on Failure + uses: rtCamp/action-slack-notify@v2.2.0 + if: failure() + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + SLACK_CHANNEL: notify-netcommons3 + SLACK_TITLE: "${{ github.repository }}(${{ matrix.php }})" + SLACK_COLOR: danger diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1b2842c..0000000 --- a/.travis.yml +++ /dev/null @@ -1,42 +0,0 @@ -language: php - -php: - - 7.0 - - 7.1 - - 7.2 - - 7.3.24 - - 7.4 - -sudo: false -dist: trusty - -env: - matrix: - - NETCOMMONS_VERSION=master DB=mysql - global: - - secure: "gfM6LvQaWwrQEtqTT3eXv4RNKXF1UBZWuGlO8DHe8X+S/ocpM5oMPBI7pYzCEheIsRhRccciBUFOaXVcI/bFkUCWsgEarimZBkCpTisKX7MwlFSuJX+rX8QNhGqXrn5aUZZ6K8F92aLipsi+j3gwccgebgTh7wHWYtfkLAxdLUw=" - - GIT_COMMITTER_NAME=kitalab - - GIT_COMMITTER_EMAIL=kitatsuji.yuto@withone.co.jp - - GIT_AUTHOR_NAME=kitalab - - GIT_AUTHOR_EMAIL=kitatsuji.yuto@withone.co.jp - -before_script: - - export NETCOMMONS_BUILD_DIR=`dirname $TRAVIS_BUILD_DIR`/NetCommons3 - - git clone git://github.com/NetCommons3/NetCommons3 $NETCOMMONS_BUILD_DIR - - cd $NETCOMMONS_BUILD_DIR - - git checkout $NETCOMMONS_VERSION - - travis_wait . tools/build/plugins/cakephp/travis/pre.sh - - . tools/build/plugins/cakephp/travis/environment.sh - -script: - - . tools/build/plugins/cakephp/travis/main.sh - -after_script: - - . tools/build/plugins/cakephp/travis/post.sh - -notifications: - email: - recipients: - - netcommons3@googlegroups.com - on_success: never # default: change - on_failure: always # default: always diff --git a/README.md b/README.md index 9a2a20b..46a9136 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,6 @@ CircularNotices ======= -CircularNotices for NetComomns3 - -[![Build Status](https://travis-ci.org/NetCommons3/CircularNotices.svg?branch=master)](https://travis-ci.org/NetCommons3/CircularNotices) -[![Coverage Status](https://img.shields.io/coveralls/NetCommons3/CircularNotices.svg)](https://coveralls.io/r/NetCommons3/CircularNotices?branch=master) - -| dependencies | status | -| ------------ | ------ | -| composer.json | [![Dependency Status](https://www.versioneye.com/user/projects/54d34c21ee3836ec1000002a/badge.svg?style=flat)](https://www.versioneye.com/user/projects/54d34c21ee3836ec1000002a) | - - - +[![Tests Status](https://github.com/NetCommons3/CircularNotices/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/NetCommons3/CircularNotices/actions/workflows/tests.yml) +[![Coverage Status](https://coveralls.io/repos/NetCommons3/CircularNotices/badge.svg?branch=master)](https://coveralls.io/r/NetCommons3/CircularNotices?branch=master) +[![Stable Version](https://img.shields.io/packagist/v/netcommons/circular-notices.svg?label=stable)](https://packagist.org/packages/netcommons/circular-notices) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index c0bacd0..1154cd3 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -3,9 +3,6 @@ - - - app/Plugin/CircularNotices @@ -20,5 +17,6 @@ + From 3b69b8ae2a485c7a42a24905f366cbd133005387 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Tue, 3 Aug 2021 11:59:57 +0900 Subject: [PATCH 08/28] =?UTF-8?q?fix:=20test:=20UnitTest=E3=82=A8=E3=83=A9?= =?UTF-8?q?=E3=83=BC=E4=BF=AE=E6=AD=A3=20https://github.com/NetCommons3/Ne?= =?UTF-8?q?tCommons3/issues/1650?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ViewElementsCircularNoticeFrameSettingsEditFormController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticeFrameSettingsEditFormController.php b/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticeFrameSettingsEditFormController.php index 72f92c6..6c4f6dd 100644 --- a/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticeFrameSettingsEditFormController.php +++ b/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticeFrameSettingsEditFormController.php @@ -27,6 +27,7 @@ class TestViewElementsCircularNoticeFrameSettingsEditFormController extends AppC public $helpers = array( 'Mails.MailsHtml', 'Mails.MailForm', + 'NetCommons.DisplayNumber', ); /** From 260959d8dfb5b76681e2343a6cb333c8f136aae3 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Tue, 3 Aug 2021 12:34:07 +0900 Subject: [PATCH 09/28] =?UTF-8?q?fix:=20test:=20UnitTest=E3=82=A8=E3=83=A9?= =?UTF-8?q?=E3=83=BC=E4=BF=AE=E6=AD=A3=20https://github.com/NetCommons3/Ne?= =?UTF-8?q?tCommons3/issues/1650?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...wElementsCircularNoticesSubjectEditFormController.php | 9 +++++++++ ...ewElementsCircularNoticesTargetEditFormController.php | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticesSubjectEditFormController.php b/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticesSubjectEditFormController.php index d7ce550..f82f1ff 100644 --- a/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticesSubjectEditFormController.php +++ b/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticesSubjectEditFormController.php @@ -19,6 +19,15 @@ */ class TestViewElementsCircularNoticesSubjectEditFormController extends AppController { +/** + * use helpers + * + * @var array + */ + public $helpers = array( + 'Groups.GroupUserList', + ); + /** * subject_edit_form * diff --git a/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticesTargetEditFormController.php b/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticesTargetEditFormController.php index fa7fdb4..76b1585 100644 --- a/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticesTargetEditFormController.php +++ b/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticesTargetEditFormController.php @@ -19,6 +19,15 @@ */ class TestViewElementsCircularNoticesTargetEditFormController extends AppController { +/** + * use helpers + * + * @var array + */ + public $helpers = array( + 'NetCommons.TitleIcon', + ); + /** * target_edit_form * From a514725ee2a777332e9e273eea587e0172934973 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Tue, 3 Aug 2021 12:39:59 +0900 Subject: [PATCH 10/28] =?UTF-8?q?fix:=20test:=20UnitTest=E3=82=A8=E3=83=A9?= =?UTF-8?q?=E3=83=BC=E4=BF=AE=E6=AD=A3=20https://github.com/NetCommons3/Ne?= =?UTF-8?q?tCommons3/issues/1650?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...TestViewElementsCircularNoticesSubjectEditFormController.php | 2 +- .../TestViewElementsCircularNoticesTargetEditFormController.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticesSubjectEditFormController.php b/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticesSubjectEditFormController.php index f82f1ff..6fd88fb 100644 --- a/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticesSubjectEditFormController.php +++ b/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticesSubjectEditFormController.php @@ -25,7 +25,7 @@ class TestViewElementsCircularNoticesSubjectEditFormController extends AppContro * @var array */ public $helpers = array( - 'Groups.GroupUserList', + 'NetCommons.TitleIcon', ); /** diff --git a/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticesTargetEditFormController.php b/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticesTargetEditFormController.php index 76b1585..d6fa86a 100644 --- a/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticesTargetEditFormController.php +++ b/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticesTargetEditFormController.php @@ -25,7 +25,7 @@ class TestViewElementsCircularNoticesTargetEditFormController extends AppControl * @var array */ public $helpers = array( - 'NetCommons.TitleIcon', + 'Groups.GroupUserList', ); /** From 36923a094e8439e49bdc464d953ac0f98588c860 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Tue, 10 Aug 2021 23:03:53 +0900 Subject: [PATCH 11/28] =?UTF-8?q?change:=20test:=20Slack=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3,=20mysql8.0=E3=83=86=E3=82=B9=E3=83=88?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20https://github.com/NetCommons3/NetCommons3?= =?UTF-8?q?/issues/1650?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 35 ++++++++++++++++++++++++-- .github/workflows/tests.yml | 47 +++++++++++++++++++++++++---------- 2 files changed, 67 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a3225bc..592d72f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,16 +4,25 @@ on: tags: - '3*' -name: Create Release +name: create_release jobs: build: - name: Create Release + name: create_release runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v2 + - name: Slack Notification on Start + uses: rtCamp/action-slack-notify@v2.2.0 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_RELEASE }} + SLACK_CHANNEL: notify-nc3-release + SLACK_TITLE: "${{ github.repository }}" + SLACK_COLOR: "#f0ad4e" + SLACK_MESSAGE: "Start Job" + - name: Create Release id: create_release uses: actions/create-release@v1 @@ -26,3 +35,25 @@ jobs: NetCommons ${{ github.ref }} released. draft: false prerelease: false + + # テスト成功時はこちらのステップが実行される + - name: Slack Notification on Finish + uses: rtCamp/action-slack-notify@v2.2.0 + if: success() + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_RELEASE }} + SLACK_CHANNEL: notify-nc3-release + SLACK_TITLE: "${{ github.repository }}" + SLACK_COLOR: good + SLACK_MESSAGE: "Job Success" + + # テスト失敗時はこちらのステップが実行される + - name: Slack Notification on Failure + uses: rtCamp/action-slack-notify@v2.2.0 + if: failure() + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_RELEASE }} + SLACK_CHANNEL: notify-nc3-tests + SLACK_TITLE: "${{ github.repository }}" + SLACK_COLOR: danger + SLACK_MESSAGE: "Job Failure" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d6bd01e..1477ea2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,12 +13,26 @@ on: name: tests jobs: + setup: + name: setup + runs-on: ubuntu-18.04 + steps: + - name: Slack Notification on Start + uses: rtCamp/action-slack-notify@v2.2.0 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} + SLACK_CHANNEL: notify-nc3-tests + SLACK_TITLE: "${{ github.repository }}" + SLACK_COLOR: "#f0ad4e" + tests: name: tests + needs: setup runs-on: ubuntu-18.04 strategy: matrix: php: [ '7.1', '7.2', '7.3', '7.4' ] + mysql: [ '5.7', '8.0' ] env: NC3_BUILD_DIR: "/opt/nc3" @@ -27,6 +41,7 @@ jobs: NC3_GIT_BRANCH: "master" PLUGIN_BUILD_DIR: ${{ github.workspace }} PHP_VERSION: ${{ matrix.php }} + MYSQL_VERSION: ${{ matrix.mysql }} MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: cakephp_test @@ -38,6 +53,7 @@ jobs: echo "GITHUB_WORKSPACE=${GITHUB_WORKSPACE}" echo "PLUGIN_BUILD_DIR=${PLUGIN_BUILD_DIR}" echo "PHP_VERSION=${PHP_VERSION}" + echo "MYSQL_VERSION=${MYSQL_VERSION}" ls -al ${PLUGIN_BUILD_DIR} - name: docker-compose install @@ -116,22 +132,27 @@ jobs: cd ${NC3_DOCKER_DIR} docker-compose rm -f - # テスト成功時はこちらのステップが実行される - - name: Slack Notification on Success - if: success() - uses: rtCamp/action-slack-notify@v2.2.0 - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - SLACK_CHANNEL: notify-netcommons3 - SLACK_TITLE: "${{ github.repository }}(${{ matrix.php }})" - SLACK_COLOR: good - # テスト失敗時はこちらのステップが実行される - name: Slack Notification on Failure uses: rtCamp/action-slack-notify@v2.2.0 if: failure() env: - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - SLACK_CHANNEL: notify-netcommons3 - SLACK_TITLE: "${{ github.repository }}(${{ matrix.php }})" + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} + SLACK_CHANNEL: notify-nc3-tests + SLACK_TITLE: "${{ github.repository }}(php${{ matrix.php }}, mysql${{ matrix.mysql }})" SLACK_COLOR: danger + + teardown: + name: teardown + runs-on: ubuntu-18.04 + needs: tests + steps: + # テスト成功時はこちらのステップが実行される + - name: Slack Notification on Success + if: success() + uses: rtCamp/action-slack-notify@v2.2.0 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} + SLACK_CHANNEL: notify-nc3-tests + SLACK_TITLE: "${{ github.repository }}" + SLACK_COLOR: good From 48272245de828c052e9ed3d2575a4126f4eca475 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 13 Aug 2021 15:00:27 +0900 Subject: [PATCH 12/28] change: Version number to 3.3.4 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index 619b537..a0891f5 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -3.3.3 +3.3.4 From 5ef6f69fe1855bd9f241f354a5fc45c0755f04c3 Mon Sep 17 00:00:00 2001 From: RikaFujiwara Date: Wed, 25 Aug 2021 09:47:35 +0900 Subject: [PATCH 13/28] refs : /NetCommons3/NetCommons3/issues/1657 --- Controller/CircularNoticesController.php | 4 ++-- Model/CircularNoticeContent.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Controller/CircularNoticesController.php b/Controller/CircularNoticesController.php index 925a2f3..66bd39d 100644 --- a/Controller/CircularNoticesController.php +++ b/Controller/CircularNoticesController.php @@ -100,13 +100,13 @@ public function index() { } // コンテンツステータスの絞り込み値チェック - if (isset($this->params['named']['content_status']) + if (!empty($this->params['named']['content_status']) && ! $this->CircularNotice->existsContentStatus($this->params['named']['content_status'])) { return $this->throwBadRequest(); } // 回答状況の絞り込み値チェック - if (isset($this->params['named']['reply_status']) + if (!empty($this->params['named']['reply_status']) && ! $this->CircularNotice->existsReplyStatus($this->params['named']['reply_status'])) { return $this->throwBadRequest(); } diff --git a/Model/CircularNoticeContent.php b/Model/CircularNoticeContent.php index e47725f..c9c2131 100644 --- a/Model/CircularNoticeContent.php +++ b/Model/CircularNoticeContent.php @@ -375,7 +375,7 @@ public function getCircularNoticeContentsForPaginate($blockKey, $userId, $pagina ), ); - if (isset($paginatorParams['reply_status'])) { + if (!empty($paginatorParams['reply_status'])) { // 未回答の場合 if ($paginatorParams['reply_status'] == CircularNoticeComponent::CIRCULAR_NOTICE_CONTENT_STATUS_NOT_REPLIED) { @@ -387,7 +387,7 @@ public function getCircularNoticeContentsForPaginate($blockKey, $userId, $pagina $conditions['CircularNoticeContent.reply_status'] = (int)$paginatorParams['reply_status']; } } - if (isset($paginatorParams['content_status'])) { + if (!empty($paginatorParams['content_status'])) { $conditions['CircularNoticeContent.content_status'] = (int)$paginatorParams['content_status']; } From 09f0e0f23e0a88136c1d8ef6ab95b9e650bd55b7 Mon Sep 17 00:00:00 2001 From: RikaFujiwara Date: Wed, 25 Aug 2021 10:41:19 +0900 Subject: [PATCH 14/28] refs : /NetCommons3/NetCommons3/issues/1658 --- View/CircularNotices/index.ctp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/View/CircularNotices/index.ctp b/View/CircularNotices/index.ctp index 1f7ea24..5451225 100644 --- a/View/CircularNotices/index.ctp +++ b/View/CircularNotices/index.ctp @@ -79,6 +79,15 @@ element('CircularNotices/status_label', array( 'circularNoticeContent' => $circularNoticeContent['CircularNoticeContent']) ); ?> + + + +
+ + + CircularNotice->displayDate($circularNoticeContent['CircularNoticeContent']['reply_deadline']); ?> + +
From 4c2ee0e77a1c680d62aeb3b7d00b649b4d22b658 Mon Sep 17 00:00:00 2001 From: RikaFujiwara Date: Wed, 29 Sep 2021 09:38:47 +0900 Subject: [PATCH 15/28] =?UTF-8?q?fix=20:=20=E5=9B=9E=E7=AD=94=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E3=81=8C=E8=A1=A8=E7=A4=BA=E3=81=95=E3=82=8C=E3=81=AA?= =?UTF-8?q?=E3=81=84=20/NetCommons3/NetCommons3/issues/1663?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- View/CircularNotices/view.ctp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/View/CircularNotices/view.ctp b/View/CircularNotices/view.ctp index 3cae1fd..487e98e 100644 --- a/View/CircularNotices/view.ctp +++ b/View/CircularNotices/view.ctp @@ -24,6 +24,12 @@ ) ); ?> +
@@ -179,10 +185,8 @@ )); break; case CircularNoticeComponent::CIRCULAR_NOTICE_CONTENT_REPLY_TYPE_SELECTION: - $selections = array(); $selected = ''; foreach ($circularNoticeChoice as $choice) : - $selections[$choice['id']] = $choice['value']; if ($choice['id'] === $myAnswer['CircularNoticeTargetUser']['reply_selection_value']) : $selected = $choice['id']; endif; @@ -197,11 +201,9 @@ )); break; case CircularNoticeComponent::CIRCULAR_NOTICE_CONTENT_REPLY_TYPE_MULTIPLE_SELECTION: - $selections = array(); $selected = explode(CircularNoticeComponent::SELECTION_VALUES_DELIMITER, $myAnswer['CircularNoticeTargetUser']['reply_selection_value']); $selectedValue = array(); foreach ($circularNoticeChoice as $choices) : - $selections[$choices['id']] = $choices['value']; if (in_array($choices['id'], $selected, true)) : $selectedValue[] = $choices['value']; endif; From 0fb80fdc6bdba3527164839df273e3ee0172f39d Mon Sep 17 00:00:00 2001 From: RikaFujiwara Date: Wed, 29 Sep 2021 10:00:10 +0900 Subject: [PATCH 16/28] =?UTF-8?q?fix=20:=20=E8=A8=98=E8=BF=B0=E5=BC=8F?= =?UTF-8?q?=E5=9B=9E=E7=AD=94=E3=81=AE=E6=94=B9=E8=A1=8C=E3=81=8C=EF=BD=82?= =?UTF-8?q?=EF=BD=92=E3=81=A7=E8=A1=A8=E7=A4=BA=E3=81=95=E3=82=8C=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /NetCommons3/NetCommons3/issues/1667 --- View/CircularNotices/view.ctp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/View/CircularNotices/view.ctp b/View/CircularNotices/view.ctp index 487e98e..9fbf2fa 100644 --- a/View/CircularNotices/view.ctp +++ b/View/CircularNotices/view.ctp @@ -333,7 +333,7 @@ foreach ($circularNoticeChoice as $choice) { $answer = null; switch ($circularNoticeContent['reply_type']) { case CircularNoticeComponent::CIRCULAR_NOTICE_CONTENT_REPLY_TYPE_TEXT: - $answer = nl2br(h($circularNoticeTargetUser['CircularNoticeTargetUser']['reply_text_value'])); + $answer = $circularNoticeTargetUser['CircularNoticeTargetUser']['reply_text_value']; break; case CircularNoticeComponent::CIRCULAR_NOTICE_CONTENT_REPLY_TYPE_SELECTION: case CircularNoticeComponent::CIRCULAR_NOTICE_CONTENT_REPLY_TYPE_MULTIPLE_SELECTION: @@ -364,7 +364,7 @@ foreach ($circularNoticeChoice as $choice) { $this->NetCommonsHtml->handleLink($circularNoticeTargetUser, array('avatar' => true), array(), 'User'), array($readDatetime, array('class' => 'row-datetime')), array($replyDatetime, array('class' => 'row-datetime')), - array(h($answer), array('class' => 'circular-notices-reply-col circular-notices-word-break')), + array(nl2br(h($answer)), array('class' => 'circular-notices-reply-col circular-notices-word-break')), )); endforeach; ?> From 85a0e93ac65e718f1d74ca085e7ea67e1cb87638 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 13 Nov 2021 15:17:24 +0900 Subject: [PATCH 17/28] comment: Change release tags. --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 592d72f..96097ff 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,7 +32,7 @@ jobs: tag_name: ${{ github.ref }} release_name: ${{ github.ref }} body: | - NetCommons ${{ github.ref }} released. + ${{ github.repository }}@${{ github.ref }} released. draft: false prerelease: false From d2a3f665619b15750192e3afb7ebe99052f6a3cc Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 13 Nov 2021 17:29:26 +0900 Subject: [PATCH 18/28] comment: Change release tags. --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 96097ff..c55f5d1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,7 +32,7 @@ jobs: tag_name: ${{ github.ref }} release_name: ${{ github.ref }} body: | - ${{ github.repository }}@${{ github.ref }} released. + ${{ github.ref }} released. draft: false prerelease: false From b2159b37400c41c296c5b6c6ec00562751ace5e0 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 11 Feb 2022 18:32:33 +0900 Subject: [PATCH 19/28] change: Version number to 3.3.5 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index a0891f5..fa7adc7 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -3.3.4 +3.3.5 From 06d4004cd7428986ab5b365e028d6232d017d23f Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Wed, 27 Apr 2022 10:02:08 +0900 Subject: [PATCH 20/28] =?UTF-8?q?fix:=20=E4=B8=8D=E8=A6=81=E3=81=AA?= =?UTF-8?q?=E8=A8=AD=E5=AE=9A=E3=82=92=E5=89=8A=E9=99=A4=20https://github.?= =?UTF-8?q?com/researchmap/RmNetCommons3/issues/2722?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controller/CircularNoticesController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Controller/CircularNoticesController.php b/Controller/CircularNoticesController.php index 66bd39d..176c647 100644 --- a/Controller/CircularNoticesController.php +++ b/Controller/CircularNoticesController.php @@ -50,7 +50,7 @@ class CircularNoticesController extends CircularNoticesAppController { 'NetCommons.Permission' => array( //アクセスの権限 'allow' => array( - 'index,view,downloads' => 'content_readable', + //'index,view,downloads' => 'content_readable', 'add,edit,delete' => 'content_creatable', ), ), From 24c22b3fa635ec16ccb01caca17a5b139a472f94 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Wed, 27 Apr 2022 10:04:44 +0900 Subject: [PATCH 21/28] =?UTF-8?q?test:=20github=20actions=E3=81=AE?= =?UTF-8?q?=E3=82=A8=E3=83=A9=E3=83=BC=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tests.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1477ea2..9501566 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -48,6 +48,9 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Fix up git URLs + run: echo -e '[url "https://github.com/"]\n insteadOf = "git://github.com/"' >> ~/.gitconfig + - name: environment run: | echo "GITHUB_WORKSPACE=${GITHUB_WORKSPACE}" @@ -58,7 +61,7 @@ jobs: - name: docker-compose install run: | - curl -L https://github.com/docker/compose/releases/download/1.11.2/docker-compose-`uname -s`-`uname -m` > ~/docker-compose + curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m` > ~/docker-compose chmod +x ~/docker-compose sudo mv ~/docker-compose /usr/local/bin/docker-compose docker-compose --version From 8d4c60da546904f23ed4ebd1ea6f7f0529ecbb05 Mon Sep 17 00:00:00 2001 From: Ryuji AMANO Date: Sun, 27 Nov 2022 14:52:58 +0900 Subject: [PATCH 22/28] fix: edit problem --- Controller/CircularNoticesController.php | 6 ++++++ Test/Case/Controller/CircularNoticesController/EditTest.php | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Controller/CircularNoticesController.php b/Controller/CircularNoticesController.php index 176c647..42e0a3c 100644 --- a/Controller/CircularNoticesController.php +++ b/Controller/CircularNoticesController.php @@ -355,10 +355,16 @@ public function edit() { $key = $this->request->params['key']; $content = $this->CircularNoticeContent->getCircularNoticeContent($key, $userId); + // フレームから取得したCircularNoticeSetting.keyとコンテンツのcircularnotice_setting_keyが一致しない場合はBadRequest if (! $content) { return $this->throwBadRequest(); } + $settingKey = $this->viewVars['circularNoticeSetting']['CircularNoticeSetting']['key'] ?? null; + if ($content['CircularNoticeContent']['circular_notice_setting_key'] !== $settingKey) { + return $this->throwBadRequest(); + } + if ($this->CircularNoticeContent->canEditWorkflowContent($content) === false) { return $this->throwBadRequest(); } diff --git a/Test/Case/Controller/CircularNoticesController/EditTest.php b/Test/Case/Controller/CircularNoticesController/EditTest.php index 5c48253..0f52d19 100644 --- a/Test/Case/Controller/CircularNoticesController/EditTest.php +++ b/Test/Case/Controller/CircularNoticesController/EditTest.php @@ -93,6 +93,7 @@ public function dataProviderEdit() { $results[0] = array( 'urlOptions' => Hash::insert($data, 'frame_id', ''), 'assert' => null, + 'exception' => 'BadRequestException' ); $results[1] = array( 'urlOptions' => Hash::insert($data, 'key', 'A'), @@ -105,7 +106,8 @@ public function dataProviderEdit() { ); $results[3] = array( 'urlOptions' => Hash::insert($data, 'key', 'circular_notice_content_4'), - 'assert' => array('method' => 'assertNotEmpty'), + 'assert' => null, + 'exception' => 'BadRequestException' ); return $results; From eb801d15e9a4288c652e76b7117444cb2be6d462 Mon Sep 17 00:00:00 2001 From: Ryuji AMANO Date: Sun, 27 Nov 2022 16:28:44 +0900 Subject: [PATCH 23/28] =?UTF-8?q?comment:=20phpmd=E6=8A=91=E6=AD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controller/CircularNoticesController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Controller/CircularNoticesController.php b/Controller/CircularNoticesController.php index 42e0a3c..f7f9b8a 100644 --- a/Controller/CircularNoticesController.php +++ b/Controller/CircularNoticesController.php @@ -347,6 +347,7 @@ public function add() { * edit action * * @return void + * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ public function edit() { $userId = Current::read('User.id'); @@ -355,11 +356,11 @@ public function edit() { $key = $this->request->params['key']; $content = $this->CircularNoticeContent->getCircularNoticeContent($key, $userId); - // フレームから取得したCircularNoticeSetting.keyとコンテンツのcircularnotice_setting_keyが一致しない場合はBadRequest if (! $content) { return $this->throwBadRequest(); } + // フレームから取得したCircularNoticeSetting.keyとコンテンツのcircular_notice_setting_keyが一致しない場合はBadRequest $settingKey = $this->viewVars['circularNoticeSetting']['CircularNoticeSetting']['key'] ?? null; if ($content['CircularNoticeContent']['circular_notice_setting_key'] !== $settingKey) { return $this->throwBadRequest(); From eb5b7e6ac0b32746632d45541c2868afbe410924 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 24 Feb 2023 13:34:30 +0900 Subject: [PATCH 24/28] =?UTF-8?q?test:=20Github=20Action=E3=82=A8=E3=83=A9?= =?UTF-8?q?=E3=83=BC=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9501566..7cfa881 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -44,6 +44,7 @@ jobs: MYSQL_VERSION: ${{ matrix.mysql }} MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: cakephp_test + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@v2 From ab3efcbb49f09ba907f5c2f1b4a2e7d7b784f452 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 24 Feb 2023 22:13:23 +0900 Subject: [PATCH 25/28] =?UTF-8?q?test:=20Github=20Action=E3=82=A8=E3=83=A9?= =?UTF-8?q?=E3=83=BC=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Test/Case/AllCircularNoticesTest.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Test/Case/AllCircularNoticesTest.php b/Test/Case/AllCircularNoticesTest.php index 2eb94dc..18e66eb 100644 --- a/Test/Case/AllCircularNoticesTest.php +++ b/Test/Case/AllCircularNoticesTest.php @@ -9,6 +9,8 @@ * @copyright Copyright 2014, NetCommons Project */ +App::uses('NetCommonsTestSuite', 'NetCommons.TestSuite'); + /** * CircularNotices All Test Case * @@ -25,7 +27,7 @@ class AllCircularNoticesTest extends CakeTestSuite { */ public static function suite() { $plugin = preg_replace('/^All([\w]+)Test$/', '$1', __CLASS__); - $suite = new CakeTestSuite(sprintf('All %s Plugin tests', $plugin)); + $suite = new NetCommonsTestSuite(sprintf('All %s Plugin tests', $plugin)); $suite->addTestDirectoryRecursive(CakePlugin::path($plugin) . 'Test' . DS . 'Case'); return $suite; } From 8df92999c436020754bb97c17d306d5b6004baac Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 25 Feb 2023 21:37:28 +0900 Subject: [PATCH 26/28] change: Version number to 3.3.6 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index fa7adc7..9c25013 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -3.3.5 +3.3.6 From f1b993bfe206ae583960368aaedf45a74b84bf6f Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Thu, 5 Oct 2023 17:17:03 +0900 Subject: [PATCH 27/28] =?UTF-8?q?test:=20github=20action=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tests.yml | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7cfa881..eb2068b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,10 +15,11 @@ name: tests jobs: setup: name: setup - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest steps: - name: Slack Notification on Start uses: rtCamp/action-slack-notify@v2.2.0 + if: env.SLACK_WEBHOOK != '' env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} SLACK_CHANNEL: notify-nc3-tests @@ -28,7 +29,7 @@ jobs: tests: name: tests needs: setup - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest strategy: matrix: php: [ '7.1', '7.2', '7.3', '7.4' ] @@ -92,46 +93,53 @@ jobs: docker-compose exec -T nc3app bash /opt/scripts/app-build.sh - name: phpcs (PHP CodeSniffer) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/phpcs.sh - name: phpmd (PHP Mess Detector) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/phpmd.sh - name: phpcpd (PHP Copy/Paste Detector) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/phpcpd.sh - name: gjslint (JavaScript Style Check) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/gjslint.sh - name: phpdoc (PHP Documentor) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/phpdoc.sh - name: phpunit (PHP UnitTest) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/phpunit.sh sudo -s chmod a+w -R ${NC3_BUILD_DIR}/build - - name: push coveralls - env: - COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COVERALLS_FLAG_NAME: ${{ matrix.php }} - run: | - cd ${NC3_BUILD_DIR} - ls -la ${NC3_BUILD_DIR} - vendors/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v +# - name: push coveralls +# env: +# COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# COVERALLS_FLAG_NAME: ${{ matrix.php }} +# run: | +# cd ${NC3_BUILD_DIR} +# ls -la ${NC3_BUILD_DIR} +# vendors/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v - name: docker-compose remove + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose rm -f @@ -139,7 +147,7 @@ jobs: # テスト失敗時はこちらのステップが実行される - name: Slack Notification on Failure uses: rtCamp/action-slack-notify@v2.2.0 - if: failure() + if: env.SLACK_WEBHOOK != '' && failure() env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} SLACK_CHANNEL: notify-nc3-tests @@ -148,13 +156,13 @@ jobs: teardown: name: teardown - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest needs: tests steps: # テスト成功時はこちらのステップが実行される - name: Slack Notification on Success - if: success() uses: rtCamp/action-slack-notify@v2.2.0 + if: env.SLACK_WEBHOOK != '' && success() env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} SLACK_CHANNEL: notify-nc3-tests From a8342737bea0b41e212975a2c6e156134acc7f08 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Mon, 9 Oct 2023 15:53:53 +0900 Subject: [PATCH 28/28] change: Version number to 3.3.7 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index 9c25013..86fb650 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -3.3.6 +3.3.7