Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(#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
dev-rana-publicis committed Nov 5, 2024
1 parent 2ada6a2 commit 2834e9a
Showing 17 changed files with 35 additions and 54 deletions.
Original file line number Diff line number Diff line change
@@ -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
@@ -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
@@ -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
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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:
Original file line number Diff line number Diff line change
@@ -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:
Original file line number Diff line number Diff line change
@@ -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:
@@ -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:
Original file line number Diff line number Diff line change
@@ -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:
@@ -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:
Original file line number Diff line number Diff line change
@@ -552,8 +552,6 @@
- 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:
Original file line number Diff line number Diff line change
@@ -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:
@@ -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:
Original file line number Diff line number Diff line change
@@ -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:
@@ -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:
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">{{ drupal_token('current-page:title')}}</h1>
</div>
{{content.field_landing_contents}}
</main>

This file was deleted.

0 comments on commit 2834e9a

Please sign in to comment.