Comments (2)
@rockxwre
With the 0.7.0 version the current ConsentCookie.get is set deprecated.
Instead 2 API functions are added:
- ConsentCookie.getConsent
- ConsentCookie.getConsents
ConsentCookie.getConsent works as the the deprecated ConsentCookie.get with some minor changes
- When calling the function and instance of Consent is always returned. The instance has the following getters for easy checking which flag is set:
isAccepted() // If the user has accepted the consent
isAlwaysOn() // If the consent is always on (and cannot be changed by the user)
isEnabled() // If the consent is accepted by the user or is always on
isRejected() // If the consent has not been accepted by the user
- When calling the function with an id, a instance of Consent is always given. If no consent with the given id exist, a consent with the flag:null is returned. The getters will all return false when called because no state was set.
- When calling the function without an id all configured consents are returned as an Array
ConsentCookie.getConsents is new and is based on calling the deprecated ConsentCookie.get without an id arguement.
- The consents are now a private variable. The return of the ConsentCookie.consent will give the Consents instance with the following getters:
get($id) // Works the same as calling ConsentCookie.get
getConsentMap // Will give a map of all configured consents with the key the id of the consent and the value a Consent object
getCookieValues // The ConsentCookie values not filtered by the configuration mapped by key = id and value = consent flag
Could you comment on this update related to the requested changes.
from consentcookie.
Test results
I tested it using the browsers Console. Everything works as described, which is great!
However, I'm struggling with some method names. What I did was executing each method on a specific consent. I did not read your explanation of the method but tried to explain the methods myself. These are the results:
isAccepted
I read some GDPR documentation and in this documentation the verb 'grant' is used in this context. You grant or reject a consent. So maybe isManuallyGranted()
is better (please read further).
isAlwaysOn
In line with my previous comment (isAccepted), a consent cannot be 'on' or 'off'. In this case you have no choice. You are forced to grant the consent. Maybe something like isForcedGranted()
or isAutoGranted()
?
isEnabled
This one confused me the most. Since consent toggles can be immutable, my first guess was that if isEnabled() === true
the toggle was enabled. But what it means is that the user granted the consent explicitly or the user had no choice to grant the consent because it was granted automatically. So maybe isGranted()
?
isRejected
This one is in line with my previous comments.
from consentcookie.
Related Issues (20)
- use of ConsentCookie.off function results in error
- Alwayson tracker toggle shows 'off' instead of on HOT 2
- ConsentCookie API changes #23 regression bug HOT 2
- Multilanguage support HOT 8
- application logo icons optional HOT 1
- Update webpack 1 HOT 1
- Where is the tracker list? HOT 1
- Default and fallback language HOT 2
- Language codes reference to available languages HOT 4
- Set default language through CC API HOT 2
- ConfigService getDefault
- Navigate within consentcookie using API HOT 3
- Add default language: en
- Consentcookie option to persit on top domain HOT 1
- ConsentCookie not working properly on mobile devices
- ConsentCookie plugin selection
- reintroduce application detail info HOT 1
- scrollbar missing HOT 2
- missing icon shows 'broken' image HOT 1
- You were added to awesome-humane-tech
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from consentcookie.