Skip to content

Commit 190b3a1

Browse files
p-neyensdrunken-monkey
p-neyens
authored andcommitted
Issue #2348185 by p-neyens, drunken monkey: Renamed "Filters" to "Processors" in the UI.
1 parent 381b3c7 commit 190b3a1

10 files changed

+29
-29
lines changed

Diff for: js/index-active-formatters.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @file
3-
* Attaches show/hide functionality to processor checkboxes in "Filters" tabs.
3+
* Attaches show/hide functionality to checkboxes in the "Processor" tab.
44
*/
55

66
(function ($) {
@@ -17,7 +17,7 @@
1717
var tab = $('.search-api-processor-settings-' + processor_id, context).data('verticalTab');
1818

1919
// Bind a click handler to this checkbox to conditionally show and hide
20-
// the filter's table row and vertical tab pane.
20+
// the processor's table row and vertical tab pane.
2121
$checkbox.on('click.searchApiUpdate', function () {
2222
if ($checkbox.is(':checked')) {
2323
$rows.show();

Diff for: search_api.links.task.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ entity.search_api_index.fields:
2020
route_name: entity.search_api_index.fields
2121
base_route: entity.search_api_index.canonical
2222
weight: 10
23-
entity.search_api_index.filters:
24-
route_name: entity.search_api_index.filters
23+
entity.search_api_index.processors:
24+
route_name: entity.search_api_index.processors
2525
base_route: entity.search_api_index.canonical
26-
title: 'Filters'
26+
title: 'Processors'
2727
weight: 20

Diff for: search_api.routing.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,12 @@ entity.search_api_index.fields:
109109
requirements:
110110
_entity_access: 'search_api_index.fields'
111111

112-
entity.search_api_index.filters:
113-
path: '/admin/config/search/search-api/index/{search_api_index}/filters'
112+
entity.search_api_index.processors:
113+
path: '/admin/config/search/search-api/index/{search_api_index}/processors'
114114
defaults:
115-
_entity_form: 'search_api_index.filters'
115+
_entity_form: 'search_api_index.processors'
116116
requirements:
117-
_entity_access: 'search_api_index.filters'
117+
_entity_access: 'search_api_index.processors'
118118

119119
entity.search_api_index.reindex:
120120
path: '/admin/config/search/search-api/index/{search_api_index}/reindex'

Diff for: search_api.theme.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ function theme_search_api_index($variables) {
254254
$info = t('Invalid or missing datasource plugin: %datasource_id', array('%datasource_id' => $datasource_id));
255255
}
256256
// Append the row and reset variables.
257-
$label = t('Data sources');
257+
$label = t('Data source');
258258
$rows[] = Utility::deepCopy($row);
259259
$class = '';
260260
}

Diff for: src/Entity/Index.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
* "default" = "Drupal\search_api\Form\IndexForm",
3939
* "edit" = "Drupal\search_api\Form\IndexForm",
4040
* "fields" = "Drupal\search_api\Form\IndexFieldsForm",
41-
* "filters" = "Drupal\search_api\Form\IndexFiltersForm",
41+
* "processors" = "Drupal\search_api\Form\IndexProcessorsForm",
4242
* "delete" = "Drupal\search_api\Form\IndexDeleteConfirmForm",
4343
* "disable" = "Drupal\search_api\Form\IndexDisableConfirmForm",
4444
* "reindex" = "Drupal\search_api\Form\IndexReindexConfirmForm",
@@ -58,7 +58,7 @@
5858
* "add-form" = "/admin/config/search/search-api/add-index",
5959
* "edit-form" = "/admin/config/search/search-api/index/{search_api_index}/edit",
6060
* "fields" = "/admin/config/search/search-api/index/{search_api_index}/fields",
61-
* "filters" = "/admin/config/search/search-api/index/{search_api_index}/filters",
61+
* "processors" = "/admin/config/search/search-api/index/{search_api_index}/processors",
6262
* "delete-form" = "/admin/config/search/search-api/index/{search_api_index}/delete",
6363
* "disable" = "/admin/config/search/search-api/index/{search_api_index}/disable",
6464
* "enable" = "/admin/config/search/search-api/index/{search_api_index}/enable",

Diff for: src/Form/IndexForm.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,8 @@ public function buildEntityForm(array &$form, FormStateInterface $form_state, In
219219
}
220220
$form['datasources'] = array(
221221
'#type' => 'select',
222-
'#title' => $this->t('Data types'),
223-
'#description' => $this->t('Select one or more data type of items that will be stored in this index.'),
222+
'#title' => $this->t('Data sources'),
223+
'#description' => $this->t('Select one or more data sources of items that will be stored in this index.'),
224224
'#options' => $datasource_options,
225225
'#default_value' => $index->getDatasourceIds(),
226226
'#multiple' => TRUE,

Diff for: src/Form/IndexFiltersForm.php renamed to src/Form/IndexProcessorsForm.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/**
44
* @file
5-
* Contains \Drupal\search_api\Form\IndexFiltersForm.
5+
* Contains \Drupal\search_api\Form\IndexProcessorsForm.
66
*/
77

88
namespace Drupal\search_api\Form;
@@ -19,7 +19,7 @@
1919
/**
2020
* Provides a form for configuring the processors of a search index.
2121
*/
22-
class IndexFiltersForm extends EntityForm {
22+
class IndexProcessorsForm extends EntityForm {
2323

2424
/**
2525
* The index being configured.
@@ -43,7 +43,7 @@ class IndexFiltersForm extends EntityForm {
4343
protected $processorPluginManager;
4444

4545
/**
46-
* Constructs an IndexFiltersForm object.
46+
* Constructs an IndexProcessorsForm.
4747
*
4848
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
4949
* The entity manager.
@@ -101,7 +101,7 @@ public function form(array $form, FormStateInterface $form_state) {
101101

102102
$form['#tree'] = TRUE;
103103
$form['#attached']['library'][] = 'search_api/drupal.search_api.index-active-formatters';
104-
$form['#title'] = $this->t('Manage filters for search index %label', array('%label' => $this->entity->label()));
104+
$form['#title'] = $this->t('Manage processors for search index %label', array('%label' => $this->entity->label()));
105105
$form['description']['#markup'] = '<p>' . $this->t('Configure processors which will pre- and post-process data at index and search time.') . '</p>';
106106

107107
// Add the list of processors with checkboxes to enable/disable them.

Diff for: src/IndexListBuilder.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ public function getDefaultOperations(EntityInterface $entity) {
6868
'weight' => 20,
6969
'url' => new Url('entity.search_api_index.fields', $route_parameters),
7070
);
71-
$operations['filters'] = array(
72-
'title' => $this->t('Filters'),
71+
$operations['processors'] = array(
72+
'title' => $this->t('Processors'),
7373
'weight' => 30,
74-
'url' => new Url('entity.search_api_index.filters', $route_parameters),
74+
'url' => new Url('entity.search_api_index.processors', $route_parameters),
7575
);
7676
}
7777

Diff for: src/Tests/IntegrationTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ protected function createIndex() {
128128
$this->drupalPostForm(NULL, $edit, $this->t('Save'));
129129
$this->assertText($this->t('!name field is required.', array('!name' => $this->t('Index name'))));
130130
$this->assertText($this->t('!name field is required.', array('!name' => $this->t('Machine-readable name'))));
131-
$this->assertText($this->t('!name field is required.', array('!name' => $this->t('Data types'))));
131+
$this->assertText($this->t('!name field is required.', array('!name' => $this->t('Data sources'))));
132132

133133
$this->indexId = 'test_index';
134134

@@ -374,7 +374,7 @@ protected function addFilter() {
374374
$edit = array(
375375
'status[ignorecase]' => 1,
376376
);
377-
$this->drupalPostForm($this->getIndexPath('filters'), $edit, $this->t('Save'));
377+
$this->drupalPostForm($this->getIndexPath('processors'), $edit, $this->t('Save'));
378378
/** @var \Drupal\search_api\IndexInterface $index */
379379
$index = entity_load('search_api_index', $this->indexId, TRUE);
380380
$processors = $index->getProcessors();
@@ -390,7 +390,7 @@ protected function configureFilter() {
390390
'processors[ignorecase][settings][fields][search_api_language]' => FALSE,
391391
'processors[ignorecase][settings][fields][entity:node/title]' => 'entity:node/title',
392392
);
393-
$this->drupalPostForm($this->getIndexPath('filters'), $edit, $this->t('Save'));
393+
$this->drupalPostForm($this->getIndexPath('processors'), $edit, $this->t('Save'));
394394
/** @var \Drupal\search_api\IndexInterface $index */
395395
$index = entity_load('search_api_index', $this->indexId, TRUE);
396396
$processors = $index->getProcessors();

Diff for: src/Tests/Processor/ProcessorIntegrationTest.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ public function checkUrlFieldIntegration() {
215215
* The ID of the processor to enable.
216216
*/
217217
protected function enableProcessor($processor_id) {
218-
$this->loadFiltersTab();
218+
$this->loadProcessorsTab();
219219

220220
$edit = array(
221221
"status[$processor_id]" => 1,
@@ -234,7 +234,7 @@ protected function enableProcessor($processor_id) {
234234
* The ID of the processor whose settings are edited.
235235
*/
236236
protected function editSettingsForm($edit, $processor_id) {
237-
$this->loadFiltersTab();
237+
$this->loadProcessorsTab();
238238

239239
$this->drupalPostForm(NULL, $edit, $this->t('Save'));
240240

@@ -252,10 +252,10 @@ protected function editSettingsForm($edit, $processor_id) {
252252
}
253253

254254
/**
255-
* Loads the test index's "Filters" tab in the test browser, if necessary.
255+
* Loads the test index's "Processors" tab in the test browser, if necessary.
256256
*/
257-
protected function loadFiltersTab() {
258-
$settings_path = 'admin/config/search/search-api/index/' . $this->indexId . '/filters';
257+
protected function loadProcessorsTab() {
258+
$settings_path = 'admin/config/search/search-api/index/' . $this->indexId . '/processors';
259259
if ($this->getAbsoluteUrl($settings_path) != $this->getUrl()) {
260260
$this->drupalGet($settings_path);
261261
}

0 commit comments

Comments
 (0)