diff --git a/README.md b/README.md index bc1f4b0c56..d65367ee7e 100644 --- a/README.md +++ b/README.md @@ -88,18 +88,18 @@ The VA.gov CMS Team ### About the CMS -This repository hosts the source code for the _Content Management System_ (**CMS** or **CMS-API**) utilized by [VA.gov](https://www.va.gov). +This repository hosts the source code for the _Content Management System_ (**CMS** or **CMS-API**) utilized by [VA.gov](https://www.va.gov). The production instance can be found at [prod.cms.va.gov](https://prod.cms.va.gov/). Please note that access to the production CMS is limited; refer to [Getting Access](READMES/access.md) for more information. -Built on [Drupal 9.5](https://www.drupal.org), the **CMS** employs the [Composer](https://getcomposer.org) package management system. To get started, consult [Getting Started](READMES/getting-started.md). +Built on [Drupal 10.1](https://www.drupal.org), the **CMS** employs the [Composer](https://getcomposer.org) package management system. To get started, consult [Getting Started](READMES/getting-started.md). ### Contributing All of the source code used for generating VA.gov is open source, listed under the [department-of-veterans-affairs](https://github.com/department-of-veterans-affairs) organization on GitHub: -- **CMS**: [github.com/department-of-veterans-affairs/va.gov-cms](https://github.com/department-of-veterans-affairs/va.gov-cms) - Drupal 9.5 +- **CMS**: [github.com/department-of-veterans-affairs/va.gov-cms](https://github.com/department-of-veterans-affairs/va.gov-cms) - Drupal 10.1 - **vets-website**: [github.com/department-of-veterans-affairs/vets-website](https://github.com/department-of-veterans-affairs/vets-website) - Node.js - **vets-api**: [github.com/department-of-veterans-affairs/vets-api](https://github.com/department-of-veterans-affairs/vets-api) - Ruby - **content-build**: [github.com/department-of-veterans-affairs/vagov-content](https://github.com/department-of-veterans-affairs/vagov-content) - Node.js, Metalsmith @@ -112,7 +112,7 @@ All development on these projects is done via Pull Requests. The public-facing website at [VA.gov](https://www.va.gov) is a static site hosted on S3, composed of HTML, CSS, JavaScript, and images. -[This codebase](https://github.com/department-of-veterans-affairs/va.gov-cms) is dedicated to the CMS, built on Drupal 9. +[This codebase](https://github.com/department-of-veterans-affairs/va.gov-cms) is dedicated to the CMS, built on Drupal 10. The source code for generating the public site is located in the [vets-website](https://github.com/department-of-veterans-affairs/vets-website) repository. The component responsible for extracting raw content from the CMS and converting it to HTML is developed in a separate repository, [content-build](https://github.com/department-of-veterans-affairs/content-build). diff --git a/READMES/upstream-dependencies.md b/READMES/upstream-dependencies.md index 65588f2508..f02a186ffd 100644 --- a/READMES/upstream-dependencies.md +++ b/READMES/upstream-dependencies.md @@ -72,3 +72,8 @@ The following services can affect the deployment process' ability to fully build | [Github](https://github.com) | | [https://www.githubstatus.com/](https://www.githubstatus.com/) | Use the #github_information channel in DSVA slack | The codebase is stored in github, and the deployment process depends on it to pull code and push status and code quality messages to our pull requests. | | [ZenHub](https://www.zenhub.com) | | https://twitter.com/zenhubstatus | | ZenHub is a project management layer on top of GitHub Issues that we use. | | [Docker Hub](https://hub.docker.com/) | | [https://status.docker.com/](https://status.docker.com/) | Contact support@docker.com and/or tweet [@Docker](https://twitter.com/Docker) | We use Docker Hub to pull down container images for our CI environments in Tugboat. | + +## Composer +There are a number of services that Composer uses to download and install dependencies. These services are used during the build process and are not required for runtime. + +We are currently aliasing several packages because of lingering dependencies on Drupal 9. We are working to remove these aliases. diff --git a/composer.json b/composer.json index 5edb124b13..a907d42db8 100644 --- a/composer.json +++ b/composer.json @@ -49,9 +49,9 @@ "drupal/consumers": "^1.17.0", "drupal/content_lock": "^2.3", "drupal/content_model_documentation": "^1.0.19", - "drupal/core": "10.1.6 as 9.5", - "drupal/core-composer-scaffold": "10.1.6 as 9.5", - "drupal/core-recommended": "10.1.6 as 9.5", + "drupal/core": "10.1.7 as 9.5", + "drupal/core-composer-scaffold": "10.1.7 as 9.5", + "drupal/core-recommended": "10.1.7 as 9.5", "drupal/crop": "^2.0", "drupal/csv_serialization": "^4.0", "drupal/ctools_block": "^4.0", @@ -67,7 +67,7 @@ "drupal/entity_browser": "^2.4", "drupal/entity_browser_table": "^1.4", "drupal/entity_clone": "^2.0@alpha", - "drupal/entity_diff_ui": "1.0.x-dev@dev", + "drupal/entity_diff_ui": "^2.0@alpha", "drupal/entity_field_fetch": "^1.0@beta", "drupal/entity_reference_hierarchy": "^1.0@beta", "drupal/entity_reference_revisions": "^1.7", @@ -166,7 +166,6 @@ "drupal/schemata": "^1.0@beta", "drupal/search_api": "^1.29.0", "drupal/seckit": "^2.0", - "drupal/seven": "^1.0@alpha", "drupal/simplesamlphp_auth": "^4.0@RC", "drupal/sitewide_alert": "^2.0", "drupal/slack": "^1.3", @@ -220,8 +219,7 @@ "symfony/phpunit-bridge": "^5.1", "symfony/process": "^6.3", "symfony/routing": "^6.3", - "twig/twig": "3.7.0 as 3.6", - "va-gov/content-build": "^0.0.3404", + "va-gov/content-build": "^0.0.3405", "vlucas/phpdotenv": "^5.3", "webflo/drupal-finder": "^1.0.0", "webmozart/path-util": "^2.3", diff --git a/composer.lock b/composer.lock index c8ba81cbef..94bd3211b1 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "bbe9f7233f8bbb6f41d8069a30025506", + "content-hash": "5076eab84ec9f08c56247c3fc868efef", "packages": [ { "name": "asm89/stack-cors", @@ -3870,16 +3870,16 @@ }, { "name": "drupal/core", - "version": "10.1.6", + "version": "10.1.7", "source": { "type": "git", "url": "https://github.com/drupal/core.git", - "reference": "33695caf467e3e1e8c75d42215df57bee31be9ec" + "reference": "54415049a721ede65318e3980b402af59bc35913" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/drupal/core/zipball/33695caf467e3e1e8c75d42215df57bee31be9ec", - "reference": "33695caf467e3e1e8c75d42215df57bee31be9ec", + "url": "https://api.github.com/repos/drupal/core/zipball/54415049a721ede65318e3980b402af59bc35913", + "reference": "54415049a721ede65318e3980b402af59bc35913", "shasum": "" }, "require": { @@ -4024,22 +4024,22 @@ ], "description": "Drupal is an open source content management platform powering millions of websites and applications.", "support": { - "source": "https://github.com/drupal/core/tree/10.1.6" + "source": "https://github.com/drupal/core/tree/10.1.7" }, - "time": "2023-11-01T11:59:20+00:00" + "time": "2023-12-06T09:22:56+00:00" }, { "name": "drupal/core-composer-scaffold", - "version": "10.1.6", + "version": "10.1.7", "source": { "type": "git", "url": "https://github.com/drupal/core-composer-scaffold.git", - "reference": "1ccd7db5ff8a5425b5bbba9b9a05e366363c0a51" + "reference": "6a2d817ccb59fdb7e6b3720a1478b0d00b475445" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/drupal/core-composer-scaffold/zipball/1ccd7db5ff8a5425b5bbba9b9a05e366363c0a51", - "reference": "1ccd7db5ff8a5425b5bbba9b9a05e366363c0a51", + "url": "https://api.github.com/repos/drupal/core-composer-scaffold/zipball/6a2d817ccb59fdb7e6b3720a1478b0d00b475445", + "reference": "6a2d817ccb59fdb7e6b3720a1478b0d00b475445", "shasum": "" }, "require": { @@ -4074,22 +4074,22 @@ "drupal" ], "support": { - "source": "https://github.com/drupal/core-composer-scaffold/tree/10.1.6" + "source": "https://github.com/drupal/core-composer-scaffold/tree/10.1.7" }, - "time": "2023-04-30T16:15:32+00:00" + "time": "2023-11-15T23:23:43+00:00" }, { "name": "drupal/core-recommended", - "version": "10.1.6", + "version": "10.1.7", "source": { "type": "git", "url": "https://github.com/drupal/core-recommended.git", - "reference": "13f5968854fe8bc02e659d8a4facc04a1a576ce5" + "reference": "e4726a4a0173a4b9acdac8cab5d4009d6085fd2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/drupal/core-recommended/zipball/13f5968854fe8bc02e659d8a4facc04a1a576ce5", - "reference": "13f5968854fe8bc02e659d8a4facc04a1a576ce5", + "url": "https://api.github.com/repos/drupal/core-recommended/zipball/e4726a4a0173a4b9acdac8cab5d4009d6085fd2e", + "reference": "e4726a4a0173a4b9acdac8cab5d4009d6085fd2e", "shasum": "" }, "require": { @@ -4098,7 +4098,7 @@ "doctrine/annotations": "~1.14.3", "doctrine/deprecations": "~v1.1.1", "doctrine/lexer": "~2.1.0", - "drupal/core": "10.1.6", + "drupal/core": "10.1.7", "egulias/email-validator": "~4.0.1", "guzzlehttp/guzzle": "~7.7.0", "guzzlehttp/psr7": "~2.5.0", @@ -4155,9 +4155,9 @@ ], "description": "Core and its dependencies with known-compatible minor versions. Require this project INSTEAD OF drupal/core.", "support": { - "source": "https://github.com/drupal/core-recommended/tree/10.1.6" + "source": "https://github.com/drupal/core-recommended/tree/10.1.7" }, - "time": "2023-11-01T11:59:20+00:00" + "time": "2023-12-06T09:22:56+00:00" }, { "name": "drupal/core_event_dispatcher", @@ -5446,27 +5446,30 @@ }, { "name": "drupal/entity_diff_ui", - "version": "dev-1.0.x", + "version": "2.0.0-alpha1", "source": { "type": "git", "url": "https://git.drupalcode.org/project/entity_diff_ui.git", - "reference": "2eb18091039d747fd36ab5120fe94ac1d3511212" + "reference": "2.0.0-alpha1" + }, + "dist": { + "type": "zip", + "url": "https://ftp.drupal.org/files/projects/entity_diff_ui-2.0.0-alpha1.zip", + "reference": "2.0.0-alpha1", + "shasum": "ba7ce7c7f8ee03c98ee326706901274fc62b4439" }, "require": { - "drupal/core": "^8.7.7 || ^9 || ^10", - "drupal/diff": "^1.0" + "drupal/core": "^9.3.0 || ^10", + "drupal/diff": "^1.1" }, "type": "drupal-module", "extra": { - "branch-alias": { - "dev-1.0.x": "1.0.x-dev" - }, "drupal": { - "version": "1.0.2+1-dev", - "datestamp": "1701893668", + "version": "2.0.0-alpha1", + "datestamp": "1701889658", "security-coverage": { "status": "not-covered", - "message": "Dev releases are not covered by Drupal security advisories." + "message": "Alpha releases are not covered by Drupal security advisories." } } }, @@ -5484,7 +5487,7 @@ "homepage": "https://www.drupal.org/user/1096864" } ], - "description": "Provide UI plugins of diff for entities.", + "description": "Provides the capabilities to compare the difference between entity revisions.", "homepage": "https://www.drupal.org/project/entity_diff_ui", "support": { "source": "https://git.drupalcode.org/project/entity_diff_ui" @@ -12033,66 +12036,6 @@ "issues": "http://drupal.org/project/issues/seckit" } }, - { - "name": "drupal/seven", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://git.drupalcode.org/project/seven.git", - "reference": "1.0.0" - }, - "dist": { - "type": "zip", - "url": "https://ftp.drupal.org/files/projects/seven-1.0.0.zip", - "reference": "1.0.0", - "shasum": "88e86926388c7e6cf66b0502d13a0470ce2399cd" - }, - "require": { - "drupal/core": "^9 || ^10" - }, - "type": "drupal-theme", - "extra": { - "drupal": { - "version": "1.0.0", - "datestamp": "1683652106", - "security-coverage": { - "status": "covered", - "message": "Covered by Drupal's security advisory policy" - } - } - }, - "notification-url": "https://packages.drupal.org/8/downloads", - "license": [ - "GPL-2.0-or-later" - ], - "authors": [ - { - "name": "bnjmnm", - "homepage": "https://www.drupal.org/user/2369194" - }, - { - "name": "lauriii", - "homepage": "https://www.drupal.org/user/1078742" - }, - { - "name": "mcrittenden", - "homepage": "https://www.drupal.org/user/420631" - }, - { - "name": "mrfelton", - "homepage": "https://www.drupal.org/user/305669" - }, - { - "name": "TravisCarden", - "homepage": "https://www.drupal.org/user/236758" - } - ], - "description": "The Seven theme from Drupal 8/9 moved to contrib", - "homepage": "https://www.drupal.org/project/seven", - "support": { - "source": "https://git.drupalcode.org/project/seven" - } - }, { "name": "drupal/simple_oauth", "version": "5.2.4", @@ -25810,16 +25753,16 @@ }, { "name": "twig/twig", - "version": "v3.7.0", + "version": "v3.6.1", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "5cf942bbab3df42afa918caeba947f1b690af64b" + "reference": "7e7d5839d4bec168dfeef0ac66d5c5a2edbabffd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/5cf942bbab3df42afa918caeba947f1b690af64b", - "reference": "5cf942bbab3df42afa918caeba947f1b690af64b", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/7e7d5839d4bec168dfeef0ac66d5c5a2edbabffd", + "reference": "7e7d5839d4bec168dfeef0ac66d5c5a2edbabffd", "shasum": "" }, "require": { @@ -25865,7 +25808,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.7.0" + "source": "https://github.com/twigphp/Twig/tree/v3.6.1" }, "funding": [ { @@ -25877,20 +25820,20 @@ "type": "tidelift" } ], - "time": "2023-07-26T07:16:09+00:00" + "time": "2023-06-08T12:52:13+00:00" }, { "name": "va-gov/content-build", - "version": "v0.0.3404", + "version": "v0.0.3405", "source": { "type": "git", "url": "https://github.com/department-of-veterans-affairs/content-build.git", - "reference": "857a0747105954f94ec26f0a501f6fa14bc79d71" + "reference": "66e1d0173d127b650eeff6bf9c57ff7273a6cfdf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/department-of-veterans-affairs/content-build/zipball/857a0747105954f94ec26f0a501f6fa14bc79d71", - "reference": "857a0747105954f94ec26f0a501f6fa14bc79d71", + "url": "https://api.github.com/repos/department-of-veterans-affairs/content-build/zipball/66e1d0173d127b650eeff6bf9c57ff7273a6cfdf", + "reference": "66e1d0173d127b650eeff6bf9c57ff7273a6cfdf", "shasum": "" }, "type": "node-project", @@ -25917,9 +25860,9 @@ "description": "Front-end for VA.gov. This repository contains the code that generates the www.va.gov website. It contains a Metalsmith static site builder that uses a Drupal CMS for content. This file is here to publish releases to https://packagist.org/packages/va-gov/content-build, so that the CMS CI system can install it and update it using standard composer processes, and so that we can run tests across both systems. See https://github.com/department-of-veterans-affairs/va.gov-cms for the CMS repo, and stand by for more documentation.", "support": { "issues": "https://github.com/department-of-veterans-affairs/content-build/issues", - "source": "https://github.com/department-of-veterans-affairs/content-build/tree/v0.0.3404" + "source": "https://github.com/department-of-veterans-affairs/content-build/tree/v0.0.3405" }, - "time": "2023-12-12T18:36:00+00:00" + "time": "2023-12-12T21:18:47+00:00" }, { "name": "vlucas/phpdotenv", @@ -26883,19 +26826,19 @@ "aliases": [ { "package": "drupal/core", - "version": "10.1.6.0", + "version": "10.1.7.0", "alias": "9.5", "alias_normalized": "9.5.0.0" }, { "package": "drupal/core-composer-scaffold", - "version": "10.1.6.0", + "version": "10.1.7.0", "alias": "9.5", "alias_normalized": "9.5.0.0" }, { "package": "drupal/core-recommended", - "version": "10.1.6.0", + "version": "10.1.7.0", "alias": "9.5", "alias_normalized": "9.5.0.0" }, @@ -26904,12 +26847,6 @@ "version": "1.1.1.0", "alias": "0.9.1", "alias_normalized": "0.9.1.0" - }, - { - "package": "twig/twig", - "version": "3.7.0.0", - "alias": "3.6", - "alias_normalized": "3.6.0.0" } ], "minimum-stability": "dev", @@ -26923,7 +26860,7 @@ "drupal/danse_content_moderation": 10, "drupal/entity_block": 10, "drupal/entity_clone": 15, - "drupal/entity_diff_ui": 20, + "drupal/entity_diff_ui": 15, "drupal/entity_field_fetch": 10, "drupal/entity_reference_hierarchy": 10, "drupal/entity_reference_validators": 15, @@ -26948,7 +26885,6 @@ "drupal/pathologic": 15, "drupal/prometheus_exporter": 10, "drupal/schemata": 10, - "drupal/seven": 15, "drupal/simplesamlphp_auth": 5, "drupal/styleguide": 10, "drupal/user_history": 15, diff --git a/config/sync/core.extension.yml b/config/sync/core.extension.yml index e0f6987dbf..9f42a81fbc 100644 --- a/config/sync/core.extension.yml +++ b/config/sync/core.extension.yml @@ -23,7 +23,6 @@ module: breakpoint: 0 cer: 0 change_labels: 0 - ckeditor: 0 ckeditor5: 0 ckeditor_abbreviation: 0 codit_menu_tools: 0 diff --git a/docroot/modules/custom/va_gov_build_trigger/js/content_release_status_block.js b/docroot/modules/custom/va_gov_build_trigger/js/content_release_status_block.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/docroot/modules/custom/va_gov_build_trigger/src/Controller/FrontEndBranchAutocompleteController.php b/docroot/modules/custom/va_gov_build_trigger/src/Controller/FrontEndBranchAutocompleteController.php deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/docroot/modules/custom/va_gov_content_types/src/EventSubscriber/EntityBundleCreateEventSubscriber.php b/docroot/modules/custom/va_gov_content_types/src/EventSubscriber/EntityBundleCreateEventSubscriber.php new file mode 100644 index 0000000000..2c97d940c0 --- /dev/null +++ b/docroot/modules/custom/va_gov_content_types/src/EventSubscriber/EntityBundleCreateEventSubscriber.php @@ -0,0 +1,84 @@ +configFactory = $configFactory; + $this->metricsCollectorManager = $metricsCollectorManager; + } + + /** + * Respond to the entity_bundle_create event. + * + * @param \Drupal\core_event_dispatcher\Event\Entity\EntityBundleCreateEvent $event + * The event to process. + */ + public function onEntityBundleCreate(EntityBundleCreateEvent $event): void { + $entityTypeId = $event->getEntityTypeId(); + if ($entityTypeId !== 'node') { + return; + } + $this->enableNodeCountOnContentType($event->getBundle()); + } + + /** + * Enable node_count for the specified content type. + * + * @param string $contentType + * The content type to enable. + */ + public function enableNodeCountOnContentType(string $contentType): void { + $config = $this->configFactory->getEditable('prometheus_exporter.settings'); + $bundles = $config->get('collectors.node_count.settings.bundles') ?? []; + $bundles[$contentType] = $contentType; + $config->set('collectors.node_count.settings.bundles', $bundles); + $config->save(); + $this->metricsCollectorManager->syncPluginConfig(); + } + +} diff --git a/docroot/modules/custom/va_gov_content_types/va_gov_content_types.services.yml b/docroot/modules/custom/va_gov_content_types/va_gov_content_types.services.yml new file mode 100644 index 0000000000..c22a6c5307 --- /dev/null +++ b/docroot/modules/custom/va_gov_content_types/va_gov_content_types.services.yml @@ -0,0 +1,6 @@ +services: + va_gov_content_types.entity_bundle_create_event_subscriber: + class: Drupal\va_gov_content_types\EventSubscriber\EntityBundleCreateEventSubscriber + arguments: ['@config.factory', '@prometheus_exporter.metrics_collector_manager'] + tags: + - { name: event_subscriber } diff --git a/docroot/modules/custom/va_gov_preview/src/Encoder/StaticEncoder.php b/docroot/modules/custom/va_gov_preview/src/Encoder/StaticEncoder.php index 7fb80387cb..4c5a85b937 100644 --- a/docroot/modules/custom/va_gov_preview/src/Encoder/StaticEncoder.php +++ b/docroot/modules/custom/va_gov_preview/src/Encoder/StaticEncoder.php @@ -51,7 +51,7 @@ class StaticEncoder implements SerializerAwareInterface, EncoderInterface { * The string translation service. */ public function __construct(MessengerInterface $messenger, TranslationInterface $string_translation) { - $this->messenger = $messenger; + $this->messenger = $messenger; $this->stringTranslation = $string_translation; } diff --git a/docroot/modules/custom/va_gov_views/src/EventSubscriber/ViewsBulkOpsSubscriber.php b/docroot/modules/custom/va_gov_views/src/EventSubscriber/ViewsBulkOpsSubscriber.php index 6efed2a798..a013ad6d86 100644 --- a/docroot/modules/custom/va_gov_views/src/EventSubscriber/ViewsBulkOpsSubscriber.php +++ b/docroot/modules/custom/va_gov_views/src/EventSubscriber/ViewsBulkOpsSubscriber.php @@ -2,6 +2,7 @@ namespace Drupal\va_gov_views\EventSubscriber; +use Drupal\Core\Form\FormStateInterface; use Drupal\core_event_dispatcher\Event\Form\FormAlterEvent; use Drupal\core_event_dispatcher\FormHookEvents; use Symfony\Component\EventDispatcher\EventSubscriberInterface; @@ -11,6 +12,15 @@ */ class ViewsBulkOpsSubscriber implements EventSubscriberInterface { + /** + * {@inheritdoc} + */ + public static function getSubscribedEvents() { + return [ + FormHookEvents::FORM_ALTER => 'formAlter', + ]; + } + /** * Form alter Event call. * @@ -20,6 +30,18 @@ class ViewsBulkOpsSubscriber implements EventSubscriberInterface { public function formAlter(FormAlterEvent $event): void { $form = &$event->getForm(); $form_state = $event->getFormState(); + $this->viewsFormContentPageTwoAlter($form, $form_state); + } + + /** + * Alter the views form for content_page_2. + * + * @param array $form + * The form. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The form state. + */ + private function viewsFormContentPageTwoAlter(array &$form, FormStateInterface $form_state): void { $id = $form_state->getFormObject()->getFormId(); if ($id === 'views_form_content_page_2') { @@ -30,13 +52,4 @@ public function formAlter(FormAlterEvent $event): void { } } - /** - * {@inheritdoc} - */ - public static function getSubscribedEvents() { - return [ - FormHookEvents::FORM_ALTER => 'formAlter', - ]; - } - } diff --git a/docroot/modules/custom/va_gov_views/va_gov_views.libraries.yml b/docroot/modules/custom/va_gov_views/va_gov_views.libraries.yml deleted file mode 100644 index 096c2737c6..0000000000 --- a/docroot/modules/custom/va_gov_views/va_gov_views.libraries.yml +++ /dev/null @@ -1 +0,0 @@ -# Custom module library for general purposes. diff --git a/docroot/modules/custom/va_gov_views/va_gov_views.module b/docroot/modules/custom/va_gov_views/va_gov_views.module deleted file mode 100644 index 07cb07a13a..0000000000 --- a/docroot/modules/custom/va_gov_views/va_gov_views.module +++ /dev/null @@ -1,6 +0,0 @@ -assertInstanceOf(EntityBundleCreateEventSubscriber::class, $this->container->get('va_gov_content_types.entity_bundle_create_event_subscriber')); + } + + /** + * Verify the prometheus_exporter config is updated. + */ + public function testOnEntityBundleCreate(): void { + $config = $this->container->get('config.factory')->get('prometheus_exporter.settings'); + $bundles = $config->get('collectors.node_count.settings.bundles') ?? []; + // Generate a random machine name that is unlikely to exist. + $typeName = strtolower($this->randomMachineName(8)); + $this->assertArrayNotHasKey($typeName, $bundles); + + $this->createContentType([ + 'type' => $typeName, + 'name' => 'My Test Content Type ' . $typeName, + ]); + + $config = $this->container->get('config.factory')->get('prometheus_exporter.settings'); + $bundles = $config->get('collectors.node_count.settings.bundles') ?? []; + $this->assertArrayHasKey($typeName, $bundles); + } + +}