@openeuropa/bcl-subscription 1.10.7 → 1.10.9
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,13 +1,13 @@
|
|
|
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>
|
|
5
5
|
<header
|
|
6
|
-
class="bcl-header bcl-header--eu"
|
|
6
|
+
class="bcl-header bcl-header--eu shadow-sm"
|
|
7
7
|
>
|
|
8
8
|
<nav
|
|
9
9
|
aria-label="Top Navigation"
|
|
10
|
-
class="w-100
|
|
10
|
+
class="w-100 bcl-header__top-navbar navbar navbar-expand-lg navbar-light"
|
|
11
11
|
>
|
|
12
12
|
<div
|
|
13
13
|
class="container"
|
|
@@ -30,19 +30,44 @@ exports[`OE - Subscription renders correctly 1`] = `
|
|
|
30
30
|
<button
|
|
31
31
|
aria-controls="header-navbar"
|
|
32
32
|
aria-expanded="false"
|
|
33
|
-
aria-label="
|
|
34
|
-
class="navbar-toggler
|
|
33
|
+
aria-label="Main navigation toggle"
|
|
34
|
+
class="bcl-navbar-toggler d-lg-none"
|
|
35
35
|
data-bs-target="#header-navbar"
|
|
36
36
|
data-bs-toggle="collapse"
|
|
37
37
|
type="button"
|
|
38
38
|
>
|
|
39
|
-
<
|
|
40
|
-
class="
|
|
41
|
-
|
|
39
|
+
<svg
|
|
40
|
+
class="default-icon bi icon--fluid"
|
|
41
|
+
>
|
|
42
|
+
<use
|
|
43
|
+
xlink:href="/icons.svg#list"
|
|
44
|
+
/>
|
|
45
|
+
</svg>
|
|
46
|
+
<svg
|
|
47
|
+
class="active-icon bi icon--fluid"
|
|
48
|
+
>
|
|
49
|
+
<use
|
|
50
|
+
xlink:href="/icons.svg#x"
|
|
51
|
+
/>
|
|
52
|
+
</svg>
|
|
42
53
|
</button>
|
|
43
54
|
</div>
|
|
44
55
|
</nav>
|
|
45
|
-
<!--
|
|
56
|
+
<!-- site name -->
|
|
57
|
+
<div
|
|
58
|
+
class="bcl-header__site-name"
|
|
59
|
+
id="site-name-heading"
|
|
60
|
+
>
|
|
61
|
+
<div
|
|
62
|
+
class="container"
|
|
63
|
+
>
|
|
64
|
+
<span
|
|
65
|
+
class="h5 py-3-5 border-top-subtle mb-0 d-block"
|
|
66
|
+
>
|
|
67
|
+
Project name
|
|
68
|
+
</span>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
46
71
|
<!-- navbar -->
|
|
47
72
|
<nav
|
|
48
73
|
aria-label="Main Navigation"
|
|
@@ -166,7 +191,7 @@ exports[`OE - Subscription renders correctly 1`] = `
|
|
|
166
191
|
<div
|
|
167
192
|
aria-labelledby="custom-trigger-mm-1"
|
|
168
193
|
class="bcl-mega-menu__submenu __level-2"
|
|
169
|
-
hidden
|
|
194
|
+
hidden
|
|
170
195
|
id="mm-panel-custom-trigger-mm-1"
|
|
171
196
|
role="group"
|
|
172
197
|
>
|
|
@@ -220,26 +245,80 @@ exports[`OE - Subscription renders correctly 1`] = `
|
|
|
220
245
|
</a>
|
|
221
246
|
</li>
|
|
222
247
|
<li
|
|
223
|
-
class="
|
|
248
|
+
class="__leaf"
|
|
249
|
+
>
|
|
250
|
+
<a
|
|
251
|
+
href="/example.html"
|
|
252
|
+
>
|
|
253
|
+
Base Sub Category Item
|
|
254
|
+
</a>
|
|
255
|
+
</li>
|
|
256
|
+
<li
|
|
257
|
+
class="__leaf"
|
|
258
|
+
>
|
|
259
|
+
<a
|
|
260
|
+
href="/example.html"
|
|
261
|
+
>
|
|
262
|
+
Base Sub Category Item
|
|
263
|
+
</a>
|
|
264
|
+
</li>
|
|
265
|
+
<li
|
|
266
|
+
class="__leaf"
|
|
267
|
+
>
|
|
268
|
+
<a
|
|
269
|
+
href="/example.html"
|
|
270
|
+
>
|
|
271
|
+
Base Sub Category Item
|
|
272
|
+
</a>
|
|
273
|
+
</li>
|
|
274
|
+
<li
|
|
275
|
+
class="__leaf"
|
|
276
|
+
>
|
|
277
|
+
<a
|
|
278
|
+
href="/example.html"
|
|
279
|
+
>
|
|
280
|
+
Base Sub Category Item
|
|
281
|
+
</a>
|
|
282
|
+
</li>
|
|
283
|
+
<li
|
|
284
|
+
class="__leaf"
|
|
285
|
+
>
|
|
286
|
+
<a
|
|
287
|
+
href="/example.html"
|
|
288
|
+
>
|
|
289
|
+
Base Sub Category Item
|
|
290
|
+
</a>
|
|
291
|
+
</li>
|
|
292
|
+
<li
|
|
293
|
+
class="__leaf"
|
|
224
294
|
>
|
|
225
295
|
<a
|
|
226
|
-
aria-label="See all items in ‘Base Category Item’"
|
|
227
|
-
class="see-all-button"
|
|
228
296
|
href="/example.html"
|
|
229
297
|
>
|
|
230
|
-
|
|
231
|
-
See all
|
|
232
|
-
</span>
|
|
233
|
-
<svg
|
|
234
|
-
class="ms-2-5 bi icon--s"
|
|
235
|
-
>
|
|
236
|
-
<use
|
|
237
|
-
xlink:href="/icons.svg#arrow-right"
|
|
238
|
-
/>
|
|
239
|
-
</svg>
|
|
298
|
+
Base Sub Category Item
|
|
240
299
|
</a>
|
|
241
300
|
</li>
|
|
242
301
|
</ul>
|
|
302
|
+
<div
|
|
303
|
+
class="__see_all"
|
|
304
|
+
>
|
|
305
|
+
<a
|
|
306
|
+
aria-label="See all items in ‘Base Category Item’"
|
|
307
|
+
class="see-all-button"
|
|
308
|
+
href="/example.html"
|
|
309
|
+
>
|
|
310
|
+
<span>
|
|
311
|
+
See all
|
|
312
|
+
</span>
|
|
313
|
+
<svg
|
|
314
|
+
class="ms-2-5 bi icon--xs"
|
|
315
|
+
>
|
|
316
|
+
<use
|
|
317
|
+
xlink:href="/icons.svg#arrow-right"
|
|
318
|
+
/>
|
|
319
|
+
</svg>
|
|
320
|
+
</a>
|
|
321
|
+
</div>
|
|
243
322
|
</div>
|
|
244
323
|
</li>
|
|
245
324
|
<li
|
|
@@ -264,7 +343,7 @@ exports[`OE - Subscription renders correctly 1`] = `
|
|
|
264
343
|
<div
|
|
265
344
|
aria-labelledby="custom-trigger-mm-2"
|
|
266
345
|
class="bcl-mega-menu__submenu __level-2"
|
|
267
|
-
hidden
|
|
346
|
+
hidden
|
|
268
347
|
id="mm-panel-custom-trigger-mm-2"
|
|
269
348
|
role="group"
|
|
270
349
|
>
|
|
@@ -499,64 +578,104 @@ exports[`OE - Subscription renders correctly 1`] = `
|
|
|
499
578
|
</li>
|
|
500
579
|
</ul>
|
|
501
580
|
</li>
|
|
502
|
-
</ul>
|
|
503
|
-
</div>
|
|
504
|
-
</nav>
|
|
505
|
-
<!-- breadcrumbs -->
|
|
506
|
-
<div
|
|
507
|
-
class="container"
|
|
508
|
-
>
|
|
509
|
-
<nav
|
|
510
|
-
aria-label="breadcrumb"
|
|
511
|
-
class="mt-3"
|
|
512
|
-
>
|
|
513
|
-
<ol
|
|
514
|
-
class="breadcrumb"
|
|
515
|
-
>
|
|
516
581
|
<li
|
|
517
|
-
class="
|
|
582
|
+
class="nav-item"
|
|
518
583
|
>
|
|
519
584
|
<a
|
|
585
|
+
class="nav-link"
|
|
520
586
|
href="/example.html"
|
|
521
587
|
>
|
|
522
|
-
|
|
588
|
+
Item 04
|
|
523
589
|
</a>
|
|
524
590
|
</li>
|
|
525
591
|
<li
|
|
526
|
-
class="
|
|
592
|
+
class="nav-item"
|
|
527
593
|
>
|
|
528
594
|
<a
|
|
595
|
+
class="nav-link"
|
|
529
596
|
href="/example.html"
|
|
530
597
|
>
|
|
531
|
-
|
|
598
|
+
Item 05
|
|
532
599
|
</a>
|
|
533
600
|
</li>
|
|
534
601
|
<li
|
|
535
|
-
class="
|
|
602
|
+
class="nav-item"
|
|
536
603
|
>
|
|
537
604
|
<a
|
|
605
|
+
class="nav-link"
|
|
538
606
|
href="/example.html"
|
|
539
607
|
>
|
|
540
|
-
|
|
541
|
-
class="d-md-none ms-0 me-2 me-2-5 bi icon--s"
|
|
542
|
-
>
|
|
543
|
-
<use
|
|
544
|
-
xlink:href="/icons.svg#arrow-left"
|
|
545
|
-
/>
|
|
546
|
-
</svg>
|
|
547
|
-
About the European Union
|
|
608
|
+
Item 06
|
|
548
609
|
</a>
|
|
549
610
|
</li>
|
|
550
611
|
<li
|
|
551
|
-
|
|
552
|
-
class="breadcrumb-item d-none d-md-block active"
|
|
612
|
+
class="nav-item"
|
|
553
613
|
>
|
|
554
|
-
|
|
614
|
+
<a
|
|
615
|
+
class="nav-link"
|
|
616
|
+
href="/example.html"
|
|
617
|
+
>
|
|
618
|
+
Item 07
|
|
619
|
+
</a>
|
|
555
620
|
</li>
|
|
556
|
-
</
|
|
557
|
-
</
|
|
558
|
-
</
|
|
621
|
+
</ul>
|
|
622
|
+
</div>
|
|
623
|
+
</nav>
|
|
559
624
|
</header>
|
|
625
|
+
<!-- breadcrumbs -->
|
|
626
|
+
<div
|
|
627
|
+
class="container"
|
|
628
|
+
>
|
|
629
|
+
<nav
|
|
630
|
+
aria-label="breadcrumb"
|
|
631
|
+
class="mt-3"
|
|
632
|
+
>
|
|
633
|
+
<ol
|
|
634
|
+
class="breadcrumb"
|
|
635
|
+
>
|
|
636
|
+
<li
|
|
637
|
+
class="breadcrumb-item d-none d-md-block"
|
|
638
|
+
>
|
|
639
|
+
<a
|
|
640
|
+
href="/example.html"
|
|
641
|
+
>
|
|
642
|
+
Home
|
|
643
|
+
</a>
|
|
644
|
+
</li>
|
|
645
|
+
<li
|
|
646
|
+
class="breadcrumb-item d-none d-md-block"
|
|
647
|
+
>
|
|
648
|
+
<a
|
|
649
|
+
href="/example.html"
|
|
650
|
+
>
|
|
651
|
+
European Union
|
|
652
|
+
</a>
|
|
653
|
+
</li>
|
|
654
|
+
<li
|
|
655
|
+
class="breadcrumb-item"
|
|
656
|
+
>
|
|
657
|
+
<a
|
|
658
|
+
href="/example.html"
|
|
659
|
+
>
|
|
660
|
+
<svg
|
|
661
|
+
class="d-md-none ms-0 me-2 me-2-5 bi icon--s"
|
|
662
|
+
>
|
|
663
|
+
<use
|
|
664
|
+
xlink:href="/icons.svg#arrow-left"
|
|
665
|
+
/>
|
|
666
|
+
</svg>
|
|
667
|
+
About the European Union
|
|
668
|
+
</a>
|
|
669
|
+
</li>
|
|
670
|
+
<li
|
|
671
|
+
aria-current="page"
|
|
672
|
+
class="breadcrumb-item d-none d-md-block active"
|
|
673
|
+
>
|
|
674
|
+
News
|
|
675
|
+
</li>
|
|
676
|
+
</ol>
|
|
677
|
+
</nav>
|
|
678
|
+
</div>
|
|
560
679
|
<div
|
|
561
680
|
aria-hidden="true"
|
|
562
681
|
aria-label="loginModalLabel"
|
|
@@ -1316,7 +1435,7 @@ exports[`OE - Subscription renders correctly 1`] = `
|
|
|
1316
1435
|
>
|
|
1317
1436
|
<form
|
|
1318
1437
|
class="needs-validation"
|
|
1319
|
-
novalidate
|
|
1438
|
+
novalidate
|
|
1320
1439
|
onsubmit="return false;"
|
|
1321
1440
|
>
|
|
1322
1441
|
<fieldset>
|
|
@@ -1339,7 +1458,7 @@ exports[`OE - Subscription renders correctly 1`] = `
|
|
|
1339
1458
|
<input
|
|
1340
1459
|
class="form-control"
|
|
1341
1460
|
placeholder="Type in your e-mail address"
|
|
1342
|
-
required
|
|
1461
|
+
required
|
|
1343
1462
|
type="email"
|
|
1344
1463
|
/>
|
|
1345
1464
|
<div
|
|
@@ -1360,12 +1479,12 @@ exports[`OE - Subscription renders correctly 1`] = `
|
|
|
1360
1479
|
<select
|
|
1361
1480
|
class="form-select"
|
|
1362
1481
|
id="language-select"
|
|
1363
|
-
required
|
|
1482
|
+
required
|
|
1364
1483
|
>
|
|
1365
1484
|
<option
|
|
1366
|
-
disabled
|
|
1367
|
-
hidden
|
|
1368
|
-
selected
|
|
1485
|
+
disabled
|
|
1486
|
+
hidden
|
|
1487
|
+
selected
|
|
1369
1488
|
value=""
|
|
1370
1489
|
>
|
|
1371
1490
|
Please select a language
|
|
@@ -1406,7 +1525,7 @@ exports[`OE - Subscription renders correctly 1`] = `
|
|
|
1406
1525
|
<input
|
|
1407
1526
|
class="form-check-input"
|
|
1408
1527
|
id="exampleInputCheck1"
|
|
1409
|
-
required
|
|
1528
|
+
required
|
|
1410
1529
|
type="checkbox"
|
|
1411
1530
|
/>
|
|
1412
1531
|
<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.9",
|
|
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.9"
|
|
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": "cb9864341bfc98404071520d61568bd18e17e1fe"
|
|
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
|
});
|