summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConnor Shea <connor.james.shea@gmail.com>2016-08-15 11:25:28 -0600
committerConnor Shea <connor.james.shea@gmail.com>2016-08-15 11:25:28 -0600
commit32e31d626f743c22b5ed21c50555f4670d5290f9 (patch)
tree55d990b6c8712aaa3fa68d08a32e666a990e0326
parent1595047777ea035d2b8bddbd3a07a1bc68b58c55 (diff)
downloadgitlab-ce-32e31d626f743c22b5ed21c50555f4670d5290f9.tar.gz
Resolve feedback.
-rw-r--r--app/assets/javascripts/diff_notes/components/jump_to_discussion.js.es611
-rw-r--r--app/views/discussions/_jump_to_next.html.haml4
-rw-r--r--db/schema.rb10
3 files changed, 16 insertions, 9 deletions
diff --git a/app/assets/javascripts/diff_notes/components/jump_to_discussion.js.es6 b/app/assets/javascripts/diff_notes/components/jump_to_discussion.js.es6
index 43ab521728f..1c7a0bad68c 100644
--- a/app/assets/javascripts/diff_notes/components/jump_to_discussion.js.es6
+++ b/app/assets/javascripts/diff_notes/components/jump_to_discussion.js.es6
@@ -149,6 +149,11 @@
if (activeTab === 'notes') {
$target = $target.closest('.note-discussion');
+
+ // If the next discussion is closed, toggle it open.
+ if ($target.find('.js-toggle-content').is(':hidden')) {
+ $target.find('.js-toggle-button i').trigger('click')
+ }
} else if (activeTab === 'diffs') {
// Resolved discussions are hidden in the diffs tab by default.
// If they are marked unresolved on the notes tab, they will still be hidden on the diffs tab.
@@ -176,12 +181,6 @@
$.scrollTo($target, {
offset: -($('.navbar-gitlab').outerHeight() + $('.layout-nav').outerHeight())
});
-
- // If the next discussion is closed, toggle it open.
- if ($target.find(".js-toggle-content").attr('style') == "display: none;") {
- $target.find('.js-toggle-button i').toggleClass('fa fa-chevron-down').toggleClass('fa fa-chevron-up');
- $target.find(".js-toggle-content").toggle();
- }
}
}
});
diff --git a/app/views/discussions/_jump_to_next.html.haml b/app/views/discussions/_jump_to_next.html.haml
index f5574ef7399..69bd416c4de 100644
--- a/app/views/discussions/_jump_to_next.html.haml
+++ b/app/views/discussions/_jump_to_next.html.haml
@@ -1,9 +1,7 @@
- discussion = local_assigns.fetch(:discussion, nil)
- if current_user
%jump-to-discussion{ "inline-template" => true, ":discussion-id" => "'#{discussion.try(:id)}'" }
- .btn-group{ role: "group",
- "v-show" => "!allResolved",
- "v-if" => "showButton" }
+ .btn-group{ role: "group", "v-show" => "!allResolved", "v-if" => "showButton" }
%button.btn.btn-default.discussion-next-btn.has-tooltip{ "@click" => "jumpToNextUnresolvedDiscussion",
title: "Jump to next unresolved discussion",
"aria-label" => "Jump to next unresolved discussion",
diff --git a/db/schema.rb b/db/schema.rb
index 26321f8a8a2..2f8a5bb0630 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -652,6 +652,16 @@ ActiveRecord::Schema.define(version: 20160810142633) do
add_index "namespaces", ["path"], name: "index_namespaces_on_path_trigram", using: :gin, opclasses: {"path"=>"gin_trgm_ops"}
add_index "namespaces", ["type"], name: "index_namespaces_on_type", using: :btree
+ create_table "note_templates", force: :cascade do |t|
+ t.integer "user_id"
+ t.string "title"
+ t.text "note"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ end
+
+ add_index "note_templates", ["user_id"], name: "index_note_templates_on_user_id", using: :btree
+
create_table "notes", force: :cascade do |t|
t.text "note"
t.string "noteable_type"