Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(package): update theme and dependencies - INNO-867 #536

Merged
merged 4 commits into from Dec 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 21 additions & 0 deletions framework/_partials/_preview-forms-file-uploads.twig
@@ -0,0 +1,21 @@
<!DOCTYPE html>
{% set bodyClass = '' %}
{% if _target.context is defined and _target.context.global is defined %}
{% if _target.context.global.svg is defined %}
{% set bodyClass = 'no-svg' %}
{% endif %}
{% endif %}
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="{{ '/framework/styles/europa.css' | path }}">
<title>Preview Layout</title>
<script>document.documentElement.classList.remove('no-js');</script>
</head>
<body{% if _target.context and _target.context.global and _target.context.global.language %} class="language-{{ _target.context.global.language }}"{% endif %}>
{{ yield }}
<script src="{{ '/framework/scripts/europa.js' | path }}"></script>
<script type="text/javascript">document.addEventListener('DOMContentLoaded', function() { ECL.fileUploads(); });</script>
</body>
</html>
10 changes: 10 additions & 0 deletions framework/components/ecl-forms/ecl-forms-file-uploads/README.md
Expand Up @@ -6,3 +6,13 @@ Combination of fields and buttons to add documents or media to a form.

When there is a need to allow users to attach anything to a form (documents,
pictures, videos, etc).

## Implementation

In order to automatically attach event listeners on your file upload forms, add the following script to your page:

