diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-23 03:09:31 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-23 03:09:31 +0000 |
commit | 63c3434ae665e1bf10f0ed47ee9b4944dde71345 (patch) | |
tree | 5532ccfb069c069279e1c490b8778672518cc041 | |
parent | d8b52231c189144d8aa05cc397c096b553295750 (diff) | |
download | gitlab-ce-63c3434ae665e1bf10f0ed47ee9b4944dde71345.tar.gz |
Add latest changes from gitlab-org/gitlab@master
4 files changed, 32 insertions, 8 deletions
diff --git a/app/assets/javascripts/diffs/components/diff_line_note_form.vue b/app/assets/javascripts/diffs/components/diff_line_note_form.vue index 10a3e5456e0..591800ee9be 100644 --- a/app/assets/javascripts/diffs/components/diff_line_note_form.vue +++ b/app/assets/javascripts/diffs/components/diff_line_note_form.vue @@ -149,7 +149,11 @@ export default { }, }, created() { - this.lines = { ...this.range }; + if (this.range) { + this.lines = { ...this.range }; + } else if (this.line) { + this.lines = { start: this.line, end: this.line }; + } }, mounted() { if (this.isLoggedIn) { diff --git a/app/assets/javascripts/frequent_items/components/frequent_items_list_item.vue b/app/assets/javascripts/frequent_items/components/frequent_items_list_item.vue index 5dac315d345..1700437aa84 100644 --- a/app/assets/javascripts/frequent_items/components/frequent_items_list_item.vue +++ b/app/assets/javascripts/frequent_items/components/frequent_items_list_item.vue @@ -1,5 +1,4 @@ <script> -/* eslint-disable vue/require-default-prop */ import { GlButton, GlSafeHtmlDirective } from '@gitlab/ui'; import highlight from '~/lib/utils/highlight'; import { truncateNamespace } from '~/lib/utils/text_utility'; @@ -23,6 +22,7 @@ export default { matcher: { type: String, required: false, + default: '', }, itemId: { type: Number, @@ -35,6 +35,7 @@ export default { namespace: { type: String, required: false, + default: '', }, webUrl: { type: String, diff --git a/lib/gitlab/saas.rb b/lib/gitlab/saas.rb index 9220ad1be6c..61676d550d2 100644 --- a/lib/gitlab/saas.rb +++ b/lib/gitlab/saas.rb @@ -42,7 +42,7 @@ module Gitlab end def self.about_pricing_faq_url - "https://about.gitlab.com/gitlab-com/#faq" + "https://about.gitlab.com/pricing#faq" end end end diff --git a/spec/frontend/diffs/components/diff_line_note_form_spec.js b/spec/frontend/diffs/components/diff_line_note_form_spec.js index 5132cfd7622..104a003b12b 100644 --- a/spec/frontend/diffs/components/diff_line_note_form_spec.js +++ b/spec/frontend/diffs/components/diff_line_note_form_spec.js @@ -24,11 +24,14 @@ describe('DiffLineNoteForm', () => { return shallowMount(DiffLineNoteForm, { store, propsData: { - diffFileHash: diffFile.file_hash, - diffLines, - line: diffLines[1], - range: { start: diffLines[0], end: diffLines[1] }, - noteTargetLine: diffLines[1], + ...{ + diffFileHash: diffFile.file_hash, + diffLines, + line: diffLines[1], + range: { start: diffLines[0], end: diffLines[1] }, + noteTargetLine: diffLines[1], + }, + ...(args.props || {}), }, }); }; @@ -119,6 +122,22 @@ describe('DiffLineNoteForm', () => { }); }); + describe('created', () => { + it('should use the provided `range` of lines', () => { + wrapper = createComponent(); + + expect(wrapper.vm.lines.start).toBe(diffLines[0]); + expect(wrapper.vm.lines.end).toBe(diffLines[1]); + }); + + it("should fill the internal `lines` data with the provided `line` if there's no provided `range", () => { + wrapper = createComponent({ props: { range: null } }); + + expect(wrapper.vm.lines.start).toBe(diffLines[1]); + expect(wrapper.vm.lines.end).toBe(diffLines[1]); + }); + }); + describe('mounted', () => { it('should init autosave', () => { const key = 'autosave/Note/Issue/98//DiffNote//1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a_1_2'; |