react-cimpress-comment
Advanced tools
Comparing version 0.2.8 to 0.2.9
@@ -64,3 +64,3 @@ 'use strict'; | ||
_this.commentServiceUrl = _config.SERVICE_URL; | ||
_this.customizrResource = 'http://comment.trdlnk.cimpress.io/'; | ||
_this.customizrResource = encodeURIComponent('https://comment.trdlnk.cimpress.io/'); | ||
_this.commentsClient = new _CommentsClient2.default(props.accessToken, props.resourceUri); | ||
@@ -96,3 +96,3 @@ _this.mentionsClient = new _MentionsClient2.default(props.accessToken); | ||
this._ismounted = true; | ||
fetch(_config.CUSTOMIZR_URL + '/v1/settings?resourceId=' + this.customizrResource, { | ||
fetch(_config.CUSTOMIZR_URL + '/v1/' + this.customizrResource + '/settings', { | ||
method: "GET", | ||
@@ -106,3 +106,5 @@ headers: { | ||
if (_this3._ismounted) { | ||
_this3.setState({ alertDismissed: json.data && json.data.mentionsUsageNotification && json.data.mentionsUsageNotification.alertDismissed === true }); | ||
_this3.setState({ | ||
alertDismissed: json && json.mentionsUsageNotification && json.mentionsUsageNotification.alertDismissed === true | ||
}); | ||
} | ||
@@ -236,4 +238,4 @@ }); | ||
value: function onAlertDismissed() { | ||
fetch(_config.CUSTOMIZR_URL + '/v1/settings', { | ||
method: "POST", | ||
fetch(_config.CUSTOMIZR_URL + '/v1/' + this.customizrResource + '/settings', { | ||
method: "PUT", | ||
headers: { | ||
@@ -243,7 +245,4 @@ 'Authorization': 'Bearer ' + this.props.accessToken | ||
data: { | ||
resourceId: this.customizrResource, | ||
data: { | ||
mentionsUsageNotification: { | ||
alertDismissed: true | ||
} | ||
mentionsUsageNotification: { | ||
alertDismissed: true | ||
} | ||
@@ -270,3 +269,4 @@ } | ||
comments = this.state.commentsIds.map(function (id, index) { | ||
return _react2.default.createElement(_Comment2.default, { className: 'comment ' + (index % 2 === 0 ? 'comment-even' : 'comment-odd'), key: id, accessToken: _this7.props.accessToken, | ||
return _react2.default.createElement(_Comment2.default, { className: 'comment ' + (index % 2 === 0 ? 'comment-even' : 'comment-odd'), key: id, | ||
accessToken: _this7.props.accessToken, | ||
commentUri: url + id, comment: _this7.state.commentObjects[id], editComments: _this7.props.editComments }); | ||
@@ -333,3 +333,4 @@ }); | ||
_reactMentions.MentionsInput, | ||
{ className: 'mentions mentions-min-height', value: this.state.commentToAdd, onChange: this.onInputChange.bind(this), | ||
{ className: 'mentions mentions-min-height', value: this.state.commentToAdd, | ||
onChange: this.onInputChange.bind(this), | ||
displayTransform: function displayTransform(id, display, type) { | ||
@@ -349,3 +350,4 @@ return '@' + display; | ||
'button', | ||
{ disabled: !this.props.resourceUri || this.state.commentToAdd.trim() === '', onClick: this.addComment.bind(this), className: 'btn btn-default' }, | ||
{ disabled: !this.props.resourceUri || this.state.commentToAdd.trim() === '', | ||
onClick: this.addComment.bind(this), className: 'btn btn-default' }, | ||
'post' | ||
@@ -352,0 +354,0 @@ ) |
{ | ||
"name": "react-cimpress-comment", | ||
"version": "0.2.8", | ||
"version": "0.2.9", | ||
"description": "Visualizes comment(s) for a particular platform resource", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
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
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
64720
1222