diff --git a/.gitattributes b/.gitattributes index 3a01b37..c1108e7 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,5 @@ +/.github/ export-ignore +/Build/ export-ignore +/Tests/ export-ignore /.gitattributes export-ignore /.gitignore export-ignore diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c0b0ea..a870292 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -97,13 +97,13 @@ jobs: -p ${{ matrix.packages.php }} \ -s composerValidate -# - name: Functional tests with sqlite -# run: | -# Build/Scripts/runTests.sh \ -# -p ${{ matrix.packages.php }} \ -# -d sqlite \ -# -s functional ${{ matrix.packages.testpath }} -# + - name: Functional tests with sqlite + run: | + Build/Scripts/runTests.sh \ + -p ${{ matrix.packages.php }} \ + -d sqlite \ + -s functional ${{ matrix.packages.testpath }} + # - name: Unit tests with sqlite # run: | # Build/Scripts/runTests.sh \ diff --git a/Build/Scripts/additionalTests.sh b/Build/Scripts/additionalTests.sh index 86b29a3..c809c7d 100755 --- a/Build/Scripts/additionalTests.sh +++ b/Build/Scripts/additionalTests.sh @@ -430,7 +430,6 @@ additionalCleanTestFiles() { rm -rf \ .cache \ bin/ \ - Build/phpunit \ Build/vendor/ \ Build/Web/ \ Documentation-GENERATED-temp/ \ diff --git a/Build/Scripts/test.sh b/Build/Scripts/test.sh index b6d332a..0fc66e7 100755 --- a/Build/Scripts/test.sh +++ b/Build/Scripts/test.sh @@ -102,11 +102,11 @@ runFunctionalTests () { -s composerValidate || exit 1 ; \ EXIT_CODE_VALIDATE=$? -# ./runTests.sh \ -# -p ${PHP_VERSION} \ -# -d sqlite \ -# -s functional ${TEST_PATH} || exit 1 ; \ -# EXIT_CODE_FUNCTIONAL=$? + ./runTests.sh \ + -p ${PHP_VERSION} \ + -d sqlite \ + -s functional ${TEST_PATH} || exit 1 ; \ + EXIT_CODE_FUNCTIONAL=$? echo "###########################################################################" >&2 echo " Finished unit and/or functional tests with" >&2 diff --git a/Build/phpunit/FunctionalTests.xml b/Build/phpunit/FunctionalTests.xml new file mode 100644 index 0000000..0afe47f --- /dev/null +++ b/Build/phpunit/FunctionalTests.xml @@ -0,0 +1,46 @@ + + + + + + + ../../../../../../typo3/sysext/*/Tests/Functional/ + + + + + + + diff --git a/Build/phpunit/FunctionalTestsBootstrap.php b/Build/phpunit/FunctionalTestsBootstrap.php new file mode 100644 index 0000000..9882f8f --- /dev/null +++ b/Build/phpunit/FunctionalTestsBootstrap.php @@ -0,0 +1,31 @@ +defineOriginalRootPath(); + $testbase->createDirectory(ORIGINAL_ROOT . 'typo3temp/var/tests'); + $testbase->createDirectory(ORIGINAL_ROOT . 'typo3temp/var/transient'); +})(); diff --git a/Classes/EventListener/BeforeContainerConfigurationIsAppliedListener.php b/Classes/EventListener/BeforeContainerConfigurationIsAppliedListener.php index dc67c61..5cc04e8 100644 --- a/Classes/EventListener/BeforeContainerConfigurationIsAppliedListener.php +++ b/Classes/EventListener/BeforeContainerConfigurationIsAppliedListener.php @@ -23,16 +23,8 @@ class BeforeContainerConfigurationIsAppliedListener #[AsEventListener('collapsible-container-beforecontainer', BeforeContainerConfigurationIsAppliedEvent::class)] public function __invoke(BeforeContainerConfigurationIsAppliedEvent $event): void { - $containerConfiguration = $event->getContainerConfiguration(); - - $containerConfiguration->setGridTemplate( - 'EXT:ew_collapsible_container/Resources/Private/Templates/Grid.html' + $event->getContainerConfiguration()->addGridPartialPath( + 'EXT:ew_collapsible_container/Resources/Private/Partials/' ); - - $containerConfiguration->setGridPartialPaths([ - 'EXT:backend/Resources/Private/Partials/', - 'EXT:container/Resources/Private/Partials/', - 'EXT:ew_collapsible_container/Resources/Private/Partials/', - ]); } } diff --git a/Classes/EventListener/BeforeContainerPreviewIsRenderedListener.php b/Classes/EventListener/BeforeContainerPreviewIsRenderedListener.php index a255886..dff3f5d 100644 --- a/Classes/EventListener/BeforeContainerPreviewIsRenderedListener.php +++ b/Classes/EventListener/BeforeContainerPreviewIsRenderedListener.php @@ -21,9 +21,15 @@ use Evoweb\EwCollapsibleContainer\Xclass\ContainerGridColumn; use TYPO3\CMS\Core\Attribute\AsEventListener; use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; +use TYPO3\CMS\Core\Page\JavaScriptModuleInstruction; +use TYPO3\CMS\Core\Page\PageRenderer; class BeforeContainerPreviewIsRenderedListener { + public function __construct(protected PageRenderer $pageRenderer) + { + } + #[AsEventListener('collapsible-container-beforepreview', BeforeContainerPreviewIsRenderedEvent::class)] public function __invoke(BeforeContainerPreviewIsRenderedEvent $event): void { @@ -38,6 +44,8 @@ public function __invoke(BeforeContainerPreviewIsRenderedEvent $event): void 'showMinItemsWarning' => $this->getShowMinItemsWarning($column, $countOfHiddenItems) ]); } + + $this->addFrontendResources(); } protected function getCountOfHiddenItems(ContainerGridColumn $columnObject): int @@ -71,6 +79,14 @@ protected function getShowMinItemsWarning(ContainerGridColumn $columnObject, int return $itemCount > 0 && ($itemCount - $hiddenItemCount) < $minItems; } + protected function addFrontendResources(): void + { + $this->pageRenderer->addCssFile('EXT:ew_collapsible_container/Resources/Public/Css/container.css'); + $this->pageRenderer->getJavaScriptRenderer()->addJavaScriptModuleInstruction( + JavaScriptModuleInstruction::create('@evoweb/ew-collapsible-container/container.js') + ); + } + protected function getBackendUser(): BackendUserAuthentication { return $GLOBALS['BE_USER']; diff --git a/Documentation/guides.xml b/Documentation/guides.xml index 8cc20c8..4268397 100644 --- a/Documentation/guides.xml +++ b/Documentation/guides.xml @@ -16,8 +16,8 @@ interlink-shortcode="evoweb/sf-books" /> diff --git a/Resources/Private/Partials/PageLayout/Grid/ColumnHeader.html b/Resources/Private/Partials/PageLayout/Grid/ColumnHeader.html index 4e167b1..f353971 100644 --- a/Resources/Private/Partials/PageLayout/Grid/ColumnHeader.html +++ b/Resources/Private/Partials/PageLayout/Grid/ColumnHeader.html @@ -39,22 +39,20 @@ - - - - - - - - + + + + + + @@ -73,14 +71,12 @@ - - - - - - {f:translate(key: 'LLL:EXT:ew_collapsible_container/Resources/Private/Language/locallang.xlf:contentcollapsed')} - - + + + + + {f:translate(key: 'LLL:EXT:ew_collapsible_container/Resources/Private/Language/locallang.xlf:contentcollapsed')} +