diff --git a/Block/Configuration.php b/Block/Configuration.php index 625b13cbd..c43ce4572 100755 --- a/Block/Configuration.php +++ b/Block/Configuration.php @@ -243,6 +243,14 @@ public function getConfiguration() ], 'analytics' => $config->getAnalyticsConfig(), 'now' => $this->getTimestamp(), + 'queue' => [ + 'isEnabled' => $config->isQueueActive($this->getStoreId()), + 'nbOfJobsToRun' => $config->getNumberOfJobToRun($this->getStoreId()), + 'retryLimit' => $config->getRetryLimit($this->getStoreId()), + 'nbOfElementsPerIndexingJob' => $config->getNumberOfElementByPage($this->getStoreId()), + ], + 'isPreventBackendRenderingEnabled' => $config->preventBackendRendering($this->getStoreId()), + 'areOutOfStockOptionsDisplayed' => $config->indexOutOfStockOptions($this->getStoreId()), 'translations' => [ 'to' => __('to'), 'or' => __('or'), diff --git a/CHANGELOG.md b/CHANGELOG.md index 798927f1b..fe8579b04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # CHANGE LOG +## 3.0.1 + +### UPDATES +- Added some configuration to algoliaConfig JS object (#1097) +- Update csp for proxy and update admin bundle (#1098) + +### FIXES +- Switch from mt_rand to random_int to meet marketplace expectations (#1095) +- Indexing queue grids fixes (#1096) + ## 3.0.0 This update will **break compatibility** if you're using the backend facets feature. Please read the [Magento 2.4 section](https://www.algolia.com/doc/integration/magento-2/getting-started/quick-start/#magento-24-compatibility) of our documentation to get more information about it. diff --git a/Model/Source/AbstractTable.php b/Model/Source/AbstractTable.php index 1b2aa933c..c202ee4cc 100755 --- a/Model/Source/AbstractTable.php +++ b/Model/Source/AbstractTable.php @@ -106,7 +106,7 @@ protected function _prepareArrayRow(DataObject $row) } if ($row['_id'] === null || is_int($row['_id'])) { - $row->setData('_id', '_' . mt_rand() . '_' . mt_rand(0, 999)); + $row->setData('_id', '_' . random_int(1000000000, 9999999999) . '_' . random_int(0, 999)); } $row->setData('option_extra_attrs', $options); diff --git a/README.md b/README.md index d5bfc9d02..8b6f2e92b 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Algolia Search for Magento 2 ================== -![Latest version](https://img.shields.io/badge/latest-3.0.0-green.svg) +![Latest version](https://img.shields.io/badge/latest-3.0.1-green.svg) ![Magento 2](https://img.shields.io/badge/Magento-%32.3,%202.4-blue.svg) [![CircleCI](https://circleci.com/gh/algolia/algoliasearch-magento-2/tree/master.svg?style=svg)](https://circleci.com/gh/algolia/algoliasearch-magento-2/tree/master) diff --git a/composer.json b/composer.json index 60a2d3325..6a9856da2 100755 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description": "Algolia Search integration for Magento 2", "type": "magento2-module", "license": ["MIT"], - "version": "3.0.0", + "version": "3.0.1", "require": { "magento/framework": "~102.0|~103.0", "algolia/algoliasearch-client-php": "^2.4", diff --git a/etc/csp_whitelist.xml b/etc/csp_whitelist.xml index 6c29bb921..4bca30daa 100644 --- a/etc/csp_whitelist.xml +++ b/etc/csp_whitelist.xml @@ -12,5 +12,11 @@ *.algolia.net + + + *.algolia.net + *.algolia.com + + \ No newline at end of file diff --git a/etc/module.xml b/etc/module.xml index 24121b53d..ec288792c 100755 --- a/etc/module.xml +++ b/etc/module.xml @@ -1,6 +1,6 @@ - + diff --git a/view/adminhtml/ui_component/algolia_algoliasearch_indexing_log_listing.xml b/view/adminhtml/ui_component/algolia_algoliasearch_indexing_log_listing.xml index 3d42a9d19..908401097 100644 --- a/view/adminhtml/ui_component/algolia_algoliasearch_indexing_log_listing.xml +++ b/view/adminhtml/ui_component/algolia_algoliasearch_indexing_log_listing.xml @@ -61,6 +61,15 @@ + + + + false + 55 + id + + + @@ -114,4 +123,4 @@ - \ No newline at end of file + diff --git a/view/adminhtml/ui_component/algolia_algoliasearch_indexing_queue_listing.xml b/view/adminhtml/ui_component/algolia_algoliasearch_indexing_queue_listing.xml index 2dc8e83d5..85419cda1 100644 --- a/view/adminhtml/ui_component/algolia_algoliasearch_indexing_queue_listing.xml +++ b/view/adminhtml/ui_component/algolia_algoliasearch_indexing_queue_listing.xml @@ -99,7 +99,6 @@ Algolia\AlgoliaSearch\Model\Source\JobStatuses - select Magento_Ui/js/grid/columns/select select select @@ -161,4 +160,4 @@ - \ No newline at end of file + diff --git a/view/adminhtml/web/algoliaAdminBundle.min.js b/view/adminhtml/web/algoliaAdminBundle.min.js index 97d27cf5c..9829e6a30 100644 --- a/view/adminhtml/web/algoliaAdminBundle.min.js +++ b/view/adminhtml/web/algoliaAdminBundle.min.js @@ -1,33 +1,30 @@ /*! algoliaAdminBundle 4.3.9 | © Algolia SAS | algolia.com */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("algoliaAdminBundle",[],t):"object"==typeof exports?exports.algoliaAdminBundle=t():e.algoliaAdminBundle=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports={$:n(1),instantsearch:n(2),algoliasearch:n(485),algoliasearchHelper:n(5),Hogan:n(351),autocomplete:n(490),angular:n(513)},n(515)},function(e,t){var n,r;!function(t,n){"object"==typeof e&&"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}:n(t)}("undefined"!=typeof window?window:this,function(i,o){function a(e){var t=!!e&&"length"in e&&e.length,n=ce.type(e);return"function"===n||ce.isWindow(e)?!1:"array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e}function s(e,t,n){if(ce.isFunction(t))return ce.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return ce.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(be.test(t))return ce.filter(t,e,n);t=ce.filter(t,e)}return ce.grep(e,function(e){return re.call(t,e)>-1!==n})}function u(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function c(e){var t={};return ce.each(e.match(Ce)||[],function(e,n){t[n]=!0}),t}function l(){Z.removeEventListener("DOMContentLoaded",l),i.removeEventListener("load",l),ce.ready()}function f(){this.expando=ce.expando+f.uid++}function h(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(ke,"-$&").toLowerCase(),n=e.getAttribute(r),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:Te.test(n)?ce.parseJSON(n):n}catch(i){}Oe.set(e,t,n)}else n=void 0;return n}function p(e,t,n,r){var i,o=1,a=20,s=r?function(){return r.cur()}:function(){return ce.css(e,t,"")},u=s(),c=n&&n[3]||(ce.cssNumber[t]?"":"px"),l=(ce.cssNumber[t]||"px"!==c&&+u)&&Ae.exec(ce.css(e,t));if(l&&l[3]!==c){c=c||l[3],n=n||[],l=+u||1;do o=o||".5",l/=o,ce.style(e,t,l+c);while(o!==(o=s()/u)&&1!==o&&--a)}return n&&(l=+l||+u||0,i=n[1]?l+(n[1]+1)*n[2]:+n[2],r&&(r.unit=c,r.start=l,r.end=i)),i}function d(e,t){var n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&ce.nodeName(e,t)?ce.merge([e],n):n}function m(e,t){for(var n=0,r=e.length;r>n;n++)Ee.set(e[n],"globalEval",!t||Ee.get(t[n],"globalEval"))}function g(e,t,n,r,i){for(var o,a,s,u,c,l,f=t.createDocumentFragment(),h=[],p=0,g=e.length;g>p;p++)if(o=e[p],o||0===o)if("object"===ce.type(o))ce.merge(h,o.nodeType?[o]:o);else if(Ue.test(o)){for(a=a||f.appendChild(t.createElement("div")),s=(Le.exec(o)||["",""])[1].toLowerCase(),u=He[s]||He._default,a.innerHTML=u[1]+ce.htmlPrefilter(o)+u[2],l=u[0];l--;)a=a.lastChild;ce.merge(h,a.childNodes),a=f.firstChild,a.textContent=""}else h.push(t.createTextNode(o));for(f.textContent="",p=0;o=h[p++];)if(r&&ce.inArray(o,r)>-1)i&&i.push(o);else if(c=ce.contains(o.ownerDocument,o),a=d(f.appendChild(o),"script"),c&&m(a),n)for(l=0;o=a[l++];)De.test(o.type||"")&&n.push(o);return f}function v(){return!0}function y(){return!1}function b(){try{return Z.activeElement}catch(e){}}function w(e,t,n,r,i,o){var a,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)w(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),i===!1)i=y;else if(!i)return e;return 1===o&&(a=i,i=function(e){return ce().off(e),a.apply(this,arguments)},i.guid=a.guid||(a.guid=ce.guid++)),e.each(function(){ce.event.add(this,t,i,r,n)})}function x(e,t){return ce.nodeName(e,"table")&&ce.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function _(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function $(e){var t=Ke.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function S(e,t){var n,r,i,o,a,s,u,c;if(1===t.nodeType){if(Ee.hasData(e)&&(o=Ee.access(e),a=Ee.set(t,o),c=o.events)){delete a.handle,a.events={};for(i in c)for(n=0,r=c[i].length;r>n;n++)ce.event.add(t,i,c[i][n])}Oe.hasData(e)&&(s=Oe.access(e),u=ce.extend({},s),Oe.set(t,u))}}function C(e,t){var n=t.nodeName.toLowerCase();"input"===n&&Ie.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}function P(e,t,n,r){t=te.apply([],t);var i,o,a,s,u,c,l=0,f=e.length,h=f-1,p=t[0],m=ce.isFunction(p);if(m||f>1&&"string"==typeof p&&!se.checkClone&&ze.test(p))return e.each(function(i){var o=e.eq(i);m&&(t[0]=p.call(this,i,o.html())),P(o,t,n,r)});if(f&&(i=g(t,e[0].ownerDocument,!1,e,r),o=i.firstChild,1===i.childNodes.length&&(i=o),o||r)){for(a=ce.map(d(i,"script"),_),s=a.length;f>l;l++)u=i,l!==h&&(u=ce.clone(u,!0,!0),s&&ce.merge(a,d(u,"script"))),n.call(e[l],u,l);if(s)for(c=a[a.length-1].ownerDocument,ce.map(a,$),l=0;s>l;l++)u=a[l],De.test(u.type||"")&&!Ee.access(u,"globalEval")&&ce.contains(c,u)&&(u.src?ce._evalUrl&&ce._evalUrl(u.src):ce.globalEval(u.textContent.replace(Ge,"")))}return e}function R(e,t,n){for(var r,i=t?ce.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||ce.cleanData(d(r)),r.parentNode&&(n&&ce.contains(r.ownerDocument,r)&&m(d(r,"script")),r.parentNode.removeChild(r));return e}function j(e,t){var n=ce(t.createElement(e)).appendTo(t.body),r=ce.css(n[0],"display");return n.detach(),r}function E(e){var t=Z,n=Je[e];return n||(n=j(e,t),"none"!==n&&n||(Ye=(Ye||ce("