@legalplace/wizardx-core 2.6.0 → 2.6.1
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 +11 -0
- package/dist/libs/EventsTracking.js +9 -13
- package/package.json +2 -2
- package/src/libs/EventsTracking.ts +10 -12
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.6.1](https://git.legalplace.eu/legalplace/monorepo/compare/@legalplace/wizardx-core@2.6.0...@legalplace/wizardx-core@2.6.1) (2021-12-09)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* fix Ab tests tracking api[#4480](https://git.legalplace.eu/legalplace/monorepo/issues/4480) ([9942e36](https://git.legalplace.eu/legalplace/monorepo/commits/9942e36e798195188a172384ce41bba7d967ac54))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [2.6.0](https://git.legalplace.eu/legalplace/monorepo/compare/@legalplace/wizardx-core@2.5.3...@legalplace/wizardx-core@2.6.0) (2021-12-08)
|
|
7
18
|
|
|
8
19
|
|
|
@@ -41,22 +41,18 @@ class _EventsTracking {
|
|
|
41
41
|
}
|
|
42
42
|
getXAbTests() {
|
|
43
43
|
const xAbTests = cookie.get("X-AbTests");
|
|
44
|
-
|
|
45
|
-
const xAbTestsObject = JSON.parse(xAbTests);
|
|
44
|
+
if (typeof xAbTests === "object") {
|
|
46
45
|
const xAbTestsFlattened = {};
|
|
47
|
-
Object.keys(
|
|
48
|
-
xAbTestsFlattened[`X-AbTests[${abTestName}]`] =
|
|
49
|
-
xAbTestsObject[abTestName];
|
|
46
|
+
Object.keys(xAbTests).forEach((abTestName) => {
|
|
47
|
+
xAbTestsFlattened[`X-AbTests[${abTestName}]`] = xAbTests[abTestName];
|
|
50
48
|
});
|
|
51
|
-
return
|
|
52
|
-
}
|
|
53
|
-
catch (e) {
|
|
54
|
-
return typeof xAbTests === "string" && xAbTests.trim().length > 0
|
|
55
|
-
? {
|
|
56
|
-
"X-AbTests": xAbTests,
|
|
57
|
-
}
|
|
58
|
-
: {};
|
|
49
|
+
return xAbTestsFlattened;
|
|
59
50
|
}
|
|
51
|
+
return typeof xAbTests === "string" && xAbTests.trim().length > 0
|
|
52
|
+
? {
|
|
53
|
+
"X-AbTests": xAbTests,
|
|
54
|
+
}
|
|
55
|
+
: {};
|
|
60
56
|
}
|
|
61
57
|
executeQueue() {
|
|
62
58
|
for (let i = 0; i < this.queue.length; i += 1) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@legalplace/wizardx-core",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.1",
|
|
4
4
|
"author": "Moncef Hammou (moncef@legalplace.fr)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"exports": {
|
|
@@ -92,5 +92,5 @@
|
|
|
92
92
|
"*.test.ts",
|
|
93
93
|
"*.test.tsx"
|
|
94
94
|
],
|
|
95
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "3a47c81e0b3dc87345e047d84b0649de398c140b"
|
|
96
96
|
}
|
|
@@ -74,23 +74,21 @@ class _EventsTracking {
|
|
|
74
74
|
private getXAbTests(): Record<string, string> {
|
|
75
75
|
const xAbTests = cookie.get("X-AbTests");
|
|
76
76
|
|
|
77
|
-
|
|
78
|
-
const xAbTestsObject = JSON.parse(xAbTests);
|
|
77
|
+
if (typeof xAbTests === "object") {
|
|
79
78
|
const xAbTestsFlattened: Record<string, string> = {};
|
|
80
79
|
|
|
81
|
-
Object.keys(
|
|
82
|
-
xAbTestsFlattened[`X-AbTests[${abTestName}]`] =
|
|
83
|
-
xAbTestsObject[abTestName];
|
|
80
|
+
Object.keys(xAbTests).forEach((abTestName) => {
|
|
81
|
+
xAbTestsFlattened[`X-AbTests[${abTestName}]`] = xAbTests[abTestName];
|
|
84
82
|
});
|
|
85
83
|
|
|
86
|
-
return
|
|
87
|
-
} catch (e) {
|
|
88
|
-
return typeof xAbTests === "string" && xAbTests.trim().length > 0
|
|
89
|
-
? {
|
|
90
|
-
"X-AbTests": xAbTests,
|
|
91
|
-
}
|
|
92
|
-
: {};
|
|
84
|
+
return xAbTestsFlattened;
|
|
93
85
|
}
|
|
86
|
+
|
|
87
|
+
return typeof xAbTests === "string" && xAbTests.trim().length > 0
|
|
88
|
+
? {
|
|
89
|
+
"X-AbTests": xAbTests,
|
|
90
|
+
}
|
|
91
|
+
: {};
|
|
94
92
|
}
|
|
95
93
|
|
|
96
94
|
/**
|