Commit 5cb94fc4 authored by GitLab Bot's avatar GitLab Bot

Add latest changes from gitlab-org/gitlab@master

parent 69a23cbe
...@@ -264,7 +264,7 @@ gem 'licensee', '~> 8.9' ...@@ -264,7 +264,7 @@ gem 'licensee', '~> 8.9'
gem 'ace-rails-ap', '~> 4.1.0' gem 'ace-rails-ap', '~> 4.1.0'
# Detect and convert string character encoding # Detect and convert string character encoding
gem 'charlock_holmes', '~> 0.7.7' gem 'charlock_holmes', '~> 0.7.5'
# Detect mime content type from content # Detect mime content type from content
gem 'mimemagic', '~> 0.3.2' gem 'mimemagic', '~> 0.3.2'
......
...@@ -142,7 +142,7 @@ GEM ...@@ -142,7 +142,7 @@ GEM
mime-types (>= 1.16) mime-types (>= 1.16)
cause (0.1) cause (0.1)
character_set (1.1.2) character_set (1.1.2)
charlock_holmes (0.7.7) charlock_holmes (0.7.6)
childprocess (0.9.0) childprocess (0.9.0)
ffi (~> 1.0, >= 1.0.11) ffi (~> 1.0, >= 1.0.11)
chronic (0.10.2) chronic (0.10.2)
...@@ -1143,7 +1143,7 @@ DEPENDENCIES ...@@ -1143,7 +1143,7 @@ DEPENDENCIES
capybara (~> 3.22.0) capybara (~> 3.22.0)
capybara-screenshot (~> 1.0.22) capybara-screenshot (~> 1.0.22)
carrierwave (~> 1.3) carrierwave (~> 1.3)
charlock_holmes (~> 0.7.7) charlock_holmes (~> 0.7.5)
chronic (~> 0.10.2) chronic (~> 0.10.2)
commonmarker (~> 0.20) commonmarker (~> 0.20)
concurrent-ruby (~> 1.1) concurrent-ruby (~> 1.1)
......
...@@ -742,7 +742,7 @@ ...@@ -742,7 +742,7 @@
display: inline-block; display: inline-block;
&:not(:last-child) { &:not(:last-child) {
margin-right: $gl-padding-8; margin-right: $gl-padding;
} }
&.right { &.right {
...@@ -812,6 +812,10 @@ ...@@ -812,6 +812,10 @@
@extend .btn; @extend .btn;
@extend .btn-default; @extend .btn-default;
} }
.nav > li:not(:last-child) {
margin-right: $gl-padding-8;
}
} }
.repository-languages-bar { .repository-languages-bar {
......
---
title: Increase margin between project stats
merge_request: 20606
author:
type: other
---
title: Fix project creation with templates using /projects/user/:id API
merge_request: 20590
author:
type: fixed
...@@ -191,6 +191,7 @@ module API ...@@ -191,6 +191,7 @@ module API
optional :path, type: String, desc: 'The path of the repository' optional :path, type: String, desc: 'The path of the repository'
optional :default_branch, type: String, desc: 'The default branch of the project' optional :default_branch, type: String, desc: 'The default branch of the project'
use :optional_project_params use :optional_project_params
use :optional_create_project_params
use :create_params use :create_params
end end
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
......
import Vue from 'vue'; import { mount } from '@vue/test-utils';
import { GlLink } from '@gitlab/ui';
import { getTimeago } from '~/lib/utils/datetime_utility'; import { getTimeago } from '~/lib/utils/datetime_utility';
import component from '~/jobs/components/erased_block.vue'; import ErasedBlock from '~/jobs/components/erased_block.vue';
import mountComponent from '../../helpers/vue_mount_component_helper';
describe('Erased block', () => { describe('Erased block', () => {
const Component = Vue.extend(component); let wrapper;
let vm;
const erasedAt = '2016-11-07T11:11:16.525Z'; const erasedAt = '2016-11-07T11:11:16.525Z';
const timeago = getTimeago(); const timeago = getTimeago();
const formatedDate = timeago.format(erasedAt); const formatedDate = timeago.format(erasedAt);
const createComponent = props => {
wrapper = mount(ErasedBlock, {
propsData: props,
sync: false,
attachToDocument: true,
});
};
afterEach(() => { afterEach(() => {
vm.$destroy(); wrapper.destroy();
}); });
describe('with job erased by user', () => { describe('with job erased by user', () => {
beforeEach(() => { beforeEach(() => {
vm = mountComponent(Component, { createComponent({
user: { user: {
username: 'root', username: 'root',
web_url: 'gitlab.com/root', web_url: 'gitlab.com/root',
...@@ -27,30 +34,30 @@ describe('Erased block', () => { ...@@ -27,30 +34,30 @@ describe('Erased block', () => {
}); });
it('renders username and link', () => { it('renders username and link', () => {
expect(vm.$el.querySelector('a').getAttribute('href')).toEqual('gitlab.com/root'); expect(wrapper.find(GlLink).attributes('href')).toEqual('gitlab.com/root');
expect(vm.$el.textContent).toContain('Job has been erased by'); expect(wrapper.text().trim()).toContain('Job has been erased by');
expect(vm.$el.textContent).toContain('root'); expect(wrapper.text().trim()).toContain('root');
}); });
it('renders erasedAt', () => { it('renders erasedAt', () => {
expect(vm.$el.textContent).toContain(formatedDate); expect(wrapper.text().trim()).toContain(formatedDate);
}); });
}); });
describe('with erased job', () => { describe('with erased job', () => {
beforeEach(() => { beforeEach(() => {
vm = mountComponent(Component, { createComponent({
erasedAt, erasedAt,
}); });
}); });
it('renders username and link', () => { it('renders username and link', () => {
expect(vm.$el.textContent).toContain('Job has been erased'); expect(wrapper.text().trim()).toContain('Job has been erased');
}); });
it('renders erasedAt', () => { it('renders erasedAt', () => {
expect(vm.$el.textContent).toContain(formatedDate); expect(wrapper.text().trim()).toContain(formatedDate);
}); });
}); });
}); });
import UserPopover from '~/vue_shared/components/user_popover/user_popover.vue'; import UserPopover from '~/vue_shared/components/user_popover/user_popover.vue';
import { mount } from '@vue/test-utils'; import { GlSkeletonLoading } from '@gitlab/ui';
import Icon from '~/vue_shared/components/icon.vue';
import { shallowMount } from '@vue/test-utils';
const DEFAULT_PROPS = { const DEFAULT_PROPS = {
loaded: true, loaded: true,
...@@ -29,7 +31,7 @@ describe('User Popover Component', () => { ...@@ -29,7 +31,7 @@ describe('User Popover Component', () => {
describe('Empty', () => { describe('Empty', () => {
beforeEach(() => { beforeEach(() => {
wrapper = mount(UserPopover, { wrapper = shallowMount(UserPopover, {
propsData: { propsData: {
target: document.querySelector('.js-user-link'), target: document.querySelector('.js-user-link'),
user: { user: {
...@@ -41,18 +43,19 @@ describe('User Popover Component', () => { ...@@ -41,18 +43,19 @@ describe('User Popover Component', () => {
status: null, status: null,
}, },
}, },
attachToDocument: true,
sync: false, sync: false,
}); });
}); });
it('should return skeleton loaders', () => { it('should return skeleton loaders', () => {
expect(wrapper.findAll('.animation-container').length).toBe(4); expect(wrapper.find(GlSkeletonLoading).exists()).toBe(true);
}); });
}); });
describe('basic data', () => { describe('basic data', () => {
it('should show basic fields', () => { it('should show basic fields', () => {
wrapper = mount(UserPopover, { wrapper = shallowMount(UserPopover, {
propsData: { propsData: {
...DEFAULT_PROPS, ...DEFAULT_PROPS,
target: document.querySelector('.js-user-link'), target: document.querySelector('.js-user-link'),
...@@ -66,9 +69,9 @@ describe('User Popover Component', () => { ...@@ -66,9 +69,9 @@ describe('User Popover Component', () => {
}); });
it('shows icon for location', () => { it('shows icon for location', () => {
const iconEl = wrapper.find('.js-location svg'); const iconEl = wrapper.find(Icon);
expect(iconEl.find('use').element.getAttribute('xlink:href')).toContain('location'); expect(iconEl.props('name')).toEqual('location');
}); });
}); });
...@@ -77,7 +80,7 @@ describe('User Popover Component', () => { ...@@ -77,7 +80,7 @@ describe('User Popover Component', () => {
const testProps = Object.assign({}, DEFAULT_PROPS); const testProps = Object.assign({}, DEFAULT_PROPS);
testProps.user.bio = 'Engineer'; testProps.user.bio = 'Engineer';
wrapper = mount(UserPopover, { wrapper = shallowMount(UserPopover, {
propsData: { propsData: {
...testProps, ...testProps,
target: document.querySelector('.js-user-link'), target: document.querySelector('.js-user-link'),
...@@ -92,7 +95,7 @@ describe('User Popover Component', () => { ...@@ -92,7 +95,7 @@ describe('User Popover Component', () => {
const testProps = Object.assign({}, DEFAULT_PROPS); const testProps = Object.assign({}, DEFAULT_PROPS);
testProps.user.organization = 'GitLab'; testProps.user.organization = 'GitLab';
wrapper = mount(UserPopover, { wrapper = shallowMount(UserPopover, {
propsData: { propsData: {
...testProps, ...testProps,
target: document.querySelector('.js-user-link'), target: document.querySelector('.js-user-link'),
...@@ -108,7 +111,7 @@ describe('User Popover Component', () => { ...@@ -108,7 +111,7 @@ describe('User Popover Component', () => {
testProps.user.bio = 'Engineer'; testProps.user.bio = 'Engineer';
testProps.user.organization = 'GitLab'; testProps.user.organization = 'GitLab';
wrapper = mount(UserPopover, { wrapper = shallowMount(UserPopover, {
propsData: { propsData: {
...DEFAULT_PROPS, ...DEFAULT_PROPS,
target: document.querySelector('.js-user-link'), target: document.querySelector('.js-user-link'),
...@@ -125,7 +128,7 @@ describe('User Popover Component', () => { ...@@ -125,7 +128,7 @@ describe('User Popover Component', () => {
testProps.user.bio = 'Manager & Team Lead'; testProps.user.bio = 'Manager & Team Lead';
testProps.user.organization = 'Me & my <funky> Company'; testProps.user.organization = 'Me & my <funky> Company';
wrapper = mount(UserPopover, { wrapper = shallowMount(UserPopover, {
propsData: { propsData: {
...DEFAULT_PROPS, ...DEFAULT_PROPS,
target: document.querySelector('.js-user-link'), target: document.querySelector('.js-user-link'),
...@@ -138,15 +141,13 @@ describe('User Popover Component', () => { ...@@ -138,15 +141,13 @@ describe('User Popover Component', () => {
}); });
it('shows icon for bio', () => { it('shows icon for bio', () => {
const iconEl = wrapper.find('.js-bio svg'); expect(wrapper.findAll(Icon).filter(icon => icon.props('name') === 'profile').length).toEqual(
1,
expect(iconEl.find('use').element.getAttribute('xlink:href')).toContain('profile'); );
}); });
it('shows icon for organization', () => { it('shows icon for organization', () => {
const iconEl = wrapper.find('.js-organization svg'); expect(wrapper.findAll(Icon).filter(icon => icon.props('name') === 'work').length).toEqual(1);
expect(iconEl.find('use').element.getAttribute('xlink:href')).toContain('work');
}); });
}); });
...@@ -155,7 +156,7 @@ describe('User Popover Component', () => { ...@@ -155,7 +156,7 @@ describe('User Popover Component', () => {
const testProps = Object.assign({}, DEFAULT_PROPS); const testProps = Object.assign({}, DEFAULT_PROPS);
testProps.user.status = { message_html: 'Hello World' }; testProps.user.status = { message_html: 'Hello World' };
wrapper = mount(UserPopover, { wrapper = shallowMount(UserPopover, {
propsData: { propsData: {
...DEFAULT_PROPS, ...DEFAULT_PROPS,
target: document.querySelector('.js-user-link'), target: document.querySelector('.js-user-link'),
...@@ -170,7 +171,7 @@ describe('User Popover Component', () => { ...@@ -170,7 +171,7 @@ describe('User Popover Component', () => {
const testProps = Object.assign({}, DEFAULT_PROPS); const testProps = Object.assign({}, DEFAULT_PROPS);
testProps.user.status = { emoji: 'basketball_player', message_html: 'Hello World' }; testProps.user.status = { emoji: 'basketball_player', message_html: 'Hello World' };
wrapper = mount(UserPopover, { wrapper = shallowMount(UserPopover, {
propsData: { propsData: {
...DEFAULT_PROPS, ...DEFAULT_PROPS,
target: document.querySelector('.js-user-link'), target: document.querySelector('.js-user-link'),
......
...@@ -722,10 +722,10 @@ ...@@ -722,10 +722,10 @@
resolved "https://registry.yarnpkg.com/@gitlab/svgs/-/svgs-1.82.0.tgz#c059c460afc13ebfe9df370521ca8963fa5afb80" resolved "https://registry.yarnpkg.com/@gitlab/svgs/-/svgs-1.82.0.tgz#c059c460afc13ebfe9df370521ca8963fa5afb80"
integrity sha512-9L4Brys2LCk44lHvFsCFDKN768lYjoMVYDb4PD7FSjqUEruQQ1SRj0rvb1RWKLhiTCDKrtDOXkH6I1TTEms24w== integrity sha512-9L4Brys2LCk44lHvFsCFDKN768lYjoMVYDb4PD7FSjqUEruQQ1SRj0rvb1RWKLhiTCDKrtDOXkH6I1TTEms24w==
"@gitlab/ui@7.15.2": "@gitlab/ui@7.16.1":
version "7.15.2" version "7.16.1"
resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-7.15.2.tgz#924c202ea43ad79032d91d803665b1f7b8f0a42e" resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-7.16.1.tgz#a539bd2e39866549f71d8678efe7cca8478ebde3"
integrity sha512-XNrs2iH8waHk/LDp3sTUSlq3vASHUL4WwCiKwoPJP7PZyXZvvumrkNmiDS0ZvPRPB3ZvIrSywRf61sL0PiQZEA== integrity sha512-7SdwSC2P2/PKZNaIzNihAudSpP95cex98i6IMcukK0ocJYvHr8S9s8GoznaD8YugTR1EGhu+f1M6ubneU5vUwQ==
dependencies: dependencies:
"@babel/standalone" "^7.0.0" "@babel/standalone" "^7.0.0"
"@gitlab/vue-toasted" "^1.3.0" "@gitlab/vue-toasted" "^1.3.0"
......
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