Skip to content
This repository has been archived by the owner on Sep 29, 2024. It is now read-only.

Commit

Permalink
clean up news listing and latest event
Browse files Browse the repository at this point in the history
  • Loading branch information
yeniatencio committed Jul 24, 2024
1 parent b862316 commit 92b5dd4
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 228 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ dependencies:
- paragraphs.paragraphs_type.complex_image
- paragraphs.paragraphs_type.data_table
- paragraphs.paragraphs_type.form_embed_openforms
- paragraphs.paragraphs_type.latest_events
- paragraphs.paragraphs_type.media_gallery
- paragraphs.paragraphs_type.navigation_card
- paragraphs.paragraphs_type.promotion_card
Expand Down Expand Up @@ -51,7 +50,6 @@ settings:
timelines: timelines
compact_card_collection: compact_card_collection
call_to_action: call_to_action
latest_events: latest_events
news_listing: news_listing
data_table: data_table
statistics_grid: statistics_grid
Expand Down Expand Up @@ -119,9 +117,6 @@ settings:
media_gallery:
enabled: true
weight: -18
latest_events:
enabled: true
weight: -11
card_carousel:
enabled: true
weight: -21
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

9 changes: 0 additions & 9 deletions config/install/paragraphs.paragraphs_type.latest_events.yml

This file was deleted.

2 changes: 0 additions & 2 deletions tests/behat/features/fields.feature
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ Feature: Fields for Landing Page content type
And I should see the button "Accordion"
And I should see the button "Call to action"
And I should see the button "Card carousel"
And I should see the button "Latest events"
And I should see the button "Promotion card"
And I should see the button "Navigation card"
And I should see the button "Key dates"
Expand Down Expand Up @@ -204,7 +203,6 @@ Feature: Fields for Landing Page content type
And I should see the button "Accordion"
And I should see the button "Call to action"
And I should see the button "Card carousel"
And I should see the button "Latest events"
And I should see the button "Promotion card"
And I should see the button "Navigation card"
And I should see the button "Key dates"
Expand Down
22 changes: 22 additions & 0 deletions tide_landing_page.install
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,25 @@ function tide_landing_page_update_10101() {
\Drupal::moduleHandler()->loadInclude('tide_core', 'inc', 'includes/updates');
_tide_core_content_category_form_display('landing_page');
}

/**
* Removes latest event paragraph types.
*/
function tide_landing_page_update_10102() {
$paragraph_types = [
'latest_event',
];
foreach ($paragraph_types as $paragraph_type) {
$query = \Drupal::entityQuery('paragraph')->condition('type', $paragraph_type);
$p_ids = $query->execute();
if (!empty($p_ids)) {
$p_entities = Paragraph::loadMultiple($p_ids);
$storage_handler = \Drupal::entityTypeManager()->getStorage('paragraph');
$storage_handler->delete($p_entities);
}
$p_type = \Drupal::entityTypeManager()->getStorage('paragraphs_type')->load($paragraph_type);
if ($p_type) {
$p_type->delete();
}
}
}

0 comments on commit 92b5dd4

Please sign in to comment.