Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1884. Add cookie policy notification #1890

Merged
merged 5 commits into from
May 29, 2017

Conversation

offtherailz
Copy link
Member

  • Add Notification system
  • Add cookie policy epic to show the cookie policy notification

 - Add Notification system
 - Add cookie policy epic to show the cookie policy notification
@coveralls
Copy link

Coverage Status

Coverage increased (+0.06%) to 79.69% when pulling 54169bf on offtherailz:cookies into 9278b8b on geosolutions-it:2017.03.01.

this.updateNotifications(this.props.notifications);
},
shouldComponentUpdate(nextProps) {
return this.props !== nextProps;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed, this should be redux connect default

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It protects the component for a future reuse in other contexts.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -130,6 +130,7 @@
"react-input-autosize": "1.1.0",
"react-intl": "2.2.3",
"react-joyride": "1.10.1",
"react-notification-system": "0.2.14",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uhm... it seems to me this module is not reactish at all if we use the NotificationSystem component. Basically it's the most imperative component I have seen til now. It would be better to use the NotificationsContainer directly, in my opinion, or use https://github.com/gor181/react-notification-system-redux that is a wrapper hiding the imperative stuff

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, i don't like very much the implementation too. This is why I wrote the wrapper, that allows to use it in a one way data flow (as many of our existing components).

Maybe in the future we can replace it modifying only the wrapper (the model for the notification is very simple, so it can be replaced quickly), or maybe they will improve the lib.

But for the moment we have a notification system that works, without creating divs here and there to notify success, warning or errors.

I've seen the wrapper you linked. It doesn't work as well as expected in our use case:

  • Uses the store in the context
  • doesn't seems to work on mount, but only on update (probably the author didn't understand the difference between componentDidUpdate and componentWillReceiveProps).

For our plugin system this solution is better in terms of maintenance.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.06%) to 79.69% when pulling a83b6b8 on offtherailz:cookies into 9278b8b on geosolutions-it:2017.03.01.

@@ -130,6 +130,11 @@
}
}
},
"cookiesPolicyNotification": {
"title": "Questo sito utilizza cookies",
"message": "Continuando a navigare sul sito accetti all'uso dei cookie",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

accetti l'uso

const { type, ...rest } = action;
return [
...state,
{ ...rest, uid: action.uid}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't uid already be taken from rest?

this.updateNotifications(this.props.notifications);
},
shouldComponentUpdate(nextProps) {
return this.props !== nextProps;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.05%) to 79.677% when pulling 0fbce9b on offtherailz:cookies into 9278b8b on geosolutions-it:2017.03.01.

@offtherailz offtherailz merged commit 2fadbf1 into geosolutions-it:2017.03.01 May 29, 2017
@offtherailz offtherailz deleted the cookies branch May 3, 2019 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants