From a799ce244681eb8b12344051997476dfc1412176 Mon Sep 17 00:00:00 2001 From: bach Date: Wed, 3 May 2023 15:10:59 +0200 Subject: [PATCH] fixes #2213, implements #2112 --- src/composer.json | 1 + src/composer.lock | 59 +++++++++++- src/config/sync/core.extension.yml | 1 + ...entity_limit.entity_limit.concernement.yml | 17 ++++ ...limit.concernement_pour_admin_figuresl.yml | 17 ++++ src/config/sync/views.view.group_nodes.yml | 93 ++++++++++++++++--- .../admin_menus/admin_menus.links.action.yml | 5 +- 7 files changed, 176 insertions(+), 17 deletions(-) create mode 100644 src/config/sync/entity_limit.entity_limit.concernement.yml create mode 100644 src/config/sync/entity_limit.entity_limit.concernement_pour_admin_figuresl.yml diff --git a/src/composer.json b/src/composer.json index a7b1f22..cfc1f20 100644 --- a/src/composer.json +++ b/src/composer.json @@ -26,6 +26,7 @@ "drupal/core-composer-scaffold": "^9", "drupal/core-project-message": "^9", "drupal/core-recommended": "^9", + "drupal/entity_limit": "^2.0@alpha", "drupal/flexible_permissions": "@beta", "drupal/genpass": "^1.1", "drupal/graphql": "4.x-dev@dev", diff --git a/src/composer.lock b/src/composer.lock index b1faf83..afbc26d 100644 --- a/src/composer.lock +++ b/src/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": "f3baae79e847c753ab9ac766f4338529", + "content-hash": "f874a1a846eacffa0d31c1312d5e160a", "packages": [ { "name": "alchemy/zippy", @@ -5184,6 +5184,62 @@ "source": "https://git.drupalcode.org/project/entity_clone" } }, + { + "name": "drupal/entity_limit", + "version": "2.0.0-alpha3", + "source": { + "type": "git", + "url": "https://git.drupalcode.org/project/entity_limit.git", + "reference": "8.x-2.0-alpha3" + }, + "dist": { + "type": "zip", + "url": "https://ftp.drupal.org/files/projects/entity_limit-8.x-2.0-alpha3.zip", + "reference": "8.x-2.0-alpha3", + "shasum": "a8f6150836414398a6c55d810b5c9afd723d645d" + }, + "require": { + "drupal/core": "^8 || ^9" + }, + "type": "drupal-module", + "extra": { + "drupal": { + "version": "8.x-2.0-alpha3", + "datestamp": "1667703283", + "security-coverage": { + "status": "not-covered", + "message": "Alpha releases are not covered by Drupal security advisories." + } + } + }, + "notification-url": "https://packages.drupal.org/8/downloads", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "gaurav.goyal", + "homepage": "https://www.drupal.org/user/2497208" + }, + { + "name": "purushotam.rai", + "homepage": "https://www.drupal.org/user/3193859" + }, + { + "name": "vyasamit2007", + "homepage": "https://www.drupal.org/user/246119" + }, + { + "name": "wasare", + "homepage": "https://www.drupal.org/user/18262" + } + ], + "description": "Allow administrators to restrict the number of entities that may be created based on different conditions.", + "homepage": "https://www.drupal.org/project/entity_limit", + "support": { + "source": "https://git.drupalcode.org/project/entity_limit" + } + }, { "name": "drupal/entity_reference_revisions", "version": "1.10.0", @@ -14604,6 +14660,7 @@ "minimum-stability": "stable", "stability-flags": { "drupal/audiofield": 20, + "drupal/entity_limit": 15, "drupal/flexible_permissions": 10, "drupal/graphql": 20, "drupal/group": 20, diff --git a/src/config/sync/core.extension.yml b/src/config/sync/core.extension.yml index 0c14566..29c31fa 100644 --- a/src/config/sync/core.extension.yml +++ b/src/config/sync/core.extension.yml @@ -51,6 +51,7 @@ module: entity: 0 entity_browser: 0 entity_browser_enhanced: 0 + entity_limit: 0 entity_reference_revisions: 0 field: 0 field_group: 0 diff --git a/src/config/sync/entity_limit.entity_limit.concernement.yml b/src/config/sync/entity_limit.entity_limit.concernement.yml new file mode 100644 index 0000000..2365d7c --- /dev/null +++ b/src/config/sync/entity_limit.entity_limit.concernement.yml @@ -0,0 +1,17 @@ +uuid: 6df89594-cb4e-47b5-aba6-36de29c5b5e9 +langcode: fr +status: true +dependencies: { } +id: concernement +label: concernement +weight: 0 +plugin: role_limit +entity_type: node +entity_bundles: + concernement: concernement + entite: '0' + static: '0' +limits: + - + id: authenticated + limit: 1 diff --git a/src/config/sync/entity_limit.entity_limit.concernement_pour_admin_figuresl.yml b/src/config/sync/entity_limit.entity_limit.concernement_pour_admin_figuresl.yml new file mode 100644 index 0000000..9f41e26 --- /dev/null +++ b/src/config/sync/entity_limit.entity_limit.concernement_pour_admin_figuresl.yml @@ -0,0 +1,17 @@ +uuid: 2aa643b1-1d91-4bc4-86f7-21bd98dd8835 +langcode: fr +status: true +dependencies: { } +id: concernement_pour_admin_figuresl +label: 'concernement pour admin@figureslibres.io' +weight: 0 +plugin: user_limit +entity_type: node +entity_bundles: + concernement: concernement + entite: '0' + static: '0' +limits: + - + id: '2' + limit: -1 diff --git a/src/config/sync/views.view.group_nodes.yml b/src/config/sync/views.view.group_nodes.yml index f6f339a..abb4be2 100644 --- a/src/config/sync/views.view.group_nodes.yml +++ b/src/config/sync/views.view.group_nodes.yml @@ -2,10 +2,13 @@ uuid: f8555968-3235-4ab5-8996-bb5deea257b9 langcode: fr status: true dependencies: + config: + - field.storage.node.field_confidentialite module: - gnode - group - node + - options _core: default_config_hash: 50gd6UKSddlPxEUbaEG7l1ZHe5Akog488RFK-jAUkCM id: group_nodes @@ -154,17 +157,80 @@ display: multi_type: separator separator: ', ' field_api_classes: false - status: - id: status - table: node_field_data - field: status + uid: + id: uid + table: group_relationship_field_data + field: uid + relationship: group_relationship + group_type: group + admin_label: '' + entity_type: group_relationship + entity_field: uid + plugin_id: field + label: 'Group relationship creator' + 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 + click_sort_column: target_id + type: entity_reference_label + settings: + link: true + group_column: target_id + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + field_confidentialite: + id: field_confidentialite + table: node__field_confidentialite + field: field_confidentialite relationship: none group_type: group admin_label: '' - entity_type: node - entity_field: status plugin_id: field - label: Status + label: Confidentialité exclude: false alter: alter_text: false @@ -206,11 +272,8 @@ display: empty_zero: false hide_alter_empty: true click_sort_column: value - type: boolean - settings: - format: custom - format_custom_false: Unpublished - format_custom_true: Published + type: list_default + settings: { } group_column: value group_columns: { } group_rows: true @@ -925,7 +988,8 @@ display: - url.query_args - user.group_permissions - 'user.node_grants:view' - tags: { } + tags: + - 'config:field.storage.node.field_confidentialite' page_1: id: page_1 display_title: Page @@ -954,4 +1018,5 @@ display: - url.query_args - user.group_permissions - 'user.node_grants:view' - tags: { } + tags: + - 'config:field.storage.node.field_confidentialite' diff --git a/src/web/modules/custom/admin_menus/admin_menus.links.action.yml b/src/web/modules/custom/admin_menus/admin_menus.links.action.yml index 2a6fd56..8e14ec0 100644 --- a/src/web/modules/custom/admin_menus/admin_menus.links.action.yml +++ b/src/web/modules/custom/admin_menus/admin_menus.links.action.yml @@ -2,10 +2,11 @@ admin_menus.concernement_add: route_name: node.add route_parameters: node_type: 'concernement' - title: 'Add Concernement' + title: 'Ajouter un concernement' appears_on: - view.admin_nodes.page_1 - + - view.user_contents.page_1 + admin_menus.entite_add: route_name: node.add route_parameters: