Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
c0e374bf5edd
Commit
c0e374bf
authored
Jun 13, 2014
by
Dmitriy Zaporozhets
Browse files
Wipe wall notes feature
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
13bfe4f5a8fc
Changes
31
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
c0e374bf
...
...
@@ -33,6 +33,7 @@
- Overall performance improvements
- Skip init script check on omnibus-gitlab
- Be more selective when killing stray Sidekiqs
- Remove wall feature (no data loss - you can take it from database)
v 6.9.2
- Revert the commit that broke the LDAP user filter
...
...
app/assets/javascripts/dispatcher.js.coffee
View file @
c0e374bf
...
...
@@ -34,8 +34,6 @@
new
Activities
()
when
'projects:new'
,
'projects:edit'
new
Project
()
when
'projects:walls:show'
new
Wall
(
project_id
)
when
'projects:teams:members:index'
new
TeamMembers
()
when
'groups:members'
...
...
app/assets/javascripts/wall.js.coffee
deleted
100644 → 0
View file @
13bfe4f5
class
Wall
constructor
:
(
project_id
)
->
@
project_id
=
project_id
@
note_ids
=
[]
@
getContent
()
@
initRefresh
()
@
initForm
()
#
# Gets an initial set of notes.
#
getContent
:
->
Api
.
notes
@
project_id
,
(
notes
)
=>
$
.
each
notes
,
(
i
,
note
)
=>
# render note if it not present in loaded list
# or skip if rendered
if
$
.
inArray
(
note
.
id
,
@
note_ids
)
==
-
1
@
note_ids
.
push
(
note
.
id
)
@
renderNote
(
note
)
@
scrollDown
()
$
(
"abbr.timeago"
).
timeago
()
initRefresh
:
->
setInterval
=>
@
refresh
()
,
10000
refresh
:
->
@
getContent
()
scrollDown
:
->
notes
=
$
(
'ul.notes'
)
$
(
'body, html'
).
scrollTop
(
notes
.
height
())
initForm
:
->
form
=
$
(
'.wall-note-form'
)
form
.
find
(
"#target_type"
).
val
(
'wall'
)
form
.
on
'ajax:success'
,
=>
@
refresh
()
form
.
find
(
".js-note-text"
).
val
(
""
).
trigger
(
"input"
)
form
.
on
'ajax:complete'
,
->
form
.
find
(
".js-comment-button"
).
removeAttr
(
'disabled'
)
form
.
find
(
".js-comment-button"
).
removeClass
(
'disabled'
)
form
.
on
"click"
,
".js-choose-note-attachment-button"
,
->
form
.
find
(
".js-note-attachment-input"
).
click
()
form
.
on
"change"
,
".js-note-attachment-input"
,
->
filename
=
$
(
this
).
val
().
replace
(
/^.*[\\\/]/
,
''
)
form
.
find
(
".js-attachment-filename"
).
text
(
filename
)
form
.
find
(
'.note_text'
).
keydown
(
e
)
->
if
e
.
ctrlKey
&&
e
.
keyCode
==
13
form
.
find
(
'.js-comment-button'
).
submit
()
form
.
show
()
renderNote
:
(
note
)
->
template
=
@
noteTemplate
()
template
=
template
.
replace
(
'{{author_name}}'
,
note
.
author
.
name
)
template
=
template
.
replace
(
/{{created_at}}/g
,
note
.
created_at
)
template
=
template
.
replace
(
'{{text}}'
,
simpleFormat
(
note
.
body
))
if
note
.
attachment
file
=
'<i class="icon-paper-clip"/><a href="'
+
gon
.
relative_url_root
+
'/files/note/'
+
note
.
id
+
'/'
+
note
.
attachment
+
'">'
+
note
.
attachment
+
'</a>'
else
file
=
''
template
=
template
.
replace
(
'{{file}}'
,
file
)
$
(
'ul.notes'
).
append
(
template
)
noteTemplate
:
->
return
'<li>
<strong class="wall-author">{{author_name}}</strong>
<span class="wall-text">
{{text}}
<span class="wall-file">{{file}}</span>
</span>
<abbr class="timeago" title="{{created_at}}">{{created_at}}</abbr>
</li>'
@
Wall
=
Wall
app/assets/stylesheets/sections/wall.scss
deleted
100644 → 0
View file @
13bfe4f5
.wall-page
{
.wall-note-form
{
@extend
.col-md-12
;
margin
:
0
;
height
:
140px
;
background
:
#F9F9F9
;
position
:
fixed
;
bottom
:
0px
;
padding
:
3px
;
padding-bottom
:
25px
;
border
:
1px
solid
#DDD
;
}
.notes
{
margin-bottom
:
160px
;
background
:
#FFE
;
border
:
1px
solid
#EED
;
>
li
{
@extend
.clearfix
;
border-bottom
:
1px
solid
#EED
;
padding
:
10px
;
}
.wall-author
{
color
:
#666
;
float
:
left
;
font-size
:
12px
;
width
:
120px
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
overflow
:
hidden
;
}
.wall-text
{
border-left
:
1px
solid
#CCC
;
margin-left
:
10px
;
padding-left
:
10px
;
float
:
left
;
width
:
75%
;
}
.wall-file
{
margin-left
:
8px
;
background
:
#EEE
;
}
abbr
{
float
:
right
;
color
:
#AAA
;
border
:
none
;
}
}
}
app/controllers/projects/walls_controller.rb
deleted
100644 → 0
View file @
13bfe4f5
class
Projects::WallsController
<
Projects
::
ApplicationController
before_filter
:module_enabled
respond_to
:js
,
:html
def
show
@note
=
@project
.
notes
.
new
respond_to
do
|
format
|
format
.
html
end
end
protected
def
module_enabled
return
render_404
unless
@project
.
wall_enabled
end
end
app/helpers/events_helper.rb
View file @
c0e374bf
...
...
@@ -109,8 +109,6 @@
"
#{
event
.
note_target_type
}
#
#{
truncate
event
.
note_target_iid
}
"
end
end
elsif
event
.
wall_note?
link_to
'wall'
,
project_wall_path
(
event
.
project
)
else
content_tag
:strong
do
"(deleted)"
...
...
app/helpers/projects_helper.rb
View file @
c0e374bf
...
...
@@ -139,7 +139,7 @@
nav_tabs
<<
:settings
end
[
:issues
,
:wiki
,
:wall
,
:snippets
].
each
do
|
feature
|
[
:issues
,
:wiki
,
:snippets
].
each
do
|
feature
|
nav_tabs
<<
feature
if
project
.
send
:"
#{
feature
}
_enabled"
end
...
...
app/helpers/search_helper.rb
View file @
c0e374bf
...
...
@@ -61,7 +61,6 @@
{
label:
"
#{
prefix
}
- Milestones"
,
url:
project_milestones_path
(
@project
)
},
{
label:
"
#{
prefix
}
- Snippets"
,
url:
project_snippets_path
(
@project
)
},
{
label:
"
#{
prefix
}
- Team"
,
url:
project_team_index_path
(
@project
)
},
{
label:
"
#{
prefix
}
- Wall"
,
url:
project_wall_path
(
@project
)
},
{
label:
"
#{
prefix
}
- Wiki"
,
url:
project_wikis_path
(
@project
)
},
]
else
...
...
app/mailers/emails/notes.rb
View file @
c0e374bf
...
...
@@ -32,14 +32,5 @@
cc:
recipient
(
recipient_id
),
subject:
subject
(
"
#{
@merge_request
.
title
}
(#
#{
@merge_request
.
iid
}
)"
))
end
def
note_wall_email
(
recipient_id
,
note_id
)
@note
=
Note
.
find
(
note_id
)
@project
=
@note
.
project
@target_url
=
project_wall_url
(
@note
.
project
,
anchor:
"note_
#{
@note
.
id
}
"
)
mail
(
from:
sender
(
@note
.
author_id
),
cc:
recipient
(
recipient_id
),
subject:
subject
(
"Note on wall"
))
end
end
end
app/models/event.rb
View file @
c0e374bf
...
...
@@ -286,10 +286,6 @@
end
.
to_s
end
def
wall_note?
target
.
noteable_type
.
blank?
end
def
note_target_type
if
target
.
noteable_type
.
present?
target
.
noteable_type
.
titleize
...
...
app/models/note.rb
View file @
c0e374bf
...
...
@@ -251,10 +251,6 @@
for_merge_request?
&&
for_diff_line?
end
def
for_wall?
noteable_type
.
blank?
end
# override to return commits, which are not active record
def
noteable
if
for_commit?
...
...
@@ -295,8 +291,6 @@
def
noteable_type_name
if
noteable_type
.
present?
noteable_type
.
downcase
else
"wall"
end
end
...
...
app/models/project.rb
View file @
c0e374bf
...
...
@@ -31,7 +31,6 @@
default_value_for
:archived
,
false
default_value_for
:issues_enabled
,
true
default_value_for
:wall_enabled
,
true
default_value_for
:merge_requests_enabled
,
true
default_value_for
:wiki_enabled
,
true
default_value_for
:snippets_enabled
,
true
...
...
@@ -39,7 +38,7 @@
ActsAsTaggableOn
.
strict_case_match
=
true
attr_accessible
:name
,
:path
,
:description
,
:issues_tracker
,
:label_list
,
:issues_enabled
,
:wall_enabled
,
:merge_requests_enabled
,
:snippets_enabled
,
:issues_tracker_id
,
:issues_enabled
,
:merge_requests_enabled
,
:snippets_enabled
,
:issues_tracker_id
,
:wiki_enabled
,
:visibility_level
,
:import_url
,
:last_activity_at
,
as:
[
:default
,
:admin
]
attr_accessible
:namespace_id
,
:creator_id
,
as: :admin
...
...
@@ -98,7 +97,7 @@
exclusion:
{
in:
Gitlab
::
Blacklist
.
path
},
format:
{
with:
Gitlab
::
Regex
.
path_regex
,
message:
"only letters, digits & '_' '-' '.' allowed. Letter or digit should be first"
}
validates
:issues_enabled
,
:wall_enabled
,
:merge_requests_enabled
,
validates
:issues_enabled
,
:merge_requests_enabled
,
:wiki_enabled
,
inclusion:
{
in:
[
true
,
false
]
}
validates
:issues_tracker_id
,
length:
{
maximum:
255
},
allow_blank:
true
validates
:namespace
,
presence:
true
...
...
app/observers/note_observer.rb
View file @
c0e374bf
...
...
@@ -3,6 +3,5 @@
notification
.
new_note
(
note
)
# Skip system notes, like status changes and cross-references.
# Skip wall notes to prevent spamming of dashboard
if
note
.
noteable_type
.
present?
&&
!
note
.
system
unless
note
.
system
event_service
.
leave_note
(
note
,
note
.
author
)
...
...
@@ -8,3 +7,2 @@
event_service
.
leave_note
(
note
,
note
.
author
)
end
...
...
@@ -10,5 +8,4 @@
unless
note
.
system?
# Create a cross-reference note if this Note contains GFM that names an
# issue, merge request, or commit.
note
.
references
.
each
do
|
mentioned
|
...
...
app/services/notification_service.rb
View file @
c0e374bf
...
...
@@ -106,7 +106,6 @@
# TODO: split on methods and refactor
#
def
new_note
(
note
)
# ignore wall messages
return
true
unless
note
.
noteable_type
.
present?
# ignore gitlab service messages
...
...
app/services/projects/create_service.rb
View file @
c0e374bf
...
...
@@ -19,7 +19,6 @@
default_opts
=
{
issues_enabled:
default_features
.
issues
,
wiki_enabled:
default_features
.
wiki
,
wall_enabled:
default_features
.
wall
,
snippets_enabled:
default_features
.
snippets
,
merge_requests_enabled:
default_features
.
merge_requests
,
visibility_level:
default_features
.
visibility_level
...
...
app/views/layouts/nav/_project.html.haml
View file @
c0e374bf
...
...
@@ -36,10 +36,6 @@
=
nav_link
(
controller: :wikis
)
do
=
link_to
'Wiki'
,
project_wiki_path
(
@project
,
:home
)
-
if
project_nav_tab?
:wall
=
nav_link
(
controller: :walls
)
do
=
link_to
'Wall'
,
project_wall_path
(
@project
)
-
if
project_nav_tab?
:snippets
=
nav_link
(
controller: :snippets
)
do
=
link_to
'Snippets'
,
project_snippets_path
(
@project
)
...
...
app/views/notify/note_wall_email.html.haml
deleted
100644 → 0
View file @
13bfe4f5
=
render
'note_message'
app/views/notify/note_wall_email.text.erb
deleted
100644 → 0
View file @
13bfe4f5
New message on the project wall
<%=
@note
.
project
%>
<%=
url_for
(
project_wall_url
(
@note
.
project
,
anchor:
"note_
#{
@note
.
id
}
"
))
%>
<%=
@note
.
author_name
%>
<%=
@note
.
note
%>
app/views/projects/edit.html.haml
View file @
c0e374bf
...
...
@@ -74,13 +74,6 @@
%span
.descr
Pages for project documentation
.form-group
=
f
.
label
:wall_enabled
,
"Wall"
,
class:
'control-label'
.col-sm-10
.checkbox
=
f
.
check_box
:wall_enabled
%span
.descr
Simple chat system for broadcasting inside project
.form-group
=
f
.
label
:snippets_enabled
,
"Snippets"
,
class:
'control-label'
.col-sm-10
.checkbox
...
...
app/views/projects/walls/show.html.haml
deleted
100644 → 0
View file @
13bfe4f5
%div
.wall-page
%ul
.notes
-
if
can?
current_user
,
:write_note
,
@project
.note-form-holder
=
form_for
[
@project
,
@note
],
remote:
true
,
html:
{
multipart:
true
,
id:
nil
,
class:
"new_note wall-note-form"
},
authenticity_token:
true
do
|
f
|
=
note_target_fields
.note_text_and_preview
=
f
.
text_area
:note
,
size:
255
,
class:
'note_text js-note-text js-gfm-input turn-on'
.note-form-actions
.buttons
=
f
.
submit
'Add Comment'
,
class:
"btn comment-btn btn-grouped js-comment-button"
.note-form-option
%a
.choose-btn.btn.btn-small.js-choose-note-attachment-button
%i
.icon-paper-clip
%span
Choose File ...
%span
.file_name.js-attachment-filename
File name...
=
f
.
file_field
:attachment
,
class:
"js-note-attachment-input hidden"
.hint.pull-right
CTRL + Enter to send message
.clearfix
Prev
1
2
Next
Write
Preview
Supports
Markdown
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