summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGábor Hojtsy2018-07-27 12:16:09 (GMT)
committerGábor Hojtsy2018-07-27 12:17:06 (GMT)
commitfe48728b801dfb19ea148af5fad37997cd10f54a (patch)
tree29f5309ffe0ee71257d5243cf23e792285ce679e
parent80818954e65f6dca74082d451137554ef865b740 (diff)
Issue #2953376 by Eli-T, anmolgoyal74, John Cook, chr.fritsch, markconroy: Adopt Content Moderation in Umami
(cherry picked from commit 8dc4c5a2c15b31a0230a5897eae10716af5e13d5)
-rw-r--r--core/profiles/demo_umami/config/install/core.entity_form_display.block_content.banner_block.default.yml3
-rw-r--r--core/profiles/demo_umami/config/install/core.entity_form_display.block_content.basic.default.yml3
-rw-r--r--core/profiles/demo_umami/config/install/core.entity_form_display.block_content.disclaimer_block.default.yml3
-rw-r--r--core/profiles/demo_umami/config/install/core.entity_form_display.block_content.footer_promo_block.default.yml3
-rw-r--r--core/profiles/demo_umami/config/install/core.entity_form_display.media.audio.default.yml3
-rw-r--r--core/profiles/demo_umami/config/install/core.entity_form_display.media.file.default.yml3
-rw-r--r--core/profiles/demo_umami/config/install/core.entity_form_display.media.image.default.yml3
-rw-r--r--core/profiles/demo_umami/config/install/core.entity_form_display.media.remote_video.default.yml3
-rw-r--r--core/profiles/demo_umami/config/install/core.entity_form_display.media.video.default.yml3
-rw-r--r--core/profiles/demo_umami/config/install/core.entity_form_display.node.article.default.yml26
-rw-r--r--core/profiles/demo_umami/config/install/core.entity_form_display.node.page.default.yml23
-rw-r--r--core/profiles/demo_umami/config/install/core.entity_form_display.node.recipe.default.yml7
-rw-r--r--core/profiles/demo_umami/config/install/core.entity_view_display.node.article.default.yml3
-rw-r--r--core/profiles/demo_umami/config/install/core.entity_view_display.node.article.full.yml3
-rw-r--r--core/profiles/demo_umami/config/install/core.entity_view_display.node.article.highlighted_bottom.yml1
-rw-r--r--core/profiles/demo_umami/config/install/core.entity_view_display.node.article.highlighted_medium.yml1
-rw-r--r--core/profiles/demo_umami/config/install/core.entity_view_display.node.article.highlighted_small.yml1
-rw-r--r--core/profiles/demo_umami/config/install/core.entity_view_display.node.article.highlighted_top.yml1
-rw-r--r--core/profiles/demo_umami/config/install/core.entity_view_display.node.article.rss.yml1
-rw-r--r--core/profiles/demo_umami/config/install/core.entity_view_display.node.article.teaser.yml3
-rw-r--r--core/profiles/demo_umami/config/install/core.entity_view_display.node.page.default.yml3
-rw-r--r--core/profiles/demo_umami/config/install/core.entity_view_display.node.page.teaser.yml3
-rw-r--r--core/profiles/demo_umami/config/install/core.entity_view_display.node.recipe.default.yml1
-rw-r--r--core/profiles/demo_umami/config/install/core.entity_view_display.node.recipe.full.yml1
-rw-r--r--core/profiles/demo_umami/config/install/core.entity_view_display.node.recipe.highlighted_bottom.yml1
-rw-r--r--core/profiles/demo_umami/config/install/core.entity_view_display.node.recipe.highlighted_medium.yml1
-rw-r--r--core/profiles/demo_umami/config/install/core.entity_view_display.node.recipe.highlighted_small.yml1
-rw-r--r--core/profiles/demo_umami/config/install/core.entity_view_display.node.recipe.highlighted_top.yml1
-rw-r--r--core/profiles/demo_umami/config/install/core.entity_view_display.node.recipe.teaser.yml1
-rw-r--r--core/profiles/demo_umami/config/install/user.role.author.yml48
-rw-r--r--core/profiles/demo_umami/config/install/user.role.editor.yml52
-rw-r--r--core/profiles/demo_umami/config/install/workflows.workflow.editorial.yml67
-rw-r--r--core/profiles/demo_umami/demo_umami.info.yml2
-rw-r--r--core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php37
-rw-r--r--core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php12
35 files changed, 293 insertions, 35 deletions
diff --git a/core/profiles/demo_umami/config/install/core.entity_form_display.block_content.banner_block.default.yml b/core/profiles/demo_umami/config/install/core.entity_form_display.block_content.banner_block.default.yml
index 5dd5dd5..c272758 100644
--- a/core/profiles/demo_umami/config/install/core.entity_form_display.block_content.banner_block.default.yml
+++ b/core/profiles/demo_umami/config/install/core.entity_form_display.block_content.banner_block.default.yml
@@ -56,4 +56,5 @@ content:
size: 60
placeholder: ''
third_party_settings: { }
-hidden: { }
+hidden:
+ moderation_state: true
diff --git a/core/profiles/demo_umami/config/install/core.entity_form_display.block_content.basic.default.yml b/core/profiles/demo_umami/config/install/core.entity_form_display.block_content.basic.default.yml
index 7ccb5b0..a60d7db 100644
--- a/core/profiles/demo_umami/config/install/core.entity_form_display.block_content.basic.default.yml
+++ b/core/profiles/demo_umami/config/install/core.entity_form_display.block_content.basic.default.yml
@@ -28,4 +28,5 @@ content:
size: 60
placeholder: ''
third_party_settings: { }
-hidden: { }
+hidden:
+ moderation_state: true
diff --git a/core/profiles/demo_umami/config/install/core.entity_form_display.block_content.disclaimer_block.default.yml b/core/profiles/demo_umami/config/install/core.entity_form_display.block_content.disclaimer_block.default.yml
index a64f7c2..386ff59 100644
--- a/core/profiles/demo_umami/config/install/core.entity_form_display.block_content.disclaimer_block.default.yml
+++ b/core/profiles/demo_umami/config/install/core.entity_form_display.block_content.disclaimer_block.default.yml
@@ -36,4 +36,5 @@ content:
size: 60
placeholder: ''
third_party_settings: { }
-hidden: { }
+hidden:
+ moderation_state: true
diff --git a/core/profiles/demo_umami/config/install/core.entity_form_display.block_content.footer_promo_block.default.yml b/core/profiles/demo_umami/config/install/core.entity_form_display.block_content.footer_promo_block.default.yml
index 041af37..81b9504 100644
--- a/core/profiles/demo_umami/config/install/core.entity_form_display.block_content.footer_promo_block.default.yml
+++ b/core/profiles/demo_umami/config/install/core.entity_form_display.block_content.footer_promo_block.default.yml
@@ -56,4 +56,5 @@ content:
size: 60
placeholder: ''
third_party_settings: { }
-hidden: { }
+hidden:
+ moderation_state: true
diff --git a/core/profiles/demo_umami/config/install/core.entity_form_display.media.audio.default.yml b/core/profiles/demo_umami/config/install/core.entity_form_display.media.audio.default.yml
index 2897993..38efab2 100644
--- a/core/profiles/demo_umami/config/install/core.entity_form_display.media.audio.default.yml
+++ b/core/profiles/demo_umami/config/install/core.entity_form_display.media.audio.default.yml
@@ -55,4 +55,5 @@ content:
placeholder: ''
region: content
third_party_settings: { }
-hidden: { }
+hidden:
+ moderation_state: true
diff --git a/core/profiles/demo_umami/config/install/core.entity_form_display.media.file.default.yml b/core/profiles/demo_umami/config/install/core.entity_form_display.media.file.default.yml
index da14503..16536c8 100644
--- a/core/profiles/demo_umami/config/install/core.entity_form_display.media.file.default.yml
+++ b/core/profiles/demo_umami/config/install/core.entity_form_display.media.file.default.yml
@@ -55,4 +55,5 @@ content:
placeholder: ''
region: content
third_party_settings: { }
-hidden: { }
+hidden:
+ moderation_state: true
diff --git a/core/profiles/demo_umami/config/install/core.entity_form_display.media.image.default.yml b/core/profiles/demo_umami/config/install/core.entity_form_display.media.image.default.yml
index fb18dfe..06ab5d2 100644
--- a/core/profiles/demo_umami/config/install/core.entity_form_display.media.image.default.yml
+++ b/core/profiles/demo_umami/config/install/core.entity_form_display.media.image.default.yml
@@ -57,4 +57,5 @@ content:
placeholder: ''
region: content
third_party_settings: { }
-hidden: { }
+hidden:
+ moderation_state: true
diff --git a/core/profiles/demo_umami/config/install/core.entity_form_display.media.remote_video.default.yml b/core/profiles/demo_umami/config/install/core.entity_form_display.media.remote_video.default.yml
index 4752e75..d0924b7 100644
--- a/core/profiles/demo_umami/config/install/core.entity_form_display.media.remote_video.default.yml
+++ b/core/profiles/demo_umami/config/install/core.entity_form_display.media.remote_video.default.yml
@@ -41,7 +41,7 @@ content:
third_party_settings: { }
uid:
type: entity_reference_autocomplete
- weight: 5
+ weight: 4
settings:
match_operator: CONTAINS
size: 60
@@ -49,4 +49,5 @@ content:
region: content
third_party_settings: { }
hidden:
+ moderation_state: true
name: true
diff --git a/core/profiles/demo_umami/config/install/core.entity_form_display.media.video.default.yml b/core/profiles/demo_umami/config/install/core.entity_form_display.media.video.default.yml
index d0fa504..6658cb9 100644
--- a/core/profiles/demo_umami/config/install/core.entity_form_display.media.video.default.yml
+++ b/core/profiles/demo_umami/config/install/core.entity_form_display.media.video.default.yml
@@ -55,4 +55,5 @@ content:
placeholder: ''
region: content
third_party_settings: { }
-hidden: { }
+hidden:
+ moderation_state: true
diff --git a/core/profiles/demo_umami/config/install/core.entity_form_display.node.article.default.yml b/core/profiles/demo_umami/config/install/core.entity_form_display.node.article.default.yml
index 122c53e..50db603 100644
--- a/core/profiles/demo_umami/config/install/core.entity_form_display.node.article.default.yml
+++ b/core/profiles/demo_umami/config/install/core.entity_form_display.node.article.default.yml
@@ -8,6 +8,7 @@ dependencies:
- image.style.thumbnail
- node.type.article
module:
+ - content_moderation
- image
- path
- text
@@ -27,13 +28,13 @@ content:
third_party_settings: { }
created:
type: datetime_timestamp
- weight: 10
+ weight: 5
region: content
settings: { }
third_party_settings: { }
field_image:
type: image_image
- weight: 4
+ weight: 3
region: content
settings:
progress_indicator: throbber
@@ -41,13 +42,22 @@ content:
third_party_settings: { }
field_tags:
type: entity_reference_autocomplete_tags
- weight: 3
+ weight: 2
+ region: content
+ settings:
+ match_operator: CONTAINS
+ size: 60
+ placeholder: ''
+ third_party_settings: { }
+ moderation_state:
+ type: moderation_state_default
+ weight: 10
region: content
settings: { }
third_party_settings: { }
path:
type: path
- weight: 30
+ weight: 8
region: content
settings: { }
third_party_settings: { }
@@ -55,21 +65,21 @@ content:
type: boolean_checkbox
settings:
display_label: true
- weight: 15
+ weight: 6
region: content
third_party_settings: { }
status:
type: boolean_checkbox
settings:
display_label: true
- weight: 120
+ weight: 9
region: content
third_party_settings: { }
sticky:
type: boolean_checkbox
settings:
display_label: true
- weight: 16
+ weight: 7
region: content
third_party_settings: { }
title:
@@ -82,7 +92,7 @@ content:
third_party_settings: { }
uid:
type: entity_reference_autocomplete
- weight: 5
+ weight: 4
region: content
settings:
match_operator: CONTAINS
diff --git a/core/profiles/demo_umami/config/install/core.entity_form_display.node.page.default.yml b/core/profiles/demo_umami/config/install/core.entity_form_display.node.page.default.yml
index 682f1a5..9a896e5 100644
--- a/core/profiles/demo_umami/config/install/core.entity_form_display.node.page.default.yml
+++ b/core/profiles/demo_umami/config/install/core.entity_form_display.node.page.default.yml
@@ -5,6 +5,7 @@ dependencies:
- field.field.node.page.body
- node.type.page
module:
+ - content_moderation
- path
- text
id: node.page.default
@@ -14,7 +15,7 @@ mode: default
content:
body:
type: text_textarea_with_summary
- weight: 31
+ weight: 6
region: content
settings:
rows: 9
@@ -23,13 +24,19 @@ content:
third_party_settings: { }
created:
type: datetime_timestamp
- weight: 10
+ weight: 2
+ region: content
+ settings: { }
+ third_party_settings: { }
+ moderation_state:
+ type: moderation_state_default
+ weight: 8
region: content
settings: { }
third_party_settings: { }
path:
type: path
- weight: 30
+ weight: 5
region: content
settings: { }
third_party_settings: { }
@@ -37,26 +44,26 @@ content:
type: boolean_checkbox
settings:
display_label: true
- weight: 15
+ weight: 3
region: content
third_party_settings: { }
status:
type: boolean_checkbox
settings:
display_label: true
- weight: 120
+ weight: 7
region: content
third_party_settings: { }
sticky:
type: boolean_checkbox
settings:
display_label: true
- weight: 16
+ weight: 4
region: content
third_party_settings: { }
title:
type: string_textfield
- weight: -5
+ weight: 0
region: content
settings:
size: 60
@@ -64,7 +71,7 @@ content:
third_party_settings: { }
uid:
type: entity_reference_autocomplete
- weight: 5
+ weight: 1
region: content
settings:
match_operator: CONTAINS
diff --git a/core/profiles/demo_umami/config/install/core.entity_form_display.node.recipe.default.yml b/core/profiles/demo_umami/config/install/core.entity_form_display.node.recipe.default.yml
index 56a53cb..42cd68e 100644
--- a/core/profiles/demo_umami/config/install/core.entity_form_display.node.recipe.default.yml
+++ b/core/profiles/demo_umami/config/install/core.entity_form_display.node.recipe.default.yml
@@ -16,6 +16,7 @@ dependencies:
- image.style.thumbnail
- node.type.recipe
module:
+ - content_moderation
- image
- path
- text
@@ -116,6 +117,12 @@ content:
third_party_settings: { }
type: entity_reference_autocomplete_tags
region: content
+ moderation_state:
+ type: moderation_state_default
+ weight: 18
+ region: content
+ settings: { }
+ third_party_settings: { }
path:
type: path
weight: 16
diff --git a/core/profiles/demo_umami/config/install/core.entity_view_display.node.article.default.yml b/core/profiles/demo_umami/config/install/core.entity_view_display.node.article.default.yml
index a544c68..66a013a 100644
--- a/core/profiles/demo_umami/config/install/core.entity_view_display.node.article.default.yml
+++ b/core/profiles/demo_umami/config/install/core.entity_view_display.node.article.default.yml
@@ -45,4 +45,5 @@ content:
region: content
settings: { }
third_party_settings: { }
-hidden: { }
+hidden:
+ content_moderation_control: true
diff --git a/core/profiles/demo_umami/config/install/core.entity_view_display.node.article.full.yml b/core/profiles/demo_umami/config/install/core.entity_view_display.node.article.full.yml
index 2e22452..e122e4f 100644
--- a/core/profiles/demo_umami/config/install/core.entity_view_display.node.article.full.yml
+++ b/core/profiles/demo_umami/config/install/core.entity_view_display.node.article.full.yml
@@ -46,4 +46,5 @@ content:
region: content
settings: { }
third_party_settings: { }
-hidden: { }
+hidden:
+ content_moderation_control: true
diff --git a/core/profiles/demo_umami/config/install/core.entity_view_display.node.article.highlighted_bottom.yml b/core/profiles/demo_umami/config/install/core.entity_view_display.node.article.highlighted_bottom.yml
index c2a0515..6a7ea88 100644
--- a/core/profiles/demo_umami/config/install/core.entity_view_display.node.article.highlighted_bottom.yml
+++ b/core/profiles/demo_umami/config/install/core.entity_view_display.node.article.highlighted_bottom.yml
@@ -27,5 +27,6 @@ content:
label: hidden
hidden:
body: true
+ content_moderation_control: true
field_tags: true
links: true
diff --git a/core/profiles/demo_umami/config/install/core.entity_view_display.node.article.highlighted_medium.yml b/core/profiles/demo_umami/config/install/core.entity_view_display.node.article.highlighted_medium.yml
index 6d5fccd..62890f5 100644
--- a/core/profiles/demo_umami/config/install/core.entity_view_display.node.article.highlighted_medium.yml
+++ b/core/profiles/demo_umami/config/install/core.entity_view_display.node.article.highlighted_medium.yml
@@ -27,5 +27,6 @@ content:
label: hidden
hidden:
body: true
+ content_moderation_control: true
field_tags: true
links: true
diff --git a/core/profiles/demo_umami/config/install/core.entity_view_display.node.article.highlighted_small.yml b/core/profiles/demo_umami/config/install/core.entity_view_display.node.article.highlighted_small.yml
index db32e7f..eb9a28e 100644
--- a/core/profiles/demo_umami/config/install/core.entity_view_display.node.article.highlighted_small.yml
+++ b/core/profiles/demo_umami/config/install/core.entity_view_display.node.article.highlighted_small.yml
@@ -27,5 +27,6 @@ content:
label: hidden
hidden:
body: true
+ content_moderation_control: true
field_tags: true
links: true
diff --git a/core/profiles/demo_umami/config/install/core.entity_view_display.node.article.highlighted_top.yml b/core/profiles/demo_umami/config/install/core.entity_view_display.node.article.highlighted_top.yml
index c943e42..5a3926a 100644
--- a/core/profiles/demo_umami/config/install/core.entity_view_display.node.article.highlighted_top.yml
+++ b/core/profiles/demo_umami/config/install/core.entity_view_display.node.article.highlighted_top.yml
@@ -27,5 +27,6 @@ content:
label: hidden
hidden:
body: true
+ content_moderation_control: true
field_tags: true
links: true
diff --git a/core/profiles/demo_umami/config/install/core.entity_view_display.node.article.rss.yml b/core/profiles/demo_umami/config/install/core.entity_view_display.node.article.rss.yml
index da445c0..df4d92d 100644
--- a/core/profiles/demo_umami/config/install/core.entity_view_display.node.article.rss.yml
+++ b/core/profiles/demo_umami/config/install/core.entity_view_display.node.article.rss.yml
@@ -19,5 +19,6 @@ content:
region: content
hidden:
body: true
+ content_moderation_control: true
field_image: true
field_tags: true
diff --git a/core/profiles/demo_umami/config/install/core.entity_view_display.node.article.teaser.yml b/core/profiles/demo_umami/config/install/core.entity_view_display.node.article.teaser.yml
index 2731e18..23f4a07 100644
--- a/core/profiles/demo_umami/config/install/core.entity_view_display.node.article.teaser.yml
+++ b/core/profiles/demo_umami/config/install/core.entity_view_display.node.article.teaser.yml
@@ -47,4 +47,5 @@ content:
region: content
settings: { }
third_party_settings: { }
-hidden: { }
+hidden:
+ content_moderation_control: true
diff --git a/core/profiles/demo_umami/config/install/core.entity_view_display.node.page.default.yml b/core/profiles/demo_umami/config/install/core.entity_view_display.node.page.default.yml
index 8afd942..29e721a 100644
--- a/core/profiles/demo_umami/config/install/core.entity_view_display.node.page.default.yml
+++ b/core/profiles/demo_umami/config/install/core.entity_view_display.node.page.default.yml
@@ -22,4 +22,5 @@ content:
links:
weight: 101
region: content
-hidden: { }
+hidden:
+ content_moderation_control: true
diff --git a/core/profiles/demo_umami/config/install/core.entity_view_display.node.page.teaser.yml b/core/profiles/demo_umami/config/install/core.entity_view_display.node.page.teaser.yml
index bc7a68c..ce8cd32 100644
--- a/core/profiles/demo_umami/config/install/core.entity_view_display.node.page.teaser.yml
+++ b/core/profiles/demo_umami/config/install/core.entity_view_display.node.page.teaser.yml
@@ -24,4 +24,5 @@ content:
links:
weight: 101
region: content
-hidden: { }
+hidden:
+ content_moderation_control: true
diff --git a/core/profiles/demo_umami/config/install/core.entity_view_display.node.recipe.default.yml b/core/profiles/demo_umami/config/install/core.entity_view_display.node.recipe.default.yml
index 42c0ed0..deaf2bb 100644
--- a/core/profiles/demo_umami/config/install/core.entity_view_display.node.recipe.default.yml
+++ b/core/profiles/demo_umami/config/install/core.entity_view_display.node.recipe.default.yml
@@ -112,4 +112,5 @@ content:
settings: { }
third_party_settings: { }
hidden:
+ content_moderation_control: true
field_author: true
diff --git a/core/profiles/demo_umami/config/install/core.entity_view_display.node.recipe.full.yml b/core/profiles/demo_umami/config/install/core.entity_view_display.node.recipe.full.yml
index deda099..bac74a2 100644
--- a/core/profiles/demo_umami/config/install/core.entity_view_display.node.recipe.full.yml
+++ b/core/profiles/demo_umami/config/install/core.entity_view_display.node.recipe.full.yml
@@ -113,4 +113,5 @@ content:
settings: { }
third_party_settings: { }
hidden:
+ content_moderation_control: true
field_author: true
diff --git a/core/profiles/demo_umami/config/install/core.entity_view_display.node.recipe.highlighted_bottom.yml b/core/profiles/demo_umami/config/install/core.entity_view_display.node.recipe.highlighted_bottom.yml
index a5d2a7b..5bae8df 100644
--- a/core/profiles/demo_umami/config/install/core.entity_view_display.node.recipe.highlighted_bottom.yml
+++ b/core/profiles/demo_umami/config/install/core.entity_view_display.node.recipe.highlighted_bottom.yml
@@ -34,6 +34,7 @@ content:
type: responsive_image
region: content
hidden:
+ content_moderation_control: true
field_author: true
field_cooking_time: true
field_difficulty: true
diff --git a/core/profiles/demo_umami/config/install/core.entity_view_display.node.recipe.highlighted_medium.yml b/core/profiles/demo_umami/config/install/core.entity_view_display.node.recipe.highlighted_medium.yml
index 0025d27..d889864 100644
--- a/core/profiles/demo_umami/config/install/core.entity_view_display.node.recipe.highlighted_medium.yml
+++ b/core/profiles/demo_umami/config/install/core.entity_view_display.node.recipe.highlighted_medium.yml
@@ -47,6 +47,7 @@ content:
settings: { }
third_party_settings: { }
hidden:
+ content_moderation_control: true
field_author: true
field_cooking_time: true
field_ingredients: true
diff --git a/core/profiles/demo_umami/config/install/core.entity_view_display.node.recipe.highlighted_small.yml b/core/profiles/demo_umami/config/install/core.entity_view_display.node.recipe.highlighted_small.yml
index 8f7971c..7c622d2 100644
--- a/core/profiles/demo_umami/config/install/core.entity_view_display.node.recipe.highlighted_small.yml
+++ b/core/profiles/demo_umami/config/install/core.entity_view_display.node.recipe.highlighted_small.yml
@@ -47,6 +47,7 @@ content:
settings: { }
third_party_settings: { }
hidden:
+ content_moderation_control: true
field_author: true
field_cooking_time: true
field_ingredients: true
diff --git a/core/profiles/demo_umami/config/install/core.entity_view_display.node.recipe.highlighted_top.yml b/core/profiles/demo_umami/config/install/core.entity_view_display.node.recipe.highlighted_top.yml
index f71cb27..ac5736d 100644
--- a/core/profiles/demo_umami/config/install/core.entity_view_display.node.recipe.highlighted_top.yml
+++ b/core/profiles/demo_umami/config/install/core.entity_view_display.node.recipe.highlighted_top.yml
@@ -34,6 +34,7 @@ content:
type: responsive_image
region: content
hidden:
+ content_moderation_control: true
field_author: true
field_cooking_time: true
field_difficulty: true
diff --git a/core/profiles/demo_umami/config/install/core.entity_view_display.node.recipe.teaser.yml b/core/profiles/demo_umami/config/install/core.entity_view_display.node.recipe.teaser.yml
index 5649684..a576765 100644
--- a/core/profiles/demo_umami/config/install/core.entity_view_display.node.recipe.teaser.yml
+++ b/core/profiles/demo_umami/config/install/core.entity_view_display.node.recipe.teaser.yml
@@ -26,6 +26,7 @@ content:
weight: 100
region: content
hidden:
+ content_moderation_control: true
field_author: true
field_cooking_time: true
field_difficulty: true
diff --git a/core/profiles/demo_umami/config/install/user.role.author.yml b/core/profiles/demo_umami/config/install/user.role.author.yml
new file mode 100644
index 0000000..346f946
--- /dev/null
+++ b/core/profiles/demo_umami/config/install/user.role.author.yml
@@ -0,0 +1,48 @@
+langcode: en
+status: true
+dependencies: { }
+id: author
+label: Author
+weight: 3
+is_admin: null
+permissions:
+ - 'access content overview'
+ - 'access contextual links'
+ - 'access files overview'
+ - 'access in-place editing'
+ - 'access toolbar'
+ - 'cancel account'
+ - 'change own username'
+ - 'create article content'
+ - 'create page content'
+ - 'create recipe content'
+ - 'create terms in ingredients'
+ - 'create terms in recipe_category'
+ - 'create terms in recipe_cuisine'
+ - 'create terms in tags'
+ - 'create url aliases'
+ - 'delete article revisions'
+ - 'delete own article content'
+ - 'delete own page content'
+ - 'delete own recipe content'
+ - 'delete page revisions'
+ - 'delete recipe revisions'
+ - 'delete terms in ingredients'
+ - 'delete terms in recipe_category'
+ - 'delete terms in recipe_cuisine'
+ - 'delete terms in tags'
+ - 'edit own article content'
+ - 'edit own page content'
+ - 'edit own recipe content'
+ - 'edit terms in ingredients'
+ - 'edit terms in recipe_category'
+ - 'edit terms in recipe_cuisine'
+ - 'edit terms in tags'
+ - 'use editorial transition create_new_draft'
+ - 'view all revisions'
+ - 'view article revisions'
+ - 'view latest version'
+ - 'view own unpublished content'
+ - 'view page revisions'
+ - 'view recipe revisions'
+ - 'view the administration theme'
diff --git a/core/profiles/demo_umami/config/install/user.role.editor.yml b/core/profiles/demo_umami/config/install/user.role.editor.yml
new file mode 100644
index 0000000..11bb67c
--- /dev/null
+++ b/core/profiles/demo_umami/config/install/user.role.editor.yml
@@ -0,0 +1,52 @@
+langcode: en
+status: true
+dependencies: { }
+id: editor
+label: Editor
+weight: 4
+is_admin: null
+permissions:
+ - 'access content overview'
+ - 'access contextual links'
+ - 'access files overview'
+ - 'access in-place editing'
+ - 'access toolbar'
+ - 'cancel account'
+ - 'change own username'
+ - 'create terms in ingredients'
+ - 'create terms in recipe_category'
+ - 'create terms in recipe_cuisine'
+ - 'create terms in tags'
+ - 'create url aliases'
+ - 'delete all revisions'
+ - 'delete any article content'
+ - 'delete any page content'
+ - 'delete any recipe content'
+ - 'delete article revisions'
+ - 'delete page revisions'
+ - 'delete recipe revisions'
+ - 'delete terms in ingredients'
+ - 'delete terms in recipe_category'
+ - 'delete terms in recipe_cuisine'
+ - 'delete terms in tags'
+ - 'edit any article content'
+ - 'edit any page content'
+ - 'edit any recipe content'
+ - 'edit terms in ingredients'
+ - 'edit terms in recipe_category'
+ - 'edit terms in recipe_cuisine'
+ - 'edit terms in tags'
+ - 'revert all revisions'
+ - 'revert article revisions'
+ - 'revert page revisions'
+ - 'revert recipe revisions'
+ - 'use editorial transition archive'
+ - 'use editorial transition archived_published'
+ - 'use editorial transition publish'
+ - 'view all revisions'
+ - 'view any unpublished content'
+ - 'view article revisions'
+ - 'view latest version'
+ - 'view page revisions'
+ - 'view recipe revisions'
+ - 'view the administration theme'
diff --git a/core/profiles/demo_umami/config/install/workflows.workflow.editorial.yml b/core/profiles/demo_umami/config/install/workflows.workflow.editorial.yml
new file mode 100644
index 0000000..9959410
--- /dev/null
+++ b/core/profiles/demo_umami/config/install/workflows.workflow.editorial.yml
@@ -0,0 +1,67 @@
+langcode: en
+status: true
+dependencies:
+ config:
+ - node.type.article
+ - node.type.page
+ - node.type.recipe
+ module:
+ - content_moderation
+id: editorial
+label: Editorial
+type: content_moderation
+type_settings:
+ states:
+ archived:
+ label: Archived
+ weight: 5
+ published: false
+ default_revision: true
+ draft:
+ label: Draft
+ published: false
+ default_revision: false
+ weight: -5
+ published:
+ label: Published
+ published: true
+ default_revision: true
+ weight: 0
+ transitions:
+ archive:
+ label: Archive
+ from:
+ - published
+ to: archived
+ weight: 2
+ archived_draft:
+ label: 'Restore to Draft'
+ from:
+ - archived
+ to: draft
+ weight: 3
+ archived_published:
+ label: Restore
+ from:
+ - archived
+ to: published
+ weight: 4
+ create_new_draft:
+ label: 'Create New Draft'
+ to: draft
+ weight: 0
+ from:
+ - draft
+ - published
+ publish:
+ label: Publish
+ to: published
+ weight: 1
+ from:
+ - draft
+ - published
+ entity_types:
+ node:
+ - article
+ - page
+ - recipe
diff --git a/core/profiles/demo_umami/demo_umami.info.yml b/core/profiles/demo_umami/demo_umami.info.yml
index 48de341..98be81f 100644
--- a/core/profiles/demo_umami/demo_umami.info.yml
+++ b/core/profiles/demo_umami/demo_umami.info.yml
@@ -40,6 +40,8 @@ install:
- tour
- automated_cron
- responsive_image
+ - content_moderation
+ - workflows
themes:
- seven
- umami
diff --git a/core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php b/core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php
index b9b855d..1268189 100644
--- a/core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php
+++ b/core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php
@@ -81,13 +81,42 @@ class InstallHelper implements ContainerInjectionInterface {
* Imports default contents.
*/
public function importContent() {
- $this->importArticles()
+ $this->importEditors()
+ ->importArticles()
->importRecipes()
->importPages()
->importBlockContent();
}
/**
+ * Imports editors.
+ *
+ * Other users are created as their content is imported. However, editors
+ * don't have their own content so are created here instead.
+ *
+ * @return $this
+ */
+ protected function importEditors() {
+ $user_storage = $this->entityTypeManager->getStorage('user');
+ $editors = [
+ 'Margaret Hopper',
+ 'Grace Hamilton',
+ ];
+ foreach ($editors as $name) {
+ $user = $user_storage->create([
+ 'name' => $name,
+ 'status' => 1,
+ 'roles' => ['editor'],
+ 'mail' => mb_strtolower(str_replace(' ', '.', $name)) . '@example.com',
+ ]);
+ $user->enforceIsNew();
+ $user->save();
+ $this->storeCreatedContentUuids([$user->uuid() => 'user']);
+ }
+ return $this;
+ }
+
+ /**
* Imports articles.
*
* @return $this
@@ -104,6 +133,7 @@ class InstallHelper implements ContainerInjectionInterface {
$values = [
'type' => 'article',
'title' => $data['title'],
+ 'moderation_state' => 'published',
];
// Fields mapping starts.
// Set Body Field.
@@ -167,6 +197,7 @@ class InstallHelper implements ContainerInjectionInterface {
'type' => 'recipe',
// Title field.
'title' => $data['title'],
+ 'moderation_state' => 'published',
];
// Set article author.
if (!empty($data['author'])) {
@@ -264,6 +295,7 @@ class InstallHelper implements ContainerInjectionInterface {
$values = [
'type' => 'page',
'title' => $data['title'],
+ 'moderation_state' => 'published',
];
// Fields mapping starts.
// Set Body Field.
@@ -401,10 +433,11 @@ class InstallHelper implements ContainerInjectionInterface {
$user_storage = $this->entityTypeManager->getStorage('user');
$users = $user_storage->loadByProperties(['name' => $name]);;
if (empty($users)) {
- // Creating user without any email/password.
+ // Creating user without any password.
$user = $user_storage->create([
'name' => $name,
'status' => 1,
+ 'roles' => ['author'],
'mail' => mb_strtolower(str_replace(' ', '.', $name)) . '@example.com',
]);
$user->enforceIsNew();
diff --git a/core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php b/core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php
index f6025fd..940c8e2 100644
--- a/core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php
+++ b/core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php
@@ -89,7 +89,12 @@ class DemoUmamiProfileTest extends BrowserTestBase {
* Tests the successful editing of nodes by admin.
*/
public function testEditNodesByAdmin() {
- $account = $this->drupalCreateUser(['administer nodes', 'edit any recipe content']);
+ $permissions = [
+ 'administer nodes',
+ 'edit any recipe content',
+ 'use editorial transition create_new_draft',
+ ];
+ $account = $this->drupalCreateUser($permissions);
$this->drupalLogin($account);
$webassert = $this->assertSession();
@@ -122,10 +127,11 @@ class DemoUmamiProfileTest extends BrowserTestBase {
public function testDemonstrationWarningMessage() {
$permissions = [
'access content overview',
+ 'access toolbar',
'administer nodes',
- 'create recipe content',
'edit any recipe content',
- 'access toolbar',
+ 'create recipe content',
+ 'use editorial transition create_new_draft',
];
$account = $this->drupalCreateUser($permissions);
$this->drupalLogin($account);