Skip to content

Commit

Permalink
VACMS-15506 aging content fwb mvp with expirable content module (#17732)
Browse files Browse the repository at this point in the history
* VACMS-15506: Adds expirable_content module.

* VACMS-15506: Adds field to expiring content. This was not a successful test, as I was not able to get the field to auto-create a bundle field.

* VACMS-15506: Gut the expirable content module for a re-work.

* VACMS-15506: Moves to a config entity + field architecture for expirable_content. The field isn't auto-installed yet, nor does it auto-populate the expiration or warning values.

* VACMS-15506: Moving toward hybrid approach with a config + content entity.

* VACMS-15506: Adds entity operations to expirable content.

* VACMS-15506: Expirable content module now uses both config and content entities as well as a hybrid computed field for expiration and warning dates.

* VACMS-15506: Adds entity operations hook implementations to expirable content.

* VACMS-15506: PHPCS updates.

* VACMS-15506: Update expirable_content readme.

* VACMS-15506: Removes mention of content_moderation.

* VACMS-15506: Removes unneeded ExpirableContentListBuilder.

* VACMS-15506: Updates readme and adds TODO.md.

* VACMS-15506: Adds expirable content type for FWB.

* VACMS-15506: Enables expirable_content in the CMS.

* VACMS-15506: Fixes missing handler.

* VACMS-15506: Resolves incorrect field names in Views data.

* VACMS-15506: Move to contrib version of expirable_content.

* VACMS-15506: Adds token support for computed field patch.

* VACMS-15506: Update aging content view to use the new computed fields.

* VACMS-15506: Adds FWB warning message template.

* VACMS-15506: Add FWB warning ECA workflow.

* VACMS-15506: Update the subject view mode to remove entity title.

* VACMS-15506: Updates expired FWB eca with updated template fields.

* VACMS-15506: Resolves bug when creating token in CreateAdvacnedQueueJob.

* Revert "Merge remote-tracking branch 'origin/main' into VACMS-15506-aging-content-fwb-mvp-with-expirable-content-module"

This reverts commit 8e3e30e, reversing
changes made to ab59cb8.

* VACMS-15506: Remove single quotes from config.yml which is preventing cli xdebug from working in phpstorm.

* VACMS-15506: Updates aging content view to use correct filtering logic.

* VACMS-15506: Adds missing fields to warning template.

* VACMS-15506: Updates warning template content.

* VACMS-15506: Adds missing mail system handling.

* VACMS-15506: Update warning and expiration rules to prevent recursion and use correct token values.

* VACMS-15506: Updates expirable_content to alpha2.

* VACMS-15506: Updates aging content view sort.

* VACMS-15506: Attempting to fix weitzman/drupal-test-traits.

* VACMS-15506: Reverting accidental change to sitewide-crew-member-onboarding.md.

* VACMS-15506: Reverting accidental change to docroot/design-system/package-lock.json.

* VACMS-15506: Reverting accidental change to docroot/themes/custom/vagovclaro/package-lock.json.

* VACMS-15506: Adds deploy hook for seeding fwb expirable information.

* VACMS-15506: Move expirable_content to dev release for easier updates. We are making changes to the module to support aging content pretty frequently, and cutting a new release every time is causing friction.

* VACMS-15506: Adds script to generate test nodes.

* VACMS-15506: Ensure the warn and expire eca models are disabled for mvp launch.

* VACMS-15506: Spelling correction.

* VACMS-15506: Updates expirable_content to solve a bug preventing entity revision deletes.
  • Loading branch information
dsasser committed May 1, 2024
1 parent eb69101 commit 5111171
Show file tree
Hide file tree
Showing 25 changed files with 760 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .ddev/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use_dns_when_possible: true
composer_version: "2"
disable_settings_management: true
web_environment:
- PHP_IDE_CONFIG='serverName=appserver'
- PHP_IDE_CONFIG=serverName=appserver
- TXT_RESET=tput sgr 0
- TXT_RED=tput setaf 1
- TXT_GREEN=tput setaf 2
Expand Down
6 changes: 5 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"drupal/entityqueue": "^1.2",
"drupal/environment_indicator": "^4.0",
"drupal/epp": "^1.1",
"drupal/expirable_content": "1.0.x-dev@dev",
"drupal/fast_404": "^3.0",
"drupal/feature_toggle": "^2.0",
"drupal/field_group": "^3.4",
Expand Down Expand Up @@ -516,11 +517,14 @@
"3163841 - Fix Undefined index: caption notice": "https://www.drupal.org/files/issues/2020-08-10/tablefield-empty-caption-notice-2.patch",
"3176982 - Tablefield input elements have no title or label": "https://www.drupal.org/files/issues/2020-10-14/tablefield-add_title_to_input_elements-3176982-2.patch",
"3195203 - Copying caption to value breaks some data exports 3195203": "https://www.drupal.org/files/issues/2021-01-28/tablefield-caption-copied-to-value-3195203-2.patch",
"3341971 - Drag & drop addition adds meaningless numbers to table data, could break integrating code": "https://www.drupal.org/files/issues/2023-03-23/tablefield-disable-drag-drop-controls.patch"
"3341971 - Drag & drop addition adds meaningless numbers to table data, could break integrating code": "https://www.drupal.org/files/issues/2023-03-23/tablefield-disable-drag-drop-controls.patch"
},
"drupal/textfield_counter": {
"3380997 - Textarea with summary and counter doesn't respect count only setting": "patches/3380997-fix-textfield_counter-respect-count-only-mode.patch"
},
"drupal/token": {
"3047568 - Consistent tokens support across all entities and fields": "https://www.drupal.org/files/issues/2022-08-04/token-consistent-entity-and-field-support-3047568-17.patch"
},
"drupal/viewfield": {
"3252356 - Add option to display default view on node edit when always use default value selected": "https://www.drupal.org/files/issues/2023-02-07/viewfield-option-display-default-view-on-node-edit-3252356-5.patch"
},
Expand Down
62 changes: 56 additions & 6 deletions composer.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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": "423fb6954fb070944b51f510c990f56a",
"content-hash": "22ee30b9e3a6ef34bc8fbc0daacd3d92",
"packages": [
{
"name": "asm89/stack-cors",
Expand Down Expand Up @@ -4745,10 +4745,6 @@
"GPL-2.0-or-later"
],
"authors": [
{
"name": "drupalspoons",
"homepage": "https://www.drupal.org/user/3647684"
},
{
"name": "moshe weitzman",
"homepage": "https://www.drupal.org/user/23"
Expand Down Expand Up @@ -4882,6 +4878,10 @@
"homepage": "https://www.drupal.org/u/realityloop",
"role": "Maintainer"
},
{
"name": "Junyor",
"homepage": "https://www.drupal.org/user/7006"
},
{
"name": "lhangea",
"homepage": "https://www.drupal.org/user/2743803"
Expand Down Expand Up @@ -6310,6 +6310,47 @@
"source": "https://git.drupalcode.org/project/epp"
}
},
{
"name": "drupal/expirable_content",
"version": "dev-1.0.x",
"source": {
"type": "git",
"url": "https://git.drupalcode.org/project/expirable_content.git",
"reference": "ecf4bd5662851f58c531fc1c71a03f7687905fad"
},
"require": {
"drupal/core": "^9 || ^10"
},
"type": "drupal-module",
"extra": {
"branch-alias": {
"dev-1.0.x": "1.0.x-dev"
},
"drupal": {
"version": "1.0.0-alpha2+3-dev",
"datestamp": "1714075716",
"security-coverage": {
"status": "not-covered",
"message": "Project has not opted into security advisory coverage!"
}
}
},
"notification-url": "https://packages.drupal.org/8/downloads",
"license": [
"GPL-2.0-or-later"
],
"authors": [
{
"name": "coderdan",
"homepage": "https://www.drupal.org/user/490684"
}
],
"description": "Configure any content entity type for expiration.",
"homepage": "https://www.drupal.org/project/expirable_content",
"support": {
"source": "https://git.drupalcode.org/project/expirable_content"
}
},
{
"name": "drupal/externalauth",
"version": "2.0.3",
Expand Down Expand Up @@ -11033,6 +11074,14 @@
"name": "Deciphered",
"homepage": "https://www.drupal.org/user/103796"
},
{
"name": "greggles",
"homepage": "https://www.drupal.org/user/36762"
},
{
"name": "kgatzby",
"homepage": "https://www.drupal.org/user/3601554"
},
{
"name": "michaellander",
"homepage": "https://www.drupal.org/user/636494"
Expand Down Expand Up @@ -11397,7 +11446,7 @@
"extra": {
"drupal": {
"version": "8.x-1.12",
"datestamp": "1696776683",
"datestamp": "1712319355",
"security-coverage": {
"status": "covered",
"message": "Covered by Drupal's security advisory policy"
Expand Down Expand Up @@ -26910,6 +26959,7 @@
"drupal/entity_reference_validators": 15,
"drupal/entity_route_context": 5,
"drupal/entity_usage": 10,
"drupal/expirable_content": 20,
"drupal/fieldhelptext": 10,
"drupal/flag": 10,
"drupal/graphql_menu": 15,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
uuid: 52b31e3b-c1bf-44ab-94bc-3a12f7bdce70
langcode: en
status: true
dependencies:
config:
- field.field.message.aging_content_warn_fwb.field_target_node_title
- field.field.message.aging_content_warn_fwb.field_warning_date
- message.template.aging_content_warn_fwb
id: message.aging_content_warn_fwb.default
targetEntityType: message
bundle: aging_content_warn_fwb
mode: default
content:
created:
type: datetime_timestamp
weight: 10
region: content
settings: { }
third_party_settings: { }
field_target_node_title:
type: string_textfield
weight: 0
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
field_warning_date:
type: string_textfield
weight: 11
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
uid:
type: entity_reference_autocomplete
weight: 5
region: content
settings:
match_operator: CONTAINS
match_limit: 10
size: 60
placeholder: ''
third_party_settings: { }
'#group': advanced
hidden: { }
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ dependencies:
- message.template.aging_content_expired_fwb
module:
- layout_builder
- string_field_formatter
- user
third_party_settings:
layout_builder:
Expand All @@ -21,21 +20,14 @@ targetEntityType: message
bundle: aging_content_expired_fwb
mode: mail_subject
content:
field_target_node_title:
type: plain_string_formatter
label: hidden
settings:
link_to_entity: false
wrap_tag: _none
wrap_class: ''
third_party_settings: { }
weight: 0
region: content
partial_0:
settings: { }
third_party_settings: { }
weight: 0
region: content
hidden:
field_expired_date: true
field_target_entity: true
field_target_node_title: true
partial_1: true
search_api_excerpt: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
uuid: 866f705f-2fc9-4850-8797-ce7d4db995d8
langcode: en
status: true
dependencies:
config:
- field.field.message.aging_content_warn_fwb.field_target_node_title
- field.field.message.aging_content_warn_fwb.field_warning_date
- message.template.aging_content_warn_fwb
module:
- user
id: message.aging_content_warn_fwb.default
targetEntityType: message
bundle: aging_content_warn_fwb
mode: default
content:
partial_0:
settings: { }
third_party_settings: { }
weight: 0
region: content
partial_1:
settings: { }
third_party_settings: { }
weight: 1
region: content
hidden:
field_target_node_title: true
field_warning_date: true
search_api_excerpt: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
uuid: ca00e7f9-a0e9-433e-b446-3996342c773e
langcode: en
status: true
dependencies:
config:
- core.entity_view_mode.message.mail_body
- field.field.message.aging_content_warn_fwb.field_target_node_title
- field.field.message.aging_content_warn_fwb.field_warning_date
- message.template.aging_content_warn_fwb
module:
- layout_builder
- user
third_party_settings:
layout_builder:
enabled: false
allow_custom: false
id: message.aging_content_warn_fwb.mail_body
targetEntityType: message
bundle: aging_content_warn_fwb
mode: mail_body
content:
partial_1:
weight: 0
region: content
hidden:
field_target_node_title: true
field_warning_date: true
partial_0: true
search_api_excerpt: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
uuid: d66cf1cb-f7cc-4827-88f6-ec2909a1ff3d
langcode: en
status: true
dependencies:
config:
- core.entity_view_mode.message.mail_subject
- field.field.message.aging_content_warn_fwb.field_target_node_title
- field.field.message.aging_content_warn_fwb.field_warning_date
- message.template.aging_content_warn_fwb
module:
- layout_builder
- user
third_party_settings:
layout_builder:
enabled: false
allow_custom: false
id: message.aging_content_warn_fwb.mail_subject
targetEntityType: message
bundle: aging_content_warn_fwb
mode: mail_subject
content:
partial_0:
weight: 0
region: content
hidden:
field_target_node_title: true
field_warning_date: true
partial_1: true
search_api_excerpt: true
1 change: 1 addition & 0 deletions config/sync/core.extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ module:
environment_indicator: 0
environment_indicator_ui: 0
epp: 0
expirable_content: 0
externalauth: 0
feature_toggle: 0
field: 0
Expand Down
15 changes: 6 additions & 9 deletions config/sync/eca.eca.aging_content_expired_fwb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ id: aging_content_expired_fwb
modeller: core
label: 'Aging Content: Expired FWB'
version: ''
weight: null
weight: -9
events:
eca_base_eca_cron:
plugin: 'eca_base:eca_cron'
Expand All @@ -28,10 +28,10 @@ events:
plugin: 'content_entity:custom'
label: 'Content Aware Event: Queue Email'
configuration:
event_id: aging_content_fwb_queue_email
event_id: aging_content_fwb_queue_expired_email
successors:
-
id: eca_trigger_content_entity_cus_1
id: create_advancedqueue_job
condition: null
conditions: { }
gateways: { }
Expand All @@ -54,17 +54,14 @@ actions:
configuration:
token_name: job
type: va_gov_aging_content_notification
payload: "template_values:\r\n uid: \"[node:author:uid]\"\r\n template: aging_content_expired_fwb\r\nrestrict_delivery_to:\r\nvalues:\r\n field_expired_date: \"[current-date:short_date_no_time]\"\r\n field_target_entity:\r\n target_id: \"[node:nid]\"\r\n field_target_node_title: \"{node:title}\""
payload: "template_values:\r\n uid: \"[node:author:uid]\"\r\n template: aging_content_expired_fwb\r\nrestrict_delivery_to:\r\nvalues:\r\n field_expired_date: \"[node:expiration_date:date:html_date]\"\r\n field_target_entity:\r\n target_id: \"[node:nid]\"\r\n field_target_node_title: \"[node:title]\""
queue: aging_content
successors: { }
eca_trigger_content_entity_cus_1:
plugin: eca_trigger_content_entity_custom_event
label: 'Trigger Custom Event: Queue Notification'
configuration:
event_id: aging_content_fwb_queue_email
event_id: aging_content_fwb_queue_expired_email
tokens: ''
object: results
successors:
-
id: create_advancedqueue_job
condition: null
successors: { }

0 comments on commit 5111171

Please sign in to comment.