From ba4121e646f479c0e5e1a7a26fb5d3fd3b55de72 Mon Sep 17 00:00:00 2001 From: Kasper Birch Date: Wed, 8 Jan 2025 12:02:21 +0100 Subject: [PATCH 1/2] Bump `drupal/facets` from 2.0.9 to 3.0.0 Steps taken: - Ran `composer require drupal/facets:^3.0` - Executed `drush updatedb` - Rebuilt cache using `drush cache:rebuild` - Exported configuration with `drush config:export --diff` No changes were detected in the database or configuration files as a result of the update. --- composer.json | 2 +- composer.lock | 31 +++++++++++++++++-------------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/composer.json b/composer.json index 578209b7e..6e752b60d 100644 --- a/composer.json +++ b/composer.json @@ -120,7 +120,7 @@ "drupal/entity_clone_template": "^2.0", "drupal/entity_reference_revisions": "^1.11.0", "drupal/enum_field": "^1.0", - "drupal/facets": "^2.0", + "drupal/facets": "^3.0", "drupal/field_group": "^3.4", "drupal/field_inheritance": "^2.0", "drupal/flat_taxonomy": "^2.0", diff --git a/composer.lock b/composer.lock index 0674e171f..8c83bf3f7 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "269af6794ea38ceed3eb2b4ced4857ed", + "content-hash": "23d8db2ac15980995884819523e43e3b", "packages": [ { "name": "amazeeio/drupal_integrations", @@ -4276,38 +4276,41 @@ }, { "name": "drupal/facets", - "version": "2.0.9", + "version": "3.0.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/facets.git", - "reference": "2.0.9" + "reference": "3.0.0" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/facets-2.0.9.zip", - "reference": "2.0.9", - "shasum": "54512df3448c2464ef2bee7eefa825115562c9d5" + "url": "https://ftp.drupal.org/files/projects/facets-3.0.0.zip", + "reference": "3.0.0", + "shasum": "9fa44774d43aa065989cdf26b3992fa4029ae63e" }, "require": { - "drupal/core": "^10 || ^11" + "drupal/core": "^10.1 || ^11" }, "conflict": { - "drupal/search_api": "<1.30" + "drupal/core": "<10.1.0", + "drupal/search_api": "<1.14" }, "require-dev": { - "drupal/jquery_ui_slider": "^2.1", - "drupal/jquery_ui_touch_punch": "^1.1", + "drupal/better_exposed_filters": "~7.0", + "drupal/jquery_ui_slider": "~2.1", + "drupal/jquery_ui_touch_punch": "~1.1", "drupal/search_api": "1.x-dev" }, "suggest": { + "drupal/better_exposed_filters": "Required for AJAX support for facets rendered as views exposed filters", "drupal/jquery_ui_slider": "Required for the 'Facets Range Widget' module to work", "drupal/jquery_ui_touch_punch": "Required for the 'Facets Range Widget' module to work" }, "type": "drupal-module", "extra": { "drupal": { - "version": "2.0.9", - "datestamp": "1728492418", + "version": "3.0.0", + "datestamp": "1735915197", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -4316,7 +4319,7 @@ }, "notification-url": "https://packages.drupal.org/8/downloads", "license": [ - "GPL-2.0+" + "GPL-2.0-or-later" ], "authors": [ { @@ -4343,7 +4346,7 @@ "description": "The Facet module allows site builders to easily create and manage faceted search interfaces.", "homepage": "https://www.drupal.org/project/facets", "support": { - "source": "https://git.drupalcode.org/project/facets", + "source": "https://git.drupalcode.org/project/facets.git", "issues": "https://www.drupal.org/project/issues/facets", "irc": "irc://irc.freenode.org/drupal-search-api" } From ea3716742dfbfed491ee14b36e6b5f7be553c9cc Mon Sep 17 00:00:00 2001 From: Kasper Birch Date: Mon, 13 Jan 2025 13:37:36 +0100 Subject: [PATCH 2/2] WIP --- config/sync/core.extension.yml | 1 + config/sync/views.view.events.yml | 139 ++++++++++++++++++ .../views/form--views-exposed-form.html.twig | 3 + .../views-view--content-list-page.html.twig | 3 + .../views/views-view--events.html.twig | 8 - 5 files changed, 146 insertions(+), 8 deletions(-) diff --git a/config/sync/core.extension.yml b/config/sync/core.extension.yml index 90aff7088..90905e68d 100644 --- a/config/sync/core.extension.yml +++ b/config/sync/core.extension.yml @@ -92,6 +92,7 @@ module: entity_reference_revisions: 0 enum_field: 0 facets: 0 + facets_exposed_filters: 0 field: 0 field_group: 0 field_inheritance: 0 diff --git a/config/sync/views.view.events.yml b/config/sync/views.view.events.yml index 385282804..6e98329fb 100644 --- a/config/sync/views.view.events.yml +++ b/config/sync/views.view.events.yml @@ -6,6 +6,7 @@ dependencies: - search_api.index.events module: - better_exposed_filters + - facets_exposed_filters - search_api - user - views_infinite_scroll @@ -280,6 +281,139 @@ display: default_group: All default_group_multiple: { } group_items: { } + facets_branch: + id: facets_branch + table: search_api_index_events + field: facets_branch + relationship: none + group_type: group + admin_label: '' + plugin_id: facets_filter + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: '' + label: 'Event Branch' + description: '' + use_operator: false + operator: '' + operator_limit_selection: false + operator_list: { } + identifier: branch + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + 0: '0' + anonymous: '0' + administrator: '0' + local_administrator: '0' + editor: '0' + mediator: '0' + patron: '0' + external_system: '0' + bnf_graphql_client: '0' + go_graphql_client: '0' + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + hierarchy: false + label_display: visible + facet: + query_operator: or + min_count: 1 + show_numbers: false + processor_configs: + translate_entity: + weights: + build: 5 + settings: { } + count_widget_order: + weights: + sort: 30 + settings: + sort: DESC + display_value_widget_order: + weights: + sort: 40 + settings: + sort: ASC + active_widget_order: + weights: + sort: 20 + settings: + sort: DESC + facets_event_categories: + id: facets_event_categories + table: search_api_index_events + field: facets_event_categories + relationship: none + group_type: group + admin_label: '' + plugin_id: facets_filter + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: '' + label: 'Event categories' + description: '' + use_operator: false + operator: '' + operator_limit_selection: false + operator_list: { } + identifier: event_categories + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + 0: '0' + anonymous: '0' + administrator: '0' + local_administrator: '0' + editor: '0' + mediator: '0' + patron: '0' + external_system: '0' + bnf_graphql_client: '0' + go_graphql_client: '0' + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + hierarchy: false + label_display: visible + facet: + query_operator: or + min_count: 1 + show_numbers: false + processor_configs: + translate_entity: + weights: + build: 5 + settings: { } search_api_fulltext: id: search_api_fulltext table: search_api_index_events @@ -332,6 +466,10 @@ display: parse_mode: terms min_length: null fields: { } + filter_groups: + operator: AND + groups: + 1: AND style: type: default row: @@ -376,6 +514,7 @@ display: cache_metadata: max-age: -1 contexts: + - 'facets_filter:f' - 'languages:language_interface' - url - url.query_args diff --git a/web/themes/custom/novel/templates/views/form--views-exposed-form.html.twig b/web/themes/custom/novel/templates/views/form--views-exposed-form.html.twig index c94637451..f4e721436 100644 --- a/web/themes/custom/novel/templates/views/form--views-exposed-form.html.twig +++ b/web/themes/custom/novel/templates/views/form--views-exposed-form.html.twig @@ -3,5 +3,8 @@ {{ children }} + + + {{dd()}} diff --git a/web/themes/custom/novel/templates/views/views-view--content-list-page.html.twig b/web/themes/custom/novel/templates/views/views-view--content-list-page.html.twig index 2cc9a72ae..a5ea88d40 100644 --- a/web/themes/custom/novel/templates/views/views-view--content-list-page.html.twig +++ b/web/themes/custom/novel/templates/views/views-view--content-list-page.html.twig @@ -5,15 +5,18 @@ ] %} + test {% if view.getTitle() %} {{ title_prefix }}

{{ view.getTitle() }}

+ {{ title_suffix }} {% endif %} {{ header }}
    + {# Skal måske slettes #} {% block facets %} {% endblock %} diff --git a/web/themes/custom/novel/templates/views/views-view--events.html.twig b/web/themes/custom/novel/templates/views/views-view--events.html.twig index c3722d748..d63765cf1 100644 --- a/web/themes/custom/novel/templates/views/views-view--events.html.twig +++ b/web/themes/custom/novel/templates/views/views-view--events.html.twig @@ -1,10 +1,2 @@ {% extends '@novel/views/views-view--content-list-page.html.twig' %} -{% block facets %} -
  • - {{ drupal_block("facet_block:event_categories") }} -
  • -
  • - {{ drupal_block("facet_block:branch") }} -
  • -{% endblock %}