From 131a948e4ce0e0134469a19cc9aa7fd4ef54d9ac Mon Sep 17 00:00:00 2001 From: Vincent Lopes-Vicente Date: Mon, 9 Dec 2019 10:49:21 +0100 Subject: [PATCH] Fix namespace + add error message on indexation fail --- Event/IndexationEvent/ProductIndexationEvent.php | 2 +- I18n/backOffice/default/fr_FR.php | 1 + Service/IndexationService.php | 2 +- .../backOffice/default/elastic-product/configuration.html | 7 ++++++- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Event/IndexationEvent/ProductIndexationEvent.php b/Event/IndexationEvent/ProductIndexationEvent.php index a691397..b75a2ce 100644 --- a/Event/IndexationEvent/ProductIndexationEvent.php +++ b/Event/IndexationEvent/ProductIndexationEvent.php @@ -1,6 +1,6 @@ 'Filtrable', 'Searchable attributes' => 'Déclinaisons filtrables', 'Searchable features' => 'Caractéristiques filtrables', + 'Success !' => 'Succés !', ); diff --git a/Service/IndexationService.php b/Service/IndexationService.php index cb2f59e..e422a41 100644 --- a/Service/IndexationService.php +++ b/Service/IndexationService.php @@ -3,7 +3,7 @@ namespace ElasticProduct\Service; use ElasticProduct\ElasticProduct; -use ElasticProduct\Event\ProductIndexationEvent; +use ElasticProduct\Event\IndexationEvent\ProductIndexationEvent; use Propel\Runtime\Propel; use Symfony\Component\EventDispatcher\EventDispatcher; use Thelia\Action\Image; diff --git a/templates/backOffice/default/elastic-product/configuration.html b/templates/backOffice/default/elastic-product/configuration.html index 2fec8a0..a2e35a8 100644 --- a/templates/backOffice/default/elastic-product/configuration.html +++ b/templates/backOffice/default/elastic-product/configuration.html @@ -102,7 +102,7 @@

{intl l="Searchable attributes" d="elasticproduct.bo.default"}

-
+
@@ -162,6 +162,7 @@

{intl l="Searchable attributes" d="elasticproduct.bo.default"}

if (percent >= 100) { document.getElementById("elastic_product_index_all_progress").style.width = "100%"; document.getElementById("elastic_product_index_all_progress").innerHTML = "{intl l="Finished" d="elasticproduct.bo.default"}"; + $("#indexation_block").prepend('
{intl l="Success !" d="elasticproduct.bo.default"}
') } else if (percent > 5) { document.getElementById("elastic_product_index_all_progress").style.width = percent+"%"; document.getElementById("elastic_product_index_all_progress").innerHTML = percent+"%"; @@ -171,6 +172,10 @@

{intl l="Searchable attributes" d="elasticproduct.bo.default"}

page++; recursively_ajax(productCount); } + }, + error: function (jqXHR) + { + $("#indexation_block").prepend('
'+jqXHR.statusText+'
') } }); }