Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-04-01 00:52:38 +0300
committerLuke "Jared" Bennett <lbennett@gitlab.com>2017-04-05 19:44:14 +0300
commitafa53810deab37c95da245510a7cf85e8846a162 (patch)
tree1e6a4e64584e64fabb8e7ea21a7e9e13624ea018 /app
parent21e10888c3fc0fe545c0443cf0e23f593df847a4 (diff)
Fix specs
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/notes.js7
-rw-r--r--app/finders/notes_finder.rb4
-rw-r--r--app/views/notify/_note_email.html.haml2
-rw-r--r--app/views/notify/_note_email.text.erb2
4 files changed, 8 insertions, 7 deletions
diff --git a/app/assets/javascripts/notes.js b/app/assets/javascripts/notes.js
index edfcda7c214..63a5d25a1dc 100644
--- a/app/assets/javascripts/notes.js
+++ b/app/assets/javascripts/notes.js
@@ -769,6 +769,10 @@ require('./task_list');
form.find('.js-note-new-discussion').remove();
this.setupNoteForm(form);
+ form
+ .removeClass('js-main-target-form')
+ .addClass("discussion-form js-discussion-note-form");
+
if (typeof gl.diffNotesCompileComponents !== 'undefined') {
var $commentBtn = form.find('comment-and-resolve-btn');
$commentBtn.attr(':discussion-id', "'" + discussionID + "'");
@@ -780,9 +784,6 @@ require('./task_list');
form
.find('.js-comment-resolve-button')
.attr('data-discussion-id', discussionID);
- form
- .removeClass('js-main-target-form')
- .addClass("discussion-form js-discussion-note-form");
};
/*
diff --git a/app/finders/notes_finder.rb b/app/finders/notes_finder.rb
index c20bfb20171..3c499184b41 100644
--- a/app/finders/notes_finder.rb
+++ b/app/finders/notes_finder.rb
@@ -98,9 +98,9 @@ class NotesFinder
#
# This method uses ILIKE on PostgreSQL and LIKE on MySQL.
#
- def search(query, notes)
+ def search(notes)
query = @params[:search]
- return unless query
+ return notes unless query
pattern = "%#{query}%"
notes.where(Note.arel_table[:note].matches(pattern))
diff --git a/app/views/notify/_note_email.html.haml b/app/views/notify/_note_email.html.haml
index 9e5aaed6f49..a80518f7986 100644
--- a/app/views/notify/_note_email.html.haml
+++ b/app/views/notify/_note_email.html.haml
@@ -1,4 +1,4 @@
-- discussion = @note.discussion unless @discussion.individual_note?
+- discussion = @note.discussion if @note.part_of_discussion?
- if discussion
%p.details
= succeed ':' do
diff --git a/app/views/notify/_note_email.text.erb b/app/views/notify/_note_email.text.erb
index b25b513f4d8..cb2e7fab6d5 100644
--- a/app/views/notify/_note_email.text.erb
+++ b/app/views/notify/_note_email.text.erb
@@ -1,4 +1,4 @@
-<% discussion = @note.discussion unless @discussion.individual_note? -%>
+<% discussion = @note.discussion if @note.part_of_discussion? -%>
<% if discussion && !discussion.individual_note? -%>
<%= @note.author_name -%>
<% if discussion.new_discussion? -%>