-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #156 from openeuropa/EPIC-1450-List-pages
OEL-1450: Epic list pages.
- Loading branch information
Showing
16 changed files
with
510 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# OpenEuropa Whitelabel list pages | ||
|
||
This module is a theming companion module to the [OpenEuropa List Pages](https://github.com/openeuropa/oe_list_pages) component. It provides the logic needed to theme the list pages. |
42 changes: 42 additions & 0 deletions
42
...itelabel_list_pages/config/install/core.entity_view_display.node.oe_list_page.default.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
langcode: en | ||
status: true | ||
dependencies: | ||
config: | ||
- node.type.oe_list_page | ||
module: | ||
- user | ||
id: node.oe_list_page.default | ||
targetEntityType: node | ||
bundle: oe_list_page | ||
mode: default | ||
content: | ||
'extra_field_oe_list_page_filters:node:oe_list_page': | ||
settings: { } | ||
third_party_settings: { } | ||
weight: 2 | ||
region: content | ||
'extra_field_oe_list_page_results:node:oe_list_page': | ||
settings: { } | ||
third_party_settings: { } | ||
weight: 1 | ||
region: content | ||
'extra_field_oe_list_page_selected_filters:node:oe_list_page': | ||
settings: { } | ||
third_party_settings: { } | ||
weight: 3 | ||
region: content | ||
'extra_field_oe_list_page_total_count:node:oe_list_page': | ||
settings: { } | ||
third_party_settings: { } | ||
weight: 0 | ||
region: content | ||
hidden: | ||
'extra_field_oe_list_page_pager_info:node:oe_list_page': true | ||
'extra_field_oe_list_page_rss_link:node:oe_list_page': true | ||
langcode: true | ||
links: true | ||
oe_content_content_owner: true | ||
oe_content_legacy_link: true | ||
oe_content_navigation_title: true | ||
oe_content_short_title: true | ||
search_api_excerpt: true |
14 changes: 14 additions & 0 deletions
14
modules/oe_whitelabel_list_pages/oe_whitelabel_list_pages.info.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: OpenEuropa Whitelabel List Pages | ||
type: module | ||
description: Companion module for the OE List Pages module. | ||
package: OpenEuropa Whitelabel Theme | ||
core_version_requirement: ^9.2 | ||
|
||
dependencies: | ||
- extra_field:extra_field | ||
- oe_list_pages:oe_list_page_content_type | ||
- oe_list_pages:oe_list_pages | ||
|
||
config_devel: | ||
install: | ||
- core.entity_view_display.node.oe_list_page.default |
28 changes: 28 additions & 0 deletions
28
modules/oe_whitelabel_list_pages/oe_whitelabel_list_pages.module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
/** | ||
* @file | ||
* OE Whitelabel List Pages module. | ||
*/ | ||
|
||
declare(strict_types = 1); | ||
|
||
use Drupal\Core\Form\FormStateInterface; | ||
|
||
/** | ||
* Implements hook_form_FORM_ID_alter() for facets_forms. | ||
*/ | ||
function oe_whitelabel_list_pages_form_oe_list_pages_facets_form_alter(&$form, FormStateInterface $form_state, $form_id) { | ||
if (isset($form['actions'])) { | ||
$action_classes = ['mt-4', 'd-grid', 'gap-4', 'd-md-block']; | ||
$form['actions']['#attributes']['class'] = array_unique(array_merge($form['actions']['#attributes']['class'] ?? [], $action_classes)); | ||
} | ||
if (isset($form['actions']['submit'])) { | ||
$submit_classes = ['me-md-3', 'btn', 'btn-primary', 'btn-md']; | ||
$form['actions']['submit']['#attributes']['class'] = array_unique(array_merge($form['actions']['submit']['#attributes']['class'] ?? [], $submit_classes)); | ||
} | ||
if (isset($form['actions']['reset'])) { | ||
$reset_classes = ['btn', 'btn-light', 'btn-md']; | ||
$form['actions']['reset']['#attributes']['class'] = array_unique(array_merge($form['actions']['reset']['#attributes']['class'] ?? [], $reset_classes)); | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
...ts/modules/oe_whitelabel_list_pages_test/config/install/facets.facet.oe_sc_news_title.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
langcode: en | ||
status: true | ||
dependencies: { } | ||
id: oe_sc_news_title | ||
name: Title | ||
url_alias: oe_sc_news_title | ||
weight: 0 | ||
min_count: 1 | ||
show_only_one_result: false | ||
field_identifier: title | ||
facet_source_id: 'list_facet_source:node:oe_sc_news' | ||
widget: | ||
type: oe_list_pages_fulltext | ||
config: | ||
fulltext_all_fields: true | ||
query_operator: or | ||
use_hierarchy: false | ||
keep_hierarchy_parents_active: false | ||
expand_hierarchy: false | ||
enable_parent_when_child_gets_disabled: true | ||
hard_limit: 0 | ||
exclude: false | ||
only_visible_when_facet_source_is_visible: false | ||
processor_configs: | ||
active_widget_order: | ||
processor_id: active_widget_order | ||
weights: | ||
sort: 20 | ||
settings: | ||
sort: DESC | ||
count_widget_order: | ||
processor_id: count_widget_order | ||
weights: | ||
sort: 30 | ||
settings: | ||
sort: DESC | ||
display_value_widget_order: | ||
processor_id: display_value_widget_order | ||
weights: | ||
sort: 40 | ||
settings: | ||
sort: ASC | ||
url_processor_handler: | ||
processor_id: url_processor_handler | ||
weights: | ||
pre_query: 50 | ||
build: 15 | ||
settings: { } | ||
empty_behavior: | ||
behavior: none | ||
show_title: false |
8 changes: 8 additions & 0 deletions
8
...ist_pages_test/config/install/facets.facet_source.list_facet_source__node__oe_sc_news.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
langcode: en | ||
status: true | ||
dependencies: { } | ||
id: list_facet_source__node__oe_sc_news | ||
name: 'list_facet_source:node:oe_sc_news' | ||
filter_key: null | ||
url_processor: query_string | ||
breadcrumb: { } |
51 changes: 51 additions & 0 deletions
51
...el_list_pages_test/config/install/search_api.index.oe_whitelabel_list_page_index_test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
langcode: en | ||
status: true | ||
dependencies: | ||
config: | ||
- search_api.server.oe_whitelabel_list_page_search_server_test | ||
module: | ||
- node | ||
- search_api | ||
id: oe_whitelabel_list_page_index_test | ||
name: oe_whitelabel_list_page_index_test | ||
description: '' | ||
read_only: false | ||
field_settings: | ||
title: | ||
label: Title | ||
datasource_id: 'entity:node' | ||
property_path: title | ||
type: text | ||
dependencies: | ||
module: | ||
- node | ||
datasource_settings: | ||
'entity:node': | ||
bundles: | ||
default: false | ||
selected: | ||
- oe_sc_news | ||
languages: | ||
default: true | ||
selected: { } | ||
processor_settings: | ||
add_url: { } | ||
aggregated_field: { } | ||
entity_type: { } | ||
ignorecase: | ||
weights: | ||
preprocess_index: -20 | ||
preprocess_query: -20 | ||
all_fields: false | ||
fields: | ||
- title | ||
language_with_fallback: { } | ||
rendered_item: { } | ||
tracker_settings: | ||
default: | ||
indexing_order: fifo | ||
options: | ||
cron_limit: 50 | ||
index_directly: true | ||
track_changes_in_references: true | ||
server: oe_whitelabel_list_page_search_server_test |
13 changes: 13 additions & 0 deletions
13
...ages_test/config/install/search_api.server.oe_whitelabel_list_page_search_server_test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
langcode: en | ||
status: true | ||
dependencies: | ||
module: | ||
- search_api_db | ||
id: oe_whitelabel_list_page_search_server_test | ||
name: oe_whitelabel_list_page_search_server_test | ||
description: '' | ||
backend: search_api_db | ||
backend_config: | ||
database: 'default:default' | ||
min_chars: 1 | ||
matching: words |
16 changes: 16 additions & 0 deletions
16
..._pages/tests/modules/oe_whitelabel_list_pages_test/oe_whitelabel_list_pages_test.info.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: OpenEuropa Whitelabel List Pages Test | ||
type: module | ||
description: The test module for OE Whitelabel List Pages. Provides EventSubscriber, facets, index and content ready. | ||
package: OpenEuropa Whitelabel Theme | ||
core_version_requirement: ^9.2 | ||
dependencies: | ||
- oe_whitelabel_list_pages | ||
- oe_whitelabel_starter_news | ||
- search_api:search_api_db | ||
|
||
config_devel: | ||
install: | ||
- facets.facet.oe_sc_news_title | ||
- facets.facet_source.list_facet_source__node__oe_sc_news | ||
- search_api.index.oe_whitelabel_list_page_index_test | ||
- search_api.server.oe_whitelabel_list_page_search_server_test |
16 changes: 16 additions & 0 deletions
16
...t_pages/tests/modules/oe_whitelabel_list_pages_test/oe_whitelabel_list_pages_test.install
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
/** | ||
* @file | ||
* The OpenEuropa Whitelabel List Pages install file. | ||
*/ | ||
|
||
declare(strict_types = 1); | ||
|
||
/** | ||
* Implements hook_install(). | ||
*/ | ||
function oe_whitelabel_list_pages_test_install($is_syncing) { | ||
// Clear the facets source cached definitions so the new ones can be found. | ||
\Drupal::service('plugin.manager.facets.facet_source')->clearCachedDefinitions(); | ||
} |
Oops, something went wrong.