Skip to content

Commit

Permalink
Merge branch 'features/sylius-theme' into pimcore7
Browse files Browse the repository at this point in the history
remove pimcore 6.9 allowance, too hard to make compatible
  • Loading branch information
dpfaffenbauer committed Nov 23, 2020
2 parents 394d465 + 5247fea commit a476b38
Show file tree
Hide file tree
Showing 55 changed files with 313 additions and 744 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
strategy:
matrix:
php: [7.3, 7.4]
pimcore: [^6.9.0, 7.0.x-dev]
pimcore: [7.0.x-dev]

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/behat_ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
strategy:
matrix:
php: [7.3, 7.4]
pimcore: [^6.9, 7.0.x-dev]
pimcore: [7.0.x-dev]

steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/stan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ jobs:
strategy:
matrix:
php: [7.3, 7.4]
pimcore: [^6.9.0, 7.0.x-dev]
pimcore: [7.0.x-dev]

steps:
- uses: actions/checkout@v2

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.2
php-version: ${{ matrix.php }}
extensions: intl

- name: Copy parameters.yml
Expand Down
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ build:
- php-scrutinizer-run
dependencies:
override:
- composer install --no-interaction --no-scripts
- COMPOSER_MEMORY_LIMIT=-1 composer install --no-interaction --no-scripts
tools:
php_mess_detector:
config:
Expand Down
3 changes: 3 additions & 0 deletions app/Resources/themes/test-theme/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name": "coreshop/test-theme"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% extends '@CoreShopFrontend/layout-column.html.twig' %}

{% block center %}

{% endblock %}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"gedmo/doctrine-extensions": "^2.4.12",
"jms/serializer-bundle": "^2.0",
"knplabs/knp-menu-bundle": "^2.2.0",
"liip/theme-bundle": "^1.4",
"sylius/theme-bundle": "^2.0",
"payum/offline": "^1.4",
"payum/paypal-express-checkout-nvp": "^1.4",
"payum/payum-bundle": "^2.2",
Expand Down
10 changes: 3 additions & 7 deletions src/CoreShop/Behat/Context/Domain/ThemeContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,29 @@

use Behat\Behat\Context\Context;
use CoreShop\Behat\Service\SharedStorageInterface;
use CoreShop\Bundle\ThemeBundle\Service\ActiveThemeInterface;
use CoreShop\Bundle\ThemeBundle\Service\ThemeResolverInterface;
use Webmozart\Assert\Assert;

