Skip to content

Commit

Permalink
10.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
pookmish authored Jul 26, 2023
2 parents 1c1e384 + 657f213 commit eb9fb0d
Show file tree
Hide file tree
Showing 17 changed files with 1,193 additions and 1,192 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ jobs:
with:
path: project
- name: Run tests
env:
STANFORD_ENCRYPT: ${{ secrets.STANFORD_ENCRYPT }}
run: |
composer global require su-sws/stanford-caravan:dev-8.x-3.x
~/.composer/vendor/bin/sws-caravan codeception /var/www/html --extension-dir=$GITHUB_WORKSPACE/project --suites=acceptance
Expand Down Expand Up @@ -102,6 +104,8 @@ jobs:
with:
path: project
- name: Run tests
env:
STANFORD_ENCRYPT: ${{ secrets.STANFORD_ENCRYPT }}=
run: |
composer global require su-sws/stanford-caravan:dev-8.x-3.x
~/.composer/vendor/bin/sws-caravan codeception /var/www/html --extension-dir=$GITHUB_WORKSPACE/project --suites=functional
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Stanford Profile

10.0.3
-------------------------------------------------------------------------------
- Update decoupled menu to recognize "Expanded" menu setting
- D8CORE-6816 Restored permissions to run importers for site managers
- Add missing chosen library
- Updated google tag settings

10.0.2
-------------------------------------------------------------------------------
- Added to the update hook to handle layout builder menu blocks when updating menu links.
Expand Down
9 changes: 4 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,10 @@
"drupal/conditional_fields": "^4.0",
"drupal/config_filter": "^2.0",
"drupal/config_ignore": "^3.0",
"drupal/config_merge": "^1.0-rc",
"drupal/config_pages": "^2.6",
"drupal/config_pages_overrides": "^2.0",
"drupal/config_readonly": "^1.0@beta",
"drupal/config_split": "^2.0",
"drupal/config_update": "^1.7",
"drupal/confirm_leave": "^1.0@beta",
"drupal/content_lock": "^2.2",
"drupal/core": "~9.5.0",
Expand All @@ -82,7 +80,7 @@
"drupal/field_validation": "^1.0-alpha",
"drupal/file_mdm_exif": "^2.4",
"drupal/file_mdm_font": "^2.4",
"drupal/flat_taxonomy": "^1.2",
"drupal/flat_taxonomy": "^2.0",
"drupal/fontawesome": "^2.19",
"drupal/google_analytics": "^4.0",
"drupal/google_tag": "^2.0",
Expand All @@ -101,7 +99,7 @@
"drupal/layout_builder_restrictions": "^2.2",
"drupal/layout_library": "^1.0-beta1",
"drupal/layout_paragraphs": "^2.0",
"drupal/link_attributes": "^1.11",
"drupal/link_attributes": "^2.0",
"drupal/link_title_formatter": "^2.0",
"drupal/linkit": "^6.0",
"drupal/markup": "^2.0",
Expand All @@ -123,7 +121,7 @@
"drupal/path_redirect_import": "^2.0",
"drupal/pathauto": "^1.6",
"drupal/pdb": "^1.0@alpha",
"drupal/printable": "^3.0@RC",
"drupal/printable": "^3.0",
"drupal/rabbit_hole": "^1.0@beta",
"drupal/real_aes": "^2.4",
"drupal/redirect": "^1.0-beta1",
Expand Down Expand Up @@ -151,6 +149,7 @@
"drupal/views_taxonomy_term_name_depth": "^7.0",
"drupal/webp": "^1.0@beta",
"drupal/xmlsitemap": "^1.0",
"harvesthq/chosen": "^1.8",
"onlyextart/colorbox": "dev-master#e58476becbc89dc671093d1bcd9f99b2167fa8f7",
"sainsburys/guzzle-oauth2-plugin": "^3.0",
"seboettg/citeproc-php": "2.4.1",
Expand Down
9 changes: 7 additions & 2 deletions config/sync/chosen.settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@ _core:
minimum_single: 20
minimum_multiple: 20
disable_search_threshold: 0
minimum_width: 0
minimum_width: 300
max_shown_results: null
use_relative_width: false
jquery_selector: 'select:visible'
search_contains: false
disable_search: false
allow_single_deselect: false
disabled_themes: { }
disabled_themes:
claro: '0'
stanford_profile_admin: '0'
minimally_branded_subtheme: '0'
stanford_basic: '0'
chosen_include: 2
placeholder_text_multiple: 'Choose some options'
placeholder_text_single: 'Choose an option'
Expand Down
45 changes: 3 additions & 42 deletions config/sync/google_tag.settings.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,4 @@
_core:
default_config_hash: 65d5DfK5p2hQDpBskbvCIj2hSEqw_Odm2e_d46BH1Lk
uri: 'public:/'
compact_snippet: true
include_file: true
rebuild_snippets: true
flush_snippets: false
debug_output: false
_default_container:
container_id: ''
data_layer: dataLayer
include_classes: false
whitelist_classes: |-
google
nonGooglePixels
nonGoogleScripts
nonGoogleIframes
blacklist_classes: |-
customScripts
customPixels
include_environment: false
environment_id: ''
environment_token: ''
path_toggle: 'exclude listed'
path_list: |-
/admin*
/batch*
/node/add*
/node/*/edit
/node/*/delete
/user/*/edit*
/user/*/cancel*
role_toggle: 'exclude listed'
role_list:
administrator: administrator
site_manager: site_manager
site_editor: site_editor
site_builder: site_builder
site_developer: site_developer
status_toggle: 'exclude listed'
status_list: |-
403
404
default_config_hash: cvh7di-mJogXOBiv_AoDN22DXIg3-OtzE5iLCIFAQ1s
use_collection: true
default_google_tag_entity: ''
2 changes: 1 addition & 1 deletion config/sync/node.type.stanford_policy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ third_party_settings:
unpublish_revision: false
name: Policy
type: stanford_policy
description: ''
description: 'BETA: Provide a administrative policy structure with breadcrumbs.'
help: ''
new_revision: true
preview_mode: 0
Expand Down
3 changes: 3 additions & 0 deletions config/sync/user.role.site_manager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,10 @@ permissions:
- 'edit terms in stanford_person_types'
- 'edit terms in stanford_publication_topics'
- 'edit terms in su_shared_tags'
- 'import stanford_courses migration'
- 'import stanford_localist_importer migration'
- 'import stanford_publications migration'
- 'import su_stanford_person migration'
- 'mark as hidden in editoria11y'
- 'mark as ok in editoria11y'
- 'notify of path changes'
Expand Down
3 changes: 3 additions & 0 deletions config/sync/xmlsitemap.settings.node.stanford_policy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
status: false
priority: 0.5
changefreq: 0
3 changes: 2 additions & 1 deletion config/sync/xmlsitemap.settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ prefetch_aliases: 1
chunk_size: auto
batch_limit: 100
path: xmlsitemap
frontpage_priority: 0.5
frontpage_priority: !!float 1
frontpage_changefreq: 604800
lastmod_format: 'Y-m-d\TH:i\Z'
gz: false
clean_url: 0
disable_cron_regeneration: false
i18n_selection_mode: simple
metatag_exclude_noindex: false
4 changes: 1 addition & 3 deletions stanford_profile.info.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'Stanford Profile'
description: 'Jumpstart Website Profile'
version: 10.0.2
version: 10.0.3
type: profile
project: Stanford
core_version_requirement: ^9 || ^10
Expand All @@ -14,12 +14,10 @@ install:
- 'chosen:chosen_lib'
- 'components:components'
- 'config_filter:config_filter'
- 'config_merge:config_merge'
- 'config_pages:config_pages'
- 'config_pages_overrides:config_pages_overrides'
- 'config_readonly:config_readonly'
- 'config_split:config_split'
- 'config_update:config_update'
- 'crop:crop'
- 'ctools:ctools'
- 'default_content:default_content'
Expand Down
44 changes: 33 additions & 11 deletions stanford_profile.install
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ function stanford_profile_update_9005(&$sandbox) {
'parent_uuid' => NULL,
'region' => NULL,
]);
$new_row_entity->setParentEntity($node, 'su_page_components');
$new_row_entity->save();

$new_components[] = [
Expand All @@ -165,17 +166,19 @@ function stanford_profile_update_9005(&$sandbox) {
'parent_uuid' => $new_row_entity->uuid(),
'region' => _stanford_profile_update_9005_get_item_region($delta, $layout_id),
];
$paragraph->setParentEntity($node, 'su_page_components');
$paragraph->setAllBehaviorSettings($behaviors);
$paragraph->save();
$new_paragraph = $paragraph->createDuplicate();
$new_paragraph->enforceIsNew();
$new_paragraph->setParentEntity($node, 'su_page_components');
$new_paragraph->setAllBehaviorSettings($behaviors);
$new_paragraph->save();

$new_components[] = [
'target_id' => $paragraph->id(),
'entity' => $paragraph,
'target_id' => $new_paragraph->id(),
'entity' => $new_paragraph,
];
$delete_entities[] = $paragraph;
}
}

$node->set('su_page_components', $new_components)->save();
_stanford_profile_reset_node_changed_time($node, $changed_time);
}
Expand Down Expand Up @@ -224,6 +227,7 @@ function stanford_profile_update_9006(&$sandbox) {
'parent_uuid' => NULL,
'region' => NULL,
]);
$new_row_entity->setParentEntity($node, 'su_publication_components');
$new_row_entity->save();

$new_components[] = [
Expand All @@ -242,14 +246,17 @@ function stanford_profile_update_9006(&$sandbox) {
'parent_uuid' => $new_row_entity->uuid(),
'region' => _stanford_profile_update_9005_get_item_region($delta, $layout_id),
];
$paragraph->setParentEntity($node, 'su_publication_components');
$paragraph->setAllBehaviorSettings($behaviors);
$paragraph->save();
$new_paragraph = $paragraph->createDuplicate();
$new_paragraph->enforceIsNew();
$new_paragraph->setParentEntity($node, 'su_publication_components');
$new_paragraph->setAllBehaviorSettings($behaviors);
$new_paragraph->save();

$new_components[] = [
'target_id' => $paragraph->id(),
'target_revision_id' => $paragraph->getRevisionId(),
'target_id' => $new_paragraph->id(),
'target_revision_id' => $new_paragraph->getRevisionId(),
];
$delete_entities[] = $paragraph;
}
}

Expand Down Expand Up @@ -427,6 +434,21 @@ function stanford_profile_update_9103(&$sandbox) {
$paragraph_type->save();
$field->delete();
}
return;
$ns = \Drupal::entityTypeManager()->getStorage('node');
$ps = \Drupal::entityTypeManager()->getStorage('paragraph');
$ids = $ns->getQuery()
->accessCheck(FALSE)
->condition('type', 'stanford_page')
->execute();
foreach ($ns->loadMultiple($ids) as $node) {
foreach ($node->get('su_page_components') as $item) {
if ($p = $ps->load($item->getValue()['target_id'])) {
$p->setParentEntity($node, 'su_page_components');
$p->save();
}
}
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,7 @@ public function testNodeRevisionDelete(AcceptanceTester $I) {
$I->amOnPage("/node/{$node->id()}/revisions");
$I->canSeeNumberOfElements('.diff-revisions tbody tr', 11);

// Force ultimate cron to run again.
\Drupal::database()
->delete('ultimate_cron_log')
->condition('name', 'node_revision_delete_cron')
->execute();

$I->runDrush('cron');
$I->runDrush('cron:run node_revision_delete_cron --force');
$I->amOnPage("/node/{$node->id()}/revisions");
$I->canSeeNumberOfElements('.diff-revisions tbody tr', 5);
}
Expand Down
21 changes: 21 additions & 0 deletions tests/codeception/acceptance/SystemCest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

/**
* System tests.
*
* @group system
*/
class SystemCest {

/**
* Test the site status report.
*/
public function testSiteStatus(AcceptanceTester $I) {
$I->logInWithRole('administrator');
$I->amOnPage('/admin/reports/status');
$I->canSee('9.5', '.system-status-general-info');
$I->canSee('1 Error', '.system-status-counter--error');
$I->canSee('8 Warnings', '.system-status-counter--warning');
}

}
2 changes: 1 addition & 1 deletion themes/stanford_basic/decoupled-menu/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18
20

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions themes/stanford_basic/decoupled-menu/src/main-menu.island.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ const MenuItemDivider = styled.div`
}
`

const MenuItem = ({title, url, items, level = 0}: { title: string, url: string, items?: MenuContentItem[], level?: number }) => {
const MenuItem = ({title, url, items, expanded, level = 0}: { title: string, url: string, items?: MenuContentItem[], expanded: boolean, level?: number }) => {
const buttonRef = useRef(null)
const [submenuOpen, setSubmenuOpen] = useState(false)
const basePath = window.location.protocol + "//" + window.location.host;
Expand Down Expand Up @@ -374,7 +374,7 @@ const MenuItem = ({title, url, items, level = 0}: { title: string, url: string,
<NoLink>{title}</NoLink>
}

{items &&
{(items && expanded) &&
<>
{level === 0 &&
<MenuItemDivider/>
Expand All @@ -396,7 +396,7 @@ const MenuItem = ({title, url, items, level = 0}: { title: string, url: string,
}
</MenuItemContainer>

{items &&
{(items && expanded) &&
<MenuList open={submenuOpen} level={level}>

{items.map(item =>
Expand Down
Loading

0 comments on commit eb9fb0d

Please sign in to comment.