Skip to content

Commit b44fa53

Browse files
committed
Merge branch 'master' into revert978
* master: (39 commits) Bump to 1.15.0 (algolia#1088) Fix error with configuration save while query rules are disabled in Algolia engine (algolia#1077) Fix special prices when customer groups are enabled (algolia#1071) Fix autocomplete bottom links (algolia#1066) update version number on mysql upgrade file update grid default direction asc on jobId Exclude non-salable subproducts from price calculation (algolia#1075) Improve name of "Remove inactive products" indexer (algolia#1054) Bump to 1.14.1 (algolia#1073) Remove color facet query rule (algolia#1072) PR updates - add view action link for indexing queue grid and add additional job methods to the list match updated logging in queue feedback fixes and add archive table long form array update indexing queue statuses notification Indexing Queue Status preliminary update to indexing queue job view add clearQueue method to Queue model and add preliminary viewAction for queue/job item view preliminary indexing queue controller, block, entity update getQueueInfo method for readable structure ...
2 parents f273ffe + 9357b9e commit b44fa53

File tree

52 files changed

+1613
-104
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1613
-104
lines changed

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
# CHANGE LOG
22

3+
## 1.15.0
4+
5+
### Features
6+
- [Reindex SKUs](https://community.algolia.com/doc/m1/sku-reindexing-form/) form (#1061)
7+
- This form allows you to reindex manually up to 10 SKUs
8+
- Recommended for troubleshooting your products
9+
- Indexing queue page (#1070)
10+
- The page shows the status and remaining jobs in indexing queue
11+
- It offers suggestions to improve performance of the queue to get the fastest indexing
12+
13+
### Updates
14+
- Improved price formatting on facets (#1051)
15+
- Improved admin notification block (#1060)
16+
17+
### Fixes
18+
- Fix autocomplete bottom links (#1066)
19+
- Fix special prices when customer groups are enabled (#1071)
20+
- Fix error with configuration save while query rules are disabled (#1077)
21+
22+
## 1.14.1
23+
24+
- Remove the default creation of the color facet query rule (#1072)
25+
326
## 1.14.0
427

528
### FEATURES

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Algolia Search for Magento 1.6+
22
==================
33

4-
![Latest version](https://img.shields.io/badge/latest-1.14.0-green.svg)
4+
![Latest version](https://img.shields.io/badge/latest-1.15.0-green.svg)
55

66
[![Build Status](https://travis-ci.org/algolia/algoliasearch-magento.svg?branch=master)](https://travis-ci.org/algolia/algoliasearch-magento)
77
![PHP >= 5.3](https://img.shields.io/badge/php-%3E=5.3-green.svg)
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
3+
class Algolia_Algoliasearch_Block_Adminhtml_IndexingQueue extends Mage_Adminhtml_Block_Widget_Grid_Container
4+
{
5+
/**
6+
* Initialize Grid Container
7+
*/
8+
public function __construct()
9+
{
10+
$this->_blockGroup = 'algoliasearch';
11+
$this->_controller = 'adminhtml_indexingqueue';
12+
13+
parent::__construct();
14+
15+
$this->_removeButton('add');
16+
$this->_addButton('clear_queue', array(
17+
'label' => Mage::helper('algoliasearch')->__('Clear Queue'),
18+
'onclick' => "if (confirm('Are you sure you want to clear the queue? This operation cannot be reverted.')) {
19+
location.href='" . $this->getUrl('*/*/clear') . "' };",
20+
'class' => 'cancel',
21+
));
22+
}
23+
24+
/**
25+
* Get header text.
26+
*
27+
* @return string
28+
*/
29+
public function getHeaderText()
30+
{
31+
return Mage::helper('algoliasearch')->__('Algolia Search - Indexing Queue');
32+
}
33+
34+
/**
35+
* Set custom Algolia icon class.
36+
*
37+
* @return string
38+
*/
39+
public function getHeaderCssClass()
40+
{
41+
return 'icon-head algoliasearch-head-icon';
42+
}
43+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
3+
class Algolia_Algoliasearch_Block_Adminhtml_IndexingQueue_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
4+
{
5+
/**
6+
* Internal constructor.
7+
*/
8+
public function __construct()
9+
{
10+
parent::__construct();
11+
12+
$this->_objectId = 'job_id';
13+
$this->_blockGroup = 'algoliasearch';
14+
$this->_controller = 'adminhtml_indexingqueue';
15+
16+
$this->_removeButton('save');
17+
$this->_removeButton('reset');
18+
$this->_removeButton('delete');
19+
}
20+
21+
/**
22+
* Get header text.
23+
*
24+
* @return string
25+
*/
26+
public function getHeaderText()
27+
{
28+
return Mage::helper('algoliasearch')->__('Algolia Search - Indexing Queue Job #%s',
29+
Mage::registry('algoliasearch_current_job')->getJobId());
30+
}
31+
32+
/**
33+
* Set custom Algolia icon class.
34+
*
35+
* @return string
36+
*/
37+
public function getHeaderCssClass()
38+
{
39+
return 'icon-head algoliasearch-head-icon';
40+
}
41+
}
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
<?php
2+
3+
class Algolia_Algoliasearch_Block_Adminhtml_IndexingQueue_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
4+
{
5+
/**
6+
* @return Algolia_Algoliasearch_Block_Adminhtml_IndexingQueue_Edit_Form
7+
*/
8+
protected function _prepareForm()
9+
{
10+
$model = Mage::registry('algoliasearch_current_job');
11+
12+
$form = new Varien_Data_Form(array(
13+
'id' => 'edit_form',
14+
'action' => $this->getUrl('*/*/updatePost'),
15+
'method' => 'post',
16+
));
17+
18+
$fieldset = $form->addFieldset('base_fieldset', array());
19+
$readOnlyStyle = 'border: 0; background: none;';
20+
21+
$fieldset->addField('job_id', 'text', array(
22+
'name' => 'job_id',
23+
'label' => Mage::helper('algoliasearch')->__('Job ID'),
24+
'title' => Mage::helper('algoliasearch')->__('Job ID'),
25+
'readonly' => true,
26+
'style' => $readOnlyStyle,
27+
));
28+
29+
$fieldset->addField('created', 'text', array(
30+
'name' => 'created',
31+
'label' => Mage::helper('algoliasearch')->__('Created'),
32+
'title' => Mage::helper('algoliasearch')->__('Created'),
33+
'readonly' => true,
34+
'style' => $readOnlyStyle,
35+
));
36+
37+
$fieldset->addField('status', 'text', array(
38+
'name' => 'status',
39+
'label' => Mage::helper('algoliasearch')->__('Status'),
40+
'title' => Mage::helper('algoliasearch')->__('Status'),
41+
'readonly' => true,
42+
'style' => $readOnlyStyle,
43+
));
44+
45+
$fieldset->addField('pid', 'text', array(
46+
'name' => 'pid',
47+
'label' => Mage::helper('algoliasearch')->__('PID'),
48+
'title' => Mage::helper('algoliasearch')->__('PID'),
49+
'readonly' => true,
50+
'style' => $readOnlyStyle,
51+
));
52+
53+
$fieldset->addField('class', 'text', array(
54+
'name' => 'class',
55+
'label' => Mage::helper('algoliasearch')->__('Class'),
56+
'title' => Mage::helper('algoliasearch')->__('Class'),
57+
'readonly' => true,
58+
'style' => $readOnlyStyle,
59+
));
60+
61+
$fieldset->addField('method', 'text', array(
62+
'name' => 'method',
63+
'label' => Mage::helper('algoliasearch')->__('Method'),
64+
'title' => Mage::helper('algoliasearch')->__('Method'),
65+
'readonly' => true,
66+
'style' => $readOnlyStyle,
67+
));
68+
69+
$fieldset->addField('data', 'textarea', array(
70+
'name' => 'data',
71+
'label' => Mage::helper('algoliasearch')->__('Data'),
72+
'title' => Mage::helper('algoliasearch')->__('Data'),
73+
'readonly' => true,
74+
));
75+
76+
$fieldset->addField('max_retries', 'text', array(
77+
'name' => 'max_retries',
78+
'label' => Mage::helper('algoliasearch')->__('Max Retries'),
79+
'title' => Mage::helper('algoliasearch')->__('Max Retries'),
80+
'readonly' => true,
81+
'style' => $readOnlyStyle,
82+
));
83+
84+
$fieldset->addField('retries', 'text', array(
85+
'name' => 'retries',
86+
'label' => Mage::helper('algoliasearch')->__('Retries'),
87+
'title' => Mage::helper('algoliasearch')->__('Retries'),
88+
'readonly' => true,
89+
'style' => $readOnlyStyle,
90+
));
91+
92+
$fieldset->addField('data_size', 'text', array(
93+
'name' => 'data_size',
94+
'label' => Mage::helper('algoliasearch')->__('Data Size'),
95+
'title' => Mage::helper('algoliasearch')->__('Data Size'),
96+
'readonly' => true,
97+
'style' => $readOnlyStyle,
98+
));
99+
100+
$fieldset->addField('error_log', 'textarea', array(
101+
'name' => 'error_log',
102+
'label' => Mage::helper('algoliasearch')->__('Error Log'),
103+
'title' => Mage::helper('algoliasearch')->__('Error Log'),
104+
'readonly' => true,
105+
));
106+
107+
108+
$form->setValues($model->getData());
109+
$form->addValues(array(
110+
'status' => $model->getStatusLabel()
111+
));
112+
$form->setUseContainer(true);
113+
114+
$this->setForm($form);
115+
116+
return parent::_prepareForm();
117+
}
118+
}
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
<?php
2+
3+
class Algolia_Algoliasearch_Block_Adminhtml_IndexingQueue_Grid extends Mage_Adminhtml_Block_Widget_Grid
4+
{
5+
/**
6+
* Initialize Grid Properties
7+
*
8+
*/
9+
public function __construct()
10+
{
11+
parent::__construct();
12+
$this->setId('job_id');
13+
$this->setDefaultSort('job_id');
14+
$this->setDefaultDir('acs');
15+
}
16+
17+
/**
18+
* Prepare Search Report collection for grid
19+
*
20+
* @return Mage_Adminhtml_Block_Report_Search_Grid
21+
*/
22+
protected function _prepareCollection()
23+
{
24+
$collection = Mage::getResourceModel('algoliasearch/job_collection');
25+
$this->setCollection($collection);
26+
27+
return parent::_prepareCollection();
28+
}
29+
30+
/**
31+
* Prepare Grid columns
32+
*
33+
* @return Mage_Adminhtml_Block_Report_Search_Grid
34+
*/
35+
protected function _prepareColumns()
36+
{
37+
$this->addColumn('job_id', array(
38+
'header' => Mage::helper('algoliasearch')->__('Job ID'),
39+
'width' => '50px',
40+
'filter' => false,
41+
'index' => 'job_id',
42+
'type' => 'number'
43+
));
44+
45+
$this->addColumn('created', array(
46+
'header' => Mage::helper('algoliasearch')->__('Created'),
47+
'index' => 'created',
48+
'type' => 'datetime',
49+
));
50+
51+
$this->addColumn('status', array(
52+
'header' => Mage::helper('algoliasearch')->__('Status'),
53+
'index' => 'status',
54+
'getter' => 'getStatusLabel',
55+
'filter' => false,
56+
));
57+
58+
$this->addColumn('method', array(
59+
'header' => Mage::helper('algoliasearch')->__('Method'),
60+
'index' => 'method',
61+
'type' => 'options',
62+
'options' => Mage::getModel('algoliasearch/source_jobMethods')->getMethods(),
63+
));
64+
65+
$this->addColumn('data', array(
66+
'header' => Mage::helper('algoliasearch')->__('Data'),
67+
'index' => 'data',
68+
'renderer' => 'Algolia_Algoliasearch_Block_Adminhtml_IndexingQueue_Grid_Renderer_Json'
69+
));
70+
71+
$this->addColumn('max_retries', array(
72+
'header' => Mage::helper('algoliasearch')->__('Max Retries'),
73+
'width' => '40px',
74+
'filter' => false,
75+
'index' => 'max_retries',
76+
'type' => 'number'
77+
));
78+
79+
$this->addColumn('retries', array(
80+
'header' => Mage::helper('algoliasearch')->__('Retries'),
81+
'width' => '40px',
82+
'filter' => false,
83+
'index' => 'retries',
84+
'type' => 'number'
85+
));
86+
87+
$this->addColumn('action',
88+
array(
89+
'header' => Mage::helper('algoliasearch')->__('Action'),
90+
'width' => '50px',
91+
'type' => 'action',
92+
'getter' => 'getJobId',
93+
'actions' => array(
94+
array(
95+
'caption' => Mage::helper('algoliasearch')->__('View'),
96+
'url' => array('base'=>'*/*/view'),
97+
'field' => 'id'
98+
)
99+
),
100+
'filter' => false,
101+
'sortable' => false,
102+
));
103+
104+
return parent::_prepareColumns();
105+
}
106+
107+
/**
108+
* Retrieve Row Click callback URL
109+
*
110+
* @return string
111+
*/
112+
public function getRowUrl($row)
113+
{
114+
return $this->getUrl('*/*/view', array('id' => $row->getJobId()));
115+
}
116+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
class Algolia_Algoliasearch_Block_Adminhtml_IndexingQueue_Grid_Renderer_Json extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
4+
{
5+
/**
6+
* @param Varien_Object $row
7+
* @return string
8+
*/
9+
public function render(Varien_Object $row)
10+
{
11+
$html = '';
12+
if ($json = $row->getData('data')) {
13+
$json = json_decode($json, true);
14+
15+
foreach ($json as $var => $value) {
16+
$html .= $var . ': ' . (is_array($value) ? implode(',', $value) : $value) . '<br/>';
17+
}
18+
}
19+
return $html;
20+
}
21+
}

0 commit comments

Comments
 (0)