From fa13910d985b62b8318399ee36d91d75a709caf0 Mon Sep 17 00:00:00 2001 From: bach Date: Fri, 18 Sep 2026 11:25:15 +0200 Subject: [PATCH] fixed inline editing views admin conflict btw filters an save button --- config/sync/block.block.gin_breadcrumbs.yml | 2 +- config/sync/block.block.gin_content.yml | 2 +- ...lock.gin_formulaireexposecontentpage_1.yml | 28 ++++ config/sync/block.block.gin_local_actions.yml | 2 +- config/sync/block.block.gin_page_title.yml | 2 +- .../block.block.gin_primary_local_tasks.yml | 2 +- .../block.block.gin_secondary_local_tasks.yml | 2 +- config/sync/core.extension.yml | 1 + config/sync/views.view.content.yml | 141 +----------------- .../gin_compat/css/exposed-filters-block.css | 22 +++ .../custom/gin_compat/gin_compat.info.yml | 5 + .../gin_compat/gin_compat.libraries.yml | 4 + .../custom/gin_compat/gin_compat.module | 31 ++++ 13 files changed, 100 insertions(+), 144 deletions(-) create mode 100644 config/sync/block.block.gin_formulaireexposecontentpage_1.yml create mode 100644 web/modules/custom/gin_compat/css/exposed-filters-block.css create mode 100644 web/modules/custom/gin_compat/gin_compat.info.yml create mode 100644 web/modules/custom/gin_compat/gin_compat.libraries.yml create mode 100644 web/modules/custom/gin_compat/gin_compat.module diff --git a/config/sync/block.block.gin_breadcrumbs.yml b/config/sync/block.block.gin_breadcrumbs.yml index c3cfbb6..c36f6d6 100644 --- a/config/sync/block.block.gin_breadcrumbs.yml +++ b/config/sync/block.block.gin_breadcrumbs.yml @@ -11,7 +11,7 @@ _core: id: gin_breadcrumbs theme: gin region: breadcrumb -weight: 0 +weight: -4 provider: null plugin: system_breadcrumb_block settings: diff --git a/config/sync/block.block.gin_content.yml b/config/sync/block.block.gin_content.yml index 491a2d3..3a47078 100644 --- a/config/sync/block.block.gin_content.yml +++ b/config/sync/block.block.gin_content.yml @@ -11,7 +11,7 @@ _core: id: gin_content theme: gin region: content -weight: 0 +weight: -2 provider: null plugin: system_main_block settings: diff --git a/config/sync/block.block.gin_formulaireexposecontentpage_1.yml b/config/sync/block.block.gin_formulaireexposecontentpage_1.yml new file mode 100644 index 0000000..f375d1a --- /dev/null +++ b/config/sync/block.block.gin_formulaireexposecontentpage_1.yml @@ -0,0 +1,28 @@ +uuid: fcf84dcc-5527-4f4c-86f2-f03cf13f8314 +langcode: fr +status: true +dependencies: + config: + - views.view.content + module: + - system + - views + theme: + - gin +id: gin_formulaireexposecontentpage_1 +theme: gin +region: content +weight: -3 +provider: null +plugin: 'views_exposed_filter_block:content-page_1' +settings: + id: 'views_exposed_filter_block:content-page_1' + label: '' + label_display: '0' + provider: views + views_label: '' +visibility: + request_path: + id: request_path + negate: false + pages: "/admin/content\r\n/admin/content/*" diff --git a/config/sync/block.block.gin_local_actions.yml b/config/sync/block.block.gin_local_actions.yml index c27b582..de8fb4b 100644 --- a/config/sync/block.block.gin_local_actions.yml +++ b/config/sync/block.block.gin_local_actions.yml @@ -9,7 +9,7 @@ _core: id: gin_local_actions theme: gin region: content -weight: -10 +weight: -4 provider: null plugin: local_actions_block settings: diff --git a/config/sync/block.block.gin_page_title.yml b/config/sync/block.block.gin_page_title.yml index ee3c584..101540c 100644 --- a/config/sync/block.block.gin_page_title.yml +++ b/config/sync/block.block.gin_page_title.yml @@ -9,7 +9,7 @@ _core: id: gin_page_title theme: gin region: header -weight: -30 +weight: -5 provider: null plugin: page_title_block settings: diff --git a/config/sync/block.block.gin_primary_local_tasks.yml b/config/sync/block.block.gin_primary_local_tasks.yml index 3e8ce67..0f7e1a9 100644 --- a/config/sync/block.block.gin_primary_local_tasks.yml +++ b/config/sync/block.block.gin_primary_local_tasks.yml @@ -9,7 +9,7 @@ _core: id: gin_primary_local_tasks theme: gin region: header -weight: 0 +weight: -4 provider: null plugin: local_tasks_block settings: diff --git a/config/sync/block.block.gin_secondary_local_tasks.yml b/config/sync/block.block.gin_secondary_local_tasks.yml index e25c7b0..230de39 100644 --- a/config/sync/block.block.gin_secondary_local_tasks.yml +++ b/config/sync/block.block.gin_secondary_local_tasks.yml @@ -9,7 +9,7 @@ _core: id: gin_secondary_local_tasks theme: gin region: pre_content -weight: 0 +weight: -5 provider: null plugin: local_tasks_block settings: diff --git a/config/sync/core.extension.yml b/config/sync/core.extension.yml index 2f8ac67..5e30efb 100644 --- a/config/sync/core.extension.yml +++ b/config/sync/core.extension.yml @@ -50,6 +50,7 @@ module: filter: 0 filter_perms: 0 formatter_suite: 0 + gin_compat: 0 gin_toolbar: 0 help: 0 honeypot: 0 diff --git a/config/sync/views.view.content.yml b/config/sync/views.view.content.yml index 83ed50e..9aa4669 100644 --- a/config/sync/views.view.content.yml +++ b/config/sync/views.view.content.yml @@ -4,8 +4,6 @@ status: true dependencies: config: - core.base_field_override.node.evenement.promote - - field.field.node.evenement.field_type_d_evenement - - field.field.node.projet.field_type_de_projet - field.storage.node.field_dates - field.storage.node.field_images - field.storage.node.field_projet_s_lie_s @@ -242,7 +240,7 @@ display: admin_label: '' plugin_id: field label: 'Type de projet / évenement' - exclude: true + exclude: false alter: alter_text: false text: '' @@ -305,7 +303,7 @@ display: admin_label: '' plugin_id: field label: "Type d'évenement" - exclude: true + exclude: false alter: alter_text: false text: '' @@ -359,136 +357,6 @@ display: multi_type: separator separator: ', ' field_api_classes: false - form_field_field_type_de_projet: - id: form_field_field_type_de_projet - table: node_field_data - field: form_field_field_type_de_projet - relationship: none - group_type: group - admin_label: '' - entity_type: node - plugin_id: entity_form_field - label: 'Type de projet / évenement' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - plugin: - hide_title: true - hide_description: true - fallback_view_mode: '0' - type: autocomplete_deluxe - settings: - match_operator: CONTAINS - match_limit: 10 - min_length: 0 - delimiter: '' - not_found_message_allow: false - not_found_message: "The term '@term' will be added" - new_terms: false - no_empty_message: "Pour qu'un projet puisse apparaître sur la home, il doit obligatoirement avoir un type de projet." - third_party_settings: { } - form_field_field_type_d_evenement: - id: form_field_field_type_d_evenement - table: node_field_data - field: form_field_field_type_d_evenement - relationship: none - group_type: group - admin_label: '' - entity_type: node - plugin_id: entity_form_field - label: "Form field: Type d'évenement" - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - plugin: - hide_title: true - hide_description: true - fallback_view_mode: '0' - type: autocomplete_deluxe - settings: - match_operator: CONTAINS - match_limit: 10 - min_length: 0 - delimiter: '' - not_found_message_allow: false - not_found_message: "The term '@term' will be added" - new_terms: false - no_empty_message: "Pour qu'un événement puisse apparaître sur la home, il doit obligatoirement avoir un type d'événement." - third_party_settings: { } field_projet_s_lie_s: id: field_projet_s_lie_s table: node__field_projet_s_lie_s @@ -1392,8 +1260,6 @@ display: - user.permissions tags: - 'config:core.base_field_override.node.evenement.promote' - - 'config:field.field.node.evenement.field_type_d_evenement' - - 'config:field.field.node.projet.field_type_de_projet' - 'config:field.storage.node.field_dates' - 'config:field.storage.node.field_images' - 'config:field.storage.node.field_projet_s_lie_s' @@ -1406,6 +1272,7 @@ display: display_plugin: page position: 1 display_options: + exposed_block: true display_extenders: { } path: admin/content/node menu: @@ -1433,8 +1300,6 @@ display: - user.permissions tags: - 'config:core.base_field_override.node.evenement.promote' - - 'config:field.field.node.evenement.field_type_d_evenement' - - 'config:field.field.node.projet.field_type_de_projet' - 'config:field.storage.node.field_dates' - 'config:field.storage.node.field_images' - 'config:field.storage.node.field_projet_s_lie_s' diff --git a/web/modules/custom/gin_compat/css/exposed-filters-block.css b/web/modules/custom/gin_compat/css/exposed-filters-block.css new file mode 100644 index 0000000..81c825d --- /dev/null +++ b/web/modules/custom/gin_compat/css/exposed-filters-block.css @@ -0,0 +1,22 @@ +/** + * gin_compat_preprocess_block() ajoute la classe "views-exposed-form" au + *
pour que Claro/Gin lui appliquent nativement leur mise en page + * flex (voir claro/css/components/views-exposed-form.css). Mais le wrapper + * du bloc porte déjà cette même classe de façon native (indépendamment de + * nous), donc la règle Claro/Gin "card" (padding, marge, bordure, ombre) + * s'applique aux deux éléments imbriqués et double l'espace utilisé. On ne + * neutralise ici que le wrapper, pour qu'une seule "card" (celle du + * ) reste visible — le style visuel proprement dit reste 100% celui + * de Gin, on ne fait que retirer la duplication. + */ +.views-exposed-form.block { + padding: 0 !important; + margin: 0 0 var(--gin-spacing-l, 24px) !important; + border: 0 !important; + background: none !important; + box-shadow: none !important; +} + +.views-exposed-form.block form.views-exposed-form{ + margin: 0!important; +} diff --git a/web/modules/custom/gin_compat/gin_compat.info.yml b/web/modules/custom/gin_compat/gin_compat.info.yml new file mode 100644 index 0000000..ea019ac --- /dev/null +++ b/web/modules/custom/gin_compat/gin_compat.info.yml @@ -0,0 +1,5 @@ +type: module +name: 'Gin Compat' +description: 'Correctifs de compatibilité CSS/JS pour le thème d''administration Gin (éléments Views/Better Exposed Filters rendus hors du contexte habituel de la vue, ex. bloc de filtres exposés).' +package: Gin +core_version_requirement: '^10.5 || ^11' diff --git a/web/modules/custom/gin_compat/gin_compat.libraries.yml b/web/modules/custom/gin_compat/gin_compat.libraries.yml new file mode 100644 index 0000000..f638478 --- /dev/null +++ b/web/modules/custom/gin_compat/gin_compat.libraries.yml @@ -0,0 +1,4 @@ +exposed-filters-block: + css: + theme: + css/exposed-filters-block.css: {} diff --git a/web/modules/custom/gin_compat/gin_compat.module b/web/modules/custom/gin_compat/gin_compat.module new file mode 100644 index 0000000..17cf038 --- /dev/null +++ b/web/modules/custom/gin_compat/gin_compat.module @@ -0,0 +1,31 @@ + "Exposed + * form in block") perd la classe "views-exposed-form" sur sa balise : + * Drupal core (BlockViewBuilder::preRender()) retire volontairement + * #attributes du contenu d'un bloc pour le fusionner dans le wrapper du + * bloc, donc tout ce qu'on ajoute via hook_form_alter atterrit sur le
+ * englobant plutôt que sur le . Or c'est justement cette classe que + * Claro/Gin ciblent nativement pour la mise en page flex (voir + * claro/css/components/views-exposed-form.css). On la réinjecte donc ici, + * après ce "vol" d'attributs, directement sur le contenu du bloc afin + * qu'elle atterrisse sur le lors de son propre rendu. + */ +function gin_compat_preprocess_block(array &$variables) { + $plugin_id = $variables['plugin_id'] ?? ''; + if (str_starts_with($plugin_id, 'views_exposed_filter_block:')) { + $variables['content']['#attributes']['class'][] = 'views-exposed-form'; + // Le wrapper du bloc porte nativement cette même classe : neutralise sa + // "card" (padding/marge/bordure/ombre) pour éviter qu'elle se double + // avec celle du . Voir css/exposed-filters-block.css. + $variables['content']['#attached']['library'][] = 'gin_compat/exposed-filters-block'; + } +}