Skip to content

Commit

Permalink
fix: cleanup code and restrict to sw6.4
Browse files Browse the repository at this point in the history
  • Loading branch information
tinect committed May 12, 2021
1 parent 18e3739 commit 4bf7de9
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 131 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pack-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env:
jobs:
pack:
runs-on: ubuntu-latest
container: ghcr.io/friendsofshopware/platform-plugin-dev:v6.3.4
container: ghcr.io/friendsofshopware/platform-plugin-dev:v6.4.0
steps:
- name: Checkout
uses: actions/checkout@v2.3.1
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG_de-DE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.0.16

* FEATURE Support für SW6.4

# 1.0.15

* FEATURE Support für SW6.4
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG_en-GB.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.0.16

* FEATURE Better support for SW6.4

# 1.0.15

* FEATURE Add support for SW6.4
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"thumbnail"
],
"description": "This plugins allows you to use variable thumbnails, without having them on storage.",
"version": "1.0.15",
"version": "1.0.16",
"type": "shopware-platform-plugin",
"license": "mit",
"authors": [
Expand All @@ -21,7 +21,7 @@
}
],
"require": {
"shopware/core": "~6.3|~6.4"
"shopware/core": "~6.4"
},
"extra": {
"shopware-plugin-class": "Frosh\\ThumbnailProcessor\\FroshPlatformThumbnailProcessor",
Expand Down
20 changes: 0 additions & 20 deletions src/Resources/config/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,6 @@
</helpText>
</input-field>

<input-field type="bool">
<name>FixListingThumbnailSizes</name>
<label>Fix Listing ThumbnailSizes</label>
<defaultValue>1</defaultValue>
<helpText>
There are problems with thumbnail-sizes in storefront.
This can help you delivering better matching sizes to the visitor.
</helpText>
</input-field>

<input-field type="bool">
<name>FixDetailGalleryThumbnailSizes</name>
<label>Fix ThumbnailSizes in DetailGallery</label>
<defaultValue>1</defaultValue>
<helpText>
There are problems with thumbnail-sizes in the gallery of the product page.
This can help you delivering better matching sizes to the visitor.
</helpText>
</input-field>

<input-field type="int">
<name>DefaultContainerMaxSize</name>
<label>Specific max width of container</label>
Expand Down
1 change: 0 additions & 1 deletion src/Resources/config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<argument type="service" id="Frosh\ThumbnailProcessor\Service\ThumbnailUrlTemplateInterface"/>
<argument type="service" id="request_stack"/>
<argument type="service" id="Shopware\Core\System\SystemConfig\SystemConfigService"/>
<argument>%shopware.filesystem.public.url%</argument>
</service>

<service id="Frosh\ThumbnailProcessor\Service\ThumbnailUrlTemplateInterface"
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
{% set container = 100 %}
{% set sizes = sizes|merge({ 'xl': (container / columns)|round(0, 'ceil') ~'vw'}) %}
{% else %}
{% set defaultContainerMaxSize = shopware.config.FroshPlatformThumbnailProcessor.config.DefaultContainerMaxSize %}
{% set defaultContainerMaxSize = config('FroshPlatformThumbnailProcessor.config.DefaultContainerMaxSize') %}
{% if defaultContainerMaxSize is defined %}
{% set container = defaultContainerMaxSize %}
{% else %}
Expand Down
29 changes: 8 additions & 21 deletions src/Service/ThumbnailServiceDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,28 +38,15 @@ public function __construct(
FilesystemInterface $fileSystemPublic,
FilesystemInterface $fileSystemPrivate,
UrlGeneratorInterface $urlGenerator,
EntityRepositoryInterface $mediaFolderRepository,
string $version
EntityRepositoryInterface $mediaFolderRepository
) {

if (version_compare($version, '6.4.0.0', '<')) {
parent::__construct(
$mediaRepository,
$thumbnailRepository,
$fileSystemPublic,
$fileSystemPrivate,
$urlGenerator,
$mediaFolderRepository
);
} else {
parent::__construct(
$thumbnailRepository,
$fileSystemPublic,
$fileSystemPrivate,
$urlGenerator,
$mediaFolderRepository
);
}
parent::__construct(
$thumbnailRepository,
$fileSystemPublic,
$fileSystemPrivate,
$urlGenerator,
$mediaFolderRepository
);

$this->mediaRepository = $mediaRepository;
$this->thumbnailRepository = $thumbnailRepository;
Expand Down

0 comments on commit 4bf7de9

Please sign in to comment.