diff options
author | George Tsiolis <tsiolis.g@gmail.com> | 2019-04-02 20:10:49 +0300 |
---|---|---|
committer | George Tsiolis <tsiolis.g@gmail.com> | 2019-04-12 00:14:23 +0300 |
commit | e68f94cda77d4039a15c74dd94a528966cef0557 (patch) | |
tree | cfb93e5e836aa4dfc38bd486e07b64822b1a54fc | |
parent | e605d8c95d39cb361d69b4a122f9e34bc7d2677d (diff) | |
download | gitlab-ce-e68f94cda77d4039a15c74dd94a528966cef0557.tar.gz |
Rename selector for framework notes
10 files changed, 21 insertions, 21 deletions
diff --git a/app/assets/javascripts/diffs/components/inline_diff_comment_row.vue b/app/assets/javascripts/diffs/components/inline_diff_comment_row.vue index 69146f1f6fd..1faa0493e79 100644 --- a/app/assets/javascripts/diffs/components/inline_diff_comment_row.vue +++ b/app/assets/javascripts/diffs/components/inline_diff_comment_row.vue @@ -41,7 +41,7 @@ export default { <template> <tr v-if="shouldRender" :class="className" class="notes_holder"> - <td class="notes_content" colspan="3"> + <td class="notes-content" colspan="3"> <div class="content"> <diff-discussions v-if="line.discussions.length" diff --git a/app/assets/javascripts/diffs/components/parallel_diff_comment_row.vue b/app/assets/javascripts/diffs/components/parallel_diff_comment_row.vue index 370cb6e339a..d2e54edca85 100644 --- a/app/assets/javascripts/diffs/components/parallel_diff_comment_row.vue +++ b/app/assets/javascripts/diffs/components/parallel_diff_comment_row.vue @@ -87,7 +87,7 @@ export default { <template> <tr v-if="shouldRender" :class="className" class="notes_holder"> - <td class="notes_content parallel old" colspan="2"> + <td class="notes-content parallel old" colspan="2"> <div v-if="shouldRenderDiscussionsOnLeft" class="content"> <diff-discussions v-if="line.left.discussions.length" @@ -105,7 +105,7 @@ export default { line-position="left" /> </td> - <td class="notes_content parallel new" colspan="2"> + <td class="notes-content parallel new" colspan="2"> <div v-if="shouldRenderDiscussionsOnRight" class="content"> <diff-discussions v-if="line.right.discussions.length" diff --git a/app/assets/javascripts/merge_request_tabs.js b/app/assets/javascripts/merge_request_tabs.js index 2f15da42271..509f19e6f00 100644 --- a/app/assets/javascripts/merge_request_tabs.js +++ b/app/assets/javascripts/merge_request_tabs.js @@ -398,7 +398,7 @@ export default class MergeRequestTabs { const hash = getLocationHash(); const anchor = hash && $container.find(`.note[id="${hash}"]`); if (anchor && anchor.length > 0) { - const notesContent = anchor.closest('.notes_content'); + const notesContent = anchor.closest('.notes-content'); const lineType = notesContent.hasClass('new') ? 'new' : 'old'; Notes.instance.toggleDiffNote({ target: anchor, diff --git a/app/assets/javascripts/notes.js b/app/assets/javascripts/notes.js index 94d2e2b53e9..36725e22365 100644 --- a/app/assets/javascripts/notes.js +++ b/app/assets/javascripts/notes.js @@ -506,7 +506,7 @@ export default class Notes { var contentContainerClass = '.' + $notes - .closest('.notes_content') + .closest('.notes-content') .attr('class') .split(' ') .join('.'); @@ -1069,14 +1069,14 @@ export default class Notes { addForm = false; let lineTypeSelector = ''; rowCssToAdd = - '<tr class="notes_holder js-temp-notes-holder"><td class="notes_content" colspan="3"><div class="content"></div></td></tr>'; + '<tr class="notes_holder js-temp-notes-holder"><td class="notes-content" colspan="3"><div class="content"></div></td></tr>'; // In parallel view, look inside the correct left/right pane if (this.isParallelView()) { lineTypeSelector = `.${lineType}`; rowCssToAdd = - '<tr class="notes_holder js-temp-notes-holder"><td class="notes_line old"></td><td class="notes_content parallel old"><div class="content"></div></td><td class="notes_line new"></td><td class="notes_content parallel new"><div class="content"></div></td></tr>'; + '<tr class="notes_holder js-temp-notes-holder"><td class="notes_line old"></td><td class="notes-content parallel old"><div class="content"></div></td><td class="notes_line new"></td><td class="notes-content parallel new"><div class="content"></div></td></tr>'; } - const notesContentSelector = `.notes_content${lineTypeSelector} .content`; + const notesContentSelector = `.notes-content${lineTypeSelector} .content`; let notesContent = targetRow.find(notesContentSelector); if (hasNotes && showReplyInput) { diff --git a/app/assets/javascripts/notes/components/diff_with_note.vue b/app/assets/javascripts/notes/components/diff_with_note.vue index ab758a9e922..b95835ed10a 100644 --- a/app/assets/javascripts/notes/components/diff_with_note.vue +++ b/app/assets/javascripts/notes/components/diff_with_note.vue @@ -105,7 +105,7 @@ export default { </td> </tr> <tr class="notes_holder"> - <td class="notes_content" colspan="3"><slot></slot></td> + <td class="notes-content" colspan="3"><slot></slot></td> </tr> </table> </div> diff --git a/app/assets/stylesheets/framework/notes.scss b/app/assets/stylesheets/framework/notes.scss index d349e3fad9c..85ddf11d6fe 100644 --- a/app/assets/stylesheets/framework/notes.scss +++ b/app/assets/stylesheets/framework/notes.scss @@ -4,7 +4,7 @@ } // Diff is side by side - .notes_content.parallel & { + .notes-content.parallel & { // We hide at double what we normally hide at because // there are two columns of notes @media (#{$condition}-width: (2 * $breakpoint-width)) { diff --git a/app/assets/stylesheets/pages/notes.scss b/app/assets/stylesheets/pages/notes.scss index fd07415a52f..09f75cd827f 100644 --- a/app/assets/stylesheets/pages/notes.scss +++ b/app/assets/stylesheets/pages/notes.scss @@ -68,7 +68,7 @@ $note-form-margin-left: 72px; } } - .notes_content { + .notes-content { border: 0; border-top: 1px solid $border-color; } @@ -453,7 +453,7 @@ $note-form-margin-left: 72px; // Merge request notes in diffs // Diff is inline - .notes_content .note-header .note-headline-light { + .notes-content .note-header .note-headline-light { display: inline-block; position: relative; } @@ -465,7 +465,7 @@ $note-form-margin-left: 72px; border: 1px solid $border-color; border-left: 0; - &.notes_content { + &.notes-content { border-width: 1px 0; padding: 0; vertical-align: top; @@ -512,7 +512,7 @@ $note-form-margin-left: 72px; } .commit-diff { - .notes_content { + .notes-content { background-color: $white-light; } } diff --git a/app/views/discussions/_diff_discussion.html.haml b/app/views/discussions/_diff_discussion.html.haml index 6b8dd156874..5a47040874f 100644 --- a/app/views/discussions/_diff_discussion.html.haml +++ b/app/views/discussions/_diff_discussion.html.haml @@ -4,6 +4,6 @@ -# Text diff discussions - expanded = local_assigns.fetch(:expanded, true) %tr.notes_holder{ class: ('hide' unless expanded) } - %td.notes_content{ colspan: 3 } + %td.notes-content{ colspan: 3 } .content{ class: ('hide' unless expanded) } = render partial: "discussions/notes", collection: discussions, as: :discussion, locals: { disable_collapse_class: true } diff --git a/app/views/discussions/_parallel_diff_discussion.html.haml b/app/views/discussions/_parallel_diff_discussion.html.haml index 2e621c4082d..03b428714b9 100644 --- a/app/views/discussions/_parallel_diff_discussion.html.haml +++ b/app/views/discussions/_parallel_diff_discussion.html.haml @@ -1,17 +1,17 @@ - expanded = [*discussions_left, *discussions_right].any?(&:expanded?) %tr.notes_holder{ class: ('hide' unless expanded) } - if discussions_left - %td.notes_content.parallel.old{ colspan: 2 } + %td.notes-content.parallel.old{ colspan: 2 } .content{ class: ('hide' unless discussions_left.any?(&:expanded?)) } = render partial: "discussions/notes", collection: discussions_left, as: :discussion, line_type: 'old', locals: { disable_collapse_class: true } - else - %td.notes_content.parallel.old{ colspan: 2 } + %td.notes-content.parallel.old{ colspan: 2 } .content - if discussions_right - %td.notes_content.parallel.new{ colspan: 2 } + %td.notes-content.parallel.new{ colspan: 2 } .content{ class: ('hide' unless discussions_right.any?(&:expanded?)) } = render partial: "discussions/notes", collection: discussions_right, as: :discussion, line_type: 'new', locals: { disable_collapse_class: true } - else - %td.notes_content.parallel.new{ colspan: 2 } + %td.notes-content.parallel.new{ colspan: 2 } .content diff --git a/spec/features/projects/commit/comments/user_adds_comment_spec.rb b/spec/features/projects/commit/comments/user_adds_comment_spec.rb index 29442a58ea4..586e2e33112 100644 --- a/spec/features/projects/commit/comments/user_adds_comment_spec.rb +++ b/spec/features/projects/commit/comments/user_adds_comment_spec.rb @@ -138,7 +138,7 @@ describe "User adds a comment on a commit", :js do click_button("Comment") end - page.within(".diff-file:nth-of-type(1) .notes_content.parallel.old") do + page.within(".diff-file:nth-of-type(1) .notes-content.parallel.old") do expect(page).to have_content(old_comment) end @@ -152,7 +152,7 @@ describe "User adds a comment on a commit", :js do wait_for_requests - expect(all(".diff-file:nth-of-type(1) .notes_content.parallel.new")[1].text).to have_content(new_comment) + expect(all(".diff-file:nth-of-type(1) .notes-content.parallel.new")[1].text).to have_content(new_comment) end end |