Skip to content

Commit

Permalink
6.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
piano-analytics committed Jun 21, 2022
1 parent d240fe0 commit 4f7d7d4
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 106 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# Changelog

## 6.1.2
## 6.2.0

### Added or Changed
- updated README
- fix privacy mode name ("no-consent", "no-storage")
- upgraded dev-dependencies

## 6.1.2

### Added or Changed
- updated README

## 6.1.1

Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "piano-analytics-js",
"description": "JavaScript library for Piano Analytics",
"version": "6.1.2",
"version": "6.2.0",
"main": "dist/browserless/piano-analytics.cjs.js",
"module": "dist/browserless/piano-analytics.esm.js",
"browser": "dist/browser/piano-analytics.umd.js",
Expand Down Expand Up @@ -31,8 +31,8 @@
"test:browserless": "npm run rollup:browserless && node test/browserless.run.js"
},
"devDependencies": {
"@babel/core": "7.17.9",
"@babel/preset-env": "7.16.11",
"@babel/core": "7.17.10",
"@babel/preset-env": "7.17.10",
"@rollup/plugin-babel": "5.3.1",
"chai": "4.3.6",
"eslint": "8.14.0",
Expand All @@ -47,9 +47,9 @@
"karma-chrome-launcher": "3.1.1",
"karma-mocha": "2.0.1",
"load-grunt-tasks": "5.1.0",
"mocha": "9.2.2",
"puppeteer": "13.6.0",
"rollup": "2.70.2",
"mocha": "10.0.0",
"puppeteer": "13.7.0",
"rollup": "2.71.1",
"rollup-plugin-eslint": "7.0.0",
"rollup-plugin-replace": "2.2.0",
"rollup-plugin-uglify": "6.0.4"
Expand Down
10 changes: 5 additions & 5 deletions src/business/privacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ function Privacy(pa) {
}
this.previousMode = this.currentMode;
this.currentMode = mode;
const privateModes = ['optin', 'optout', 'noConsent', 'noStorage', 'exempt'];
const privateModes = ['optin', 'optout', 'no-consent', 'no-storage', 'exempt'];
pa.storage.getItem(pa.getConfiguration('storageVisitor'), (function (visitorIdStored) {
pa.storage.getItem(config.storageKey, (function (storedMode) {
if (
mode === 'noStorage' ||
mode === 'no-storage' ||
((privateModes.indexOf(mode) < 0 || mode === 'optin' || mode === 'exempt') &&
(this.previousMode === 'optout' || this.previousMode === 'noConsent' || this.previousMode === 'noStorage')) ||
(mode === 'noConsent' && visitorIdStored) ||
(this.previousMode === 'optout' || this.previousMode === 'no-consent' || this.previousMode === 'no-storage')) ||
(mode === 'no-consent' && visitorIdStored) ||
(mode === 'optout' && (visitorIdStored !== this.modes[mode].visitorId))
) {
pa.storage.deleteItem(pa.getConfiguration('storageVisitor'));
pa.setVisitorId(undefined);
}
if (mode === 'optout' || mode === 'noConsent' || mode === 'noStorage') {
if (mode === 'optout' || mode === 'no-consent' || mode === 'no-storage') {
pa.setVisitorId(this.modes[mode].visitorId);
}

Expand Down
10 changes: 5 additions & 5 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default {
],
'storageVisitor': 'pa_vid',
'storageUser': 'pa_user',
'version': '6.1.2',
'version': '6.2.0',
'minHeartbeat': 5,
'minBufferingHeartbeat': 1,
'privacy': {
Expand Down Expand Up @@ -93,8 +93,8 @@ export default {
'forbidden': {}
}
},
'noConsent': {
'name': 'noConsent',
'no-consent': {
'name': 'no-consent',
'visitorId': 'Consent-NO',
'properties': {
'include': {
Expand All @@ -121,8 +121,8 @@ export default {
'forbidden': {}
}
},
'noStorage': {
'name': 'noStorage',
'no-storage': {
'name': 'no-storage',
'visitorId': 'no-storage',
'properties': {
'include': {
Expand Down
8 changes: 4 additions & 4 deletions test/browser/privacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -780,8 +780,8 @@ describe('Privacy in Browser :', function () {
}
});
});
it('Should work properly using noConsent mode', function (done) {
globalPA.privacy.setMode('noConsent');
it('Should work properly using no-consent mode', function (done) {
globalPA.privacy.setMode('no-consent');
globalPA.privacy.include.properties(
[
'event_collection_*',
Expand Down Expand Up @@ -1056,8 +1056,8 @@ describe('Privacy in Browser :', function () {
}
});
});
it('Should work properly using noStorage mode', function (done) {
globalPA.privacy.setMode('noStorage');
it('Should work properly using no-storage mode', function (done) {
globalPA.privacy.setMode('no-storage');
globalPA.privacy.include.properties(
[
'event_collection_*',
Expand Down
8 changes: 4 additions & 4 deletions test/browserless/privacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -645,8 +645,8 @@ describe('Privacy not in Browser :', function () {
}
});
});
it('Should work properly using noConsent mode', function (done) {
globalPA.privacy.setMode('noConsent');
it('Should work properly using no-consent mode', function (done) {
globalPA.privacy.setMode('no-consent');
globalPA.privacy.include.properties(
[
'event_collection_*',
Expand Down Expand Up @@ -849,8 +849,8 @@ describe('Privacy not in Browser :', function () {
}
});
});
it('Should work properly using noStorage mode', function (done) {
globalPA.privacy.setMode('noStorage');
it('Should work properly using no-storage mode', function (done) {
globalPA.privacy.setMode('no-storage');
globalPA.privacy.include.properties(
[
'event_collection_*',
Expand Down
Loading

0 comments on commit 4f7d7d4

Please sign in to comment.