From 1a13e60a38d5e21b1d605d07fde1528fcf619f0a Mon Sep 17 00:00:00 2001 From: bach Date: Thu, 20 Jul 2023 22:29:43 +0200 Subject: [PATCH] node revisions (historique) fixed #2257 --- ...form_display.node.concernement.default.yml | 41 +++++++++++-------- src/config/sync/user.role.anonymous.yml | 5 +++ src/config/sync/user.role.authenticated.yml | 4 ++ .../ouatminimal_theme/ouatminimal.theme | 25 ++++++----- ...ode-edit-form--node-concernement.html.twig | 6 +-- 5 files changed, 47 insertions(+), 34 deletions(-) diff --git a/src/config/sync/core.entity_form_display.node.concernement.default.yml b/src/config/sync/core.entity_form_display.node.concernement.default.yml index 2b7de80..737df88 100644 --- a/src/config/sync/core.entity_form_display.node.concernement.default.yml +++ b/src/config/sync/core.entity_form_display.node.concernement.default.yml @@ -30,7 +30,7 @@ third_party_settings: - group_ateliers - group_puissance_d_agir - group_doleancer - - group_confidentialite + - group_revision label: Tabs region: content parent_name: '' @@ -105,21 +105,6 @@ third_party_settings: formatter: closed description: '' required_fields: true - group_confidentialite: - children: - - field_confidentialite - label: Confidentialité - region: content - parent_name: group_tabs - weight: 18 - format_type: tab - format_settings: - classes: '' - show_empty_fields: false - id: '' - formatter: closed - description: '' - required_fields: true group_doleancer: children: - field_doleancer @@ -150,6 +135,21 @@ third_party_settings: formatter: closed description: '' required_fields: true + group_revision: + children: + - revision_log + label: revision + region: content + parent_name: group_tabs + weight: 18 + format_type: tab + format_settings: + classes: '' + show_empty_fields: false + id: '' + formatter: closed + description: '' + required_fields: true id: node.concernement.default targetEntityType: node bundle: concernement @@ -244,6 +244,14 @@ content: rows: 5 placeholder: '' third_party_settings: { } + revision_log: + type: string_textarea + weight: 19 + region: content + settings: + rows: 5 + placeholder: '' + third_party_settings: { } title: type: string_textfield weight: 0 @@ -262,7 +270,6 @@ hidden: langcode: true path: true promote: true - revision_log: true status: true sticky: true uid: true diff --git a/src/config/sync/user.role.anonymous.yml b/src/config/sync/user.role.anonymous.yml index 736cdaf..4a63cc0 100644 --- a/src/config/sync/user.role.anonymous.yml +++ b/src/config/sync/user.role.anonymous.yml @@ -4,11 +4,14 @@ status: true dependencies: config: - filter.format.wysiwyg + - node.type.concernement + - node.type.entite module: - devel - filter - graphql - group + - node - system - workflow _core: @@ -31,5 +34,7 @@ permissions: - 'execute ouatterrir arbitrary graphql requests' - 'execute ouatterrir persisted graphql requests' - 'use text format wysiwyg' + - 'view concernement revisions' + - 'view entite revisions' - 'view published fil entities' - 'view search api pages' diff --git a/src/config/sync/user.role.authenticated.yml b/src/config/sync/user.role.authenticated.yml index 1318565..b9aab46 100644 --- a/src/config/sync/user.role.authenticated.yml +++ b/src/config/sync/user.role.authenticated.yml @@ -7,6 +7,8 @@ dependencies: - filter.format.wysiwyg - node.type.besoin - node.type.cercle_politique + - node.type.concernement + - node.type.entite module: - devel - filter @@ -50,6 +52,8 @@ permissions: - 'use chutier' - 'use text format linkonly' - 'use text format wysiwyg' + - 'view concernement revisions' + - 'view entite revisions' - 'view own unpublished chutier entities' - 'view own unpublished composition entities' - 'view own unpublished fil entities' diff --git a/src/web/themes/custom/ouatminimal_theme/ouatminimal.theme b/src/web/themes/custom/ouatminimal_theme/ouatminimal.theme index b07a3ca..a244bb5 100644 --- a/src/web/themes/custom/ouatminimal_theme/ouatminimal.theme +++ b/src/web/themes/custom/ouatminimal_theme/ouatminimal.theme @@ -59,9 +59,8 @@ function ouatminimal_form_node_form_alter(&$form, FormStateInterface $form_state $form['#attached']['library'][] = 'seven/node-form'; if ($form["#form_id"] != 'node_static_edit_form') { - // unset($form['advanced']); $form['advanced']['#type'] = 'container'; - $form['advanced']['#access'] = FALSE; + // $form['advanced']['#access'] = true; $form['meta']['#type'] = 'container'; $form['meta']['#access'] = TRUE; $form['meta']['changed']['#wrapper_attributes']['class'][] = 'container-inline'; @@ -150,19 +149,19 @@ function ouatminimal_preprocess_textarea(&$variables) { // $variables['attributes']->setAttribute('cols', 40); } -function ouatminimal_preprocess_node_edit_form__node_concernement(&$variables) { - // $variables['form']['advanced']['#group'] = "group_admin"; - // $ph = $variables['form']['title']['widget'][0]['value']['#placeholder']; - // $variables['form']['title']['widget']['#description'] = $ph; - // $variables['form']['title']['widget'][0]['#description'] = $ph; - // $variables['form']['title']['widget'][0]['value']['#description'] = $ph; +// function ouatminimal_preprocess_node_edit_form__node_concernement(&$variables) { +// // $variables['form']['advanced']['#group'] = "group_admin"; +// // $ph = $variables['form']['title']['widget'][0]['value']['#placeholder']; +// // $variables['form']['title']['widget']['#description'] = $ph; +// // $variables['form']['title']['widget'][0]['#description'] = $ph; +// // $variables['form']['title']['widget'][0]['value']['#description'] = $ph; - // $variables['form']['title']['widget']['#title'] = $ph; - // $variables['form']['title']['widget'][0]['#title'] = $ph; - // $variables['form']['title']['widget'][0]['value']['#title'] = $ph; - // $variables['form']['title']['widget'][0]['value']['#placeholder'] = ""; -} +// // $variables['form']['title']['widget']['#title'] = $ph; +// // $variables['form']['title']['widget'][0]['#title'] = $ph; +// // $variables['form']['title']['widget'][0]['value']['#title'] = $ph; +// // $variables['form']['title']['widget'][0]['value']['#placeholder'] = ""; +// } function ouatminimal_preprocess_input(&$variables) { $element = &$variables['element']; diff --git a/src/web/themes/custom/ouatminimal_theme/templates/form/node-edit-form--node-concernement.html.twig b/src/web/themes/custom/ouatminimal_theme/templates/form/node-edit-form--node-concernement.html.twig index 4e01f2a..2fc2251 100644 --- a/src/web/themes/custom/ouatminimal_theme/templates/form/node-edit-form--node-concernement.html.twig +++ b/src/web/themes/custom/ouatminimal_theme/templates/form/node-edit-form--node-concernement.html.twig @@ -23,8 +23,6 @@
{{ form|without('title','advanced', 'footer', 'actions', 'group_internal') }} - {# {{ form|without('title','footer') }} #} - {# {{ form }} #}
{{ form.group_internal }} @@ -32,9 +30,9 @@ {{ form.actions }}
- {#