BigW Consortium Gitlab

Commit 99ba5d0d by Douwe Maan

Remove view=full_data from NotesController

parent 3ef93db5
...@@ -110,7 +110,6 @@ ...@@ -110,7 +110,6 @@
endpoint: this.endpoint, endpoint: this.endpoint,
flashContainer: this.$el, flashContainer: this.$el,
data: { data: {
view: 'full_data',
note: { note: {
noteable_type: constants.NOTEABLE_TYPE, noteable_type: constants.NOTEABLE_TYPE,
noteable_id: this.getIssueData.id, noteable_id: this.getIssueData.id,
......
...@@ -100,7 +100,6 @@ ...@@ -100,7 +100,6 @@
target_type: 'issue', target_type: 'issue',
target_id: this.discussion.noteable_id, target_id: this.discussion.noteable_id,
note: { note: noteText }, note: { note: noteText },
view: 'full_data',
}, },
}; };
......
...@@ -77,7 +77,6 @@ ...@@ -77,7 +77,6 @@
const data = { const data = {
endpoint: this.note.path, endpoint: this.note.path,
note: { note: {
view: 'full_data',
target_type: 'issue', target_type: 'issue',
target_id: this.note.noteable_id, target_id: this.note.noteable_id,
note: { note: noteText }, note: { note: noteText },
......
...@@ -18,8 +18,7 @@ module NotesActions ...@@ -18,8 +18,7 @@ module NotesActions
@notes = prepare_notes_for_rendering(@notes) @notes = prepare_notes_for_rendering(@notes)
notes_json[:notes] = notes_json[:notes] =
case params[:view] if noteable.is_a?(Issue)
when 'full_data'
note_serializer.represent(@notes) note_serializer.represent(@notes)
else else
@notes.map { |note| note_json(note) } @notes.map { |note| note_json(note) }
...@@ -88,8 +87,7 @@ module NotesActions ...@@ -88,8 +87,7 @@ module NotesActions
if note.persisted? if note.persisted?
attrs[:valid] = true attrs[:valid] = true
case params[:view] if noteable.is_a?(Issue)
when 'full_data'
attrs.merge!(note_serializer.represent(note)) attrs.merge!(note_serializer.represent(note))
else else
attrs.merge!( attrs.merge!(
...@@ -179,8 +177,6 @@ module NotesActions ...@@ -179,8 +177,6 @@ module NotesActions
end end
def set_polling_interval_header def set_polling_interval_header
return unless noteable.is_a?(Issue)
Gitlab::PollingInterval.set_header(response, interval: 6_000) Gitlab::PollingInterval.set_header(response, interval: 6_000)
end end
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
new_session_path: new_session_path(:user, redirect_to_referer: 'yes'), new_session_path: new_session_path(:user, redirect_to_referer: 'yes'),
markdown_docs: help_page_path('user/markdown'), markdown_docs: help_page_path('user/markdown'),
quick_actions_docs: help_page_path('user/project/quick_actions'), quick_actions_docs: help_page_path('user/project/quick_actions'),
notes_path: notes_url(view: 'full_data'), notes_path: notes_url,
last_fetched_at: Time.now.to_i, last_fetched_at: Time.now.to_i,
issue_data: serialize_issuable(@issue), issue_data: serialize_issuable(@issue),
current_user_data: UserSerializer.new.represent(current_user).to_json } } current_user_data: UserSerializer.new.represent(current_user).to_json } }
......
...@@ -205,14 +205,6 @@ describe NotesHelper do ...@@ -205,14 +205,6 @@ describe NotesHelper do
expect(helper.notes_url).to eq("/nm/test/noteable/issue/#{@noteable.id}/notes") expect(helper.notes_url).to eq("/nm/test/noteable/issue/#{@noteable.id}/notes")
end end
it 'adds extra params' do
namespace = create(:namespace, path: 'nm')
@project = create(:project, path: 'test', namespace: namespace)
@noteable = create(:issue, project: @project)
expect(helper.notes_url(view: 'full_data')).to eq("/nm/test/noteable/issue/#{@noteable.id}/notes?view=full_data")
end
end end
describe '#note_url' do describe '#note_url' do
......
...@@ -4,7 +4,7 @@ export const notesDataMock = { ...@@ -4,7 +4,7 @@ export const notesDataMock = {
lastFetchedAt: '1501862675', lastFetchedAt: '1501862675',
markdownDocs: '/help/user/markdown', markdownDocs: '/help/user/markdown',
newSessionPath: '/users/sign_in?redirect_to_referer=yes', newSessionPath: '/users/sign_in?redirect_to_referer=yes',
notesPath: '/gitlab-org/gitlab-ce/noteable/issue/98/notes?view=full_data', notesPath: '/gitlab-org/gitlab-ce/noteable/issue/98/notes',
quickActionsDocs: '/help/user/project/quick_actions', quickActionsDocs: '/help/user/project/quick_actions',
registerPath: '/users/sign_in?redirect_to_referer=yes#register-pane', registerPath: '/users/sign_in?redirect_to_referer=yes#register-pane',
}; };
...@@ -446,4 +446,4 @@ export const discussionNoteServerResponse = [{ ...@@ -446,4 +446,4 @@ export const discussionNoteServerResponse = [{
"path": "/gitlab-org/gitlab-ce/notes/1471" "path": "/gitlab-org/gitlab-ce/notes/1471"
}], }],
"individual_note": false "individual_note": false
}]; }];
\ No newline at end of file
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