Skip to content
Snippets Groups Projects
Commit 4e375367 authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent 99ddca0d
No related branches found
No related tags found
No related merge requests found
Showing
with 79 additions and 27 deletions
<script>
import { mapActions, mapState } from 'vuex';
import _ from 'underscore';
import Icon from '~/vue_shared/components/icon.vue';
import { GlLoadingIcon } from '@gitlab/ui';
import Icon from '~/vue_shared/components/icon.vue';
import Item from './item.vue';
 
export default {
Loading
Loading
<script>
import $ from 'jquery';
import { mapActions, mapState } from 'vuex';
import DropdownButton from '~/vue_shared/components/dropdown/dropdown_button.vue';
import { GlLoadingIcon } from '@gitlab/ui';
import DropdownButton from '~/vue_shared/components/dropdown/dropdown_button.vue';
 
export default {
components: {
Loading
Loading
<script>
import { mapActions, mapGetters, mapState } from 'vuex';
import Icon from '~/vue_shared/components/icon.vue';
import { GlSkeletonLoading } from '@gitlab/ui';
import Icon from '~/vue_shared/components/icon.vue';
import FileRow from '~/vue_shared/components/file_row.vue';
import NavDropdown from './nav_dropdown.vue';
import FileRowExtra from './file_row_extra.vue';
Loading
Loading
<script>
import { mapActions, mapState } from 'vuex';
import _ from 'underscore';
import { GlLoadingIcon } from '@gitlab/ui';
import { __ } from '~/locale';
import Icon from '~/vue_shared/components/icon.vue';
import { GlLoadingIcon } from '@gitlab/ui';
import Item from './item.vue';
import TokenedInput from '../shared/tokened_input.vue';
 
Loading
Loading
<script>
import $ from 'jquery';
import { mapActions, mapState, mapGetters } from 'vuex';
import flash from '~/flash';
import { __, sprintf, s__ } from '~/locale';
import { mapActions, mapState, mapGetters } from 'vuex';
import DeprecatedModal2 from '~/vue_shared/components/deprecated_modal_2.vue';
import { modalTypes } from '../../constants';
 
Loading
Loading
<script>
import { listen } from 'codesandbox-api';
import Icon from '~/vue_shared/components/icon.vue';
import { GlLoadingIcon } from '@gitlab/ui';
import Icon from '~/vue_shared/components/icon.vue';
 
export default {
components: {
Loading
Loading
<script>
import { __, sprintf } from '~/locale';
import { mapActions } from 'vuex';
import { __, sprintf } from '~/locale';
 
import FileIcon from '~/vue_shared/components/file_icon.vue';
import Icon from '~/vue_shared/components/icon.vue';
Loading
Loading
import $ from 'jquery';
import Vue from 'vue';
import _ from 'underscore';
import { __, sprintf } from '~/locale';
import { visitUrl } from '~/lib/utils/url_utility';
import flash from '~/flash';
import _ from 'underscore';
import * as types from './mutation_types';
import { decorateFiles } from '../lib/files';
import { stageKeys } from '../constants';
Loading
Loading
Loading
Loading
@@ -246,7 +246,7 @@ class Commit
 
def lazy_author
BatchLoader.for(author_email.downcase).batch do |emails, loader|
users = User.by_any_email(emails).includes(:emails)
users = User.by_any_email(emails, confirmed: true).includes(:emails)
 
emails.each do |email|
user = users.find { |u| u.any_email?(email) }
Loading
Loading
@@ -263,8 +263,8 @@ class Commit
end
request_cache(:author) { author_email.downcase }
 
def committer
@committer ||= User.find_by_any_email(committer_email)
def committer(confirmed: true)
@committer ||= User.find_by_any_email(committer_email, confirmed: confirmed)
end
 
def parents
Loading
Loading
---
title: Add nonunique indexes to Labels
merge_request: 21230
author:
type: fixed
---
title: Do not attribute unverified commit e-mails to GitLab users
merge_request: 21214
author:
type: fixed
# frozen_string_literal: true
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class AddLabelProjectGroupPartialIndexes < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
PROJECT_AND_TITLE = [:project_id, :title]
GROUP_AND_TITLE = [:group_id, :title]
def up
add_concurrent_index :labels, PROJECT_AND_TITLE, unique: false, where: "labels.group_id = null"
add_concurrent_index :labels, GROUP_AND_TITLE, unique: false, where: "labels.project_id = null"
end
def down
remove_concurrent_index :labels, PROJECT_AND_TITLE
remove_concurrent_index :labels, GROUP_AND_TITLE
end
end
Loading
Loading
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
 
ActiveRecord::Schema.define(version: 2019_12_04_070713) do
ActiveRecord::Schema.define(version: 2019_12_04_093410) do
 
# These are extensions that must be enabled in order to support this database
enable_extension "pg_trgm"
Loading
Loading
@@ -2228,6 +2228,8 @@ ActiveRecord::Schema.define(version: 2019_12_04_070713) do
t.integer "group_id"
t.integer "cached_markdown_version"
t.index ["group_id", "project_id", "title"], name: "index_labels_on_group_id_and_project_id_and_title", unique: true
t.index ["group_id", "title"], name: "index_labels_on_group_id_and_title", where: "(project_id = NULL::integer)"
t.index ["project_id", "title"], name: "index_labels_on_project_id_and_title", where: "(group_id = NULL::integer)"
t.index ["project_id"], name: "index_labels_on_project_id"
t.index ["template"], name: "index_labels_on_template", where: "template"
t.index ["title"], name: "index_labels_on_title"
Loading
Loading
Loading
Loading
@@ -61,7 +61,7 @@ describe 'Member autocomplete', :js do
 
before do
allow(User).to receive(:find_by_any_email)
.with(noteable.author_email.downcase).and_return(author)
.with(noteable.author_email.downcase, confirmed: true).and_return(author)
 
visit project_commit_path(project, noteable)
end
Loading
Loading
Loading
Loading
@@ -76,16 +76,23 @@ describe 'User browses commits' do
end
 
context 'secondary email' do
let(:user) { create(:user) }
it 'finds a commit by a secondary email' do
user =
create(:user) do |user|
create(:email, { user: user, email: 'dmitriy.zaporozhets@gmail.com' })
end
create(:email, :confirmed, user: user, email: 'dmitriy.zaporozhets@gmail.com')
 
visit(project_commit_path(project, sample_commit.parent_id))
 
check_author_link(sample_commit.author_email, user)
end
it 'links to an unverified e-mail address instead of the user' do
create(:email, user: user, email: 'dmitriy.zaporozhets@gmail.com')
visit(project_commit_path(project, sample_commit.parent_id))
check_author_email(sample_commit.author_email)
end
end
 
context 'when the blob does not exist' do
Loading
Loading
@@ -263,3 +270,9 @@ def check_author_link(email, author)
expect(author_link['href']).to eq(user_path(author))
expect(find('.commit-author-name').text).to eq(author.name)
end
def check_author_email(email)
author_link = find('.commit-author-link')
expect(author_link['href']).to eq("mailto:#{email}")
end
import Vue from 'vue';
import mountCompontent from 'spec/helpers/vue_mount_component_helper';
import mountCompontent from 'helpers/vue_mount_component_helper';
import router from '~/ide/ide_router';
import Item from '~/ide/components/branches/item.vue';
import { getTimeago } from '~/lib/utils/datetime_utility';
Loading
Loading
@@ -30,7 +30,7 @@ describe('IDE branch item', () => {
it('renders branch name and timeago', () => {
const timeText = getTimeago().format(TEST_BRANCH.committedDate);
 
expect(vm.$el).toContainText(TEST_BRANCH.name);
expect(vm.$el.textContent).toContain(TEST_BRANCH.name);
expect(vm.$el.querySelector('time')).toHaveText(timeText);
expect(vm.$el.querySelector('.ic-mobile-issue-close')).toBe(null);
});
Loading
Loading
@@ -39,7 +39,7 @@ describe('IDE branch item', () => {
const expectedHref = router.resolve(`/project/${TEST_PROJECT_ID}/edit/${TEST_BRANCH.name}`)
.href;
 
expect(vm.$el).toMatch('a');
expect(vm.$el.textContent).toMatch('a');
expect(vm.$el).toHaveAttr('href', expectedHref);
});
 
Loading
Loading
import { shallowMount, createLocalVue } from '@vue/test-utils';
import Vuex from 'vuex';
import { GlLoadingIcon } from '@gitlab/ui';
import { __ } from '~/locale';
import List from '~/ide/components/branches/search_list.vue';
import Item from '~/ide/components/branches/item.vue';
import { GlLoadingIcon } from '@gitlab/ui';
import { branches } from '../../mock_data';
 
const localVue = createLocalVue();
Loading
Loading
import { shallowMount, createLocalVue } from '@vue/test-utils';
import Vuex from 'vuex';
import { GlLoadingIcon } from '@gitlab/ui';
import List from '~/ide/components/merge_requests/list.vue';
import Item from '~/ide/components/merge_requests/item.vue';
import TokenedInput from '~/ide/components/shared/tokened_input.vue';
import { GlLoadingIcon } from '@gitlab/ui';
import { mergeRequests as mergeRequestsMock } from '../../mock_data';
 
const localVue = createLocalVue();
Loading
Loading
Loading
Loading
@@ -3,7 +3,7 @@ import '~/behaviors/markdown/render_gfm';
import { createStore } from '~/ide/stores';
import RightPane from '~/ide/components/panes/right.vue';
import { rightSidebarViews } from '~/ide/constants';
import { createComponentWithStore } from '../../../helpers/vue_mount_component_helper';
import { createComponentWithStore } from 'helpers/vue_mount_component_helper';
 
describe('IDE right pane', () => {
let Component;
Loading
Loading
@@ -56,7 +56,7 @@ describe('IDE right pane', () => {
 
describe('click', () => {
beforeEach(() => {
spyOn(vm, 'open');
jest.spyOn(vm, 'open').mockReturnValue();
});
 
it('sets view to merge request', done => {
Loading
Loading
@@ -74,7 +74,9 @@ describe('IDE right pane', () => {
 
describe('live preview', () => {
it('renders live preview button', done => {
Vue.set(vm.$store.state.entries, 'package.json', { name: 'package.json' });
Vue.set(vm.$store.state.entries, 'package.json', {
name: 'package.json',
});
vm.$store.state.clientsidePreviewEnabled = true;
 
vm.$nextTick(() => {
Loading
Loading
import { shallowMount, createLocalVue } from '@vue/test-utils';
import Vuex from 'vuex';
import { GlLoadingIcon } from '@gitlab/ui';
import { TEST_HOST } from 'helpers/test_constants';
import List from '~/ide/components/pipelines/list.vue';
import JobsList from '~/ide/components/jobs/list.vue';
import Tab from '~/vue_shared/components/tabs/tab.vue';
import CiIcon from '~/vue_shared/components/ci_icon.vue';
import { GlLoadingIcon } from '@gitlab/ui';
import { TEST_HOST } from 'helpers/test_constants';
import { pipelines } from '../../../../javascripts/ide/mock_data';
 
const localVue = createLocalVue();
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment