Skip to content

Commit

Permalink
Merge pull request #14 from SU-SOE/release-8.1.1
Browse files Browse the repository at this point in the history
"8.x-1.x >  8.1.0
  • Loading branch information
imonroe authored Aug 7, 2020
2 parents ce80eb5 + d5644bc commit 91ebaad
Show file tree
Hide file tree
Showing 17 changed files with 393 additions and 96 deletions.
23 changes: 20 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,21 @@ behat: &behat
- store_artifacts:
path: /var/www/html/artifacts

codeception: &codeception
<<: *defaults
steps:
- checkout:
path: /var/www/test
- run:
name: Run Acceptance Tests
command: |
composer global require SU-SWS/stanford-caravan:dev-8.x-1.x
~/.composer/vendor/bin/sws-caravan codeception /var/www/html --extension-dir=/var/www/test
- store_test_results:
path: /var/www/html/artifacts/behat
- store_artifacts:
path: /var/www/html/artifacts

back_to_dev: &back_to_dev
<<: *defaults
steps:
Expand All @@ -75,6 +90,8 @@ jobs:
<<: *behat
run-back-to-dev:
<<: *back_to_dev
run-codeception:
<<: *codeception

# Declare a workflow that runs all of our jobs in parallel.
workflows:
Expand All @@ -92,15 +109,15 @@ workflows:
weekly:
jobs:
- run-coverage
- run-behat
- run-codeception
triggers:
- schedule:
cron: "0 0 * * 0"
filters:
branches:
only:
- 8.x-2.x
- 8.x-1.x
tests:
jobs:
- run-coverage
- run-behat
- run-codeception
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# SOE Paragraphs

8.x-1.0
--------------------------------------------------------------------------------
_Release Date: 2020-08-07_

- D8CORE-2273: Moved tests into module, as well as profile. (#9) (79a3bf4)
- D8CORE-2427: added aria tags for presentation only (768c0e9)
- D8CORE-2427: corrected a11y problem with empty link when image was absent. (c62233b)
- D8CORE-2247: fixup! (5635293)
- D8CORE-2247: changing the images to responsive display (d73abfd)

8.x-1.0-beta.1
--------------------------------------------------------------------------------
_Release Date: 2020-07-13_
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Changelog: [Changelog.txt](CHANGELOG.txt)
Description
---

The `soe_paragraphs` module provides custom paragraph types for the Stanford School of Engineering.
The `soe_paragraphs` module provides three custom paragraph types developed for the Stanford School of Engineering.

Accessibility
---
Expand Down
8 changes: 6 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,12 @@
],
"require": {
"drupal/paragraphs": "^1.11",
"su-sws/jumpstart_ui": "~8.1.0",
"su-sws/stanford_text_editor": "~8.1.0"
"drupal/element_class_formatter": "^1.1",
"drupal/field_formatter_class": "^1.4",
"drupal/allowed_formats": "^1.3",
"su-sws/stanford_fields": "^8.1.0",
"su-sws/jumpstart_ui": "^8.1.0",
"su-sws/stanford_text_editor": "^8.1.0"
},
"autoload": {
"psr-4": {
Expand Down
80 changes: 1 addition & 79 deletions dist/css/image-cta-paragraph.styles.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions lib/scss/components/image-cta/_image_cta.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
@include grid-media-between('xs', 'sm') {
display: none;
}

img {
width: 100%;
}

}

.su-image-cta-paragraph__link {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ dependencies:
- paragraphs:paragraphs
- drupal:text
- soe_paragraphs:soe_paragraphs
version: 8.x-1.0-beta1
version: 8.x-1.0
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@ bundle: stanford_image_cta
mode: default
content:
stanford_image_cta_image:
type: media_multimedia_formatter
type: media_responsive_image_formatter
weight: 0
label: hidden
settings:
view_mode: default
image_style: ''
link: false
image:
image_formatter: image_style
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ dependencies:
- paragraphs:paragraphs
- drupal:text
- soe_paragraphs:soe_paragraphs
version: 8.x-1.0-beta1
version: 8.x-1.0
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,21 @@
*
*/
#}
{%- set field_keys = link|keys -%}
{%- set field_name = field_keys[0] -%}
{%- set field_info = link[field_name] -%}
{%- set field_items = field_info["#items"] -%}
{%- set link_uri = field_items[0].uri -%}

{%- set image_field_keys = image|keys -%}
{%- set image_field_name = image_field_keys[0] -%}
{%- set image_field_info = image[image_field_name] -%}
{%- set image_field_items = image_field_info["#items"] -%}
{%- set link_field_keys = link|keys -%}
{%- set link_field_name = link_field_keys[0] -%}
{%- set link_field_info = link[link_field_name] -%}
{%- set link_field_items = link_field_info["#items"] -%}
{%- set link_uri = link_field_items[0].uri -%}
{%- set attributes = attributes.addClass(['su-image-cta-paragraph', modifier_class]) -%}

<div{{ attributes }}>
{{ link(image, link_uri) }}
{% if image_field_items is not empty %}
{{ link(image, link_uri, {'tabindex': '-1', 'aria-hidden': 'true', 'role': 'presentation'}) }}
{% endif %}
{{ link }}
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ dependencies:
- paragraphs:paragraphs
- drupal:text
- soe_paragraphs:soe_paragraphs
version: 8.x-1.0-beta1
version: 8.x-1.0
6 changes: 5 additions & 1 deletion soe_paragraphs.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ type: module
description: 'Provides custom paragraph types for SOE'
core_version_requirement: ^8.8 || ^9
package: Stanford
version: 8.x-1.0-beta1
version: 8.x-1.0
dependencies:
- paragraphs:paragraphs
- jumpstart_ui:jumpstart_ui
- ds:ds
- drupal:field
- drupal:text
- drupal:allowed_formats
- drupal:field_formatter_class
- drupal:element_class_formatter
- stanford_fields:stanford_fields
- stanford_text_editor:stanford_text_editor
File renamed without changes.
97 changes: 97 additions & 0 deletions tests/codeception/acceptance/StanfordCTAListCest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<?php

/**
* Codeception tests on CTA List paragraph type.
*/
class StanfordCTAListCest {

/**
* Create a paragraphs field on the basic page content type.
*/
protected function setupContentType(\AcceptanceTester $I) {
$I->logInWithRole('administrator');
$I->amOnPage('/admin/structure/types/manage/page/fields/add-field');
$I->selectOption('Add a new field', 'Paragraph');
$I->fillField('Label', 'Paragraphs');
$I->fillField('Machine-readable name', 'paragraphs');
$I->click('Save and continue');
$I->click('Save field settings');
$I->selectOption('Exclude the selected below', 1);
$I->click('Save settings');
$I->see('Saved Paragraphs configuration');
drupal_flush_all_caches();
}

/**
* Remove the paragraphs field from the basic page content type.
*/
protected function revertContentType(\AcceptanceTester $I) {
$I->logInWithRole('administrator');
$I->amOnPage('/admin/structure/types/manage/page/fields/node.page.field_paragraphs/delete');
$I->click('Delete');
drupal_flush_all_caches();
}

/**
* Create a CTA List paragraph to test.
*/
protected function createParagraph(\AcceptanceTester $I) {
$paragraph = $I->createEntity([
'type' => 'stanford_cta_list',
'stanford_cta_list_header' => [
'value' => 'Lorem Ipsum CTA List',
],
'stanford_cta_list_deck' => [
'value' => 'Test value for the deck',
],
'stanford_cta_list_links' => [
[
'uri' => 'http://google.com',
'title' => 'Link Alpha',
],
[
'uri' => 'http://google.com',
'title' => 'Link Beta',
],
[
'uri' => 'http://google.com',
'title' => 'Link Gamma',
],
],
], 'paragraph', TRUE);
return $paragraph;
}

/**
* Create a node to hold the paragraph.
*/
protected function createNodeWithParagraph(\AcceptanceTester $I) {
$paragraph = $this->createParagraph($I);
$node = $I->createEntity([
'type' => 'page',
'title' => 'Test CTA List',
]);
$node->field_paragraphs->appendItem($paragraph);
$node->save();

$I->runDrush('cache-rebuild');
return $node;
}

/**
* Test the CTA List paragraph in the page.
*/
public function testCtaList(\AcceptanceTester $I) {
$I->runDrush('pm-enable soe_paragraph_cta_list');
$this->setupContentType($I);
$node = $this->createNodeWithParagraph($I);
$I->amOnPage($node->toUrl()->toString());
$I->canSee('Lorem Ipsum CTA List');
$I->canSee('Test value for the deck');
$I->canSeeLink('Link Alpha', 'http://google.com');
$I->canSeeLink('Link Beta', 'http://google.com');
$I->canSeeLink('Link Gamma', 'http://google.com');
$this->revertContentType($I);
}

}
Loading

0 comments on commit 91ebaad

Please sign in to comment.