Skip to content

Commit

Permalink
Merge branch '11.x' of https://github.com/SU-SWS/stanford_profile int…
Browse files Browse the repository at this point in the history
…o 11.x
  • Loading branch information
pookmish committed Oct 27, 2023
2 parents e263c25 + 9764274 commit 096ad32
Show file tree
Hide file tree
Showing 15 changed files with 53 additions and 40 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# SOE Profile

11.0.8
-------------------------------------------------------------------------------
- D8CORE-7066 Adjust site contact fields & language (#741)
- Update contact field labels
- Adjusted access denied message
- Added the anchor for contact details on site settings

11.0.7
-------------------------------------------------------------------------------
- Invalidate cache tag when saving site contact details
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,17 @@ third_party_settings:
- su_site_tech_contact
- su_site_a11y_contact
- su_site_org
label: 'Contact Details'
label: 'Site Contacts'
region: content
parent_name: group_tabs
weight: 20
format_type: tab
format_settings:
classes: ''
show_empty_fields: false
id: ''
id: contact
formatter: closed
description: "<p>Site owners are required to provide the email addresses for important site contacts on an annual basis in order to renew the site. Please provide an email address for the business owner, technical owner, and the accessibility contact for the site, as well as an indication of the organizational affiliation of the site. </p>\r\n\r\n<p>If you have questions about this information or policies around site renewal, please visit our <a href=\"https://sitesuserguide.stanford.edu/get-started/enter-site-ownership-information\">User Guide page on site ownership</a>.</p>"
description: "<h2>Contact and Affiliation Information for this Site</h2>\r\n<p>Site owners are required to provide the email addresses for important site contacts on an annual basis in order to renew the site. Please provide an email address for the primary site owner(s), primary site manager(s), and a contact who will be responsible for ensuring the accessibility of content on the site. Also select the site’s closest organizational affiliation(s).</p>\r\n<p>If you have questions about this information or policies around site renewal, please visit our <a href=\"https://sitesuserguide.stanford.edu/get-started/enter-site-ownership-information\">User Guide page about site ownership</a>.</p>"
required_fields: true
id: config_pages.stanford_basic_site_settings.default
targetEntityType: config_pages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ field_name: su_google_analytics
entity_type: config_pages
bundle: stanford_basic_site_settings
label: 'Google Analytics Account'
description: 'This ID is unique to each site you want to track separately, and is in the form of UA-xxxxxxx-yy or G-xxxxxxxxx. To get a Web Property ID, <a href="https://marketingplatform.google.com/about/analytics/">register your site with Google Analytics</a>, or if you already have registered your site, go to your Google Analytics Settings page to see the ID next to every site profile. <a href="https://developers.google.com/analytics/resources/concepts/gaConceptsAccounts#webProperty">Find more information in the documentation.</a>'
description: 'This ID is unique to each site you want to track separately and is in the form of G-xxxxxxxxx. To get a Web Property ID, <a href="https://marketingplatform.google.com/about/analytics/">register your site with Google Analytics</a>, or if you already have registered your site, go to your Google Analytics Settings page to see the ID next to every site profile. <a href="https://developers.google.com/analytics/resources/concepts/gaConceptsAccounts#webProperty">Find more information in the documentation.</a>'
required: false
translatable: false
default_value: { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ id: config_pages.stanford_basic_site_settings.su_site_a11y_contact
field_name: su_site_a11y_contact
entity_type: config_pages
bundle: stanford_basic_site_settings
label: 'Accessibility Contact'
description: ''
label: 'Accessibility Contact Email'
description: '<p>Please enter the email for the person(s) who are responsible for site content. (This may be the same as the Primary Site Manager in many cases.)</p>'
required: true
translatable: false
default_value: { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ id: config_pages.stanford_basic_site_settings.su_site_dropdowns
field_name: su_site_dropdowns
entity_type: config_pages
bundle: stanford_basic_site_settings
label: 'Use drop down menus'
label: 'Use Drop Down Menus'
description: 'Check this box to enable the split-button drop down menu feature.'
required: false
translatable: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ id: config_pages.stanford_basic_site_settings.su_site_owner_contact
field_name: su_site_owner_contact
entity_type: config_pages
bundle: stanford_basic_site_settings
label: 'Site Owner Contact'
description: ''
label: 'Site Owner Contact Email'
description: '<p>Please enter the email for the business owner(s) for this site. This might be the director, chair, program owner, lab PI, etc.</p>'
required: true
translatable: false
default_value: { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ id: config_pages.stanford_basic_site_settings.su_site_tech_contact
field_name: su_site_tech_contact
entity_type: config_pages
bundle: stanford_basic_site_settings
label: 'Technical Contact'
description: ''
label: 'Primary Site Manager Email'
description: '<p>Please enter the email for the person(s) who leads the site building and editing efforts for this site.</p>'
required: true
translatable: false
default_value: { }
Expand Down
4 changes: 4 additions & 0 deletions config/sync/field.storage.config_pages.su_site_email.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ status: true
dependencies:
module:
- config_pages
- field_permissions
third_party_settings:
field_permissions:
permission_type: custom
id: config_pages.su_site_email
field_name: su_site_email
entity_type: config_pages
Expand Down
4 changes: 2 additions & 2 deletions config/sync/r4032login.settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ _core:
default_config_hash: FtwnuCXmazPAh2H2i_gbDhMK1-eBmNy1dG4RBU4qt4o
langcode: en
display_denied_message: true
access_denied_message: 'Access denied. You must log in to view this page.'
access_denied_message_type: error
access_denied_message: 'You must log in to view this page. Please log in below.'
access_denied_message_type: warning
redirect_authenticated_users_to: ''
throw_authenticated_404: false
display_auth_denied_message: true
Expand Down
2 changes: 1 addition & 1 deletion soe_profile.info.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'SOE Profile'
description: 'Jumpstart Website Profile'
version: 11.0.7
version: 11.0.8
type: profile
project: Stanford
core_version_requirement: ^9 || ^10
Expand Down
6 changes: 3 additions & 3 deletions src/EventSubscriber/EventSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ public function onKernelRequest(RequestEvent $event) {

if (
$event->getRequestType() == HttpKernelInterface::MAIN_REQUEST &&
$current_uri != '/admin/config/system/basic-site-settings' &&
!str_starts_with($current_uri, '/admin/config/system/basic-site-settings') &&
self::redirectUser()
) {
$config_page_url = Url::fromRoute('config_pages.stanford_basic_site_settings');
$this->messenger->addWarning('Please update or verify the site contact information.');
$config_page_url = Url::fromRoute('config_pages.stanford_basic_site_settings', [], ['query' => ['destination' => $current_uri]]);
$this->messenger->addWarning('Please update or verify the site contact information on the "Site Contacts" tab.');
$event->setResponse(new RedirectResponse($config_page_url->toString() . '#contact'));
}
}
Expand Down
6 changes: 3 additions & 3 deletions tests/codeception/acceptance/Content/SearchBlockCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ public function testHideSearchBlock(AcceptanceTester $I) {
$I->amOnPage('/admin/config/system/basic-site-settings');
$I->see('Hide Site Search');
$I->checkOption('Hide Site Search');
$I->fillField('Site Owner Contact (value 1)', $this->faker->email);
$I->fillField('Technical Contact (value 1)', $this->faker->email);
$I->fillField('Accessibility Contact (value 1)', $this->faker->email);
$I->fillField('Site Owner Contact Email (value 1)', $this->faker->email);
$I->fillField('Primary Site Manager Email (value 1)', $this->faker->email);
$I->fillField('Accessibility Contact Email (value 1)', $this->faker->email);
$I->selectOption('[name="su_site_org[0][target_id]"]', $org_term->id());
$I->click('Save');
// The settings might have been created or updated.
Expand Down
19 changes: 10 additions & 9 deletions tests/codeception/acceptance/SystemSiteConfigCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@ public function testBasicSiteSettings(AcceptanceTester $I) {
$I->amOnPage('/');
$I->cantSee('Foo Bar Site');
$I->amOnPage('/admin/config/system/basic-site-settings');
$I->canSeeElement('#contact');
$I->cantSee('Site URL');
$I->fillField('Site Name', 'Foo Bar Site');
$I->fillField('Site Owner Contact (value 1)', $this->faker->email);
$I->fillField('Technical Contact (value 1)', $this->faker->email);
$I->fillField('Accessibility Contact (value 1)', $this->faker->email);
$I->fillField('Site Owner Contact Email (value 1)', $this->faker->email);
$I->fillField('Primary Site Manager Email (value 1)', $this->faker->email);
$I->fillField('Accessibility Contact Email (value 1)', $this->faker->email);
$I->selectOption('[name="su_site_org[0][target_id]"]', $org_term->id());
$I->click('Save');
$I->canSee('Site Settings has been', '.messages-list');
Expand Down Expand Up @@ -101,9 +102,9 @@ public function testSitePages(AcceptanceTester $I) {
$I->logInWithRole('administrator');
$I->amOnPage('/admin/config/system/basic-site-settings');
$I->selectOption('Home Page', $node->label());
$I->fillField('Site Owner Contact (value 1)', $this->faker->email);
$I->fillField('Technical Contact (value 1)', $this->faker->email);
$I->fillField('Accessibility Contact (value 1)', $this->faker->email);
$I->fillField('Site Owner Contact Email (value 1)', $this->faker->email);
$I->fillField('Primary Site Manager Email (value 1)', $this->faker->email);
$I->fillField('Accessibility Contact Email (value 1)', $this->faker->email);
$I->selectOption('[name="su_site_org[0][target_id]"]', $org_term->id());
$I->click('Save');
$I->canSee('Site Settings has been', '.messages-list');
Expand Down Expand Up @@ -142,9 +143,9 @@ protected function experimentalTestGoogleAnalytics(AcceptanceTester $I) {
$I->amOnPage('/admin/config/system/basic-site-settings');
$I->fillField('Google Analytics Account', 'abcdefg');

$I->fillField('Site Owner Contact (value 1)', $this->faker->email);
$I->fillField('Technical Contact (value 1)', $this->faker->email);
$I->fillField('Accessibility Contact (value 1)', $this->faker->email);
$I->fillField('Site Owner Contact Email (value 1)', $this->faker->email);
$I->fillField('Primary Site Manager Email (value 1)', $this->faker->email);
$I->fillField('Accessibility Contact Email (value 1)', $this->faker->email);
$I->selectOption('[name="su_site_org[0][target_id]"]', $org_term->id());

$I->click('Save');
Expand Down
9 changes: 5 additions & 4 deletions tests/codeception/functional/Contrib/ExtLinkCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,11 @@ public function testExtLink(FunctionalTester $I) {
$I->amOnPage('/admin/config/system/basic-site-settings');
$I->uncheckOption('Hide External Link Icons');

$I->click('Contact Details');
$I->fillField('Site Owner Contact (value 1)', $this->faker->email);
$I->fillField('Technical Contact (value 1)', $this->faker->email);
$I->fillField('Accessibility Contact (value 1)', $this->faker->email);
$I->click('Site Contacts');
$I->waitForText('Site Owner Contact Email');
$I->fillField('Site Owner Contact Email (value 1)', $this->faker->email);
$I->fillField('Primary Site Manager Email (value 1)', $this->faker->email);
$I->fillField('Accessibility Contact Email (value 1)', $this->faker->email);
$I->selectOption('.js-form-item-su-site-org-0-target-id select.simpler-select', $org_term->id());
$I->click('Save');
$I->canSee('Site Settings has been', '.messages-list');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ public function testDropdownMenus(FunctionalTester $I) {
$I->logInWithRole('site_manager');
$I->resizeWindow(1400, 2000);
$I->amOnPage('/admin/config/system/basic-site-settings');
$I->uncheckOption('Use drop down menus');
$I->uncheckOption('Use Drop Down Menus');

$I->click('Contact Details');
$I->waitForElementVisible('[data-drupal-selector="edit-group-contact-details"]');
$I->fillField('Site Owner Contact (value 1)', $this->faker->email);
$I->fillField('Technical Contact (value 1)', $this->faker->email);
$I->fillField('Accessibility Contact (value 1)', $this->faker->email);
$I->click('Site Contacts');
$I->waitForText('Site Owner Contact Email');
$I->fillField('Site Owner Contact Email (value 1)', $this->faker->email);
$I->fillField('Primary Site Manager Email (value 1)', $this->faker->email);
$I->fillField('Accessibility Contact Email (value 1)', $this->faker->email);
$I->selectOption('.js-form-item-su-site-org-0-target-id select.simpler-select', $org_term->id());
$I->click('Save');
$I->canSee('Site Settings has been', '.messages-list');
Expand All @@ -70,7 +70,7 @@ public function testDropdownMenus(FunctionalTester $I) {
$I->cantSeeElement('button', ['class' => 'su-nav-toggle']);

$I->amOnPage('/admin/config/system/basic-site-settings');
$I->checkOption('Use drop down menus');
$I->checkOption('Use Drop Down Menus');
$I->click('Save');
$I->canSee('Site Settings has been', '.messages-list');

Expand Down

0 comments on commit 096ad32

Please sign in to comment.