@openeuropa/bcl-subscription 0.21.0 → 0.24.0
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.
- package/__snapshots__/subscription.test.js.snap +42 -41
- package/data/data--modal.js +1 -1
- package/data/data.js +43 -28
- package/package.json +3 -3
- package/subscription.story.js +4 -37
- package/subscription.test.js +1 -30
|
@@ -116,7 +116,7 @@ exports[`OE - Subscription renders correctly 1`] = `
|
|
|
116
116
|
aria-current="page"
|
|
117
117
|
aria-label="homepage"
|
|
118
118
|
class="nav-link active"
|
|
119
|
-
href="/example"
|
|
119
|
+
href="/example.html"
|
|
120
120
|
>
|
|
121
121
|
Home
|
|
122
122
|
</a>
|
|
@@ -126,7 +126,7 @@ exports[`OE - Subscription renders correctly 1`] = `
|
|
|
126
126
|
>
|
|
127
127
|
<a
|
|
128
128
|
class="nav-link"
|
|
129
|
-
href="/example"
|
|
129
|
+
href="/example.html"
|
|
130
130
|
>
|
|
131
131
|
Item 01
|
|
132
132
|
</a>
|
|
@@ -136,7 +136,7 @@ exports[`OE - Subscription renders correctly 1`] = `
|
|
|
136
136
|
>
|
|
137
137
|
<a
|
|
138
138
|
class="nav-link"
|
|
139
|
-
href="/example"
|
|
139
|
+
href="/example.html"
|
|
140
140
|
>
|
|
141
141
|
Item 02
|
|
142
142
|
</a>
|
|
@@ -238,7 +238,7 @@ exports[`OE - Subscription renders correctly 1`] = `
|
|
|
238
238
|
>
|
|
239
239
|
<a
|
|
240
240
|
aria-label="homepage"
|
|
241
|
-
href="/example"
|
|
241
|
+
href="/example.html"
|
|
242
242
|
>
|
|
243
243
|
Home
|
|
244
244
|
</a>
|
|
@@ -247,7 +247,7 @@ exports[`OE - Subscription renders correctly 1`] = `
|
|
|
247
247
|
class="breadcrumb-item d-none d-md-block"
|
|
248
248
|
>
|
|
249
249
|
<a
|
|
250
|
-
href="/example"
|
|
250
|
+
href="/example.html"
|
|
251
251
|
>
|
|
252
252
|
European Union
|
|
253
253
|
</a>
|
|
@@ -256,7 +256,7 @@ exports[`OE - Subscription renders correctly 1`] = `
|
|
|
256
256
|
class="breadcrumb-item"
|
|
257
257
|
>
|
|
258
258
|
<a
|
|
259
|
-
href="/example"
|
|
259
|
+
href="/example.html"
|
|
260
260
|
>
|
|
261
261
|
<svg
|
|
262
262
|
class="d-md-none ms-0 me-2 me-2-5 bi icon--s"
|
|
@@ -614,12 +614,12 @@ exports[`OE - Subscription renders correctly 1`] = `
|
|
|
614
614
|
</div>
|
|
615
615
|
<main>
|
|
616
616
|
<div
|
|
617
|
-
class="bcl-content-banner
|
|
617
|
+
class="bcl-content-banner pb-md-4-75 pb-4 pt-4 pt-md-4-75 bg-lighter"
|
|
618
618
|
>
|
|
619
619
|
<div
|
|
620
620
|
class="container"
|
|
621
621
|
>
|
|
622
|
-
<
|
|
622
|
+
<article
|
|
623
623
|
class="bg-transparent border-0 card"
|
|
624
624
|
>
|
|
625
625
|
<div
|
|
@@ -640,27 +640,26 @@ exports[`OE - Subscription renders correctly 1`] = `
|
|
|
640
640
|
<div
|
|
641
641
|
class="card-body pt-4 pt-md-0 px-0 px-md-3 pb-0"
|
|
642
642
|
>
|
|
643
|
-
<
|
|
644
|
-
class="
|
|
643
|
+
<h1
|
|
644
|
+
class="fs-1 card-title bcl-heading"
|
|
645
645
|
>
|
|
646
646
|
This is the title of this page
|
|
647
|
-
</
|
|
647
|
+
</h1>
|
|
648
648
|
<div
|
|
649
|
-
class="
|
|
649
|
+
class="my-3"
|
|
650
650
|
>
|
|
651
651
|
<span
|
|
652
652
|
class="text-muted me-3"
|
|
653
653
|
>
|
|
654
|
-
|
|
654
|
+
17 October 2019
|
|
655
655
|
</span>
|
|
656
656
|
</div>
|
|
657
657
|
<p>
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
658
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
659
|
+
Suspendisse volutpat ultricies massa, a dapibus libero porta nec.
|
|
660
|
+
Sed facilisis dictum vestibulum. Fusce commodo hendrerit diam, pretium tempus leo varius sit amet.
|
|
661
|
+
Etiam interdum, orci at sagittis luctus, lorem libero tempus mauris, a fermentum libero orci semper lacus.
|
|
662
|
+
Duis tristique fringilla magna, eu egestas dolor molestie non.
|
|
664
663
|
</p>
|
|
665
664
|
<div
|
|
666
665
|
class="mt-2-5"
|
|
@@ -679,7 +678,7 @@ exports[`OE - Subscription renders correctly 1`] = `
|
|
|
679
678
|
</div>
|
|
680
679
|
</div>
|
|
681
680
|
</div>
|
|
682
|
-
</
|
|
681
|
+
</article>
|
|
683
682
|
<div
|
|
684
683
|
class="d-flex justify-content-end mt-2 align-items-center"
|
|
685
684
|
>
|
|
@@ -721,15 +720,17 @@ exports[`OE - Subscription renders correctly 1`] = `
|
|
|
721
720
|
class="row"
|
|
722
721
|
>
|
|
723
722
|
<div
|
|
724
|
-
class="col-12 col-lg-3"
|
|
723
|
+
class="col-12 bcl-sidebar col-lg-3"
|
|
725
724
|
>
|
|
726
725
|
<nav
|
|
727
|
-
class="
|
|
726
|
+
class="bcl-inpage-navigation position-sticky"
|
|
728
727
|
id="bcl-inpage-navigation"
|
|
729
728
|
>
|
|
730
|
-
<
|
|
729
|
+
<h2
|
|
730
|
+
class="mb-0 bcl-heading"
|
|
731
|
+
>
|
|
731
732
|
Page content
|
|
732
|
-
</
|
|
733
|
+
</h2>
|
|
733
734
|
<ul
|
|
734
735
|
class="nav nav-pills flex-column"
|
|
735
736
|
>
|
|
@@ -778,12 +779,12 @@ exports[`OE - Subscription renders correctly 1`] = `
|
|
|
778
779
|
Duis ac augue sed tortor elementum dignissim
|
|
779
780
|
</li>
|
|
780
781
|
</ul>
|
|
781
|
-
<
|
|
782
|
-
class="
|
|
782
|
+
<h2
|
|
783
|
+
class="my-4"
|
|
783
784
|
id="subheading"
|
|
784
785
|
>
|
|
785
786
|
Sub heading
|
|
786
|
-
</
|
|
787
|
+
</h2>
|
|
787
788
|
<p>
|
|
788
789
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sit amet eleifend tortor. In facilisis eros vitae turpis ullamcorper, a euismod dolor lacinia. Nam facilisis ipsum et sollicitudin imperdiet. Curabitur a efficitur ante. Phasellus non felis laoreet, posuere ante ut, rhoncus tortor. Proin sed erat vel nisl luctus vulputate. Nunc tristique ultricies turpis, eu dictum enim ultrices vel. Sed posuere at leo sit amet placerat. Sed dapibus viverra urna ac pretium. Praesent et laoreet erat, eget volutpat metus. Duis ac augue sed tortor elementum dignissim in sit amet velit. Nullam nec viverra mi.
|
|
789
790
|
</p>
|
|
@@ -839,11 +840,11 @@ exports[`OE - Subscription renders correctly 1`] = `
|
|
|
839
840
|
<div
|
|
840
841
|
class="modal-header"
|
|
841
842
|
>
|
|
842
|
-
<
|
|
843
|
-
class="modal-title"
|
|
843
|
+
<div
|
|
844
|
+
class="modal-title fs-5 fw-medium"
|
|
844
845
|
>
|
|
845
846
|
Subscribe
|
|
846
|
-
</
|
|
847
|
+
</div>
|
|
847
848
|
<button
|
|
848
849
|
aria-label="Close"
|
|
849
850
|
class="btn-close"
|
|
@@ -852,11 +853,11 @@ exports[`OE - Subscription renders correctly 1`] = `
|
|
|
852
853
|
/>
|
|
853
854
|
</div>
|
|
854
855
|
<div
|
|
855
|
-
class="success-alert d-none mb-0 alert alert-success d-flex align-items-center fade show"
|
|
856
|
+
class="success-alert d-none mb-0 alert alert-success d-flex align-items-center fade show text-dark"
|
|
856
857
|
role="alert"
|
|
857
858
|
>
|
|
858
859
|
<svg
|
|
859
|
-
class="flex-shrink-0 me-3 mt-1 align-self-start bi icon--s"
|
|
860
|
+
class="flex-shrink-0 me-3 mt-1 align-self-start text-success bi icon--s"
|
|
860
861
|
>
|
|
861
862
|
<use
|
|
862
863
|
xlink:href="/icons.svg#check-circle-fill"
|
|
@@ -865,20 +866,20 @@ exports[`OE - Subscription renders correctly 1`] = `
|
|
|
865
866
|
<div
|
|
866
867
|
class="alert-content flex-grow-1"
|
|
867
868
|
>
|
|
868
|
-
<
|
|
869
|
-
class="alert-heading"
|
|
869
|
+
<div
|
|
870
|
+
class="alert-heading h4"
|
|
870
871
|
>
|
|
871
872
|
Thank you!
|
|
872
|
-
</
|
|
873
|
+
</div>
|
|
873
874
|
Your subscription has been successfully registered. You can now close this dialog.
|
|
874
875
|
</div>
|
|
875
876
|
</div>
|
|
876
877
|
<div
|
|
877
|
-
class="error-alert d-none mb-0 alert alert-danger d-flex align-items-center fade show"
|
|
878
|
+
class="error-alert d-none mb-0 alert alert-danger d-flex align-items-center fade show text-dark"
|
|
878
879
|
role="alert"
|
|
879
880
|
>
|
|
880
881
|
<svg
|
|
881
|
-
class="flex-shrink-0 me-3 mt-1 align-self-start bi icon--s"
|
|
882
|
+
class="flex-shrink-0 me-3 mt-1 align-self-start text-danger bi icon--s"
|
|
882
883
|
>
|
|
883
884
|
<use
|
|
884
885
|
xlink:href="/icons.svg#dash-circle-fill"
|
|
@@ -887,11 +888,11 @@ exports[`OE - Subscription renders correctly 1`] = `
|
|
|
887
888
|
<div
|
|
888
889
|
class="alert-content flex-grow-1"
|
|
889
890
|
>
|
|
890
|
-
<
|
|
891
|
-
class="alert-heading"
|
|
891
|
+
<div
|
|
892
|
+
class="alert-heading h4"
|
|
892
893
|
>
|
|
893
894
|
Sorry!
|
|
894
|
-
</
|
|
895
|
+
</div>
|
|
895
896
|
There was an error!
|
|
896
897
|
<hr
|
|
897
898
|
class="d-none d-md-block"
|
|
@@ -1048,7 +1049,7 @@ exports[`OE - Subscription renders correctly 1`] = `
|
|
|
1048
1049
|
</div>
|
|
1049
1050
|
</main>
|
|
1050
1051
|
<footer
|
|
1051
|
-
class="mt-4 bcl-footer bcl-footer--neutral"
|
|
1052
|
+
class="mt-md-4-75 mt-4 bcl-footer bcl-footer--neutral"
|
|
1052
1053
|
>
|
|
1053
1054
|
<div
|
|
1054
1055
|
class="container"
|
package/data/data--modal.js
CHANGED
|
@@ -3,7 +3,7 @@ const drupalAttribute = require("drupal-attribute");
|
|
|
3
3
|
module.exports = {
|
|
4
4
|
id: "subscribeModal",
|
|
5
5
|
header:
|
|
6
|
-
'<
|
|
6
|
+
'<div class="modal-title fs-5 fw-medium">Subscribe</div><button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>',
|
|
7
7
|
footer:
|
|
8
8
|
'<div class="text-align-end">' +
|
|
9
9
|
'<button class="btn btn-light" data-bs-dismiss="modal">Close</button>' +
|
package/data/data.js
CHANGED
|
@@ -1,30 +1,45 @@
|
|
|
1
|
-
|
|
1
|
+
import layout from "@openeuropa/bcl-base-templates/data/layout";
|
|
2
|
+
import {
|
|
3
|
+
banner,
|
|
4
|
+
sidebar,
|
|
5
|
+
} from "@openeuropa/bcl-base-templates/data/content-page";
|
|
6
|
+
import isChromatic from "chromatic/isChromatic";
|
|
2
7
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
8
|
+
import content from "@openeuropa/bcl-news/data/data--content";
|
|
9
|
+
import blockData from "@openeuropa/bcl-subscription-block/data";
|
|
10
|
+
import modalData from "@openeuropa/bcl-subscription/data/data--modal";
|
|
11
|
+
|
|
12
|
+
const chromatic = process.env.STORYBOOK_ENV;
|
|
13
|
+
|
|
14
|
+
const header =
|
|
15
|
+
layout[`header_${process.env.STORYBOOK_THEME}`] || layout.headerSimple;
|
|
16
|
+
|
|
17
|
+
if (isChromatic() || chromatic) {
|
|
18
|
+
banner.image.classes = banner.image.classes
|
|
19
|
+
? `${banner.image.classes} chromatic-ignore`
|
|
20
|
+
: "chromatic-ignore";
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const demoData = {
|
|
24
|
+
content_type: "subscription",
|
|
25
|
+
title: "Subscription",
|
|
26
|
+
header,
|
|
27
|
+
footer: layout.footer,
|
|
28
|
+
with_banner: true,
|
|
29
|
+
with_header: true,
|
|
30
|
+
with_footer: true,
|
|
31
|
+
sidebar,
|
|
32
|
+
subscription: blockData,
|
|
33
|
+
modal: modalData,
|
|
34
|
+
banner: {
|
|
35
|
+
...banner,
|
|
36
|
+
action_bar: `
|
|
37
|
+
<div class="d-flex justify-content-end mt-2 align-items-center">
|
|
38
|
+
<button class="me-3 btn btn-outline-primary btn-md" type="button"><svg class="me-2-5 bi icon--fluid"><use xlink:href="/icons.svg#printer-fill"></use></svg>Print</button>
|
|
39
|
+
<button data-bs-toggle="modal" data-bs-target="#subscribeModal" class="btn btn-outline-primary btn-md" type="button"><svg class="me-2-5 bi icon--fluid"><use xlink:href="/icons.svg#envelope-fill"></use></svg>Subscribe</button>
|
|
40
|
+
</div>`,
|
|
41
|
+
},
|
|
42
|
+
content,
|
|
30
43
|
};
|
|
44
|
+
|
|
45
|
+
export default demoData;
|
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": "0.
|
|
5
|
+
"version": "0.24.0",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
8
8
|
},
|
|
9
9
|
"description": "OE - BCL subscription",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@openeuropa/bcl-subscription-block": "^0.
|
|
11
|
+
"@openeuropa/bcl-subscription-block": "^0.24.0"
|
|
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": "a46bb6bc12771da4667516dc7b0665b00504ade2"
|
|
28
28
|
}
|
package/subscription.story.js
CHANGED
|
@@ -1,46 +1,13 @@
|
|
|
1
1
|
import { withDesign } from "storybook-addon-designs";
|
|
2
|
+
import withCode from "@openeuropa/storybook-addon-code";
|
|
2
3
|
import { within, userEvent } from "@storybook/testing-library";
|
|
3
4
|
import isChromatic from "chromatic/isChromatic";
|
|
4
5
|
import { correctPaths, initScrollspy } from "@openeuropa/bcl-story-utils";
|
|
5
|
-
import
|
|
6
|
-
import footer from "@openeuropa/bcl-data-footer/data";
|
|
7
|
-
import content from "@openeuropa/bcl-news/data/data--content";
|
|
8
|
-
import banner from "@openeuropa/bcl-content-banner/data/data";
|
|
9
|
-
import sidebar from "@openeuropa/bcl-inpage-navigation/data/data--simple";
|
|
10
|
-
import blockData from "@openeuropa/bcl-subscription-block/data";
|
|
11
|
-
import drupalAttribute from "drupal-attribute";
|
|
6
|
+
import demoData from "@openeuropa/bcl-subscription/data/data";
|
|
12
7
|
|
|
13
8
|
import subscriptionPage from "@openeuropa/bcl-subscription/subscription.html.twig";
|
|
14
|
-
import subscriptionPageData from "@openeuropa/bcl-subscription/data/data";
|
|
15
|
-
import modalData from "@openeuropa/bcl-subscription/data/data--modal";
|
|
16
|
-
const chromatic = process.env.STORYBOOK_ENV;
|
|
17
|
-
|
|
18
|
-
if (isChromatic()) {
|
|
19
|
-
banner.image.classes = banner.image.classes
|
|
20
|
-
? `${banner.image.classes} chromatic-ignore`
|
|
21
|
-
: "chromatic-ignore";
|
|
22
|
-
}
|
|
23
9
|
|
|
24
|
-
const
|
|
25
|
-
content_type: "subscription",
|
|
26
|
-
page_title: "Subscription",
|
|
27
|
-
header: header,
|
|
28
|
-
footer: {
|
|
29
|
-
...footer,
|
|
30
|
-
attributes: new drupalAttribute().addClass("mt-4"),
|
|
31
|
-
},
|
|
32
|
-
with_banner: true,
|
|
33
|
-
with_header: true,
|
|
34
|
-
with_footer: true,
|
|
35
|
-
sidebar: sidebar,
|
|
36
|
-
subscription: blockData,
|
|
37
|
-
modal: modalData,
|
|
38
|
-
banner: {
|
|
39
|
-
...banner,
|
|
40
|
-
...subscriptionPageData,
|
|
41
|
-
},
|
|
42
|
-
content: content,
|
|
43
|
-
};
|
|
10
|
+
const chromatic = process.env.STORYBOOK_ENV;
|
|
44
11
|
|
|
45
12
|
const clientValidation = (story) => {
|
|
46
13
|
const demo = story();
|
|
@@ -121,7 +88,7 @@ const errorState = (story) => {
|
|
|
121
88
|
|
|
122
89
|
export default {
|
|
123
90
|
title: "Features/Subscription",
|
|
124
|
-
decorators: [withDesign, initScrollspy],
|
|
91
|
+
decorators: [withCode, withDesign, initScrollspy],
|
|
125
92
|
parameters: {
|
|
126
93
|
layout: "fullscreen",
|
|
127
94
|
controls: { disable: true },
|
package/subscription.test.js
CHANGED
|
@@ -1,35 +1,6 @@
|
|
|
1
1
|
import { renderTwigFileAsNode } from "@openeuropa/bcl-test-utils";
|
|
2
|
-
import header from "@openeuropa/bcl-data-header/data--simple";
|
|
3
|
-
import footer from "@openeuropa/bcl-data-footer/data";
|
|
4
|
-
import content from "@openeuropa/bcl-news/data/data--content";
|
|
5
|
-
import banner from "@openeuropa/bcl-content-banner/data/data";
|
|
6
|
-
import sidebar from "@openeuropa/bcl-inpage-navigation/data/data--simple";
|
|
7
|
-
import blockData from "@openeuropa/bcl-subscription-block/data";
|
|
8
|
-
import drupalAttribute from "drupal-attribute";
|
|
9
2
|
|
|
10
|
-
import
|
|
11
|
-
import modalData from "@openeuropa/bcl-subscription/data/data--modal";
|
|
12
|
-
|
|
13
|
-
const demoData = {
|
|
14
|
-
content_type: "subscription",
|
|
15
|
-
page_title: "Subscription",
|
|
16
|
-
header: header,
|
|
17
|
-
footer: {
|
|
18
|
-
...footer,
|
|
19
|
-
attributes: new drupalAttribute().addClass("mt-4"),
|
|
20
|
-
},
|
|
21
|
-
with_banner: true,
|
|
22
|
-
with_header: true,
|
|
23
|
-
with_footer: true,
|
|
24
|
-
sidebar: sidebar,
|
|
25
|
-
subscription: blockData,
|
|
26
|
-
modal: modalData,
|
|
27
|
-
banner: {
|
|
28
|
-
...banner,
|
|
29
|
-
...subscriptionPageData,
|
|
30
|
-
},
|
|
31
|
-
content: content,
|
|
32
|
-
};
|
|
3
|
+
import demoData from "@openeuropa/bcl-subscription/data/data";
|
|
33
4
|
|
|
34
5
|
const template = "@oe-bcl/bcl-subscription/subscription.html.twig";
|
|
35
6
|
|