Skip to content

Commit

Permalink
OXDEV-8316 Minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
tkcreateit committed Oct 11, 2024
1 parent fa45b92 commit 031b2c3
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 13 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [v3.2.0] - Unreleased

### Changed
- Controller name `oemtgreeting` to `oemt_greeting` making it consistent with the other one (`oemt_admin_greeting`)

### Removed
- PHP 8.1 support removed

Expand Down
22 changes: 18 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,24 @@ like OXID suggests it could be implemented.

This module also comes with all the quality tools OXID recommends to use.

## Table of contents
1. [Branch compatibility](#branch-compatibility)
1. [Installation](#installation)
1. [Install and try it out](#install-and-try-it-out)
1. [Use as a base for own module](#use-as-a-base-for-own-module)
1. [Development installation](#development-installation)
1. [Idea](#idea)
1. [Things to be aware of](#things-to-be-aware-of)
1. [Running tests and quality tools](#running-tests-and-quality-tools)
1. [Additional info](#additional-info)

## Branch compatibility

* b-6.4.x branch is compatible with OXID eShop compilation b-6.4.x
* b-6.5.x branch / v1.0.0 version - compatible with OXID eShop compilation b-6.5.x
* b-7.0.x branch / v2.x version - compatible with OXID eShop compilation b-7.0.x
* b-7.1.x branch / v3.x version - compatible with OXID eShop compilation 7.1.x and the respective branch
* b-7.1.x branch / v3.x version - compatible with OXID eShop compilation 7.1.x
* b-7.2.x branch - compatible with OXID eShop compilation 7.2.x

## Installation

Expand Down Expand Up @@ -110,7 +122,7 @@ installation for development process:
2. Clone your created repository to your local shop modules directory:
```
cd <shopRoot>
git clone <yourModuleGithubRepositoryUrl> source/modules/<yourVendorPrefix>/<yourModuleRootDirectory> --branch=b-7.0.x
git clone <yourModuleGithubRepositoryUrl> source/modules/<yourVendorPrefix>/<yourModuleRootDirectory> --branch=b-7.2.x
```

3. Next step is to personalize the original OXID traces with your own vendor, module id, namespace etc. We prepared
Expand Down Expand Up @@ -173,7 +185,7 @@ Installation example for improving and develop the current module is provided he
1. Clone the module
```
cd <shopRoot>
git clone https://github.com/OXID-eSales/module-template source/modules/oe/moduletemplate --branch=b-7.0.x
git clone https://github.com/OXID-eSales/module-template source/modules/oe/moduletemplate --branch=b-7.2.x
```
2. Install the module from local path
Expand Down Expand Up @@ -227,7 +239,7 @@ Put module business logic to a service (which make it easier to test as well) an
If you need to extend the shop class chain by overwriting, try to stick to the public methods.

#### Sometimes we need to bring our own
* own module controller (`oemtgreeting` with own template and own translations)
* own module controller (`oemt_greeting` with own template and own translations)
* own module admin controller (`oemt_admin_greeting` with own template and own translations)
* module setting (`oemoduletemplate_GreetingMode`)
* event subscriber (`OxidEsales\ModuleTemplate\Tracker\Subscriber\BeforeModelUpdate`)
Expand Down Expand Up @@ -390,6 +402,8 @@ be excluded as well.

Ps: a failing shop test might also turn up issues in your module, in that case fix the module and let the test live ;)

## Additional info

### Useful links

* Vendor home page - https://www.oxid-esales.com
Expand Down
6 changes: 1 addition & 5 deletions bin/cleanexamples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,19 @@ rm -rf ./src/*
touch ./src/.gitkeep

#clean out tests
mv ./tests/Codeception/Acceptance/ExampleCest.php ./tests/Codeception/Acceptance/ExampleCest.bak
mv ./tests/Codeception/Acceptance/_bootstrap.php ./tests/Codeception/Acceptance/_bootstrap.bak
rm -rf ./tests/Codeception/Acceptance/*.php
mv ./tests/Codeception/Acceptance/ExampleCest.bak ./tests/Codeception/Acceptance/ExampleCest.php
mv ./tests/Codeception/Acceptance/_bootstrap.bak ./tests/Codeception/Acceptance/_bootstrap.php

mv ./tests/Integration/ExampleTest.php ./tests/ExampleTest.bak
rm -rf ./tests/Integration/*
mv ./tests/ExampleTest.bak ./tests/Integration/ExampleTest.php

mv ./tests/Unit/ExampleTest.php ./tests/ExampleTest.bak
rm -rf ./tests/Unit/*
mv ./tests/ExampleTest.bak ./tests/Unit/ExampleTest.php

perl -pi\
-e 's#paths:.*#paths: "Application/views/flow/translations,Application/views/admin"#g;'\
./tests/Codeception/acceptance.suite.yml
./tests/Codeception/Acceptance.suite.yml

echo
echo 'Cleanup done. Now it is your turn to fill the module with code.'
2 changes: 1 addition & 1 deletion metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
\OxidEsales\Eshop\Application\Model\User::class => \OxidEsales\ModuleTemplate\Extension\Model\User::class,
],
'controllers' => [
'oemtgreeting' => \OxidEsales\ModuleTemplate\Greeting\Controller\GreetingController::class,
'oemt_greeting' => \OxidEsales\ModuleTemplate\Greeting\Controller\GreetingController::class,
'oemt_admin_greeting' => \OxidEsales\ModuleTemplate\Greeting\Controller\Admin\GreetingAdminController::class,
],
'events' => [
Expand Down
2 changes: 1 addition & 1 deletion tests/Codeception/Acceptance/UpdateGreetingCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function testAnonymousUserAccessingModuleController(AcceptanceTester $I):
$I->wantToTest('not logged in user accessing module controller');

$I->openShop();
$I->amOnUrl($I->getShopUrl() . '?cl=oemtgreeting');
$I->amOnUrl($I->getShopUrl() . '?cl=oemt_greeting');

$I->see(Translator::translate('OEMODULETEMPLATE_GREETING_UPDATE_COUNT') . '0');
$I->fillField(ModuleCore::OEMT_GREETING_TEMPLATE_VARNAME, 'Hi shopping addict');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<!-- Allow logged in user to change his greeting text -->
{% if oView.canUpdateOemtGreeting() %}
<!-- Use seo_url function to output SEO style url -->
<a id='oemt_update_greeting' class="btn btn-primary" href="{{ seo_url({ ident: oViewConf.getSelfLink()|cat("cl=oemtgreeting") }) }}">{{ translate({ ident: "OEMODULETEMPLATE_GREETING_UPDATE" }) }}</a>
<a id='oemt_update_greeting' class="btn btn-primary" href="{{ seo_url({ ident: oViewConf.getSelfLink() ~ "cl=oemt_greeting" }) }}">{{ translate({ ident: "OEMODULETEMPLATE_GREETING_UPDATE" }) }}</a>
{% endif %}
</p>

Expand Down
2 changes: 1 addition & 1 deletion views/twig/templates/greetingtemplate.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<form action="{{ oViewConf.getSelfActionLink() }}" name="OxsampleDoSomethingAction" method="post" role="form">
<div class="hidden">
{{ oViewConf.getHiddenSid()|raw }}
<input type="hidden" name="cl" value="oemtgreeting">
<input type="hidden" name="cl" value="oemt_greeting">
<input type="hidden" name="fnc" value="updateGreeting">
</div>
<div>
Expand Down

0 comments on commit 031b2c3

Please sign in to comment.