Skip to content

Commit d37db94

Browse files
committed
Merge branch 'release/0.2.16'
2 parents 012e088 + 893713c commit d37db94

File tree

9 files changed

+5943
-50
lines changed

9 files changed

+5943
-50
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: node_js
22
node_js:
3-
- "0.12"
3+
- "6"
44
before_script:
55
- export DISPLAY=:99.0
66
- sh -e /etc/init.d/xvfb start

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CHANGELOG
22

3+
## 0.2.16 - Oct 19, 2017
4+
5+
* Support for React 16 (thanks to @marudor)
6+
37
## 0.2.15 - Aug 1, 2017
48

59
* UMD build now specifies the library name (thanks to @franckamayou)

example/build/app.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/build/app.js

Lines changed: 5 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-notification-system",
3-
"version": "0.2.15",
3+
"version": "0.2.16",
44
"description": "A React Notification System fully customized",
55
"main": "dist/NotificationSystem.js",
66
"scripts": {
@@ -37,8 +37,8 @@
3737
"prop-types": "^15.5.6"
3838
},
3939
"peerDependencies": {
40-
"react": "0.14.x || ^15.0.0",
41-
"react-dom": "0.14.x || ^15.0.0"
40+
"react": "0.14.x || ^15.0.0 || ^16.0.0",
41+
"react-dom": "0.14.x || ^15.0.0 || ^16.0.0"
4242
},
4343
"devDependencies": {
4444
"autoprefixer-loader": "^3.1.0",
@@ -49,32 +49,31 @@
4949
"babel-plugin-react-transform": "^2.0.2",
5050
"babel-preset-airbnb": "^2.0.0",
5151
"css-loader": "^0.24.0",
52-
"eslint": "3.4.0",
53-
"eslint-config-airbnb": "^10.0.1",
54-
"eslint-plugin-import": "^1.14.0",
55-
"eslint-plugin-jsx-a11y": "^2.2.1",
56-
"eslint-plugin-react": "^6.2.0",
57-
"expect": "^1.12.1",
52+
"eslint": "4.9.0",
53+
"eslint-config-airbnb": "^16.0.0",
54+
"eslint-plugin-import": "^2.7.0",
55+
"eslint-plugin-jsx-a11y": "^6.0.2",
56+
"eslint-plugin-react": "^7.4.0",
57+
"expect": "^21.2.1",
5858
"express": "^4.13.3",
5959
"extract-text-webpack-plugin": "^0.8.2",
6060
"file-loader": "^0.8.4",
61-
"install": "^0.1.8",
61+
"install": "^0.10.1",
6262
"isparta-loader": "^1.0.0",
63-
"karma": "^0.13.10",
64-
"karma-chai-plugins": "^0.6.0",
65-
"karma-chrome-launcher": "^0.2.1",
66-
"karma-cli": "^0.1.1",
67-
"karma-coverage": "^0.5.2",
63+
"karma": "^1.7.1",
64+
"karma-chai-plugins": "^0.9.0",
65+
"karma-chrome-launcher": "^2.2.0",
66+
"karma-cli": "^1.0.1",
67+
"karma-coverage": "^1.1.1",
6868
"karma-coveralls": "^1.1.2",
69-
"karma-firefox-launcher": "^0.1.6",
70-
"karma-mocha": "^0.2.0",
69+
"karma-firefox-launcher": "^1.0.1",
70+
"karma-mocha": "^1.3.0",
7171
"karma-sourcemap-loader": "^0.3.6",
7272
"karma-webpack": "^1.7.0",
73-
"mocha": "^2.3.3",
73+
"mocha": "^4.0.1",
7474
"node-sass": "^3.3.3",
75-
"react": "^15.0.0",
76-
"react-addons-test-utils": "^15.0.0",
77-
"react-dom": "^15.0.0",
75+
"react": "^16.0.0",
76+
"react-dom": "^16.0.0",
7877
"react-tools": "^0.13.2",
7978
"react-transform-catch-errors": "^1.0.0",
8079
"react-transform-hmr": "^1.0.1",

src/NotificationItem.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ var NotificationItem = createReactClass({
181181
_onTransitionEnd: function() {
182182
if (this._removeCount > 0) return;
183183
if (this.state.removed) {
184-
this._removeCount++;
184+
this._removeCount += 1;
185185
this._removeNotification();
186186
}
187187
},
@@ -306,7 +306,7 @@ var NotificationItem = createReactClass({
306306
<button className="notification-action-button"
307307
onClick={ this._defaultAction }
308308
style={ this._styles.action }>
309-
{ notification.action.label }
309+
{ notification.action.label }
310310
</button>
311311
</div>
312312
);

src/NotificationSystem.jsx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ var NotificationSystem = createReactClass({
118118
throw new Error('\'' + _notification.level + '\' is not a valid level.');
119119
}
120120

121+
// eslint-disable-next-line
121122
if (isNaN(_notification.autoDismiss)) {
122123
throw new Error('\'autoDismiss\' must be a number.');
123124
}
@@ -136,7 +137,7 @@ var NotificationSystem = createReactClass({
136137
this.uid += 1;
137138

138139
// do not add if the notification already exists based on supplied uid
139-
for (i = 0; i < notifications.length; i++) {
140+
for (i = 0; i < notifications.length; i += 1) {
140141
if (notifications[i].uid === _notification.uid) {
141142
return false;
142143
}
@@ -167,7 +168,6 @@ var NotificationSystem = createReactClass({
167168
// NOTE: Stop iterating further and return the found notification.
168169
// Since UIDs are uniques and there won't be another notification found.
169170
foundNotification = self.refs[container].refs[_notification];
170-
return;
171171
}
172172
});
173173
}
@@ -201,13 +201,11 @@ var NotificationSystem = createReactClass({
201201
return;
202202
}
203203

204-
newNotifications.push(
205-
merge(
206-
{},
207-
foundNotification,
208-
newNotification
209-
)
210-
);
204+
newNotifications.push(merge(
205+
{},
206+
foundNotification,
207+
newNotification
208+
));
211209

212210
this.setState({
213211
notifications: newNotifications

test/notification-system.test.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* global sinon */
22

33
import React, { Component } from 'react';
4-
import TestUtils from 'react-addons-test-utils';
4+
import TestUtils from 'react-dom/test-utils';
55
import expect from 'expect';
66
import NotificationSystem from 'NotificationSystem';
77
import { positions, levels } from 'constants';
@@ -56,12 +56,12 @@ describe('Notification Component', function() {
5656

5757
it('should be rendered', done => {
5858
component = TestUtils.findRenderedDOMComponentWithClass(instance, 'notifications-wrapper');
59-
expect(component).toExist();
59+
expect(component).not.toBeNull();
6060
done();
6161
});
6262

6363
it('should hold the component ref', done => {
64-
expect(component).toExist();
64+
expect(component).not.toBeNull();
6565
done();
6666
});
6767

@@ -75,8 +75,8 @@ describe('Notification Component', function() {
7575
it('should not set a notification visibility class when the notification is initially added', done => {
7676
component.addNotification(defaultNotification);
7777
let notification = TestUtils.findRenderedDOMComponentWithClass(instance, 'notification');
78-
expect(notification.className).toNotMatch(/notification-hidden/);
79-
expect(notification.className).toNotMatch(/notification-visible/);
78+
expect(notification.className).not.toMatch(/notification-hidden/);
79+
expect(notification.className).not.toMatch(/notification-visible/);
8080
done();
8181
});
8282

@@ -109,7 +109,7 @@ describe('Notification Component', function() {
109109
containers.forEach(function(container) {
110110
for (let level of Object.keys(levels)) {
111111
let notification = container.getElementsByClassName('notification-' + levels[level]);
112-
expect(notification).toExist();
112+
expect(notification).not.toBeNull();
113113
}
114114
});
115115

@@ -249,7 +249,7 @@ describe('Notification Component', function() {
249249
let notification = TestUtils.findRenderedDOMComponentWithClass(instance, 'notification');
250250
TestUtils.Simulate.click(notification);
251251
let notificationAfterClicked = TestUtils.findRenderedDOMComponentWithClass(instance, 'notification');
252-
expect(notificationAfterClicked).toExist();
252+
expect(notificationAfterClicked).not.toBeNull();
253253
done();
254254
});
255255

@@ -261,7 +261,7 @@ describe('Notification Component', function() {
261261

262262
component.addNotification(defaultNotification);
263263
let button = TestUtils.findRenderedDOMComponentWithClass(instance, 'notification-action-button');
264-
expect(button).toExist();
264+
expect(button).not.toBeNull();
265265
done();
266266
});
267267

@@ -325,7 +325,7 @@ describe('Notification Component', function() {
325325

326326
component.addNotification(defaultNotification);
327327
let customContainer = TestUtils.findRenderedDOMComponentWithClass(instance, 'custom-container');
328-
expect(customContainer).toExist();
328+
expect(customContainer).not.toBeNull();
329329
done();
330330
});
331331

@@ -336,7 +336,7 @@ describe('Notification Component', function() {
336336
TestUtils.Simulate.mouseEnter(notification);
337337
clock.tick(4000);
338338
let _notification = TestUtils.findRenderedDOMComponentWithClass(instance, 'notification');
339-
expect(_notification).toExist();
339+
expect(_notification).not.toBeNull();
340340
done();
341341
});
342342

0 commit comments

Comments
 (0)