Skip to content

Commit

Permalink
Merge pull request #11 from lopes-vincent/master
Browse files Browse the repository at this point in the history
Fix namespace + add error message on indexation fail
  • Loading branch information
lopes-vincent committed Dec 9, 2019
2 parents d25085a + 131a948 commit 36f8c1a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Event/IndexationEvent/ProductIndexationEvent.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace ElasticProduct\Event;
namespace ElasticProduct\Event\IndexationEvent;

use Thelia\Core\Event\ActionEvent;
use Thelia\Model\Product;
Expand Down
1 change: 1 addition & 0 deletions I18n/backOffice/default/fr_FR.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@
'Searchable' => 'Filtrable',
'Searchable attributes' => 'Déclinaisons filtrables',
'Searchable features' => 'Caractéristiques filtrables',
'Success !' => 'Succés !',
);
2 changes: 1 addition & 1 deletion Service/IndexationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ <h4>{intl l="Searchable attributes" d="elasticproduct.bo.default"}</h4>
</div>
</div>
<div class="row">
<div class="col-md-12 general-block-decorator">
<div id="indexation_block" class="col-md-12 general-block-decorator">
<div class="progress">
<div id="elastic_product_index_all_progress" class="progress-bar progress-bar-striped active" role="progressbar"
aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width:0%">
Expand Down Expand Up @@ -162,6 +162,7 @@ <h4>{intl l="Searchable attributes" d="elasticproduct.bo.default"}</h4>
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('<div class="alert alert-success">{intl l="Success !" d="elasticproduct.bo.default"}</div>')
} else if (percent > 5) {
document.getElementById("elastic_product_index_all_progress").style.width = percent+"%";
document.getElementById("elastic_product_index_all_progress").innerHTML = percent+"%";
Expand All @@ -171,6 +172,10 @@ <h4>{intl l="Searchable attributes" d="elasticproduct.bo.default"}</h4>
page++;
recursively_ajax(productCount);
}
},
error: function (jqXHR)
{
$("#indexation_block").prepend('<div class="alert alert-danger">'+jqXHR.statusText+'</div>')
}
});
}
Expand Down

0 comments on commit 36f8c1a

Please sign in to comment.