empreinte-digitale / orejime

An easy to use consent manager that focuses on accessibility.
https://orejime.empreintedigitale.fr/
Other
155 stars 26 forks source link

Bug on "decline" action #9

Closed RomainTweaks closed 5 years ago

RomainTweaks commented 5 years ago

I have an issue with the modal and the notice. When the user click on the decline btn, or decline all, apps required are set to false.

In the callback of my app i have this log : "User consent for app myapp: consent=false", and in the cookie set by Orejime my app is also set to false.

But visually in the modal the orejime-AppItem-slider is on position activate.

We can reproduce this issue on the demo page : https://orejime.netlify.com/

Can you fix this please?

[Edit] After investigation I found where the bug is located. In ConsentManager inside the declineAll function you have to add an if statement before the call of updateConsent to check if the app is required or not and then update to false only if it isn't required.

this.config.apps.map((app) => { if (!app.required) { this.updateConsent(app.name, false); } });

[Edit 2] For the button decline all in the modal this is the function toggle that needs to be changed in /components/apps.js like this :

const toggle = (apps, value) => { apps.map((app)=>{ if (!app.required) { manager.updateConsent(app.name, value); } }) }

Can you put this fix in the repo please? @Leimi

manuhabitela commented 5 years ago

Hey, thanks. I added the fix 54ae6357e09a7a209c6f0bbce8b5063b724af67c, will publish a new version in the week.

RomainTweaks commented 5 years ago

Nice thank you!

By the way, can i ask you to make a little addition to the Notice component? :)

Or would you prefer if I created a new Issue?

manuhabitela commented 5 years ago

Please make another issue ;)

RomainTweaks commented 5 years ago

Ok

manuhabitela commented 5 years ago

This should now be fixed in version 1.1.0, thanks.