@ordergroove/offers 2.27.6 → 2.27.7
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/CHANGELOG.md +8 -0
- package/dist/bundle-report.html +4 -4
- package/dist/offers.js +46 -44
- package/dist/offers.js.map +2 -2
- package/package.json +2 -2
- package/src/components/OptinSelect.js +19 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ordergroove/offers",
|
|
3
|
-
"version": "2.27.
|
|
3
|
+
"version": "2.27.7",
|
|
4
4
|
"description": "offer state component",
|
|
5
5
|
"author": "Eugenio Lattanzio <eugenio63@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/ordergroove/plush-toys#readme",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@ordergroove/offers-templates": "^0.4.13"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "09226ede168eae0ac25625557615c4c6a6dfc247"
|
|
49
49
|
}
|
|
@@ -31,8 +31,14 @@ export class OptinSelect extends withChildOptions(OptinStatus) {
|
|
|
31
31
|
`;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
get
|
|
35
|
-
|
|
34
|
+
get currentFrequency() {
|
|
35
|
+
if (!this.subscribed) {
|
|
36
|
+
return 'optedOut';
|
|
37
|
+
}
|
|
38
|
+
if (this.frequency) {
|
|
39
|
+
return this.frequency;
|
|
40
|
+
}
|
|
41
|
+
return this.defaultFrequency;
|
|
36
42
|
}
|
|
37
43
|
|
|
38
44
|
onOptinChange(value) {
|
|
@@ -44,7 +50,7 @@ export class OptinSelect extends withChildOptions(OptinStatus) {
|
|
|
44
50
|
}
|
|
45
51
|
|
|
46
52
|
render() {
|
|
47
|
-
const { options: childOptions
|
|
53
|
+
const { options: childOptions } = this.childOptions;
|
|
48
54
|
let options;
|
|
49
55
|
if (this.frequencies?.length) {
|
|
50
56
|
options = [
|
|
@@ -63,13 +69,21 @@ export class OptinSelect extends withChildOptions(OptinStatus) {
|
|
|
63
69
|
}))
|
|
64
70
|
];
|
|
65
71
|
} else {
|
|
66
|
-
options =
|
|
72
|
+
options = [
|
|
73
|
+
{
|
|
74
|
+
value: 'optedOut',
|
|
75
|
+
text: html`
|
|
76
|
+
<og-text key="offerOptOutLabel"></og-text>
|
|
77
|
+
`
|
|
78
|
+
},
|
|
79
|
+
...childOptions
|
|
80
|
+
];
|
|
67
81
|
}
|
|
68
82
|
|
|
69
83
|
return html`
|
|
70
84
|
<og-select
|
|
71
85
|
.options="${options}"
|
|
72
|
-
.selected="${
|
|
86
|
+
.selected="${this.currentFrequency}"
|
|
73
87
|
.onChange="${({ target: { value } }) => this.onOptinChange(value)}"
|
|
74
88
|
></og-select>
|
|
75
89
|
`;
|