Skip to content

Commit

Permalink
Merge pull request #7 from scaleflex/feature/v7
Browse files Browse the repository at this point in the history
Remove v7 option added to the configuration
  • Loading branch information
Aurelien-GH authored Mar 3, 2022
2 parents 465d9d3 + 6ff37a7 commit 043c6de
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Block/Tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ public function getConfigToString(): string
if ($this->config->isIgnoreStyleImgSize()) {
$config .= 'ignoreStyleImgSize:true, ';
}
if ($this->config->isRemoveV7()) {
$config .= 'apiVersion:null, ';
}
if ($this->config->isCustomFunctionActive()) {
$config .= 'processQueryString: function (props) ' . $this->config->getCustomFunction() . ', ';
}
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to this project will be documented in this file.

## [2.0.1] - 2022-02-01

* Remove "/v7" from the URL part option added

## [2.0.0] - 2022-01-17

* Add a text field in the configuration to modify the URL for retrieving the Cloudimage library
Expand Down
11 changes: 11 additions & 0 deletions Helper/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class Config extends AbstractHelper
const XML_PATH_SCALEFLEX_CLOUDIMAGE_ADVANCED_IMAGE_QUALITY = 'scaleflex_cloudimage/advanced/image_quality';
const XML_PATH_SCALEFLEX_CLOUDIMAGE_ADVANCED_PROCESS_SVG = 'scaleflex_cloudimage/advanced/ignore_svg';
const XML_PATH_SCALEFLEX_CLOUDIMAGE_ADVANCED_LIBRARY_OPTIONS = 'scaleflex_cloudimage/advanced/library_options';
const XML_PATH_SCALEFLEX_CLOUDIMAGE_ADVANCED_REMOVE_V7 = 'scaleflex_cloudimage/advanced/remove_v7';

/**
* @return bool
Expand Down Expand Up @@ -211,4 +212,14 @@ public function isIgnoreSvg()
{
return $this->scopeConfig->isSetFlag(self::XML_PATH_SCALEFLEX_CLOUDIMAGE_ADVANCED_PROCESS_SVG);
}

/**
* Ignore SVG images ?
*
* @return bool
*/
public function isRemoveV7()
{
return $this->scopeConfig->isSetFlag(self::XML_PATH_SCALEFLEX_CLOUDIMAGE_ADVANCED_REMOVE_V7);
}
}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ This setting is for advanced users only and allows to inject a custom JS functio

**(new) Custom Library Options**: Those optional parameters will be added to the request for each URL going through the Cloudimage acceleration infrastructure. It can allow you to force image formats, apply automatic transformations or watermarking, and might be used for troubleshooting purposes. (for advanced users only, please refer to the official [Cloudimage documentation here](https://docs/cloudimage.io) for the list of possible parameters)

**(new) Remove v7**: Removes the "/v7" part in URL format. Activate for token created after October 20th 2021.


## 2. Integration "on-the-fly" in Magento templates

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"ext-libxml": "*"
},
"type": "magento2-module",
"version": "2.0.0",
"version": "2.0.1",
"license": "BSD-3-Clause",
"authors": [
{
Expand Down
5 changes: 5 additions & 0 deletions etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@
<label>Custom Library Options</label>
<comment><![CDATA[For advanced users only! This will modify the library URL. Must begin with the symbol &. By default, leave empty.]]></comment>
</field>
<field id="remove_v7" translate="label" type="select" sortOrder="60" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Remove v7</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<comment><![CDATA[Removes the "/v7" part in URL format. Activate for token created after October 20th 2021.]]></comment>
</field>
</group>
</section>
</system>
Expand Down

0 comments on commit 043c6de

Please sign in to comment.