Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scratch-www
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
scratch-www
Commits
b7f1f5e9
Commit
b7f1f5e9
authored
Sep 05, 2017
by
Matthew Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix comment message handling
add comment message to redux to access the current user, and fix the string
parent
6092bfe5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
10 deletions
+18
-10
src/views/messages/l10n.json
src/views/messages/l10n.json
+1
-1
src/views/messages/message-rows/comment-message.jsx
src/views/messages/message-rows/comment-message.jsx
+17
-9
No files found.
src/views/messages/l10n.json
View file @
b7f1f5e9
...
...
@@ -16,7 +16,7 @@
"messages.messageTitle"
:
"Messages"
,
"messages.profileComment"
:
"{profileLink} commented on {commentLink}"
,
"messages.commentReply"
:
"{profileLink} replied to your comment on {commentLink}"
,
"messages.profileOther"
:
"{username}'s
reply
"
,
"messages.profileOther"
:
"{username}'s
profile
"
,
"messages.profileSelf"
:
"your profile"
,
"messages.projectComment"
:
"{profileLink} commented on your project {commentLink}"
,
"messages.remixText"
:
"{profileLink} remixed your project {remixedProjectLink} as {projectLink}"
,
...
...
src/views/messages/message-rows/comment-message.jsx
View file @
b7f1f5e9
var
classNames
=
require
(
'
classnames
'
);
var
connect
=
require
(
'
react-redux
'
).
connect
;
var
FormattedMessage
=
require
(
'
react-intl
'
).
FormattedMessage
;
var
injectIntl
=
require
(
'
react-intl
'
).
injectIntl
;
var
React
=
require
(
'
react
'
);
...
...
@@ -55,16 +56,16 @@ var CommentMessage = injectIntl(React.createClass({
if
(
typeof
commentee
!==
'
undefined
'
&&
commentee
===
this
.
props
.
user
.
username
)
{
// is a profile comment, and is a reply
if
(
this
.
props
.
objectTitle
===
this
.
props
.
user
.
username
)
{
linkText
=
this
.
props
.
intl
.
formatMessage
({
id
:
'
messages.profileSelf
'
})
;
linkText
=
<
FormattedMessage
id
=
'messages.profileSelf'
/>
;
}
else
{
linkText
=
this
.
props
.
intl
.
formatMessage
({
id
:
'
messages.profileOther
'
,
values
:
{
linkText
=
<
FormattedMessage
id
=
'messages.profileOther'
values
=
{
{
username
:
this
.
props
.
objectTitle
}
})
;
}
}
/>
;
}
return
<
FormattedMessage
id=
'messages.commentReply'
...
...
@@ -158,4 +159,11 @@ var CommentMessage = injectIntl(React.createClass({
}
}));
module
.
exports
=
CommentMessage
;
var
mapStateToProps
=
function
(
state
)
{
return
{
user
:
state
.
session
.
session
.
user
};
};
var
ConnectedCommentMessage
=
connect
(
mapStateToProps
)(
CommentMessage
);
module
.
exports
=
ConnectedCommentMessage
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment