Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
360c1470
Commit
360c1470
authored
Sep 07, 2017
by
Jarka Kadlecova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable comment form when discussion locked for user
parent
142bbd90
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
5 deletions
+26
-5
app/assets/javascripts/notes/components/issue_comment_form.vue
...ssets/javascripts/notes/components/issue_comment_form.vue
+3
-0
app/assets/javascripts/notes/components/issue_discussion_locked_widget.vue
...ripts/notes/components/issue_discussion_locked_widget.vue
+16
-0
app/serializers/issue_entity.rb
app/serializers/issue_entity.rb
+1
-1
app/views/shared/notes/_notes_with_form.html.haml
app/views/shared/notes/_notes_with_form.html.haml
+6
-4
No files found.
app/assets/javascripts/notes/components/issue_comment_form.vue
View file @
360c1470
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
import
eventHub
from
'
../event_hub
'
;
import
eventHub
from
'
../event_hub
'
;
import
issueWarning
from
'
../../vue_shared/components/issue/issue_warning.vue
'
;
import
issueWarning
from
'
../../vue_shared/components/issue/issue_warning.vue
'
;
import
issueNoteSignedOutWidget
from
'
./issue_note_signed_out_widget.vue
'
;
import
issueNoteSignedOutWidget
from
'
./issue_note_signed_out_widget.vue
'
;
import
issueDiscussionLockedWidget
from
'
./issue_discussion_locked_widget.vue
'
;
import
markdownField
from
'
../../vue_shared/components/markdown/field.vue
'
;
import
markdownField
from
'
../../vue_shared/components/markdown/field.vue
'
;
import
userAvatarLink
from
'
../../vue_shared/components/user_avatar/user_avatar_link.vue
'
;
import
userAvatarLink
from
'
../../vue_shared/components/user_avatar/user_avatar_link.vue
'
;
import
issuableStateMixin
from
'
../mixins/issuable_state
'
;
import
issuableStateMixin
from
'
../mixins/issuable_state
'
;
...
@@ -29,6 +30,7 @@
...
@@ -29,6 +30,7 @@
components
:
{
components
:
{
issueWarning
,
issueWarning
,
issueNoteSignedOutWidget
,
issueNoteSignedOutWidget
,
issueDiscussionLockedWidget
,
markdownField
,
markdownField
,
userAvatarLink
,
userAvatarLink
,
},
},
...
@@ -239,6 +241,7 @@
...
@@ -239,6 +241,7 @@
<
template
>
<
template
>
<div>
<div>
<issue-note-signed-out-widget
v-if=
"!isLoggedIn"
/>
<issue-note-signed-out-widget
v-if=
"!isLoggedIn"
/>
<issue-discussion-locked-widget
v-else-if=
"!canCreate"
/>
<ul
<ul
v-else
v-else
class=
"notes notes-form timeline"
>
class=
"notes notes-form timeline"
>
...
...
app/assets/javascripts/notes/components/issue_discussion_locked_widget.vue
0 → 100644
View file @
360c1470
<
script
>
import
{
mapGetters
}
from
'
vuex
'
;
export
default
{
name
:
'
discussionLockedWidget
'
,
};
</
script
>
<
template
>
<div
class=
"disabled-comment text-center"
>
<span
class=
"issuable-note-warning"
>
This issue is locked. Only
<b>
project members
</b>
can comment.
</span>
</div>
</
template
>
app/serializers/issue_entity.rb
View file @
360c1470
...
@@ -15,7 +15,7 @@ class IssueEntity < IssuableEntity
...
@@ -15,7 +15,7 @@ class IssueEntity < IssuableEntity
expose
:current_user
do
expose
:current_user
do
expose
:can_create_note
do
|
issue
|
expose
:can_create_note
do
|
issue
|
can?
(
request
.
current_user
,
:create_note
,
issue
.
project
)
can?
(
request
.
current_user
,
:create_note
,
issue
)
end
end
expose
:can_update
do
|
issue
|
expose
:can_update
do
|
issue
|
...
...
app/views/shared/notes/_notes_with_form.html.haml
View file @
360c1470
...
@@ -25,9 +25,11 @@
...
@@ -25,9 +25,11 @@
=
link_to
"sign in"
,
new_session_path
(
:user
,
redirect_to_referer:
'yes'
),
class:
'js-sign-in-link'
=
link_to
"sign in"
,
new_session_path
(
:user
,
redirect_to_referer:
'yes'
),
class:
'js-sign-in-link'
to comment
to comment
-
elsif
discussion_locked
-
elsif
discussion_locked
.dis
cussion_locked
.dis
abled-comment.text-center.prepend-top-default
%span
%span
.issuable-note-warning
This
This
=
issuable
.
class
.
to_s
=
issuable
.
class
.
to_s
.
titleize
has been locked. Posting comments has been restricted to project members.
is locked. Only
%b
project members
can comment.
%script
.js-notes-data
{
type:
"application/json"
}=
initial_notes_data
(
autocomplete
).
to_json
.
html_safe
%script
.js-notes-data
{
type:
"application/json"
}=
initial_notes_data
(
autocomplete
).
to_json
.
html_safe
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