From 5fec035735b9c6636417cfcb1dea2d76d82a0606 Mon Sep 17 00:00:00 2001 From: pookmish Date: Wed, 16 Oct 2024 09:31:58 -0700 Subject: [PATCH] 11.4.5 --- CHANGELOG.md | 7 ++++ ...s.stanford_basic_site_settings.default.yml | 39 +++++++++++++++++++ ...s.stanford_basic_site_settings.default.yml | 20 ++++++++++ ...rd_basic_site_settings.su_site_created.yml | 19 +++++++++ ...d.storage.config_pages.su_site_created.yml | 18 +++++++++ src/Plugin/InstallTask/SiteSettings.php | 4 +- stanford_profile.info.yml | 2 +- .../Plugin/InstallTask/SiteSettingsTest.php | 26 +++++++++++++ 8 files changed, 133 insertions(+), 2 deletions(-) create mode 100644 config/sync/field.field.config_pages.stanford_basic_site_settings.su_site_created.yml create mode 100644 config/sync/field.storage.config_pages.su_site_created.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 639614b86..6751de32f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Stanford Profile +11.4.5 +------------------------------------------------------------------------------- +- Remove edit links in views (#821) +- D8CORE-7564: removed decanter link and replaced with identity guide (#822) +- D8CORE-7517 | update event subtitle heading (#816) +- D8Core-7515: adding a few additional "Site Type" options + 11.4.4 ------------------------------------------------------------------------------- - Updated image_effects module for compatibility with imagemagic 4.0.0. diff --git a/config/sync/core.entity_form_display.config_pages.stanford_basic_site_settings.default.yml b/config/sync/core.entity_form_display.config_pages.stanford_basic_site_settings.default.yml index 6e5ede026..b23560b04 100644 --- a/config/sync/core.entity_form_display.config_pages.stanford_basic_site_settings.default.yml +++ b/config/sync/core.entity_form_display.config_pages.stanford_basic_site_settings.default.yml @@ -18,6 +18,7 @@ dependencies: - field.field.config_pages.stanford_basic_site_settings.su_site_algolia_key - field.field.config_pages.stanford_basic_site_settings.su_site_algolia_search - field.field.config_pages.stanford_basic_site_settings.su_site_algolia_ui + - field.field.config_pages.stanford_basic_site_settings.su_site_created - field.field.config_pages.stanford_basic_site_settings.su_site_dropdowns - field.field.config_pages.stanford_basic_site_settings.su_site_email - field.field.config_pages.stanford_basic_site_settings.su_site_home @@ -35,9 +36,11 @@ dependencies: - change_labels - conditional_fields - cshs + - field_formatter_class - field_group - file - link + - readonly_field_widget - text third_party_settings: field_group: @@ -248,6 +251,42 @@ content: settings: display_label: true third_party_settings: { } + su_site_created: + type: readonly_field_widget + weight: 1 + region: content + settings: + label: above + formatter_type: timestamp + formatter_settings: + timestamp: + date_format: html_date + custom_date_format: '' + timezone: '' + tooltip: + date_format: long + custom_date_format: '' + time_diff: + enabled: false + future_format: '@interval hence' + past_format: '@interval ago' + granularity: 2 + refresh: 60 + description: '' + formatter_third_party_settings: + empty_fields: + handler: '' + field_formatter_class: + class: '' + field_label: + label_value: '' + label_tag: '' + show_description: false + third_party_settings: + field_formatter_class: + class: '' + change_labels: + field_label_overwrite: '' su_site_dropdowns: type: boolean_checkbox weight: 5 diff --git a/config/sync/core.entity_view_display.config_pages.stanford_basic_site_settings.default.yml b/config/sync/core.entity_view_display.config_pages.stanford_basic_site_settings.default.yml index 358923ecc..ad587372a 100644 --- a/config/sync/core.entity_view_display.config_pages.stanford_basic_site_settings.default.yml +++ b/config/sync/core.entity_view_display.config_pages.stanford_basic_site_settings.default.yml @@ -18,6 +18,7 @@ dependencies: - field.field.config_pages.stanford_basic_site_settings.su_site_algolia_key - field.field.config_pages.stanford_basic_site_settings.su_site_algolia_search - field.field.config_pages.stanford_basic_site_settings.su_site_algolia_ui + - field.field.config_pages.stanford_basic_site_settings.su_site_created - field.field.config_pages.stanford_basic_site_settings.su_site_dropdowns - field.field.config_pages.stanford_basic_site_settings.su_site_email - field.field.config_pages.stanford_basic_site_settings.su_site_home @@ -150,6 +151,25 @@ content: third_party_settings: { } weight: 23 region: content + su_site_created: + type: timestamp + label: above + settings: + date_format: medium + custom_date_format: '' + timezone: '' + tooltip: + date_format: long + custom_date_format: '' + time_diff: + enabled: false + future_format: '@interval hence' + past_format: '@interval ago' + granularity: 2 + refresh: 60 + third_party_settings: { } + weight: 26 + region: content su_site_dropdowns: type: boolean label: above diff --git a/config/sync/field.field.config_pages.stanford_basic_site_settings.su_site_created.yml b/config/sync/field.field.config_pages.stanford_basic_site_settings.su_site_created.yml new file mode 100644 index 000000000..d93a1b3a6 --- /dev/null +++ b/config/sync/field.field.config_pages.stanford_basic_site_settings.su_site_created.yml @@ -0,0 +1,19 @@ +uuid: 1e49df54-32d6-4f5b-a5ec-e16691ef2bd4 +langcode: en +status: true +dependencies: + config: + - config_pages.type.stanford_basic_site_settings + - field.storage.config_pages.su_site_created +id: config_pages.stanford_basic_site_settings.su_site_created +field_name: su_site_created +entity_type: config_pages +bundle: stanford_basic_site_settings +label: 'Site Created' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: timestamp diff --git a/config/sync/field.storage.config_pages.su_site_created.yml b/config/sync/field.storage.config_pages.su_site_created.yml new file mode 100644 index 000000000..f13c19d1d --- /dev/null +++ b/config/sync/field.storage.config_pages.su_site_created.yml @@ -0,0 +1,18 @@ +uuid: fe6fd938-d6ff-4a78-afc2-07bb6d493e5b +langcode: en +status: true +dependencies: + module: + - config_pages +id: config_pages.su_site_created +field_name: su_site_created +entity_type: config_pages +type: timestamp +settings: { } +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/src/Plugin/InstallTask/SiteSettings.php b/src/Plugin/InstallTask/SiteSettings.php index 09dcd825c..5bada364c 100644 --- a/src/Plugin/InstallTask/SiteSettings.php +++ b/src/Plugin/InstallTask/SiteSettings.php @@ -104,6 +104,7 @@ public function __construct(array $configuration, $plugin_id, $plugin_definition */ public function runTask(array &$install_state) { $this->state->set('nobots', FALSE); + $this->state->set('stanford-created', time()); $node_pages = [ '403_page' => '4b8018dc-49a6-4018-9c54-e8c3e462beee', @@ -138,9 +139,10 @@ public function runTask(array &$install_state) { ->create([ 'type' => 'stanford_basic_site_settings', 'context' => 'a:0:{}', - 'su_hide_ext_link_icons' => TRUE, ]); } + $config_page->set('su_hide_ext_link_icons', TRUE); + $config_page->set('su_site_created', time()); $config_page->set('su_site_email', $site_data['email']); $config_page->set('su_site_name', $site_data['webSiteTitle']); $config_page->save(); diff --git a/stanford_profile.info.yml b/stanford_profile.info.yml index b8781ad57..6fed7184e 100644 --- a/stanford_profile.info.yml +++ b/stanford_profile.info.yml @@ -1,6 +1,6 @@ name: 'Stanford Profile' description: 'Jumpstart Website Profile' -version: 11.4.4 +version: 11.4.5 type: profile project: Stanford core_version_requirement: ^10 || ^11 diff --git a/tests/src/Kernel/Plugin/InstallTask/SiteSettingsTest.php b/tests/src/Kernel/Plugin/InstallTask/SiteSettingsTest.php index c984bc801..9f307e9c8 100644 --- a/tests/src/Kernel/Plugin/InstallTask/SiteSettingsTest.php +++ b/tests/src/Kernel/Plugin/InstallTask/SiteSettingsTest.php @@ -114,6 +114,32 @@ public function setup(): void { 'label' => 'Name', ])->save(); + $field_storage = FieldStorageConfig::create([ + 'field_name' => 'su_hide_ext_link_icons', + 'entity_type' => 'config_pages', + 'type' => 'boolean', + ]); + $field_storage->save(); + FieldConfig::create([ + 'entity_type' => 'config_pages', + 'field_storage' => $field_storage, + 'bundle' => 'stanford_basic_site_settings', + 'label' => 'Hide Ext Links', + ])->save(); + + $field_storage = FieldStorageConfig::create([ + 'field_name' => 'su_site_created', + 'entity_type' => 'config_pages', + 'type' => 'timestamp', + ]); + $field_storage->save(); + FieldConfig::create([ + 'entity_type' => 'config_pages', + 'field_storage' => $field_storage, + 'bundle' => 'stanford_basic_site_settings', + 'label' => 'Created', + ])->save(); + drupal_flush_all_caches(); $data = json_encode([