@openeuropa/bcl-subscription 1.10.6 → 1.10.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://
|
|
1
|
+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
|
2
2
|
|
|
3
3
|
exports[`OE - Subscription renders correctly 1`] = `
|
|
4
4
|
<jest>
|
|
@@ -166,7 +166,6 @@ exports[`OE - Subscription renders correctly 1`] = `
|
|
|
166
166
|
<div
|
|
167
167
|
aria-labelledby="custom-trigger-mm-1"
|
|
168
168
|
class="bcl-mega-menu__submenu __level-2"
|
|
169
|
-
hidden=""
|
|
170
169
|
id="mm-panel-custom-trigger-mm-1"
|
|
171
170
|
role="group"
|
|
172
171
|
>
|
|
@@ -264,7 +263,6 @@ exports[`OE - Subscription renders correctly 1`] = `
|
|
|
264
263
|
<div
|
|
265
264
|
aria-labelledby="custom-trigger-mm-2"
|
|
266
265
|
class="bcl-mega-menu__submenu __level-2"
|
|
267
|
-
hidden=""
|
|
268
266
|
id="mm-panel-custom-trigger-mm-2"
|
|
269
267
|
role="group"
|
|
270
268
|
>
|
|
@@ -1316,7 +1314,7 @@ exports[`OE - Subscription renders correctly 1`] = `
|
|
|
1316
1314
|
>
|
|
1317
1315
|
<form
|
|
1318
1316
|
class="needs-validation"
|
|
1319
|
-
novalidate="
|
|
1317
|
+
novalidate="novalidate"
|
|
1320
1318
|
onsubmit="return false;"
|
|
1321
1319
|
>
|
|
1322
1320
|
<fieldset>
|
|
@@ -1339,7 +1337,7 @@ exports[`OE - Subscription renders correctly 1`] = `
|
|
|
1339
1337
|
<input
|
|
1340
1338
|
class="form-control"
|
|
1341
1339
|
placeholder="Type in your e-mail address"
|
|
1342
|
-
required="
|
|
1340
|
+
required="required"
|
|
1343
1341
|
type="email"
|
|
1344
1342
|
/>
|
|
1345
1343
|
<div
|
|
@@ -1360,7 +1358,7 @@ exports[`OE - Subscription renders correctly 1`] = `
|
|
|
1360
1358
|
<select
|
|
1361
1359
|
class="form-select"
|
|
1362
1360
|
id="language-select"
|
|
1363
|
-
required="
|
|
1361
|
+
required="required"
|
|
1364
1362
|
>
|
|
1365
1363
|
<option
|
|
1366
1364
|
disabled=""
|
|
@@ -1406,7 +1404,7 @@ exports[`OE - Subscription renders correctly 1`] = `
|
|
|
1406
1404
|
<input
|
|
1407
1405
|
class="form-check-input"
|
|
1408
1406
|
id="exampleInputCheck1"
|
|
1409
|
-
required="
|
|
1407
|
+
required="required"
|
|
1410
1408
|
type="checkbox"
|
|
1411
1409
|
/>
|
|
1412
1410
|
<label
|
package/data/data--modal.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const { DrupalAttribute } = require("drupal-attribute");
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
4
|
id: "subscribeModal",
|
|
@@ -10,7 +10,7 @@ module.exports = {
|
|
|
10
10
|
'<button class="btn btn-primary form-submit ms-4">Subscribe now</button>' +
|
|
11
11
|
"</div>",
|
|
12
12
|
form: {
|
|
13
|
-
attributes: new
|
|
13
|
+
attributes: new DrupalAttribute()
|
|
14
14
|
.addClass("needs-validation")
|
|
15
15
|
.setAttribute("novalidate", true)
|
|
16
16
|
.setAttribute("onsubmit", "return false;"),
|
|
@@ -75,7 +75,7 @@ module.exports = {
|
|
|
75
75
|
heading: "Thank you!",
|
|
76
76
|
icon_path: "/icons.svg",
|
|
77
77
|
variant: "success",
|
|
78
|
-
attributes: new
|
|
78
|
+
attributes: new DrupalAttribute().addClass([
|
|
79
79
|
"success-alert",
|
|
80
80
|
"d-none",
|
|
81
81
|
"mb-0",
|
|
@@ -89,7 +89,7 @@ module.exports = {
|
|
|
89
89
|
icon_path: "/icons.svg",
|
|
90
90
|
variant: "danger",
|
|
91
91
|
dismissible: false,
|
|
92
|
-
attributes: new
|
|
92
|
+
attributes: new DrupalAttribute().addClass([
|
|
93
93
|
"error-alert",
|
|
94
94
|
"d-none",
|
|
95
95
|
"mb-0",
|
package/package.json
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
"name": "@openeuropa/bcl-subscription",
|
|
3
3
|
"author": "European Commission",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
|
-
"version": "1.10.
|
|
5
|
+
"version": "1.10.8",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
8
8
|
},
|
|
9
9
|
"description": "OE - BCL subscription",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@openeuropa/bcl-subscription-block": "^1.10.
|
|
11
|
+
"@openeuropa/bcl-subscription-block": "^1.10.8"
|
|
12
12
|
},
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
"design-system",
|
|
25
25
|
"twig"
|
|
26
26
|
],
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "9c2e64443ae179948cbf748c41d438af7a0f2421"
|
|
28
28
|
}
|
package/subscription.html.twig
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
{% extends '@oe-bcl/bcl-base-templates/content-type.html.twig'
|
|
1
|
+
{% extends '@oe-bcl/bcl-base-templates/content-type.html.twig' -%}
|
|
2
2
|
|
|
3
|
-
{
|
|
3
|
+
{%- block sidebar %}
|
|
4
4
|
{% include '@oe-bcl/bcl-inpage-navigation/inpage-navigation.html.twig' with sidebar only %}
|
|
5
|
-
{
|
|
5
|
+
{%- endblock -%}
|
|
6
6
|
|
|
7
|
-
{
|
|
7
|
+
{%- block content_bottom %}
|
|
8
8
|
{% include '@oe-bcl/bcl-subscription-block/subscription-block.html.twig' with subscription only %}
|
|
9
9
|
{% include '@oe-bcl/bcl-subscription/subscription-modal.html.twig' with modal only %}
|
|
10
|
-
{
|
|
10
|
+
{%- endblock -%}
|
package/subscription.story.js
CHANGED
|
@@ -3,8 +3,8 @@ import { correctPaths, initScrollspy } from "@openeuropa/bcl-story-utils";
|
|
|
3
3
|
import demoData from "@openeuropa/bcl-subscription/data/data";
|
|
4
4
|
import subscriptionPage from "@openeuropa/bcl-subscription/subscription.html.twig";
|
|
5
5
|
|
|
6
|
-
const clientValidation = (story) => {
|
|
7
|
-
const demo = story();
|
|
6
|
+
const clientValidation = async (story) => {
|
|
7
|
+
const demo = await story();
|
|
8
8
|
return `<script>
|
|
9
9
|
var backdrop = document.getElementsByClassName("modal-backdrop")[0];
|
|
10
10
|
if (typeof backdrop != "undefined" && backdrop != null) {
|
|
@@ -35,8 +35,8 @@ const clientValidation = (story) => {
|
|
|
35
35
|
</script>${demo}`;
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
const openModal = (story) => {
|
|
39
|
-
const demo = story();
|
|
38
|
+
const openModal = async (story) => {
|
|
39
|
+
const demo = await story();
|
|
40
40
|
return `
|
|
41
41
|
${demo}
|
|
42
42
|
<script>
|
|
@@ -52,8 +52,8 @@ const openModal = (story) => {
|
|
|
52
52
|
`;
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
-
const successState = (story) => {
|
|
56
|
-
const demo = story();
|
|
55
|
+
const successState = async (story) => {
|
|
56
|
+
const demo = await story();
|
|
57
57
|
return `
|
|
58
58
|
${demo}
|
|
59
59
|
<script>
|
|
@@ -68,8 +68,8 @@ const successState = (story) => {
|
|
|
68
68
|
`;
|
|
69
69
|
};
|
|
70
70
|
|
|
71
|
-
const errorState = (story) => {
|
|
72
|
-
const demo = story();
|
|
71
|
+
const errorState = async (story) => {
|
|
72
|
+
const demo = await story();
|
|
73
73
|
return `
|
|
74
74
|
${demo}
|
|
75
75
|
<script>
|
package/subscription.test.js
CHANGED
|
@@ -21,7 +21,7 @@ describe("OE - Subscription", () => {
|
|
|
21
21
|
|
|
22
22
|
test(`passes the accessibility tests`, async () => {
|
|
23
23
|
expect(
|
|
24
|
-
await axe(renderTwigFileAsHtml(template, demoData)),
|
|
24
|
+
await axe(await renderTwigFileAsHtml(template, demoData)),
|
|
25
25
|
).toHaveNoViolations();
|
|
26
26
|
});
|
|
27
27
|
});
|