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
5d7d1cde
Commit
5d7d1cde
authored
Mar 19, 2021
by
seotts
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add comments; fix reply logic
parent
94eb3dc6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
+13
-11
src/views/preview/comment/compose-comment.jsx
src/views/preview/comment/compose-comment.jsx
+13
-11
No files found.
src/views/preview/comment/compose-comment.jsx
View file @
5d7d1cde
...
...
@@ -28,9 +28,9 @@ const JUST_MUTED_ERROR = 'isBad';
const
ComposeStatus
=
keyMirror
({
EDITING
:
null
,
SUBMITTING
:
null
,
REJECTED
:
null
,
REJECTED_MUTE
:
null
,
COMPOSE_DISALLOWED
:
null
REJECTED
:
null
,
// comment rejected for a reason other than muting (such as commenting too quickly)
REJECTED_MUTE
:
null
,
// comment made in this ComposeComment was rejected and muted the user
COMPOSE_DISALLOWED
:
null
// user is already muted due to past behavior
});
class
ComposeComment
extends
React
.
Component
{
...
...
@@ -186,14 +186,14 @@ class ComposeComment extends React.Component {
return
false
;
}
// TODO: Check with Kathy, but we think you should always see the modal when you reply?
// If the user is already muted (for example, in a different tab),
// do not show modal unless the comment is a reply. We always want to show
// the modal on replies when the user is already muted because the blue box
// may be out-of-sight for them.
if
(
!
justMuted
)
{
if
(
this
.
props
.
isReply
)
{
return
true
;
}
// If the user is already muted (for example, in a different tab),
// do not show modal because it would be confusing
if
(
!
justMuted
)
{
return
false
;
}
...
...
@@ -284,7 +284,9 @@ class ComposeComment extends React.Component {
render
()
{
return
(
<
React
.
Fragment
>
{
(
this
.
isMuted
()
&&
!
(
this
.
props
.
isReply
&&
this
.
state
.
status
!==
ComposeStatus
.
REJECTED_MUTE
))
?
(
{
/* If a user is muted, show the blue mute box, unless
the comment is a reply and the user was already muted before attempting to make it. */
}
{
(
this
.
isMuted
()
&&
!
(
this
.
props
.
isReply
&&
this
.
state
.
status
===
ComposeStatus
.
COMPOSE_DISALLOWED
))
?
(
<
FlexRow
className=
"comment"
>
<
CommentingStatus
>
<
p
>
...
...
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