```js
document.addEventListener('DOMContentLoaded', function() {
ECL.fileUploads();
});
```
@@ -1,8 +1,9 @@
module.exports = {
title: 'File uploads',
label: 'File uploads',
preview: '@preview-forms-file-uploads',
status: 'ready',
collated: false,
collated: true,
collator(markup, item) {
return `
<!-- Start: @${item.handle} -->\n
Expand All @@ -18,11 +19,6 @@ module.exports = {
context: {
id: 'example-input-id-1',
name: 'example-input-name-1',
_demo: {
scripts: `document.addEventListener('DOMContentLoaded', function () {
ECL.fileUploads();
});`,
},
},
},
{
Expand All @@ -32,11 +28,6 @@ module.exports = {
id: 'example-input-id-2',
name: 'example-input-name-2',
is_disabled: true,
_demo: {
scripts: `document.addEventListener('DOMContentLoaded', function () {
ECL.fileUploads();
});`,
},
},
},
{
Expand All @@ -46,11 +37,6 @@ module.exports = {
id: 'example-input-id-3',
name: 'example-input-name-3',
is_multiple: true,
_demo: {
scripts: `document.addEventListener('DOMContentLoaded', function () {
ECL.fileUploads();
});`,
},
},
},
{
Expand All @@ -60,11 +46,6 @@ module.exports = {
id: 'example-input-id-4',
name: 'example-input-name-4',
has_error: true,
_demo: {
scripts: `document.addEventListener('DOMContentLoaded', function () {
ECL.fileUploads();
});`,
},
},
},
],
Expand Down
@@ -1,39 +1,31 @@
const variants = ['default', 'is-disabled', 'is-multiple', 'has-error'];

describe('ecl-forms-file-uploads', () => {
before(() => {
// Set viewport size
browser.setViewportSize({
width: 600,
height: 300,
});
});

variants.forEach(variant => {
describe(`--${variant}`, () => {
before(() => {
// Go to url
browser.url(`ecl-forms-file-uploads--${variant}.html`);

// Inject axe-core (for accessibility tests)
browser.injectAxeCore();
// Go to url
browser.url(`ecl-forms-file-uploads.html`);

// Make sure the browser has finished painting
browser.pause(500);
});
// Inject axe-core (for accessibility tests)
browser.injectAxeCore();

// Normal state
it('should match the reference screenshot', () => {
const screenshots = browser.checkDocument({
name: `forms/file-uploads/${variant}`,
});
expect(screenshots).to.matchReference();
});
// Make sure the browser has finished painting
browser.pause(500);
});

it('should be accessible', () => {
const a11yReport = browser.runAxeCore('ecl-file-upload').value;
expect(a11yReport).to.be.accessible;
});
// Normal state
it('should match the reference screenshot', () => {
const screenshots = browser.checkDocument({
name: `forms/file-uploads`,
});
expect(screenshots).to.matchReference();
});

it('should be accessible', () => {
const a11yReport = browser.runAxeCore('ecl-file-upload').value;
expect(a11yReport).to.be.accessible;
});
});
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Expand Up @@ -22,6 +22,15 @@ module.exports = {
title: 'Navigation lists',
label: 'Lists',
status: 'ready',
collated: true,
collator(markup, item) {
return `
<!-- Start: @${item.handle} -->\n
<h3 class="ecl-heading ecl-heading--h3">${item.label}\n</h3>\n
${markup}\n
<!-- End: @${item.handle} -->\n
`;
},
tags: ['organism'],
variants: [
{
Expand Down
@@ -1,5 +1,3 @@
const variants = ['default', 'tabs', 'small'];

describe('navigation-lists', () => {
before(() => {
// Set viewport size
Expand All @@ -8,33 +6,26 @@ describe('navigation-lists', () => {
height: 600,
});

browser.pause(500);
});
// Go to url
browser.url(`ecl-navigation-lists.html`);

variants.forEach(variant => {
describe(`--${variant}`, () => {
before(() => {
// Go to url
browser.url(`ecl-navigation-lists--${variant}.html`);
// Make sure the browser has finished painting
browser.pause(500);
// Inject axe-core (for accessibility tests)
browser.injectAxeCore();
});
// Inject axe-core (for accessibility tests)
browser.injectAxeCore();

// Normal state
it('should match the reference screenshot', () => {
const screenshots = browser.checkDocument({
name: `navigation/lists/${variant}`,
});
expect(screenshots).to.matchReference();
});
// Make sure the browser has finished painting
browser.pause(500);
});

it('should be accessible', () => {
const a11yReport = browser.runAxeCore('ecl-navigation-list-wrapper')
.value;
expect(a11yReport).to.be.accessible;
});
// Normal state
it('should match the reference screenshot', () => {
const screenshots = browser.checkDocument({
name: `navigation/lists`,
});
expect(screenshots).to.matchReference();
});

it('should be accessible', () => {
const a11yReport = browser.runAxeCore('ecl-navigation-list-wrapper').value;
expect(a11yReport).to.be.accessible;
});
});
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
2 changes: 1 addition & 1 deletion framework/content/ecl-icons/_icons.scss
Expand Up @@ -55,7 +55,7 @@
%ecl-icon--#{$modifier} {
/* stylelint-disable-next-line */
&::before {
@include ecl-icon($modifier);
@include ecl-icon($modifier); /* stylelint-disable-line scss/percent-placeholder-pattern */
}
}
}
Expand Down
14 changes: 7 additions & 7 deletions package.json
Expand Up @@ -27,18 +27,18 @@
"watch": "npm-run-all --parallel watch:* -ln"
},
"devDependencies": {
"@ec-europa/ecl-builder": "0.12.3",
"@ec-europa/ecl-fractal-theme": "0.11.4",
"@ec-europa/ecl-qa": "0.3.6",
"@ec-europa/eslint-config-ecl": "0.4.6",
"@ec-europa/stylelint-config-ecl": "0.7.0",
"@ec-europa/ecl-builder": "0.12.4",
"@ec-europa/ecl-fractal-theme": "0.12.0",
"@ec-europa/ecl-qa": "0.3.7",
"@ec-europa/eslint-config-ecl": "0.4.7",
"@ec-europa/stylelint-config-ecl": "0.7.1",
"@frctl/fractal": "1.1.7",
"@frctl/twig": "1.0.0-beta.2",
"chai": "4.1.2",
"chokidar-cli": "1.2.0",
"cross-env": "5.1.1",
"dotenv": "4.0.0",
"eslint": "4.12.1",
"eslint": "4.13.1",
"gh-pages": "1.1.0",
"glob": "7.1.2",
"husky": "0.14.3",
Expand All @@ -49,7 +49,7 @@
"npmlog": "4.1.2",
"prettier": "1.9.2",
"rimraf": "2.6.2",
"stylelint": "8.3.1",
"stylelint": "8.4.0",
"stylelint-config-prettier": "2.0.0",
"wdio-mocha-framework": "0.5.11",
"wdio-sauce-service": "0.4.4",
Expand Down