Commit eaefa0a0 authored by GitLab Bot's avatar GitLab Bot

Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-11-29

# Conflicts:
#	app/assets/javascripts/notes/components/note_form.vue
#	db/schema.rb
#	locale/gitlab.pot

[ci skip]
parents dc46ae6b b05a3643
......@@ -199,6 +199,7 @@ export default {
></textarea>
</markdown-field>
<div class="note-form-actions clearfix">
<<<<<<< HEAD
<p v-if="(discussion && discussion.id) || isDraft">
<label>
<template v-if="discussionResolved">
......@@ -265,6 +266,30 @@ export default {
Cancel
</button>
</template>
=======
<button
:disabled="isDisabled"
type="button"
class="js-vue-issue-save btn btn-success js-comment-button"
@click="handleUpdate();"
>
{{ saveButtonTitle }}
</button>
<button
v-if="discussion.resolvable"
class="btn btn-nr btn-default append-right-10 js-comment-resolve-button"
@click.prevent="handleUpdate(true);"
>
{{ resolveButtonTitle }}
</button>
<button
class="btn btn-cancel note-edit-cancel js-close-discussion-note-form"
type="button"
@click="cancelHandler();"
>
Cancel
</button>
>>>>>>> upstream/master
</div>
</form>
</div>
......
<script>
import _ from 'underscore';
import { mapActions, mapGetters } from 'vuex';
import { GlTooltipDirective } from '@gitlab/ui';
import { truncateSha } from '~/lib/utils/text_utility';
import { s__, __ } from '~/locale';
import { s__, __, sprintf } from '~/locale';
import systemNote from '~/vue_shared/components/notes/system_note.vue';
import icon from '~/vue_shared/components/icon.vue';
import batchCommentsDiffLineNoteFormMixin from 'ee/batch_comments/mixins/diff_line_note_form';
......@@ -166,6 +167,37 @@ export default {
(!discussion.diff_discussion && resolved && hasReplies && !isRepliesToggledByUser) || false
);
},
actionText() {
const commitId = this.discussion.commit_id ? truncateSha(this.discussion.commit_id) : '';
const linkStart = `<a href="${_.escape(this.discussion.discussion_path)}">`;
const linkEnd = '</a>';
let text = s__('MergeRequests|started a discussion');
if (this.discussion.for_commit) {
text = s__(
'MergeRequests|started a discussion on commit %{linkStart}%{commitId}%{linkEnd}',
);
} else if (this.discussion.diff_discussion) {
if (this.discussion.active) {
text = s__('MergeRequests|started a discussion on %{linkStart}the diff%{linkEnd}');
} else {
text = s__(
'MergeRequests|started a discussion on %{linkStart}an old version of the diff%{linkEnd}',
);
}
}
return sprintf(
text,
{
commitId,
linkStart,
linkEnd,
},
false,
);
},
},
watch: {
isReplying() {
......@@ -301,24 +333,7 @@ Please check your network connection and try again.`;
:expanded="discussion.expanded"
@toggleHandler="toggleDiscussionHandler"
>
<template v-if="discussion.diff_discussion">
started a discussion on
<a :href="discussion.discussion_path">
<template v-if="discussion.active"
>the diff</template
>
<template v-else
>an old version of the diff</template
>
</a>
</template>
<template v-else-if="discussion.for_commit">
started a discussion on commit
<a :href="discussion.discussion_path">{{ truncateSha(discussion.commit_id) }}</a>
</template>
<template v-else
>started a discussion</template
>
<span v-html="actionText"></span>
</note-header>
<note-edited-text
v-if="discussion.resolved"
......
......@@ -244,6 +244,7 @@ $gl-padding-top: 10px;
$gl-sidebar-padding: 22px;
$gl-bar-padding: 3px;
$input-horizontal-padding: 12px;
$browserScrollbarSize: 10px;
/*
* Misc
......
......@@ -724,7 +724,8 @@
.scrolling-tabs-container {
.scrolling-tabs {
margin-top: $gl-padding-8;
margin-bottom: $gl-padding-8;
margin-bottom: $gl-padding-8 - $browserScrollbarSize;
padding-bottom: $browserScrollbarSize;
flex-wrap: wrap;
border-bottom: 0;
}
......@@ -732,7 +733,7 @@
.fade-left,
.fade-right {
top: 0;
height: 100%;
height: calc(100% - #{$browserScrollbarSize});
.fa {
top: 50%;
......
---
title: Fix horizontal scrollbar overlapping on horizontal scrolling-tabs
merge_request: 23167
author: Harry Kiselev
type: other
---
title: Display commit ID for commit diff discussion on merge request
merge_request: 23370
author:
type: fixed
......@@ -2158,6 +2158,7 @@ ActiveRecord::Schema.define(version: 20181126153547) do
t.index ["shard_id"], name: "index_project_repositories_on_shard_id", using: :btree
end
<<<<<<< .merge_file_IKjDac
create_table "project_repository_states", force: :cascade do |t|
t.integer "project_id", null: false
t.binary "repository_verification_checksum"
......@@ -2174,6 +2175,8 @@ ActiveRecord::Schema.define(version: 20181126153547) do
t.index ["project_id"], name: "index_project_repository_states_on_project_id", unique: true, using: :btree
end
=======
>>>>>>> .merge_file_jHBiGC
create_table "project_statistics", force: :cascade do |t|
t.integer "project_id", null: false
t.integer "namespace_id", null: false
......@@ -3277,10 +3280,16 @@ ActiveRecord::Schema.define(version: 20181126153547) do
add_foreign_key "project_features", "projects", name: "fk_18513d9b92", on_delete: :cascade
add_foreign_key "project_group_links", "projects", name: "fk_daa8cee94c", on_delete: :cascade
add_foreign_key "project_import_data", "projects", name: "fk_ffb9ee3a10", on_delete: :cascade
<<<<<<< .merge_file_IKjDac
add_foreign_key "project_mirror_data", "projects", name: "fk_d1aad367d7", on_delete: :cascade
add_foreign_key "project_repositories", "projects", on_delete: :cascade
add_foreign_key "project_repositories", "shards", on_delete: :restrict
add_foreign_key "project_repository_states", "projects", on_delete: :cascade
=======
add_foreign_key "project_mirror_data", "projects", on_delete: :cascade
add_foreign_key "project_repositories", "projects", on_delete: :cascade
add_foreign_key "project_repositories", "shards", on_delete: :restrict
>>>>>>> .merge_file_jHBiGC
add_foreign_key "project_statistics", "projects", on_delete: :cascade
add_foreign_key "project_tracing_settings", "projects", on_delete: :cascade
add_foreign_key "projects", "pool_repositories", name: "fk_6e5c14658a", on_delete: :nullify
......
......@@ -5331,7 +5331,23 @@ msgstr ""
msgid "Metrics|System"
msgstr ""
<<<<<<< HEAD
msgid "Metrics|There was an error fetching the environments data, please try again"
=======
msgid "MergeRequests|started a discussion"
msgstr ""
msgid "MergeRequests|started a discussion on %{linkStart}an old version of the diff%{linkEnd}"
msgstr ""
msgid "MergeRequests|started a discussion on %{linkStart}the diff%{linkEnd}"
msgstr ""
msgid "MergeRequests|started a discussion on commit %{linkStart}%{commitId}%{linkEnd}"
msgstr ""
msgid "MergeRequest| %{paragraphStart}changed the description %{descriptionChangedTimes} times %{timeDifferenceMinutes}%{paragraphEnd}"
>>>>>>> upstream/master
msgstr ""
msgid "Metrics|There was an error getting deployment information."
......
......@@ -68,6 +68,7 @@ module Trigger
def base_variables
{
'GITLAB_REF_SLUG' => ref_slug,
'TRIGGERED_USER' => ENV['TRIGGERED_USER'] || ENV['GITLAB_USER_NAME'],
'TRIGGER_SOURCE' => ENV['CI_JOB_URL'],
'TOP_UPSTREAM_SOURCE_PROJECT' => ENV['CI_PROJECT_PATH'],
......@@ -76,6 +77,12 @@ module Trigger
}
end
def ref_slug
return 'master' if ENV['CI_COMMIT_REF_SLUG'] =~ %r{(\Aqa[/-]|-qa\z)}
ENV['CI_COMMIT_REF_SLUG']
end
# Read version files from all components
def version_file_variables
Dir.glob("*_VERSION").each_with_object({}) do |version_file, params|
......@@ -106,18 +113,11 @@ module Trigger
def extra_variables
{
'GITLAB_VERSION' => ENV['CI_COMMIT_SHA'],
'GITLAB_REF_SLUG' => ref_slug,
'ALTERNATIVE_SOURCES' => 'true',
'ee' => Trigger.ee? ? 'true' : 'false',
'QA_BRANCH' => ENV['QA_BRANCH'] || 'master'
}
end
def ref_slug
return 'master' if ENV['CI_COMMIT_REF_SLUG'] =~ %r{(\Aqa[/-]|-qa\z)}
ENV['CI_COMMIT_REF_SLUG']
end
end
class CNG < Base
......
......@@ -53,13 +53,11 @@ describe 'Merge request > User sees discussions', :js do
shared_examples 'a functional discussion' do
let(:discussion_id) { note.discussion_id(merge_request) }
# TODO: https://gitlab.com/gitlab-org/gitlab-ce/issues/48034
xit 'is displayed' do
it 'is displayed' do
expect(page).to have_css(".discussion[data-discussion-id='#{discussion_id}']")
end
# TODO: https://gitlab.com/gitlab-org/gitlab-ce/issues/48034
xit 'can be replied to' do
it 'can be replied to' do
within(".discussion[data-discussion-id='#{discussion_id}']") do
click_button 'Reply...'
fill_in 'note[note]', with: 'Test!'
......@@ -74,16 +72,21 @@ describe 'Merge request > User sees discussions', :js do
visit project_merge_request_path(project, merge_request)
end
context 'a regular commit comment' do
let(:note) { create(:note_on_commit, project: project) }
it_behaves_like 'a functional discussion'
end
# TODO: https://gitlab.com/gitlab-org/gitlab-ce/issues/48034
# context 'a regular commit comment' do
# let(:note) { create(:note_on_commit, project: project) }
#
# it_behaves_like 'a functional discussion'
# end
context 'a commit diff comment' do
let(:note) { create(:diff_note_on_commit, project: project) }
it_behaves_like 'a functional discussion'
it 'displays correct header' do
expect(page).to have_content "started a discussion on commit #{note.commit_id[0...7]}"
end
end
end
end
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