Skip to content

Commit

Permalink
(#4471) Remove MLP Title Paragraph and add it to MLP Template
Browse files Browse the repository at this point in the history
- Adds update hook to remove paragraph from the database and delete
  paragraph from any active pages on prod

Closes #4471
  • Loading branch information
dev-rana-publicis authored and bryanpizzillo committed Nov 15, 2024
1 parent eb610e4 commit cfb848a
Show file tree
Hide file tree
Showing 18 changed files with 35 additions and 82 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,35 @@ function cgov_home_landing_update_8002() {
\Drupal::logger($bundle)->notice("Created $count rows in $page_style_table.");
}
}

/**
* Implements hook_install().
*
* Deletes the NCIDS Title Block Paragraph.
*
*/
function cgov_home_landing_update_10001() {
// Import the feature to ensure we have the latest configuration.
$features_mgr = \Drupal::service('features.manager');
$assigner = \Drupal::service('features_assigner');
$assigner->assignConfigPackages();
$features_mgr->import(['cgov_home_landing']);

$storage = \Drupal::entityTypeManager()->getStorage('paragraph');
$ids = $storage->getQuery()
->condition('type', 'ncids_page_title_block')
->accessCheck(FALSE)
->execute();

if (!empty($ids)) {
$paragraphs = $storage->loadMultiple($ids);

// Delete existing entities.
$storage->delete($paragraphs);
}

// Deletes paragraph config.
$config = \Drupal::configFactory()
->getEditable('paragraphs.paragraphs_type.ncids_page_title_block');
$config->delete();
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ dependencies:
- paragraphs.paragraphs_type.ncids_flag_card_group
- paragraphs.paragraphs_type.ncids_imageless_card_group
- paragraphs.paragraphs_type.ncids_mlp_two_column_layout
- paragraphs.paragraphs_type.ncids_page_title_block
- paragraphs.paragraphs_type.ncids_slim_hero
- paragraphs.paragraphs_type.ncids_summary_box
- paragraphs.paragraphs_type.ncids_wide_guide_card
Expand All @@ -41,7 +40,6 @@ settings:
cgov_card_borderless: cgov_card_borderless
cgov_card_raw_html: cgov_card_raw_html
cgov_dynamic_list: cgov_dynamic_list
ncids_page_title_block: ncids_page_title_block
ncids_slim_hero: ncids_slim_hero
ncids_3_feature_row_opt_head: ncids_3_feature_row_opt_head
ncids_content_block: ncids_content_block
Expand Down Expand Up @@ -205,9 +203,6 @@ settings:
ncids_mlp_two_column_layout:
weight: 99
enabled: true
ncids_page_title_block:
weight: 49
enabled: true
ncids_promo_block_external:
weight: 93
enabled: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,6 @@ settings:
ncids_link_button_internal:
weight: 98
enabled: false
ncids_page_title_block:
weight: 99
enabled: false
ncids_promo_block_external:
weight: 100
enabled: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,6 @@ settings:
ncids_mlp_two_column_layout:
weight: 110
enabled: false
ncids_page_title_block:
weight: 99
enabled: false
ncids_promo_block_external:
weight: 100
enabled: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,6 @@ settings:
ncids_mlp_two_column_layout:
weight: 100
enabled: false
ncids_page_title_block:
weight: 101
enabled: false
ncids_promo_block_external:
weight: 102
enabled: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,6 @@ settings:
ncids_mlp_two_column_layout:
weight: 100
enabled: false
ncids_page_title_block:
weight: 101
enabled: false
ncids_promo_block_external:
weight: 102
enabled: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,6 @@ settings:
ncids_link_button_internal:
weight: 97
enabled: true
ncids_page_title_block:
weight: 99
enabled: false
ncids_promo_block_external:
weight: 100
enabled: false
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
- type: 'module'
filename: 'AI-Cancer-Research-Slim-Hero.jpg'
alt: 'AI in Cancer Research alt text'
- entity: "paragraph"
type: "ncids_page_title_block"
- entity: "paragraph"
type: "ncids_content_block"
field_html_content:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
- type: 'module'
filename: 'Slim-Hero.png'
alt: 'The RAS Initiative Slim Hero Alt Text'
- entity: "paragraph"
type: "ncids_page_title_block"
- entity: "paragraph"
type: "ncids_content_block"
field_html_content:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
### English Contents
field_landing_contents:
######## Begin Feature Row ###########
- entity: "paragraph"
type: "ncids_page_title_block"
- entity: "paragraph"
type: "ncids_slim_hero"
field_slim_hero_image:
Expand Down Expand Up @@ -555,8 +553,6 @@
### Wide Guide Card END ###
field_landing_contents__ES:
## SPANISH CONTENTS HERE
- entity: "paragraph"
type: "ncids_page_title_block"
- entity: "paragraph"
type: "ncids_slim_hero"
field_slim_hero_image:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -716,8 +716,6 @@
### English Contents
field_landing_contents:
######## Begin Feature Row ###########
- entity: "paragraph"
type: "ncids_page_title_block"
- entity: "paragraph"
type: "ncids_content_block"
field_html_content:
Expand Down Expand Up @@ -765,8 +763,6 @@
title: 'Cancer Disparities'
field_landing_contents__ES:
######## Begin Feature Row ###########
- entity: "paragraph"
type: "ncids_page_title_block"
- entity: "paragraph"
type: "ncids_content_block"
field_html_content:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,6 @@
value: "ncids_default"
### English Contents
field_landing_contents:
- entity: "paragraph"
type: "ncids_page_title_block"
######## Begin Feature Row ###########
- entity: "paragraph"
type: "ncids_mlp_two_column_layout"
Expand Down Expand Up @@ -549,11 +547,7 @@
value: "ncids_default"
### English Contents
field_landing_contents:
- entity: "paragraph"
type: "ncids_page_title_block"
######## Begin Feature Row ###########
- entity: "paragraph"
type: "ncids_page_title_block"
- entity: "paragraph"
type: "ncids_mlp_two_column_layout"
field_two_column_layout_display:
Expand Down Expand Up @@ -727,8 +721,6 @@
value: "ncids_default"
### English Contents
field_landing_contents:
- entity: "paragraph"
type: "ncids_page_title_block"
######## Begin Feature Row ###########
- entity: "paragraph"
type: "ncids_flag_card_group"
Expand Down Expand Up @@ -879,8 +871,6 @@
field_override_list_description:
- value: 'DCEG research findings have had a significant impact on public health - both national and global.'
field_landing_contents__ES:
- entity: "paragraph"
type: "ncids_page_title_block"
######## Begin Feature Row ###########
- entity: "paragraph"
type: "ncids_flag_card_group"
Expand Down Expand Up @@ -1072,8 +1062,6 @@
value: "ncids_default"
### English Contents
field_landing_contents:
- entity: "paragraph"
type: "ncids_page_title_block"
######## Begin Feature Row ###########
- entity: "paragraph"
type: "ncids_mlp_two_column_layout"
Expand Down Expand Up @@ -1269,8 +1257,6 @@
name: 'About Cancer Treatment - Image'
### Spanish Contents
field_landing_contents__ES:
- entity: "paragraph"
type: "ncids_page_title_block"
######## Begin Feature Row ###########
- entity: "paragraph"
type: "ncids_mlp_two_column_layout"
Expand Down Expand Up @@ -1505,8 +1491,6 @@
value: "ncids_default"
### English Contents
field_landing_contents:
- entity: "paragraph"
type: "ncids_page_title_block"
######## Begin Feature Row ###########
- entity: "paragraph"
type: "ncids_mlp_two_column_layout"
Expand Down Expand Up @@ -1702,8 +1686,6 @@
name: 'About Cancer Treatment - Image'
### Spanish Contents
field_landing_contents__ES:
- entity: "paragraph"
type: "ncids_page_title_block"
######## Begin Feature Row ###########
- entity: "paragraph"
type: "ncids_mlp_two_column_layout"
Expand Down Expand Up @@ -1938,8 +1920,6 @@
value: "ncids_default"
### English Contents
field_landing_contents:
- entity: "paragraph"
type: "ncids_page_title_block"
######## Begin Feature Row ###########
- entity: "paragraph"
type: "ncids_mlp_two_column_layout"
Expand Down Expand Up @@ -2135,8 +2115,6 @@
name: 'About Cancer Treatment - Image'
### Spanish Contents
field_landing_contents__ES:
- entity: "paragraph"
type: "ncids_page_title_block"
######## Begin Feature Row ###########
- entity: "paragraph"
type: "ncids_mlp_two_column_layout"
Expand Down Expand Up @@ -2371,8 +2349,6 @@
value: "ncids_default"
### English Contents
field_landing_contents:
- entity: "paragraph"
type: "ncids_page_title_block"
######## Begin Feature Row ###########
- entity: "paragraph"
type: "ncids_flag_card_group"
Expand Down Expand Up @@ -2523,8 +2499,6 @@
field_override_list_description:
- value: 'DCEG research findings have had a significant impact on public health - both national and global.'
field_landing_contents__ES:
- entity: "paragraph"
type: "ncids_page_title_block"
######## Begin Feature Row ###########
- entity: "paragraph"
type: "ncids_flag_card_group"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -780,8 +780,6 @@
### English Contents
field_landing_contents:
######## Begin Feature Row ###########
- entity: "paragraph"
type: "ncids_page_title_block"
- entity: "paragraph"
type: "ncids_slim_hero"
field_slim_hero_image:
Expand Down Expand Up @@ -912,8 +910,6 @@
value: "ncids_default"
### English Contents
field_landing_contents:
- entity: "paragraph"
type: "ncids_page_title_block"
- entity: "paragraph"
type: "ncids_content_block"
field_html_content:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
### English Contents
field_landing_contents:
######## Begin Feature Row ###########
- entity: "paragraph"
type: "ncids_page_title_block"
- entity: "paragraph"
type: "ncids_content_block"
field_html_content:
Expand Down Expand Up @@ -114,8 +112,6 @@
### Spanish Contents
field_landing_contents__ES:
######## Begin Feature Row ###########
- entity: "paragraph"
type: "ncids_page_title_block"
- entity: "paragraph"
type: "ncids_content_block"
field_html_content:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
### English Contents
field_landing_contents:
######## Begin Feature Row ###########
- entity: "paragraph"
type: "ncids_page_title_block"
- entity: "paragraph"
type: "ncids_wide_guide_card"
field_html_content:
Expand Down Expand Up @@ -183,8 +181,6 @@
### English Contents
field_landing_contents:
######## Begin Feature Row ###########
- entity: "paragraph"
type: "ncids_page_title_block"
- entity: "paragraph"
type: "ncids_wide_guide_card"
field_html_content:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<!-- Begin MAIN CONTENT AREA -->
<main class="main-content type {{ page_type }}" id="main-content">
<div class="usa-section usa-section--cgdp-no-bottom" data-eddl-landing-row>
<h1 class="nci-heading-h1">{{ node.label }}</h1>
</div>
{{content.field_landing_contents}}
</main>

This file was deleted.

0 comments on commit cfb848a

Please sign in to comment.