Commit 9bb4ee9e authored by Stan Hu's avatar Stan Hu

Merge branch 'ce-to-ee-2018-06-29' into 'master'

CE upstream - 2018-06-29 21:22 UTC

See merge request gitlab-org/gitlab-ee!6334
parents a4deb7c4 7614e169
...@@ -201,7 +201,7 @@ export default { ...@@ -201,7 +201,7 @@ export default {
<div <div
v-if="!diffFile.submodule && addMergeRequestButtons" v-if="!diffFile.submodule && addMergeRequestButtons"
class="file-actions d-none d-md-block" class="file-actions d-none d-sm-block"
> >
<template <template
v-if="diffFile.blob && diffFile.blob.readableText" v-if="diffFile.blob && diffFile.blob.readableText"
......
/* eslint-disable consistent-return, no-new */ /* eslint-disable consistent-return, no-new */
import $ from 'jquery'; import $ from 'jquery';
import Flash from './flash';
import GfmAutoComplete from './gfm_auto_complete'; import GfmAutoComplete from './gfm_auto_complete';
import { convertPermissionToBoolean } from './lib/utils/common_utils'; import { convertPermissionToBoolean } from './lib/utils/common_utils';
import GlFieldErrors from './gl_field_errors'; import GlFieldErrors from './gl_field_errors';
import Shortcuts from './shortcuts'; import Shortcuts from './shortcuts';
import SearchAutocomplete from './search_autocomplete'; import SearchAutocomplete from './search_autocomplete';
import performanceBar from './performance_bar';
function initSearch() { function initSearch() {
// Only when search form is present // Only when search form is present
...@@ -72,9 +72,7 @@ function initGFMInput() { ...@@ -72,9 +72,7 @@ function initGFMInput() {
function initPerformanceBar() { function initPerformanceBar() {
if (document.querySelector('#js-peek')) { if (document.querySelector('#js-peek')) {
import('./performance_bar') performanceBar({ container: '#js-peek' });
.then(m => new m.default({ container: '#js-peek' })) // eslint-disable-line new-cap
.catch(() => Flash('Error loading performance bar module'));
} }
} }
......
...@@ -16,6 +16,7 @@ import Diff from './diff'; ...@@ -16,6 +16,7 @@ import Diff from './diff';
import { localTimeAgo } from './lib/utils/datetime_utility'; import { localTimeAgo } from './lib/utils/datetime_utility';
import syntaxHighlight from './syntax_highlight'; import syntaxHighlight from './syntax_highlight';
import Notes from './notes'; import Notes from './notes';
import { polyfillSticky } from './lib/utils/sticky';
/* eslint-disable max-len */ /* eslint-disable max-len */
// MergeRequestTabs // MergeRequestTabs
...@@ -426,7 +427,6 @@ export default class MergeRequestTabs { ...@@ -426,7 +427,6 @@ export default class MergeRequestTabs {
initAffix() { initAffix() {
const $tabs = $('.js-tabs-affix'); const $tabs = $('.js-tabs-affix');
const $fixedNav = $('.navbar-gitlab');
// Screen space on small screens is usually very sparse // Screen space on small screens is usually very sparse
// So we dont affix the tabs on these // So we dont affix the tabs on these
...@@ -439,21 +439,6 @@ export default class MergeRequestTabs { ...@@ -439,21 +439,6 @@ export default class MergeRequestTabs {
*/ */
if ($tabs.css('position') !== 'static') return; if ($tabs.css('position') !== 'static') return;
const $diffTabs = $('#diff-notes-app'); polyfillSticky($tabs);
$tabs
.off('affix.bs.affix affix-top.bs.affix')
.affix({
offset: {
top: () => $diffTabs.offset().top - $tabs.height() - $fixedNav.height(),
},
})
.on('affix.bs.affix', () => $diffTabs.css({ marginTop: $tabs.height() }))
.on('affix-top.bs.affix', () => $diffTabs.css({ marginTop: '' }));
// Fix bug when reloading the page already scrolling
if ($tabs.hasClass('affix')) {
$tabs.trigger('affix.bs.affix');
}
} }
} }
...@@ -109,6 +109,7 @@ export default { ...@@ -109,6 +109,7 @@ export default {
:key="i" :key="i"
> >
<job-component <job-component
:dropdown-length="job.size"
:job="item" :job="item"
css-class-job-name="mini-pipeline-graph-dropdown-item" css-class-job-name="mini-pipeline-graph-dropdown-item"
@pipelineActionRequestComplete="pipelineActionRequestComplete" @pipelineActionRequestComplete="pipelineActionRequestComplete"
......
...@@ -46,6 +46,11 @@ export default { ...@@ -46,6 +46,11 @@ export default {
required: false, required: false,
default: '', default: '',
}, },
dropdownLength: {
type: Number,
required: false,
default: Infinity,
},
}, },
computed: { computed: {
status() { status() {
...@@ -70,6 +75,10 @@ export default { ...@@ -70,6 +75,10 @@ export default {
return textBuilder.join(' '); return textBuilder.join(' ');
}, },
tooltipBoundary() {
return this.dropdownLength < 5 ? 'viewport' : null;
},
/** /**
* Verifies if the provided job has an action path * Verifies if the provided job has an action path
* *
...@@ -94,9 +103,9 @@ export default { ...@@ -94,9 +103,9 @@ export default {
:href="status.details_path" :href="status.details_path"
:title="tooltipText" :title="tooltipText"
:class="cssClassJobName" :class="cssClassJobName"
:data-boundary="tooltipBoundary"
data-container="body" data-container="body"
data-html="true" data-html="true"
data-boundary="viewport"
class="js-pipeline-graph-job-link" class="js-pipeline-graph-job-link"
> >
......
...@@ -186,32 +186,27 @@ export default { ...@@ -186,32 +186,27 @@ export default {
</i> </i>
</button> </button>
<ul <div
class="dropdown-menu mini-pipeline-graph-dropdown-menu js-builds-dropdown-container" class="dropdown-menu mini-pipeline-graph-dropdown-menu js-builds-dropdown-container"
aria-labelledby="stageDropdown" aria-labelledby="stageDropdown"
> >
<loading-icon v-if="isLoading"/>
<li <ul
v-else
class="js-builds-dropdown-list scrollable-menu" class="js-builds-dropdown-list scrollable-menu"
> >
<li
<loading-icon v-if="isLoading"/> v-for="job in dropdownContent"
:key="job.id"
<ul
v-else
> >
<li <job-component
v-for="job in dropdownContent" :dropdown-length="dropdownContent.length"
:key="job.id" :job="job"
> css-class-job-name="mini-pipeline-graph-dropdown-item"
<job-component @pipelineActionRequestComplete="pipelineActionRequestComplete"
:job="job" />
css-class-job-name="mini-pipeline-graph-dropdown-item" </li>
@pipelineActionRequestComplete="pipelineActionRequestComplete" </ul>
/> </div>
</li>
</ul>
</li>
</ul>
</div> </div>
</template> </template>
...@@ -128,6 +128,11 @@ table { ...@@ -128,6 +128,11 @@ table {
border-spacing: 0; border-spacing: 0;
} }
.tooltip {
// Fix bootstrap4 bug whereby tooltips flicker when they are hovered over their borders
pointer-events: none;
}
.popover { .popover {
font-size: 14px; font-size: 14px;
} }
......
...@@ -322,14 +322,17 @@ span.idiff { ...@@ -322,14 +322,17 @@ span.idiff {
} }
.file-title-flex-parent { .file-title-flex-parent {
display: flex; &,
align-items: center; .file-holder & {
justify-content: space-between; display: flex;
background-color: $gray-light; align-items: center;
border-bottom: 1px solid $border-color; justify-content: space-between;
padding: 5px $gl-padding; background-color: $gray-light;
margin: 0; border-bottom: 1px solid $border-color;
border-radius: $border-radius-default $border-radius-default 0 0; padding: 5px $gl-padding;
margin: 0;
border-radius: $border-radius-default $border-radius-default 0 0;
}
.file-header-content { .file-header-content {
white-space: nowrap; white-space: nowrap;
...@@ -337,6 +340,17 @@ span.idiff { ...@@ -337,6 +340,17 @@ span.idiff {
text-overflow: ellipsis; text-overflow: ellipsis;
padding-right: 30px; padding-right: 30px;
position: relative; position: relative;
width: auto;
@media (max-width: map-get($grid-breakpoints, sm)-1) {
width: 100%;
}
}
.file-holder & {
.file-actions {
position: static;
}
} }
.btn-clipboard { .btn-clipboard {
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
- @pre_auth.scopes.each do |scope| - @pre_auth.scopes.each do |scope|
%li %li
%strong= t scope, scope: [:doorkeeper, :scopes] %strong= t scope, scope: [:doorkeeper, :scopes]
.scope-description= t scope, scope: [:doorkeeper, :scope_desc] .text-secondary= t scope, scope: [:doorkeeper, :scope_desc]
.form-actions.text-right .form-actions.text-right
= form_tag oauth_authorization_path, method: :delete, class: 'inline' do = form_tag oauth_authorization_path, method: :delete, class: 'inline' do
= hidden_field_tag :client_id, @pre_auth.client.uid = hidden_field_tag :client_id, @pre_auth.client.uid
......
---
title: Prevent pipeline job tooltip from scrolling off dropdown container
merge_request:
author:
type: fixed
---
title: Replace deprecated bs.affix in merge request tabs with sticky polyfill
merge_request:
author:
type: fixed
---
title: Minor style changes to personal access token form and scope checkboxes
merge_request: 20052
author:
type: other
---
title: Fix overlapping file title and file actions in MR changes tag
merge_request:
author:
type: fixed
---
title: Fix tooltip flickering bug
merge_request:
author:
type: fixed
...@@ -135,4 +135,34 @@ describe('pipeline graph job component', () => { ...@@ -135,4 +135,34 @@ describe('pipeline graph job component', () => {
expect(component.$el.querySelector('.js-job-component-tooltip').getAttribute('data-original-title')).toEqual('test - success'); expect(component.$el.querySelector('.js-job-component-tooltip').getAttribute('data-original-title')).toEqual('test - success');
}); });
}); });
describe('tooltip placement', () => {
const tooltipBoundary = 'a[data-boundary="viewport"]';
it('does not set tooltip boundary by default', () => {
component = mountComponent(JobComponent, {
job: mockJob,
});
expect(component.$el.querySelector(tooltipBoundary)).toBeNull();
});
it('sets tooltip boundary to viewport for small dropdowns', () => {
component = mountComponent(JobComponent, {
job: mockJob,
dropdownLength: 1,
});
expect(component.$el.querySelector(tooltipBoundary)).not.toBeNull();
});
it('does not set tooltip boundary for large lists', () => {
component = mountComponent(JobComponent, {
job: mockJob,
dropdownLength: 7,
});
expect(component.$el.querySelector(tooltipBoundary)).toBeNull();
});
});
}); });
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