@storybook/addon-comments
Advanced tools
Comparing version 3.2.8 to 3.3.0-alpha.0
{ | ||
"name": "@storybook/addon-comments", | ||
"version": "3.2.8", | ||
"version": "3.3.0-alpha.0", | ||
"description": "Comments addon for Storybook", | ||
@@ -26,3 +26,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@storybook/addons": "^3.2.6", | ||
"@storybook/addons": "^3.3.0-alpha.0", | ||
"babel-runtime": "^6.23.0", | ||
@@ -42,4 +42,4 @@ "deep-equal": "^1.0.1", | ||
"@kadira/storybook-deployer": "*", | ||
"@storybook/addon-actions": "^3.2.0", | ||
"@storybook/react": "^3.2.8", | ||
"@storybook/addon-actions": "^3.3.0-alpha.0", | ||
"@storybook/react": "^3.3.0-alpha.0", | ||
"git-url-parse": "^6.2.2", | ||
@@ -46,0 +46,0 @@ "react": "^15.6.1", |
@@ -13,6 +13,7 @@ import PropTypes from 'prop-types'; | ||
const Button = ({ children, onClick, style = {} }) => | ||
const Button = ({ children, onClick, style = {} }) => ( | ||
<button style={{ ...buttonStyles, ...style }} onClick={onClick}> | ||
{children} | ||
</button>; | ||
</button> | ||
); | ||
@@ -19,0 +20,0 @@ Button.defaultProps = { |
@@ -62,12 +62,6 @@ import PropTypes from 'prop-types'; | ||
<div style={style.commentHead}> | ||
<span style={style.commentUser}> | ||
{comment.user.name} | ||
</span> | ||
<span style={style.commentTime}> | ||
{time} | ||
</span> | ||
<span style={style.commentUser}>{comment.user.name}</span> | ||
<span style={style.commentTime}>{time}</span> | ||
</div> | ||
<span style={style.commentText}> | ||
{body} | ||
</span> | ||
<span style={style.commentText}>{body}</span> | ||
{showDelete ? this.renderDelete() : null} | ||
@@ -74,0 +68,0 @@ </div> |
@@ -40,3 +40,3 @@ import PropTypes from 'prop-types'; | ||
> | ||
{comments.map(comment => | ||
{comments.map(comment => ( | ||
<CommentItem | ||
@@ -48,3 +48,3 @@ key={comment.id} | ||
/> | ||
)} | ||
))} | ||
</div> | ||
@@ -51,0 +51,0 @@ ); |
@@ -82,6 +82,8 @@ import deepEquals from 'deep-equal'; | ||
this.fireComments([]); | ||
this.loadUsers().then(() => this.loadComments()).then(() => { | ||
this.eventStore.emit('loading', false); | ||
return Promise.resolve(null); | ||
}); | ||
this.loadUsers() | ||
.then(() => this.loadComments()) | ||
.then(() => { | ||
this.eventStore.emit('loading', false); | ||
return Promise.resolve(null); | ||
}); | ||
@@ -102,11 +104,14 @@ return this.currentStory; | ||
} | ||
return this.db.getCollection('users').get(query, options).then(users => { | ||
this.users = users.reduce((newUsers, user) => { | ||
const usersObj = { | ||
...newUsers, | ||
}; | ||
usersObj[user.id] = user; | ||
return usersObj; | ||
}, {}); | ||
}); | ||
return this.db | ||
.getCollection('users') | ||
.get(query, options) | ||
.then(users => { | ||
this.users = users.reduce((newUsers, user) => { | ||
const usersObj = { | ||
...newUsers, | ||
}; | ||
usersObj[user.id] = user; | ||
return usersObj; | ||
}, {}); | ||
}); | ||
}); | ||
@@ -123,11 +128,14 @@ } | ||
} | ||
return this.db.getCollection('comments').get(query, options).then(comments => { | ||
// add to cache | ||
this.addToCache(currentStory, comments); | ||
return this.db | ||
.getCollection('comments') | ||
.get(query, options) | ||
.then(comments => { | ||
// add to cache | ||
this.addToCache(currentStory, comments); | ||
// set comments only if we are on the relavant story | ||
if (deepEquals(currentStory, this.currentStory)) { | ||
this.fireComments(comments); | ||
} | ||
}); | ||
// set comments only if we are on the relavant story | ||
if (deepEquals(currentStory, this.currentStory)) { | ||
this.fireComments(comments); | ||
} | ||
}); | ||
}); | ||
@@ -134,0 +142,0 @@ } |
@@ -61,10 +61,10 @@ import React from 'react'; | ||
.add('CommentList - No Comments', () => <CommentList comments={[]} />) | ||
.add('CommentList - with comments', () => | ||
.add('CommentList - with comments', () => ( | ||
<CommentList user={userObj} comments={commentsList} deleteComment={action('deleteComment')} /> | ||
) | ||
)) | ||
.add('CommentPanel - not loggedIn', () => <CommentsPanel />) | ||
.add('CommentPanel - app not available', () => | ||
.add('CommentPanel - app not available', () => ( | ||
<CommentsPanel user={userObj} appNotAvailable={{}} /> | ||
) | ||
.add('CommentPanel - loggedIn with no comments', () => | ||
)) | ||
.add('CommentPanel - loggedIn with no comments', () => ( | ||
<CommentsPanel | ||
@@ -77,4 +77,4 @@ user={userObj} | ||
/> | ||
) | ||
.add('CommentPanel - loggedIn with has comments', () => | ||
)) | ||
.add('CommentPanel - loggedIn with has comments', () => ( | ||
<CommentsPanel | ||
@@ -87,2 +87,2 @@ user={userObj} | ||
/> | ||
); | ||
)); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
225788
2031
0
2