diff --git a/CHANGELOG b/CHANGELOG index 2e4736a0803a349d6aeada77c0e6c7484e3e8fd7..a1e9c80e1ef06430229a1a17a896bd51246e8c39 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -33,6 +33,7 @@ v 7.0.0 - 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 diff --git a/app/assets/javascripts/dispatcher.js.coffee b/app/assets/javascripts/dispatcher.js.coffee index 6518c380bdcc034c90a9c4b744a17d45cfaa3796..ff68b520ad6eaba5243d249b65f164038e16f660 100644 --- a/app/assets/javascripts/dispatcher.js.coffee +++ b/app/assets/javascripts/dispatcher.js.coffee @@ -34,8 +34,6 @@ class Dispatcher 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' diff --git a/app/assets/javascripts/wall.js.coffee b/app/assets/javascripts/wall.js.coffee deleted file mode 100644 index 4cc11331acaebf58a1bef6d41f075b971fa5a452..0000000000000000000000000000000000000000 --- a/app/assets/javascripts/wall.js.coffee +++ /dev/null @@ -1,85 +0,0 @@ -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 diff --git a/app/assets/stylesheets/sections/wall.scss b/app/assets/stylesheets/sections/wall.scss deleted file mode 100644 index 3705afdb87cc1e62531df6b8ecd37f327ecc87de..0000000000000000000000000000000000000000 --- a/app/assets/stylesheets/sections/wall.scss +++ /dev/null @@ -1,55 +0,0 @@ -.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; - } - } -} diff --git a/app/controllers/projects/walls_controller.rb b/app/controllers/projects/walls_controller.rb deleted file mode 100644 index 834215a1473cfcaff0befd91420de37c0b3f9d3c..0000000000000000000000000000000000000000 --- a/app/controllers/projects/walls_controller.rb +++ /dev/null @@ -1,20 +0,0 @@ -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 - diff --git a/app/helpers/events_helper.rb b/app/helpers/events_helper.rb index 929f9a9c38177d37e23e11da77dbdcd3956f3f7e..d3904e16c110b373f42e73112b295c641176aac9 100644 --- a/app/helpers/events_helper.rb +++ b/app/helpers/events_helper.rb @@ -109,8 +109,6 @@ module EventsHelper "#{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)" diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index ef0460f87284a7f5e4f41ffb59b40c3ee1a67b70..ba4c7068e9077e91bf71831f1bad781943214fdc 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -139,7 +139,7 @@ module ProjectsHelper 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 diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb index a4471507da888fadfc1f4a144941914789279699..ecd8d3994d0238c358dc075ffe94cb7c56685381 100644 --- a/app/helpers/search_helper.rb +++ b/app/helpers/search_helper.rb @@ -61,7 +61,6 @@ module SearchHelper { 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 diff --git a/app/mailers/emails/notes.rb b/app/mailers/emails/notes.rb index 7848d34ab2b52c0dc9a8c8300b65e587c116c531..acc6d03b5e4f1c42c3b15796a3672b7d98fbb88a 100644 --- a/app/mailers/emails/notes.rb +++ b/app/mailers/emails/notes.rb @@ -32,14 +32,5 @@ module Emails 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 diff --git a/app/models/event.rb b/app/models/event.rb index cf88e9f4afcae8752e3a3335d00f0efc55e2f26d..b88635ccb59fa2e96de1fc8ceb4d5722a902ab79 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -286,10 +286,6 @@ class Event < ActiveRecord::Base 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 diff --git a/app/models/note.rb b/app/models/note.rb index dc8b968c3d224432e1b76f60e1fcccdcfe93be8f..659cd75207198d56ae0bda1679ecbb0f75420a81 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -251,10 +251,6 @@ class Note < ActiveRecord::Base 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 @@ class Note < ActiveRecord::Base def noteable_type_name if noteable_type.present? noteable_type.downcase - else - "wall" end end diff --git a/app/models/project.rb b/app/models/project.rb index f92cc40642ae73c3c2f79c1d158895ab87f5bad8..e251c777d89be8ce6df36b399f07ec82d58ed9f0 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -31,7 +31,6 @@ class Project < ActiveRecord::Base 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 @@ class Project < ActiveRecord::Base 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 @@ class Project < ActiveRecord::Base 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 diff --git a/app/observers/note_observer.rb b/app/observers/note_observer.rb index 9bb1f0f7b98f56ddcb5033bf515302092bc18db9..bb0b0876eca2e9cc17e5542b477dea378f5eb62a 100644 --- a/app/observers/note_observer.rb +++ b/app/observers/note_observer.rb @@ -3,12 +3,9 @@ class NoteObserver < BaseObserver 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) - end - 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| diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb index 3547552df8e071ab532ff17e4e8ec695d82aa938..650b6008db82c8834a5b8a261033492154b6c375 100644 --- a/app/services/notification_service.rb +++ b/app/services/notification_service.rb @@ -106,7 +106,6 @@ class NotificationService # TODO: split on methods and refactor # def new_note(note) - # ignore wall messages return true unless note.noteable_type.present? # ignore gitlab service messages diff --git a/app/services/projects/create_service.rb b/app/services/projects/create_service.rb index 7d322f25e44ee5808ece1e16c16d75f7bad225f7..3d2b9bf48753b096f3a78f87b62103b41bfa6d5e 100644 --- a/app/services/projects/create_service.rb +++ b/app/services/projects/create_service.rb @@ -19,7 +19,6 @@ module Projects 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 diff --git a/app/views/layouts/nav/_project.html.haml b/app/views/layouts/nav/_project.html.haml index d7d330e2a616ef20ee5105068bb6fc98adc52432..dd48ff6ce384516f042b0095b48b7c14495ebf68 100644 --- a/app/views/layouts/nav/_project.html.haml +++ b/app/views/layouts/nav/_project.html.haml @@ -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) diff --git a/app/views/notify/note_wall_email.html.haml b/app/views/notify/note_wall_email.html.haml deleted file mode 100644 index 2fa2f7846611da52652a8307e29b3992409f1606..0000000000000000000000000000000000000000 --- a/app/views/notify/note_wall_email.html.haml +++ /dev/null @@ -1 +0,0 @@ -= render 'note_message' diff --git a/app/views/notify/note_wall_email.text.erb b/app/views/notify/note_wall_email.text.erb deleted file mode 100644 index ee0dc3db1dbb54e194febce8762477e8447a7210..0000000000000000000000000000000000000000 --- a/app/views/notify/note_wall_email.text.erb +++ /dev/null @@ -1,9 +0,0 @@ -New message on the project wall <%= @note.project %> - -<%= url_for(project_wall_url(@note.project, anchor: "note_#{@note.id}")) %> - - -<%= @note.author_name %> - -<%= @note.note %> - diff --git a/app/views/projects/edit.html.haml b/app/views/projects/edit.html.haml index 59dcf3a6ff05d59b5157f2d82d2db101d525a16f..adc7316820de23fe15aea354edae5fa931383090 100644 --- a/app/views/projects/edit.html.haml +++ b/app/views/projects/edit.html.haml @@ -73,13 +73,6 @@ = f.check_box :wiki_enabled %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 diff --git a/app/views/projects/walls/show.html.haml b/app/views/projects/walls/show.html.haml deleted file mode 100644 index 3e3c7c4f8dd14949824f1155da4a4ec34655835d..0000000000000000000000000000000000000000 --- a/app/views/projects/walls/show.html.haml +++ /dev/null @@ -1,23 +0,0 @@ -%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 diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index 6f33256a2b152d21f2c89af482390dd70e40d6a4..50a1a78b504d4022fec988156808f5bf63920d13 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -73,7 +73,6 @@ production: &base issues: true merge_requests: true wiki: true - wall: false snippets: false visibility_level: "private" # can be "private" | "internal" | "public" diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 18c628223a4edd5004fe2eacd46d1870845f976d..de7c0990c093ab6ecadd954f5ee3661699e77257 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -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['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['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['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) diff --git a/config/routes.rb b/config/routes.rb index 34ee8d2d798f8d4b6e7d2253a0e88d32b388bc78..746e532a0ecb8343b256ebef3e140d1c4a25c4e3 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -209,12 +209,6 @@ Gitlab::Application.routes.draw do end end - resource :wall, only: [:show], constraints: {id: /\d+/} do - member do - get 'notes' - end - end - resource :repository, only: [:show] do member do get "stats" diff --git a/doc/api/notes.md b/doc/api/notes.md index 6d140643fcbc6b00ff840320692420ec2e2aa742..e7f19965a30bdf9d6243dea1a1a4458543e76c1a 100644 --- a/doc/api/notes.md +++ b/doc/api/notes.md @@ -1,67 +1,6 @@ # Notes -Notes can be wall notes or 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 - +Notes are comments on snippets, issues or merge requests. ## Issues diff --git a/doc/api/projects.md b/doc/api/projects.md index ae2b8365e80fc771540d954d4c20c06bb73ac712..d32af678fcc82643cf2134bdcc6c24f9f4147c54 100644 --- a/doc/api/projects.md +++ b/doc/api/projects.md @@ -30,7 +30,6 @@ GET /projects "path_with_namespace": "diaspora/diaspora-client", "issues_enabled": true, "merge_requests_enabled": true, - "wall_enabled": false, "wiki_enabled": true, "snippets_enabled": false, "created_at": "2013-09-30T13: 46: 02Z", @@ -66,7 +65,6 @@ GET /projects "path_with_namespace": "brightbox/puppet", "issues_enabled": true, "merge_requests_enabled": true, - "wall_enabled": false, "wiki_enabled": true, "snippets_enabled": false, "created_at": "2013-09-30T13:46:02Z", @@ -136,7 +134,6 @@ Parameters: "path_with_namespace": "diaspora/diaspora-project-site", "issues_enabled": true, "merge_requests_enabled": true, - "wall_enabled": false, "wiki_enabled": true, "snippets_enabled": false, "created_at": "2013-09-30T13: 46: 02Z", @@ -252,7 +249,6 @@ Parameters: + `namespace_id` (optional) - namespace for the new project (defaults to user) + `description` (optional) - short project description + `issues_enabled` (optional) -+ `wall_enabled` (optional) + `merge_requests_enabled` (optional) + `wiki_enabled` (optional) + `snippets_enabled` (optional) @@ -276,7 +272,6 @@ Parameters: + `description` (optional) - short project description + `default_branch` (optional) - 'master' by default + `issues_enabled` (optional) -+ `wall_enabled` (optional) + `merge_requests_enabled` (optional) + `wiki_enabled` (optional) + `snippets_enabled` (optional) diff --git a/doc/markdown/markdown.md b/doc/markdown/markdown.md index 0d0a08d50d64bc0c1f1508e1379e3c19c13e4695..64f571b43516c83b412f094e1cdacf194e227f01 100644 --- a/doc/markdown/markdown.md +++ b/doc/markdown/markdown.md @@ -48,7 +48,6 @@ You can use GFM in - commit messages - comments -- wall posts - issues - merge requests - milestones diff --git a/doc/permissions/permissions.md b/doc/permissions/permissions.md index 9ddf56d046e5773dc7b556202dc46b6852c7e6e5..e01b02212b69bd8111e14bb9151a4b0d2457e8e6 100644 --- a/doc/permissions/permissions.md +++ b/doc/permissions/permissions.md @@ -13,7 +13,6 @@ If a user is a GitLab administrator they receive all permissions. |---------------------------------------|---------|------------|-------------|----------|--------| | Create new issue | ✓ | ✓ | ✓ | ✓ | ✓ | | Leave comments | ✓ | ✓ | ✓ | ✓ | ✓ | -| Write on project wall | ✓ | ✓ | ✓ | ✓ | ✓ | | Pull project code | | ✓ | ✓ | ✓ | ✓ | | Download project | | ✓ | ✓ | ✓ | ✓ | | Create code snippets | | ✓ | ✓ | ✓ | ✓ | diff --git a/doc/workflow/project_features.md b/doc/workflow/project_features.md index 6ed9c1127a2f89c675a9b63dd33401c678162a5a..48e86ee3ef58e1734a33b4acb42fe62631d43e0a 100644 --- a/doc/workflow/project_features.md +++ b/doc/workflow/project_features.md @@ -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. -## 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 are little bits of code or text. diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 6bad6c74bca4c45e3458d0fe44f9b82ecec1a87c..f15fe185ae0a30e60faf916d4388382ac759af0e 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -48,7 +48,7 @@ module API expose :owner, using: Entities::UserBasic, unless: ->(project, options) { project.group } expose :name, :name_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 :forked_from_project, using: Entities::ForkedFromProject, :if => lambda{ | project, options | project.forked? } end diff --git a/lib/api/notes.rb b/lib/api/notes.rb index cb2bc764476274fef42561b9e67501ae7aa1a732..413faf0cf2de35ed33f266a4aefeab56bf4f69fe 100644 --- a/lib/api/notes.rb +++ b/lib/api/notes.rb @@ -6,55 +6,6 @@ module API NOTEABLE_TYPES = [Issue, MergeRequest, Snippet] 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| noteables_str = noteable_type.to_s.underscore.pluralize noteable_id_str = "#{noteable_type.to_s.underscore}_id" diff --git a/lib/api/projects.rb b/lib/api/projects.rb index 9d290c75ba950be49e93134aec54d84d186ecd79..9a7f22b536f15033fda83cad822c3f8675b06ff0 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -71,7 +71,6 @@ module API # name (required) - name for new project # description (optional) - short project description # issues_enabled (optional) - # wall_enabled (optional) # merge_requests_enabled (optional) # wiki_enabled (optional) # snippets_enabled (optional) @@ -86,7 +85,6 @@ module API :path, :description, :issues_enabled, - :wall_enabled, :merge_requests_enabled, :wiki_enabled, :snippets_enabled, @@ -114,7 +112,6 @@ module API # description (optional) - short project description # default_branch (optional) - 'master' by default # issues_enabled (optional) - # wall_enabled (optional) # merge_requests_enabled (optional) # wiki_enabled (optional) # snippets_enabled (optional) @@ -129,7 +126,6 @@ module API :description, :default_branch, :issues_enabled, - :wall_enabled, :merge_requests_enabled, :wiki_enabled, :snippets_enabled,