Commit 15c27192 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'remove-wall'

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

Conflicts:
	CHANGELOG
parents d3d0775a d593c98f
...@@ -34,6 +34,7 @@ v 7.0.0 ...@@ -34,6 +34,7 @@ v 7.0.0
- Skip init script check on omnibus-gitlab - Skip init script check on omnibus-gitlab
- Be more selective when killing stray Sidekiqs - Be more selective when killing stray Sidekiqs
- Check LDAP user filter during sign-in - Check LDAP user filter during sign-in
- Remove wall feature (no data loss - you can take it from database)
v 6.9.2 v 6.9.2
- Revert the commit that broke the LDAP user filter - Revert the commit that broke the LDAP user filter
......
...@@ -34,8 +34,6 @@ class Dispatcher ...@@ -34,8 +34,6 @@ class Dispatcher
new Activities() new Activities()
when 'projects:new', 'projects:edit' when 'projects:new', 'projects:edit'
new Project() new Project()
when 'projects:walls:show'
new Wall(project_id)
when 'projects:teams:members:index' when 'projects:teams:members:index'
new TeamMembers() new TeamMembers()
when 'groups:members' when 'groups:members'
......
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
.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;
}
}
}
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
...@@ -109,8 +109,6 @@ module EventsHelper ...@@ -109,8 +109,6 @@ module EventsHelper
"#{event.note_target_type} ##{truncate event.note_target_iid}" "#{event.note_target_type} ##{truncate event.note_target_iid}"
end end
end end
elsif event.wall_note?
link_to 'wall', project_wall_path(event.project)
else else
content_tag :strong do content_tag :strong do
"(deleted)" "(deleted)"
......
...@@ -139,7 +139,7 @@ module ProjectsHelper ...@@ -139,7 +139,7 @@ module ProjectsHelper
nav_tabs << :settings nav_tabs << :settings
end end
[:issues, :wiki, :wall, :snippets].each do |feature| [:issues, :wiki, :snippets].each do |feature|
nav_tabs << feature if project.send :"#{feature}_enabled" nav_tabs << feature if project.send :"#{feature}_enabled"
end end
......
...@@ -61,7 +61,6 @@ module SearchHelper ...@@ -61,7 +61,6 @@ module SearchHelper
{ label: "#{prefix} - Milestones", url: project_milestones_path(@project) }, { label: "#{prefix} - Milestones", url: project_milestones_path(@project) },
{ label: "#{prefix} - Snippets", url: project_snippets_path(@project) }, { label: "#{prefix} - Snippets", url: project_snippets_path(@project) },
{ label: "#{prefix} - Team", url: project_team_index_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) }, { label: "#{prefix} - Wiki", url: project_wikis_path(@project) },
] ]
else else
......
...@@ -32,14 +32,5 @@ module Emails ...@@ -32,14 +32,5 @@ module Emails
cc: recipient(recipient_id), cc: recipient(recipient_id),
subject: subject("#{@merge_request.title} (##{@merge_request.iid})")) subject: subject("#{@merge_request.title} (##{@merge_request.iid})"))
end 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
end end
...@@ -286,10 +286,6 @@ class Event < ActiveRecord::Base ...@@ -286,10 +286,6 @@ class Event < ActiveRecord::Base
end.to_s end.to_s
end end
def wall_note?
target.noteable_type.blank?
end
def note_target_type def note_target_type
if target.noteable_type.present? if target.noteable_type.present?
target.noteable_type.titleize target.noteable_type.titleize
......
...@@ -251,10 +251,6 @@ class Note < ActiveRecord::Base ...@@ -251,10 +251,6 @@ class Note < ActiveRecord::Base
for_merge_request? && for_diff_line? for_merge_request? && for_diff_line?
end end
def for_wall?
noteable_type.blank?
end
# override to return commits, which are not active record # override to return commits, which are not active record
def noteable def noteable
if for_commit? if for_commit?
...@@ -295,8 +291,6 @@ class Note < ActiveRecord::Base ...@@ -295,8 +291,6 @@ class Note < ActiveRecord::Base
def noteable_type_name def noteable_type_name
if noteable_type.present? if noteable_type.present?
noteable_type.downcase noteable_type.downcase
else
"wall"
end end
end end
......
...@@ -31,7 +31,6 @@ class Project < ActiveRecord::Base ...@@ -31,7 +31,6 @@ class Project < ActiveRecord::Base
default_value_for :archived, false default_value_for :archived, false
default_value_for :issues_enabled, true default_value_for :issues_enabled, true
default_value_for :wall_enabled, true
default_value_for :merge_requests_enabled, true default_value_for :merge_requests_enabled, true
default_value_for :wiki_enabled, true default_value_for :wiki_enabled, true
default_value_for :snippets_enabled, true default_value_for :snippets_enabled, true
...@@ -39,7 +38,7 @@ class Project < ActiveRecord::Base ...@@ -39,7 +38,7 @@ class Project < ActiveRecord::Base
ActsAsTaggableOn.strict_case_match = true ActsAsTaggableOn.strict_case_match = true
attr_accessible :name, :path, :description, :issues_tracker, :label_list, 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] :wiki_enabled, :visibility_level, :import_url, :last_activity_at, as: [:default, :admin]
attr_accessible :namespace_id, :creator_id, as: :admin attr_accessible :namespace_id, :creator_id, as: :admin
...@@ -98,7 +97,7 @@ class Project < ActiveRecord::Base ...@@ -98,7 +97,7 @@ class Project < ActiveRecord::Base
exclusion: { in: Gitlab::Blacklist.path }, exclusion: { in: Gitlab::Blacklist.path },
format: { with: Gitlab::Regex.path_regex, format: { with: Gitlab::Regex.path_regex,
message: "only letters, digits & '_' '-' '.' allowed. Letter or digit should be first" } 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] } :wiki_enabled, inclusion: { in: [true, false] }
validates :issues_tracker_id, length: { maximum: 255 }, allow_blank: true validates :issues_tracker_id, length: { maximum: 255 }, allow_blank: true
validates :namespace, presence: true validates :namespace, presence: true
......
...@@ -3,12 +3,9 @@ class NoteObserver < BaseObserver ...@@ -3,12 +3,9 @@ class NoteObserver < BaseObserver
notification.new_note(note) notification.new_note(note)
# Skip system notes, like status changes and cross-references. # Skip system notes, like status changes and cross-references.
# Skip wall notes to prevent spamming of dashboard unless note.system
if note.noteable_type.present? && !note.system
event_service.leave_note(note, note.author) event_service.leave_note(note, note.author)
end
unless note.system?
# Create a cross-reference note if this Note contains GFM that names an # Create a cross-reference note if this Note contains GFM that names an
# issue, merge request, or commit. # issue, merge request, or commit.
note.references.each do |mentioned| note.references.each do |mentioned|
......
...@@ -106,7 +106,6 @@ class NotificationService ...@@ -106,7 +106,6 @@ class NotificationService
# TODO: split on methods and refactor # TODO: split on methods and refactor
# #
def new_note(note) def new_note(note)
# ignore wall messages
return true unless note.noteable_type.present? return true unless note.noteable_type.present?
# ignore gitlab service messages # ignore gitlab service messages
......
...@@ -19,7 +19,6 @@ module Projects ...@@ -19,7 +19,6 @@ module Projects
default_opts = { default_opts = {
issues_enabled: default_features.issues, issues_enabled: default_features.issues,
wiki_enabled: default_features.wiki, wiki_enabled: default_features.wiki,
wall_enabled: default_features.wall,
snippets_enabled: default_features.snippets, snippets_enabled: default_features.snippets,
merge_requests_enabled: default_features.merge_requests, merge_requests_enabled: default_features.merge_requests,
visibility_level: default_features.visibility_level visibility_level: default_features.visibility_level
......
...@@ -36,10 +36,6 @@ ...@@ -36,10 +36,6 @@
= nav_link(controller: :wikis) do = nav_link(controller: :wikis) do
= link_to 'Wiki', project_wiki_path(@project, :home) = 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 - if project_nav_tab? :snippets
= nav_link(controller: :snippets) do = nav_link(controller: :snippets) do
= link_to 'Snippets', project_snippets_path(@project) = link_to 'Snippets', project_snippets_path(@project)
......
New message on the project wall <%= @note.project %>
<%= url_for(project_wall_url(@note.project, anchor: "note_#{@note.id}")) %>
<%= @note.author_name %>
<%= @note.note %>
...@@ -73,13 +73,6 @@ ...@@ -73,13 +73,6 @@
= f.check_box :wiki_enabled = f.check_box :wiki_enabled
%span.descr Pages for project documentation %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 .form-group
= f.label :snippets_enabled, "Snippets", class: 'control-label' = f.label :snippets_enabled, "Snippets", class: 'control-label'
.col-sm-10 .col-sm-10
......
%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 ...
&nbsp;
%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
...@@ -73,7 +73,6 @@ production: &base ...@@ -73,7 +73,6 @@ production: &base
issues: true issues: true
merge_requests: true merge_requests: true
wiki: true wiki: true
wall: false
snippets: false snippets: false
visibility_level: "private" # can be "private" | "internal" | "public" visibility_level: "private" # can be "private" | "internal" | "public"
......
...@@ -95,7 +95,6 @@ Settings.gitlab['default_projects_features'] ||= {} ...@@ -95,7 +95,6 @@ Settings.gitlab['default_projects_features'] ||= {}
Settings.gitlab.default_projects_features['issues'] = true if Settings.gitlab.default_projects_features['issues'].nil? Settings.gitlab.default_projects_features['issues'] = true if Settings.gitlab.default_projects_features['issues'].nil?
Settings.gitlab.default_projects_features['merge_requests'] = true if Settings.gitlab.default_projects_features['merge_requests'].nil? Settings.gitlab.default_projects_features['merge_requests'] = true if Settings.gitlab.default_projects_features['merge_requests'].nil?
Settings.gitlab.default_projects_features['wiki'] = true if Settings.gitlab.default_projects_features['wiki'].nil? Settings.gitlab.default_projects_features['wiki'] = true if Settings.gitlab.default_projects_features['wiki'].nil?
Settings.gitlab.default_projects_features['wall'] = false if Settings.gitlab.default_projects_features['wall'].nil?
Settings.gitlab.default_projects_features['snippets'] = false if Settings.gitlab.default_projects_features['snippets'].nil? Settings.gitlab.default_projects_features['snippets'] = false if Settings.gitlab.default_projects_features['snippets'].nil?
Settings.gitlab.default_projects_features['visibility_level'] = Settings.send(:verify_constant, Gitlab::VisibilityLevel, Settings.gitlab.default_projects_features['visibility_level'], Gitlab::VisibilityLevel::PRIVATE) Settings.gitlab.default_projects_features['visibility_level'] = Settings.send(:verify_constant, Gitlab::VisibilityLevel, Settings.gitlab.default_projects_features['visibility_level'], Gitlab::VisibilityLevel::PRIVATE)
Settings.gitlab['repository_downloads_path'] = File.absolute_path(Settings.gitlab['repository_downloads_path'] || 'tmp/repositories', Rails.root) Settings.gitlab['repository_downloads_path'] = File.absolute_path(Settings.gitlab['repository_downloads_path'] || 'tmp/repositories', Rails.root)
......
...@@ -209,12 +209,6 @@ Gitlab::Application.routes.draw do ...@@ -209,12 +209,6 @@ Gitlab::Application.routes.draw do
end end
end end
resource :wall, only: [:show], constraints: {id: /\d+/} do
member do
get 'notes'
end
end
resource :repository, only: [:show] do resource :repository, only: [:show] do
member do member do
get "stats" get "stats"
......
# Notes # Notes
Notes can be wall notes or comments on snippets, issues or merge requests. Notes are comments on snippets, issues or merge requests.
## Wall
### List project wall notes
Get a list of project wall notes.
```
GET /projects/:id/notes
```
Parameters:
+ `id` (required) - The ID of a project
```json
[
{
"id": 522,
"body": "The solution is rather tricky",
"attachment": null,
"author": {
"id": 1,
"username": "john_smith",
"email": "john@example.com",
"name": "John Smith",
"state": "active",
"created_at": "2012-05-23T08:00:58Z"
},
"created_at": "2012-11-27T19:16:44Z"
}
]
```
### Get single wall note
Returns a single wall note.
```
GET /projects/:id/notes/:note_id
```
Parameters:
+ `id` (required) - The ID of a project
+ `note_id` (required) - The ID of a wall note
### Create new wall note
Creates a new wall note.
```
POST /projects/:id/notes
```
Parameters:
+ `id` (required) - The ID of a project
+ `body` (required) - The content of a note
## Issues ## Issues
......
...@@ -30,7 +30,6 @@ GET /projects ...@@ -30,7 +30,6 @@ GET /projects
"path_with_namespace": "diaspora/diaspora-client", "path_with_namespace": "diaspora/diaspora-client",
"issues_enabled": true, "issues_enabled": true,
"merge_requests_enabled": true, "merge_requests_enabled": true,
"wall_enabled": false,
"wiki_enabled": true, "wiki_enabled": true,
"snippets_enabled": false, "snippets_enabled": false,
"created_at": "2013-09-30T13: 46: 02Z", "created_at": "2013-09-30T13: 46: 02Z",
...@@ -66,7 +65,6 @@ GET /projects ...@@ -66,7 +65,6 @@ GET /projects
"path_with_namespace": "brightbox/puppet", "path_with_namespace": "brightbox/puppet",
"issues_enabled": true, "issues_enabled": true,
"merge_requests_enabled": true, "merge_requests_enabled": true,
"wall_enabled": false,
"wiki_enabled": true, "wiki_enabled": true,
"snippets_enabled": false, "snippets_enabled": false,
"created_at": "2013-09-30T13:46:02Z", "created_at": "2013-09-30T13:46:02Z",
...@@ -136,7 +134,6 @@ Parameters: ...@@ -136,7 +134,6 @@ Parameters:
"path_with_namespace": "diaspora/diaspora-project-site", "path_with_namespace": "diaspora/diaspora-project-site",
"issues_enabled": true, "issues_enabled": true,
"merge_requests_enabled": true, "merge_requests_enabled": true,
"wall_enabled": false,
"wiki_enabled": true, "wiki_enabled": true,
"snippets_enabled": false, "snippets_enabled": false,
"created_at": "2013-09-30T13: 46: 02Z", "created_at": "2013-09-30T13: 46: 02Z",
...@@ -252,7 +249,6 @@ Parameters: ...@@ -252,7 +249,6 @@ Parameters:
+ `namespace_id` (optional) - namespace for the new project (defaults to user) + `namespace_id` (optional) - namespace for the new project (defaults to user)
+ `description` (optional) - short project description + `description` (optional) - short project description
+ `issues_enabled` (optional) + `issues_enabled` (optional)
+ `wall_enabled` (optional)
+ `merge_requests_enabled` (optional) + `merge_requests_enabled` (optional)
+ `wiki_enabled` (optional) + `wiki_enabled` (optional)
+ `snippets_enabled` (optional) + `snippets_enabled` (optional)
...@@ -276,7 +272,6 @@ Parameters: ...@@ -276,7 +272,6 @@ Parameters:
+ `description` (optional) - short project description + `description` (optional) - short project description
+ `default_branch` (optional) - 'master' by default + `default_branch` (optional) - 'master' by default
+ `issues_enabled` (optional) + `issues_enabled` (optional)
+ `wall_enabled` (optional)
+ `merge_requests_enabled` (optional) + `merge_requests_enabled` (optional)
+ `wiki_enabled` (optional) + `wiki_enabled` (optional)
+ `snippets_enabled` (optional) + `snippets_enabled` (optional)
......
...@@ -48,7 +48,6 @@ You can use GFM in ...@@ -48,7 +48,6 @@ You can use GFM in
- commit messages - commit messages
- comments - comments
- wall posts
- issues - issues
- merge requests - merge requests
- milestones - milestones
......
...@@ -13,7 +13,6 @@ If a user is a GitLab administrator they receive all permissions. ...@@ -13,7 +13,6 @@ If a user is a GitLab administrator they receive all permissions.
|---------------------------------------|---------|------------|-------------|----------|--------| |---------------------------------------|---------|------------|-------------|----------|--------|
| Create new issue | ✓ | ✓ | ✓ | ✓ | ✓ | | Create new issue | ✓ | ✓ | ✓ | ✓ | ✓ |
| Leave comments | ✓ | ✓ | ✓ | ✓ | ✓ | | Leave comments | ✓ | ✓ | ✓ | ✓ | ✓ |
| Write on project wall | ✓ | ✓ | ✓ | ✓ | ✓ |
| Pull project code | | ✓ | ✓ | ✓ | ✓ | | Pull project code | | ✓ | ✓ | ✓ | ✓ |
| Download project | | ✓ | ✓ | ✓ | ✓ | | Download project | | ✓ | ✓ | ✓ | ✓ |
| Create code snippets | | ✓ | ✓ | ✓ | ✓ | | Create code snippets | | ✓ | ✓ | ✓ | ✓ |
......
...@@ -26,12 +26,6 @@ This is a separate system for documentation, built right into GitLab. ...@@ -26,12 +26,6 @@ This is a separate system for documentation, built right into GitLab.
It is source controlled and is very convenient if you don't want to keep you documentation in your source code, but you do want to keep it in your GitLab project. It is source controlled and is very convenient if you don't want to keep you documentation in your source code, but you do want to keep it in your GitLab project.
## Wall
For simple, project specific conversations, the wall can be used.
It's very lightweight and simple and works well if you're not interested in using issues, but still want to occasionally communicate within a project.
## Snippets ## Snippets
Snippets are little bits of code or text. Snippets are little bits of code or text.
......
...@@ -35,11 +35,6 @@ Feature: Project active tab ...@@ -35,11 +35,6 @@ Feature: Project active tab
Then the active main tab should be Merge Requests Then the active main tab should be Merge Requests
And no other main tabs should be active And no other main tabs should be active
Scenario: On Project Wall
Given I visit my project's wall page
Then the active main tab should be Wall
And no other main tabs should be active
Scenario: On Project Wiki Scenario: On Project Wiki
Given I visit my project's wiki page Given I visit my project's wiki page
Then the active main tab should be Wiki Then the active main tab should be Wiki
......
Feature: Project Wall
In order to use Project Wall
A user should be able to read and write messages
Background:
Given I sign in as a user
And I own project "Shop"
And I visit project "Shop" wall page
@javascript
Scenario: Write comment
Given I write new comment "my special test message"
Then I should see project wall note "my special test message"
Then I visit project "Shop" wall page
And I should see project wall note "my special test message"
class ProjectWall < Spinach::FeatureSteps
include SharedAuthentication
include SharedProject
include SharedNote
include SharedPaths
Given 'I write new comment "my special test message"' do
within(".wall-note-form") do
fill_in "note[note]", with: "my special test message"
click_button "Add Comment"
end
end
Then 'I should see project wall note "my special test message"' do
page.should have_content "my special test message"
end
end
...@@ -204,10 +204,6 @@ module SharedPaths ...@@ -204,10 +204,6 @@ module SharedPaths
visit project_merge_requests_path(@project) visit project_merge_requests_path(@project)
end end
step "I visit my project's wall page" do
visit project_wall_path(@project)
end
step "I visit my project's wiki page" do step "I visit my project's wiki page" do
visit project_wiki_path(@project, :home) visit project_wiki_path(@project, :home)
end end
...@@ -319,10 +315,6 @@ module SharedPaths ...@@ -319,10 +315,6 @@ module SharedPaths
visit project_team_index_path(project) visit project_team_index_path(project)
end end
step 'I visit project "Shop" wall page' do
visit project_wall_path(project)
end
step 'I visit project wiki page' do step 'I visit project wiki page' do
visit project_wiki_path(@project, :home) visit project_wiki_path(@project, :home)
end end
......
...@@ -48,7 +48,7 @@ module API ...@@ -48,7 +48,7 @@ module API
expose :owner, using: Entities::UserBasic, unless: ->(project, options) { project.group } expose :owner, using: Entities::UserBasic, unless: ->(project, options) { project.group }
expose :name, :name_with_namespace expose :name, :name_with_namespace
expose :path, :path_with_namespace expose :path, :path_with_namespace
expose :issues_enabled, :merge_requests_enabled, :wall_enabled, :wiki_enabled, :snippets_enabled, :created_at, :last_activity_at expose :issues_enabled, :merge_requests_enabled, :wiki_enabled, :snippets_enabled, :created_at, :last_activity_at
expose :namespace expose :namespace
expose :forked_from_project, using: Entities::ForkedFromProject, :if => lambda{ | project, options | project.forked? } expose :forked_from_project, using: Entities::ForkedFromProject, :if => lambda{ | project, options | project.forked? }
end end
......
...@@ -6,55 +6,6 @@ module API ...@@ -6,55 +6,6 @@ module API
NOTEABLE_TYPES = [Issue, MergeRequest, Snippet] NOTEABLE_TYPES = [Issue, MergeRequest, Snippet]
resource :projects do resource :projects do
# Get a list of project wall notes
#
# Parameters:
# id (required) - The ID of a project
# Example Request:
# GET /projects/:id/notes
get ":id/notes" do
@notes = user_project.notes.common
# Get recent notes if recent = true
@notes = @notes.order('id DESC') if params[:recent]
present paginate(@notes), with: Entities::Note
end
# Get a single project wall note
#
# Parameters:
# id (required) - The ID of a project
# note_id (required) - The ID of a note
# Example Request:
# GET /projects/:id/notes/:note_id
get ":id/notes/:note_id" do
@note = user_project.notes.common.find(params[:note_id])
present @note, with: Entities::Note
end
# Create a new project wall note
#
# Parameters:
# id (required) - The ID of a project
# body (required) - The content of a note
# Example Request:
# POST /projects/:id/notes
post ":id/notes" do
required_attributes! [:body]
@note = user_project.notes.new(note: params[:body])
@note.author = current_user
if @note.save
present @note, with: Entities::Note
else
# :note is exposed as :body, but :note is set on error
bad_request!(:note) if @note.errors[:note].any?
not_found!
end
end
NOTEABLE_TYPES.each do |noteable_type| NOTEABLE_TYPES.each do |noteable_type|
noteables_str = noteable_type.to_s.underscore.pluralize noteables_str = noteable_type.to_s.underscore.pluralize
noteable_id_str = "#{noteable_type.to_s.underscore}_id" noteable_id_str = "#{noteable_type.to_s.underscore}_id"
......
...@@ -71,7 +71,6 @@ module API ...@@ -71,7 +71,6 @@ module API
# name (required) - name for new project # name (required) - name for new project
# description (optional) - short project description # description (optional) - short project description
# issues_enabled (optional) # issues_enabled (optional)
# wall_enabled (optional)
# merge_requests_enabled (optional) # merge_requests_enabled (optional)
# wiki_enabled (optional) # wiki_enabled (optional)
# snippets_enabled (optional) # snippets_enabled (optional)
...@@ -86,7 +85,6 @@ module API ...@@ -86,7 +85,6 @@ module API
:path, :path,
:description, :description,
:issues_enabled, :issues_enabled,
:wall_enabled,
:merge_requests_enabled, :merge_requests_enabled,
:wiki_enabled, :wiki_enabled,
:snippets_enabled, :snippets_enabled,
...@@ -114,7 +112,6 @@ module API ...@@ -114,7 +112,6 @@ module API
# description (optional) - short project description # description (optional) - short project description
# default_branch (optional) - 'master' by default # default_branch (optional) - 'master' by default
# issues_enabled (optional) # issues_enabled (optional)
# wall_enabled (optional)
# merge_requests_enabled (optional) # merge_requests_enabled (optional)
# wiki_enabled (optional) # wiki_enabled (optional)
# snippets_enabled (optional) # snippets_enabled (optional)
...@@ -129,7 +126,6 @@ module API ...@@ -129,7 +126,6 @@ module API
:description, :description,
:default_branch, :default_branch,
:issues_enabled, :issues_enabled,
:wall_enabled,
:merge_requests_enabled, :merge_requests_enabled,
:wiki_enabled, :wiki_enabled,
:snippets_enabled, :snippets_enabled,
......
...@@ -87,17 +87,6 @@ describe "Internal Project Access", feature: true do ...@@ -87,17 +87,6 @@ describe "Internal Project Access", feature: true do
it { should be_denied_for :visitor } it { should be_denied_for :visitor }
end end
describe "GET /:project_path/wall" do
subject { project_wall_path(project) }
it { should be_allowed_for master }
it { should be_allowed_for reporter }
it { should be_allowed_for :admin }
it { should be_allowed_for guest }
it { should be_allowed_for :user }
it { should be_denied_for :visitor }
end
describe "GET /:project_path/blob" do describe "GET /:project_path/blob" do
before do before do
commit = project.repository.commit commit = project.repository.commit
......
...@@ -87,17 +87,6 @@ describe "Private Project Access", feature: true do ...@@ -87,17 +87,6 @@ describe "Private Project Access", feature: true do
it { should be_denied_for :visitor } it { should be_denied_for :visitor }
end end
describe "GET /:project_path/wall" do
subject { project_wall_path(project) }
it { should be_allowed_for master }
it { should be_allowed_for reporter }
it { should be_allowed_for :admin }
it { should be_denied_for guest }
it { should be_denied_for :user }
it { should be_denied_for :visitor }
end
describe "GET /:project_path/blob" do describe "GET /:project_path/blob" do
before do before do
commit = project.repository.commit commit = project.repository.commit
......
...@@ -92,17 +92,6 @@ describe "Public Project Access", feature: true do ...@@ -92,17 +92,6 @@ describe "Public Project Access", feature: true do
it { should be_denied_for :visitor } it { should be_denied_for :visitor }
end end
describe "GET /:project_path/wall" do
subject { project_wall_path(project) }
it { should be_allowed_for master }
it { should be_allowed_for reporter }
it { should be_allowed_for :admin }
it { should be_allowed_for guest }
it { should be_allowed_for :user }
it { should be_allowed_for :visitor }
end
describe "GET /:project_path/blob" do describe "GET /:project_path/blob" do
before do before do
commit = project.repository.commit commit = project.repository.commit
......
...@@ -410,22 +410,6 @@ describe Notify do ...@@ -410,22 +410,6 @@ describe Notify do
end end
end end
describe 'on a project wall' do
let(:note_on_the_wall_path) { project_wall_path(project, anchor: "note_#{note.id}") }
subject { Notify.note_wall_email(recipient.id, note.id) }
it_behaves_like 'a note email'
it 'has the correct subject' do
should have_subject /#{project.name}/
end
it 'contains a link to the wall note' do
should have_body_text /#{note_on_the_wall_path}/
end
end
describe 'on a commit' do describe 'on a commit' do
let(:commit) { project.repository.commit } let(:commit) { project.repository.commit }
......
...@@ -13,58 +13,8 @@ describe API::API, api: true do ...@@ -13,58 +13,8 @@ describe API::API, api: true do
let!(:issue_note) { create(:note, noteable: issue, project: project, author: user) } let!(:issue_note) { create(:note, noteable: issue, project: project, author: user) }
let!(:merge_request_note) { create(:note, noteable: merge_request, project: project, author: user) } let!(:merge_request_note) { create(:note, noteable: merge_request, project: project, author: user) }
let!(:snippet_note) { create(:note, noteable: snippet, project: project, author: user) } let!(:snippet_note) { create(:note, noteable: snippet, project: project, author: user) }
let!(:wall_note) { create(:note, project: project, author: user) }
before { project.team << [user, :reporter] } before { project.team << [user, :reporter] }
describe "GET /projects/:id/notes" do
context "when unauthenticated" do
it "should return authentication error" do
get api("/projects/#{project.id}/notes")
response.status.should == 401
end
end
context "when authenticated" do
it "should return project wall notes" do
get api("/projects/#{project.id}/notes", user)
response.status.should == 200
json_response.should be_an Array
json_response.first['body'].should == wall_note.note
end
end
end
describe "GET /projects/:id/notes/:note_id" do
it "should return a wall note by id" do
get api("/projects/#{project.id}/notes/#{wall_note.id}", user)
response.status.should == 200
json_response['body'].should == wall_note.note
end
it "should return a 404 error if note not found" do
get api("/projects/#{project.id}/notes/123", user)
response.status.should == 404
end
end
describe "POST /projects/:id/notes" do
it "should create a new wall note" do
post api("/projects/#{project.id}/notes", user), body: 'hi!'
response.status.should == 201
json_response['body'].should == 'hi!'
end
it "should return 401 unauthorized error" do
post api("/projects/#{project.id}/notes")
response.status.should == 401
end
it "should return a 400 bad request if body is missing" do
post api("/projects/#{project.id}/notes", user)
response.status.should == 400
end
end
describe "GET /projects/:id/noteable/:noteable_id/notes" do describe "GET /projects/:id/noteable/:noteable_id/notes" do
context "when noteable is an Issue" do context "when noteable is an Issue" do
it "should return an array of issue notes" do it "should return an array of issue notes" do
......
...@@ -126,7 +126,6 @@ describe API::API, api: true do ...@@ -126,7 +126,6 @@ describe API::API, api: true do
project = attributes_for(:project, { project = attributes_for(:project, {
description: Faker::Lorem.sentence, description: Faker::Lorem.sentence,
issues_enabled: false, issues_enabled: false,
wall_enabled: false,
merge_requests_enabled: false, merge_requests_enabled: false,
wiki_enabled: false wiki_enabled: false
}) })
...@@ -208,7 +207,6 @@ describe API::API, api: true do ...@@ -208,7 +207,6 @@ describe API::API, api: true do
project = attributes_for(:project, { project = attributes_for(:project, {
description: Faker::Lorem.sentence, description: Faker::Lorem.sentence,
issues_enabled: false, issues_enabled: false,
wall_enabled: false,
merge_requests_enabled: false, merge_requests_enabled: false,
wiki_enabled: false wiki_enabled: false
}) })
......
...@@ -56,7 +56,6 @@ end ...@@ -56,7 +56,6 @@ end
# projects POST /projects(.:format) projects#create # projects POST /projects(.:format) projects#create
# new_project GET /projects/new(.:format) projects#new # new_project GET /projects/new(.:format) projects#new
# fork_project POST /:id/fork(.:format) projects#fork # fork_project POST /:id/fork(.:format) projects#fork
# wall_project GET /:id/wall(.:format) projects#wall
# files_project GET /:id/files(.:format) projects#files # files_project GET /:id/files(.:format) projects#files
# edit_project GET /:id/edit(.:format) projects#edit # edit_project GET /:id/edit(.:format) projects#edit
# project GET /:id(.:format) projects#show # project GET /:id(.:format) projects#show
...@@ -75,10 +74,6 @@ describe ProjectsController, "routing" do ...@@ -75,10 +74,6 @@ describe ProjectsController, "routing" do
post("/gitlab/gitlabhq/fork").should route_to('projects#fork', id: 'gitlab/gitlabhq') post("/gitlab/gitlabhq/fork").should route_to('projects#fork', id: 'gitlab/gitlabhq')
end end
it "to #wall" do
get("/gitlab/gitlabhq/wall").should route_to('projects/walls#show', project_id: 'gitlab/gitlabhq')
end
it "to #edit" do it "to #edit" do
get("/gitlab/gitlabhq/edit").should route_to('projects#edit', id: 'gitlab/gitlabhq') get("/gitlab/gitlabhq/edit").should route_to('projects#edit', id: 'gitlab/gitlabhq')
end end
......
...@@ -65,7 +65,6 @@ describe Projects::CreateService do ...@@ -65,7 +65,6 @@ describe Projects::CreateService do
@settings.stub(:issues) { true } @settings.stub(:issues) { true }
@settings.stub(:merge_requests) { true } @settings.stub(:merge_requests) { true }
@settings.stub(:wiki) { true } @settings.stub(:wiki) { true }
@settings.stub(:wall) { true }
@settings.stub(:snippets) { true } @settings.stub(:snippets) { true }
stub_const("Settings", Class.new) stub_const("Settings", Class.new)
@restrictions = double("restrictions") @restrictions = double("restrictions")
...@@ -108,7 +107,6 @@ describe Projects::CreateService do ...@@ -108,7 +107,6 @@ describe Projects::CreateService do
@settings.stub(:issues) { true } @settings.stub(:issues) { true }
@settings.stub(:merge_requests) { true } @settings.stub(:merge_requests) { true }
@settings.stub(:wiki) { true } @settings.stub(:wiki) { true }
@settings.stub(:wall) { true }
@settings.stub(:snippets) { true } @settings.stub(:snippets) { true }
@settings.stub(:visibility_level) { Gitlab::VisibilityLevel::PRIVATE } @settings.stub(:visibility_level) { Gitlab::VisibilityLevel::PRIVATE }
stub_const("Settings", Class.new) stub_const("Settings", Class.new)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment