Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • wcms/uw_cfg_common
1 result
Show changes
Commits on Source (10)
Showing
with 149 additions and 84 deletions
langcode: en
status: true
dependencies:
config:
- node.type.uw_ct_blog
- node.type.uw_ct_catalog_item
- node.type.uw_ct_contact
- node.type.uw_ct_event
- node.type.uw_ct_expand_collapse_group
- node.type.uw_ct_news_item
- node.type.uw_ct_opportunity
- node.type.uw_ct_profile
- node.type.uw_ct_project
- node.type.uw_ct_service
- node.type.uw_ct_sidebar
- node.type.uw_ct_site_footer
- node.type.uw_ct_web_page
module:
- content_moderation
id: uw_workflow
label: 'UW workflow'
type: content_moderation
type_settings:
states:
draft:
label: Draft
weight: -10
published: false
default_revision: false
published:
label: Published
weight: -10
published: true
default_revision: true
uw_wf_archived:
label: Archived
weight: -10
published: false
default_revision: true
uw_wf_needs_review:
label: 'Needs Review'
weight: -10
published: false
default_revision: false
uw_wf_unpublished:
label: Unpublished
weight: 0
published: false
default_revision: true
transitions:
archived:
label: Archive
from:
- draft
- published
- uw_wf_archived
- uw_wf_needs_review
to: uw_wf_archived
weight: 3
draft:
label: 'Create draft'
from:
- draft
- published
- uw_wf_archived
- uw_wf_needs_review
to: draft
weight: 0
needs_review:
label: 'Submit for review'
from:
- draft
- published
- uw_wf_archived
- uw_wf_needs_review
to: uw_wf_needs_review
weight: 1
published:
label: Publish
from:
- draft
- published
- uw_wf_archived
- uw_wf_needs_review
to: published
weight: 2
unpublish:
label: Unpublish
from:
- uw_wf_unpublished
to: draft
weight: 4
entity_types:
node:
- uw_ct_blog
- uw_ct_catalog_item
- uw_ct_contact
- uw_ct_event
- uw_ct_expand_collapse_group
- uw_ct_news_item
- uw_ct_opportunity
- uw_ct_profile
- uw_ct_project
- uw_ct_service
- uw_ct_sidebar
- uw_ct_site_footer
- uw_ct_web_page
default_moderation_state: draft
......@@ -5,7 +5,7 @@ id: uw_lbs_carousel_1_item
label: 'Carousel - 1 item'
classes: uw-carousel--one-item
type: component
group: default
group: null
weight: -10
block_restrictions:
- 'inline_block:uw_cbl_facts_and_figures'
......
......@@ -5,7 +5,7 @@ id: uw_lbs_carousel_2_items
label: 'Carousel - 2 items'
classes: uw-carousel--two-items
type: component
group: default
group: null
weight: -9
block_restrictions:
- 'inline_block:uw_cbl_facts_and_figures'
......
......@@ -5,7 +5,7 @@ id: uw_lbs_carousel_3_items
label: 'Carousel - 3 items'
classes: uw-carousel--three-items
type: component
group: default
group: null
weight: -8
block_restrictions:
- 'inline_block:uw_cbl_facts_and_figures'
......
......@@ -5,7 +5,7 @@ id: uw_lbs_carousel_4_items
label: 'Carousel - 4 items'
classes: uw-carousel--four-items
type: component
group: default
group: null
weight: -7
block_restrictions:
- 'inline_block:uw_cbl_facts_and_figures'
......
......@@ -6,12 +6,11 @@ label: 'Extra-wide contained width'
classes: uw-contained-width
type: section
group: default
weight: -4
block_restrictions:
- 'inline_block:uw_cbl_call_to_action'
- 'inline_block:uw_cbl_copy_text'
- 'inline_block:uw_cbl_facebook'
- 'inline_block:uw_cbl_facts_and_figures'
- 'inline_block:uw_cbl_image'
- 'inline_block:uw_cbl_remote_video'
layout_restrictions: { }
weight: -4
......@@ -6,6 +6,6 @@ label: 'Narrow contained width'
classes: "uw-contained-width\r\nuw-contained-width--narrow"
type: section
group: default
weight: -6
block_restrictions: { }
layout_restrictions: { }
weight: -6
......@@ -6,6 +6,6 @@ label: 'Wide contained width'
classes: "uw-contained-width\r\nuw-contained-width--wide"
type: section
group: default
weight: -5
block_restrictions: { }
layout_restrictions: { }
weight: -5
......@@ -6,12 +6,11 @@ label: 'Full width'
classes: uw-full-width
type: section
group: default
weight: -3
block_restrictions:
- 'inline_block:uw_cbl_call_to_action'
- 'inline_block:uw_cbl_copy_text'
- 'inline_block:uw_cbl_facebook'
- 'inline_block:uw_cbl_facts_and_figures'
- 'inline_block:uw_cbl_image'
- 'inline_block:uw_cbl_remote_video'
layout_restrictions: { }
weight: -3
......@@ -50,80 +50,18 @@ class UwDeleteFormEventSubscriber implements EventSubscriberInterface {
public function alterForm(FormAlterEvent $event): void {
$form = &$event->getForm();
// Define all names in an array.
$names = [
'ct_names' => [
'uw_ct_blog',
'uw_ct_contact',
'uw_ct_catalog_item',
'uw_ct_event',
'uw_ct_expand_collapse_group',
'uw_ct_news_item',
'uw_ct_opportunity',
'uw_ct_profile',
'uw_ct_project',
'uw_ct_service',
'uw_ct_sidebar',
'uw_ct_site_footer',
'uw_ct_web_page',
],
'vocab_names' => [
'uw_vocab_blog_tags',
'uw_vocab_contact_group',
'uw_vocab_audience',
'uw_vocab_catalog_categories',
'uw_vocab_catalogs',
'uw_tax_event_tags',
'uw_tax_event_type',
'uw_vocab_news_tags',
'uw_vocab_profile_type',
'uw_vocab_project_roles',
'uw_vocab_project_topics',
'uw_vocab_service_categories',
],
'media_names' => [
'uw_mt_file',
'uw_mt_icon',
'uw_mt_image',
'uw_mt_local_video',
'uw_mt_remote_video',
'uw_mt_vimeo_banner_video',
],
];
// Loop all names in array.
foreach ($names as $key => $type_names) {
foreach ($type_names as $name) {
$custom_waring_message = $this->t('CAUTION. This will permanently delete this piece of content; this action cannot be undone. If anything references this content, it may cause visual or structural issues on that page. Make sure you have removed or updated all references before deleting.');
// Use custom warning message for deleting nodes, terms and medias.
// The user has 'delete any' and 'delete own' permissions.
if ($key == 'ct_names') {
if (($form['#form_id'] == 'node_' . $name . '_delete_form') &&
($this->currentUser->hasPermission('delete any ' . $name . ' content') ||
$this->currentUser->hasPermission('delete own ' . $name . ' content'))) {
$form['description']['#markup'] = $custom_waring_message;
break;
}
}
// The user has 'delete terms' permission.
if ($key == 'vocab_names') {
if (($form['#form_id'] == 'taxonomy_term_' . $name . '_delete_form') &&
$this->currentUser->hasPermission('delete terms in ' . $name)) {
$form['description']['#markup'] = $custom_waring_message;
break;
}
}
// The user has 'delete any' permission.
if ($key == 'media_names') {
if (($form['#form_id'] == 'media_' . $name . '_delete_form') &&
($this->currentUser->hasPermission('delete any media') || $this->currentUser->hasPermission('delete any ' . $name . ' media') ||
$this->currentUser->hasPermission('delete own ' . $name . ' media'))) {
$form['description']['#markup'] = $custom_waring_message;
break;
}
}
}
// Change the deletion warning on any of the following forms.
// - any node, taxonomy term, or media deletion page.
// - the node delete multiple page.
// - the media delete multiple page.
if (
preg_match('/^(?:node|taxonomy_term|media)_.+_delete_form$/', $form['#form_id'])
||
$form['#form_id'] == 'node_delete_multiple_confirm_form'
||
$form['#form_id'] == 'media_delete_multiple_confirm_form'
) {
$form['description']['#markup'] = $this->t('CAUTION. This will permanently delete this piece of content; this action cannot be undone. If anything references this content, it may cause visual or structural issues on that page. Make sure you have removed or updated all references before deleting.');
}
}
......
......@@ -19,6 +19,16 @@ use Symfony\Component\Yaml\Yaml;
*/
function uw_cfg_common_install() {
// ISTWCMS-5865: this the attempt to fix features for our build.
// Moving the actual installing of workflows to here, so that
// we can include workflows as a dependency in our modules and
// that it will allow new site installs.
$name = 'workflows.workflow.uw_workflow';
$path = \Drupal::service('extension.list.module')->getPath('uw_cfg_common') . '/config/custom/';
$source = new FileStorage($path);
$active_storage = \Drupal::service('config.storage');
$active_storage->write($name, $source->read($name));
// Get the role ids for UW roles.
$uw_rids = UwRoles::getUwRoleIds();
......@@ -437,3 +447,14 @@ function uw_cfg_common_update_9104(&$sandbox) {
$service->removeMissingBlocksFromUnsaved();
$service->removeMissingBlocksFromSaved();
}
/**
* Feature revert for workflows.
*/
function uw_cfg_common_update_9105(&$sandbox) {
$name = 'workflows.workflow.uw_workflow';
$path = \Drupal::service('extension.list.module')->getPath('uw_cfg_common') . '/config/custom/';
$source = new FileStorage($path);
$active_storage = \Drupal::service('config.storage');
$active_storage->write($name, $source->read($name));
}