Skip to content

Commit

Permalink
Remove SSR rendering delay time
Browse files Browse the repository at this point in the history
  • Loading branch information
Rayn93 committed Mar 14, 2024
1 parent d357194 commit 7562bbf
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 40 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
# Changelog
## Unreleased
### BREAKING
- Add support for PHP v8.2 and v8.3
- Upgrade magento libraries
- Upgrade composer dependencies
- Fix deprecations for magento/framework

### Remove
- Remove SSR rendering delay time

## [v4.3.0] - 2024.01.16
### Add
- Add landing page campaign
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@ The module uses [Mustache.php](https://github.com/bobthecow/mustache.php) librar

**Note:** More information about SSR concept you can find in the article [Server Side Rendering](https://web-components.fact-finder.de/documentation/4.x/server-side-rendering) from Web Components documentation.

**Note:** If you have a problem with displaying Fact-Finder campaign while using SSR please set a delay time for loading the SSR component. The number of seconds depends on your website speed.

### Advanced Settings

Advanced Settings contains additional parameters used for the `ff-communication` web component. Each setting is set to a
Expand Down
18 changes: 0 additions & 18 deletions src/Helper/ConfigurationHelper.php

This file was deleted.

3 changes: 3 additions & 0 deletions src/Model/Filter/TextFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

class TextFilter implements FilterInterface
{
/**
* phpcs:disable Magento2.Functions.DiscouragedFunction.Discouraged
*/
public function filterValue(string $value): string
{
// phpcs:ignore
Expand Down
15 changes: 0 additions & 15 deletions src/etc/adminhtml/system/general.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,6 @@
<label>Use server-side rendering?</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
<field id="ssr_delay_time" translate="label comment" type="select" sortOrder="77" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Delay time for loading SSR component</label>
<options>
<option label="0 second">0</option>
<option label="1 second">1</option>
<option label="2 seconds">2</option>
<option label="3 seconds">3</option>
<option label="4 seconds">4</option>
<option label="5 seconds">5</option>
</options>
<comment>How many seconds wait to load the SSR component? If your Fact-Finder campaigns do not display correctly, please set this value to 1 or more depending on your webpage speed. Default value 0.</comment>
<depends>
<field id="use_ssr">1</field>
</depends>
</field>
<field id="show_add_to_cart_button" translate="label" type="select" sortOrder="80" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Show 'Add to Cart' button in search results</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
Expand Down
6 changes: 1 addition & 5 deletions src/view/frontend/templates/ff/ssr/record-list.phtml
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
<?php
/** @var Magento\Framework\View\Element\Template $block */
$delayTime = $this->helper(Omikron\Factfinder\Helper\ConfigurationHelper::class)->getConfig('factfinder/general/ssr_delay_time');
?>
<?= $block->getChildHtml() ?>
<script>
document.addEventListener('ffCommunicationReady', function ({factfinder}) {
const searchResult = {FF_SEARCH_RESULT};
factfinder.communication.EventAggregator.currentSearchResult = searchResult;
setTimeout(function () {
factfinder.communication.ResultDispatcher.dispatchRaw(searchResult);
},
<?= $delayTime * 1000 ?>)
factfinder.communication.ResultDispatcher.dispatchRaw(searchResult);
});
</script>

0 comments on commit 7562bbf

Please sign in to comment.