final class ThemeContext implements Context
{
private $sharedStorage;
private $themeResolver;
private $activeTheme;

public function __construct(
SharedStorageInterface $sharedStorage,
ThemeResolverInterface $themeResolver,
ActiveThemeInterface $activeTheme
ThemeResolverInterface $themeResolver
) {
$this->sharedStorage = $sharedStorage;
$this->themeResolver = $themeResolver;
$this->activeTheme = $activeTheme;
}

/**
* @Then /^the current theme name should be "([^"]+)"$/
*/
public function currentThemeNameIs(string $currentThemeName)
{
$this->themeResolver->resolveTheme($this->activeTheme);
$theme = $this->themeResolver->resolveTheme();

Assert::same($this->activeTheme->getActiveTheme(), $currentThemeName);
Assert::same($theme, $currentThemeName);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ services:
arguments:
- '@coreshop.behat.shared_storage'
- '@coreshop.theme.resolver'
- '@CoreShop\Bundle\ThemeBundle\Service\ActiveThemeInterface'
tags:
- { name: fob.context_service }

Expand Down
2 changes: 1 addition & 1 deletion src/CoreShop/Bundle/AddressBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"php": "^7.2",
"coreshop/address": "^3.0",
"coreshop/resource-bundle": "^3.0",
"pimcore/pimcore": "^6.9.0 | ^7.0.0"
"pimcore/pimcore": "^7.0.0"
},
"config": {
"bin-dir": "bin"
Expand Down
2 changes: 1 addition & 1 deletion src/CoreShop/Bundle/ConfigurationBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"php": "^7.2",
"coreshop/configuration": "^3.0",
"coreshop/resource-bundle": "^3.0",
"pimcore/pimcore": "^6.9.0 | ^7.0.0"
"pimcore/pimcore": "^7.0.0"
},
"config": {
"bin-dir": "bin"
Expand Down
2 changes: 1 addition & 1 deletion src/CoreShop/Bundle/CoreBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"coreshop/core": "^3.0",
"fzaninotto/faker": "^1.6",
"rinvex/countries": "^6.0",
"pimcore/pimcore": "^6.9.0 | ^7.0.0"
"pimcore/pimcore": "^7.0.0"
},
"config": {
"bin-dir": "bin"
Expand Down
2 changes: 1 addition & 1 deletion src/CoreShop/Bundle/CurrencyBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"php": "^7.2",
"coreshop/currency": "^3.0",
"coreshop/resource-bundle": "^3.0",
"pimcore/pimcore": "^6.9.0 | ^7.0.0"
"pimcore/pimcore": "^7.0.0"
},
"config": {
"bin-dir": "bin"
Expand Down
2 changes: 1 addition & 1 deletion src/CoreShop/Bundle/CustomerBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"php": "^7.2",
"coreshop/customer": "^3.0",
"coreshop/resource-bundle": "^3.0",
"pimcore/pimcore": "^6.9.0 | ^7.0.0"
"pimcore/pimcore": "^7.0.0"
},
"config": {
"bin-dir": "bin"
Expand Down
2 changes: 1 addition & 1 deletion src/CoreShop/Bundle/IndexBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"coreshop/registry": "^3.0",
"coreshop/resource-bundle": "^3.0",
"coreshop/menu-bundle": "^3.0",
"pimcore/pimcore": "^6.9.0 | ^7.0.0"
"pimcore/pimcore": "^7.0.0"
},
"conflict": {
"dpfaffenbauer/process-manager": "<2.4"
Expand Down
2 changes: 1 addition & 1 deletion src/CoreShop/Bundle/MenuBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"require": {
"php": "^7.2",
"pimcore/pimcore": "^6.9.0 | ^7.0.0",
"pimcore/pimcore": "^7.0.0",
"knplabs/knp-menu-bundle": "^2.2.0"
},
"config": {
Expand Down
2 changes: 1 addition & 1 deletion src/CoreShop/Bundle/MoneyBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"php": "^7.2",
"coreshop/currency": "^3.0",
"coreshop/pimcore-bundle": "^3.0",
"pimcore/pimcore": "^6.9.0 | ^7.0.0"
"pimcore/pimcore": "^7.0.0"
},
"config": {
"bin-dir": "bin"
Expand Down
2 changes: 1 addition & 1 deletion src/CoreShop/Bundle/NotificationBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"coreshop/notification": "^3.0",
"coreshop/registry": "^3.0",
"coreshop/rule-bundle": "^3.0",
"pimcore/pimcore": "^6.9.0 | ^7.0.0"
"pimcore/pimcore": "^7.0.0"
},
"config": {
"bin-dir": "bin"
Expand Down
14 changes: 13 additions & 1 deletion src/CoreShop/Bundle/OrderBundle/Controller/OrderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,19 @@ protected function getPayments(OrderInterface $order)
continue;
}
if (is_array($detailValue)) {
$detailValue = join(', ', $detailValue);
$detailValue = implode(', ', $detailValue);
}

if (true === is_bool($detailValue)) {
if (true === $detailValue) {
$detailValue = 'true';
} else {
$detailValue = 'false';
}
}

if (false === is_string($detailValue)) {
$detailValue = (string)$detailValue;
}

$details[] = [$detailName, $detailValue ? htmlentities($detailValue) : ''];
Expand Down
2 changes: 1 addition & 1 deletion src/CoreShop/Bundle/OrderBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"coreshop/store-bundle": "^3.0",
"coreshop/money-bundle": "^3.0",
"coreshop/workflow-bundle": "^3.0",
"pimcore/pimcore": "^6.9.0 | ^7.0.0"
"pimcore/pimcore": "^7.0.0"
},
"config": {
"bin-dir": "bin"
Expand Down
2 changes: 1 addition & 1 deletion src/CoreShop/Bundle/PaymentBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"coreshop/currency-bundle": "^3.0",
"coreshop/resource-bundle": "^3.0",
"coreshop/workflow-bundle": "^3.0",
"pimcore/pimcore": "^6.9.0 | ^7.0.0"
"pimcore/pimcore": "^7.0.0"
},
"config": {
"bin-dir": "bin"
Expand Down
2 changes: 1 addition & 1 deletion src/CoreShop/Bundle/PayumBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"payum/sofort": "^1.4",
"payum/paypal-express-checkout-nvp": "^1.4",
"php-http/guzzle6-adapter": "^2.0",
"pimcore/pimcore": "^6.9.0 | ^7.0.0"
"pimcore/pimcore": "^7.0.0"
},
"config": {
"bin-dir": "bin"
Expand Down
2 changes: 1 addition & 1 deletion src/CoreShop/Bundle/ProductBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"coreshop/rule-bundle": "^3.0",
"coreshop/resource-bundle": "^3.0",
"coreshop/money-bundle": "^3.0",
"pimcore/pimcore": "^6.9.0 | ^7.0.0"
"pimcore/pimcore": "^7.0.0"
},
"config": {
"bin-dir": "bin"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"coreshop/product-quantity-price-rules": "^3.0",
"coreshop/rule-bundle": "^3.0",
"coreshop/money-bundle": "^3.0",
"pimcore/pimcore": "^6.9.0 | ^7.0.0"
"pimcore/pimcore": "^7.0.0"
},
"config": {
"bin-dir": "bin"
Expand Down
2 changes: 1 addition & 1 deletion src/CoreShop/Bundle/ResourceBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"symfony/validator": "^4.3",
"symfony/yaml": "^4.3",
"gedmo/doctrine-extensions": "^2.4.12",
"pimcore/pimcore": "^6.9.0 | ^7.0.0"
"pimcore/pimcore": "^7.0.0"
},
"config": {
"bin-dir": "bin"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ services:
CoreShop\Bundle\StoreBundle\Theme\StoreThemeResolver:
arguments:
- '@CoreShop\Component\Store\Context\StoreContextInterface'
- '@coreshop.repository.store'
tags:
- { name: coreshop.theme.resolver, type: coreshop_store, priority: 20 }
32 changes: 4 additions & 28 deletions src/CoreShop/Bundle/StoreBundle/Theme/StoreThemeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,54 +14,30 @@

namespace CoreShop\Bundle\StoreBundle\Theme;

use CoreShop\Bundle\ThemeBundle\Service\ActiveThemeInterface;
use CoreShop\Bundle\ThemeBundle\Service\ThemeNotResolvedException;
use CoreShop\Bundle\ThemeBundle\Service\ThemeResolverInterface;
use CoreShop\Component\Resource\Repository\RepositoryInterface;
use CoreShop\Component\Store\Context\StoreContextInterface;
use CoreShop\Component\Store\Context\StoreNotFoundException;
use CoreShop\Component\Store\Model\StoreInterface;

final class StoreThemeResolver implements ThemeResolverInterface
{
private $storeContext;
private $storeRepository;

public function __construct(
StoreContextInterface $storeContext,
RepositoryInterface $storeRepository
) {
public function __construct(StoreContextInterface $storeContext)
{
$this->storeContext = $storeContext;
$this->storeRepository = $storeRepository;
}

/**
* {@inheritdoc}
*/
public function resolveTheme(ActiveThemeInterface $activeTheme): void
public function resolveTheme(): string
{
$themes = [];

/**
* @var StoreInterface $store
*/
foreach ($this->storeRepository->findAll() as $store) {
$storeTheme = $store->getTemplate();

if ($storeTheme) {
$themes[] = $storeTheme;
}
}

$activeTheme->addThemes($themes);

try {
$store = $this->storeContext->getStore();

if ($theme = $store->getTemplate()) {
$activeTheme->setActiveTheme($theme);

return;
return $theme;
}
} catch (StoreNotFoundException $exception) {
throw new ThemeNotResolvedException($exception);
Expand Down
2 changes: 1 addition & 1 deletion src/CoreShop/Bundle/StoreBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"coreshop/currency-bundle": "^3.0",
"coreshop/theme-bundle": "^3.0",
"coreshop/store": "^3.0",
"pimcore/pimcore": "^6.9.0 | ^7.0.0"
"pimcore/pimcore": "^7.0.0"
},
"config": {
"bin-dir": "bin"
Expand Down
Loading

0 comments on commit a476b38

Please sign in to comment.