Commit c94bfae4 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'ce-to-ee-2018-12-03' into 'master'

CE upstream - 2018-12-03 18:21 UTC

Closes gitlab-ce#53515

See merge request gitlab-org/gitlab-ee!8678
parents e35040dc a6c8359c
...@@ -88,10 +88,15 @@ export const conditions = [ ...@@ -88,10 +88,15 @@ export const conditions = [
value: 'started', value: 'started',
}, },
{ {
url: 'label_name[]=No+Label', url: 'label_name[]=None',
tokenKey: 'label', tokenKey: 'label',
value: 'none', value: 'none',
}, },
{
url: 'label_name[]=Any',
tokenKey: 'any',
value: 'any',
},
{ {
url: 'my_reaction_emoji=None', url: 'my_reaction_emoji=None',
tokenKey: 'my-reaction', tokenKey: 'my-reaction',
......
...@@ -30,6 +30,7 @@ export default class MirrorRepos { ...@@ -30,6 +30,7 @@ export default class MirrorRepos {
this.$password.on('input.updateUrl', () => this.debouncedUpdateUrl()); this.$password.on('input.updateUrl', () => this.debouncedUpdateUrl());
this.initMirrorSSH(); this.initMirrorSSH();
this.updateProtectedBranches();
} }
initMirrorSSH() { initMirrorSSH() {
......
...@@ -84,10 +84,6 @@ export default { ...@@ -84,10 +84,6 @@ 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
* *
...@@ -108,7 +104,7 @@ export default { ...@@ -108,7 +104,7 @@ export default {
<div class="ci-job-component"> <div class="ci-job-component">
<gl-link <gl-link
v-if="status.has_details" v-if="status.has_details"
v-gl-tooltip="{ boundary: tooltipBoundary }" v-gl-tooltip
:href="status.details_path" :href="status.details_path"
:title="tooltipText" :title="tooltipText"
:class="cssClassJobName" :class="cssClassJobName"
......
...@@ -23,11 +23,11 @@ export default class Star { ...@@ -23,11 +23,11 @@ export default class Star {
if (isStarred) { if (isStarred) {
$starSpan.removeClass('starred').text(s__('StarProject|Star')); $starSpan.removeClass('starred').text(s__('StarProject|Star'));
$startIcon.remove(); $startIcon.remove();
$this.prepend(spriteIcon('star-o')); $this.prepend(spriteIcon('star-o', 'icon'));
} else { } else {
$starSpan.addClass('starred').text(__('Unstar')); $starSpan.addClass('starred').text(__('Unstar'));
$startIcon.remove(); $startIcon.remove();
$this.prepend(spriteIcon('star')); $this.prepend(spriteIcon('star', 'icon'));
} }
}) })
.catch(() => Flash('Star toggle failed. Try again later.')); .catch(() => Flash('Star toggle failed. Try again later.'));
......
...@@ -363,6 +363,12 @@ ...@@ -363,6 +363,12 @@
background-color: $white-light; background-color: $white-light;
border-top: 0; border-top: 0;
} }
.filter-dropdown-container {
.dropdown {
margin-left: 0;
}
}
} }
@include media-breakpoint-down(sm) { @include media-breakpoint-down(sm) {
...@@ -372,16 +378,6 @@ ...@@ -372,16 +378,6 @@
.dropdown-menu { .dropdown-menu {
width: 100%; width: 100%;
} }
.dropdown {
margin-left: 0;
}
.fa-chevron-down {
position: absolute;
right: 10px;
top: 10px;
}
} }
} }
......
...@@ -158,6 +158,10 @@ ...@@ -158,6 +158,10 @@
width: 100%; width: 100%;
} }
.dropdown-menu-toggle {
margin-bottom: 0;
}
form { form {
display: block; display: block;
height: auto; height: auto;
......
...@@ -11,7 +11,7 @@ class Admin::RequestsProfilesController < Admin::ApplicationController ...@@ -11,7 +11,7 @@ class Admin::RequestsProfilesController < Admin::ApplicationController
profile = Gitlab::RequestProfiler::Profile.find(clean_name) profile = Gitlab::RequestProfiler::Profile.find(clean_name)
if profile if profile
render text: profile.content render html: profile.content
else else
redirect_to admin_requests_profiles_path, alert: 'Profile not found' redirect_to admin_requests_profiles_path, alert: 'Profile not found'
end end
......
...@@ -15,7 +15,7 @@ class ChaosController < ActionController::Base ...@@ -15,7 +15,7 @@ class ChaosController < ActionController::Base
duration_taken = (Time.now - start).seconds duration_taken = (Time.now - start).seconds
Kernel.sleep duration_s - duration_taken if duration_s > duration_taken Kernel.sleep duration_s - duration_taken if duration_s > duration_taken
render text: "OK", content_type: 'text/plain' render plain: "OK"
end end
def cpuspin def cpuspin
...@@ -24,14 +24,14 @@ class ChaosController < ActionController::Base ...@@ -24,14 +24,14 @@ class ChaosController < ActionController::Base
rand while Time.now < end_time rand while Time.now < end_time
render text: "OK", content_type: 'text/plain' render plain: "OK"
end end
def sleep def sleep
duration_s = (params[:duration_s]&.to_i || 30).seconds duration_s = (params[:duration_s]&.to_i || 30).seconds
Kernel.sleep duration_s Kernel.sleep duration_s
render text: "OK", content_type: 'text/plain' render plain: "OK"
end end
def kill def kill
...@@ -44,13 +44,13 @@ class ChaosController < ActionController::Base ...@@ -44,13 +44,13 @@ class ChaosController < ActionController::Base
secret = ENV['GITLAB_CHAOS_SECRET'] secret = ENV['GITLAB_CHAOS_SECRET']
# GITLAB_CHAOS_SECRET is required unless you're running in Development mode # GITLAB_CHAOS_SECRET is required unless you're running in Development mode
if !secret && !Rails.env.development? if !secret && !Rails.env.development?
render text: "chaos misconfigured: please configure GITLAB_CHAOS_SECRET when using GITLAB_ENABLE_CHAOS_ENDPOINTS outside of a development environment", content_type: 'text/plain', status: 500 render plain: "chaos misconfigured: please configure GITLAB_CHAOS_SECRET when using GITLAB_ENABLE_CHAOS_ENDPOINTS outside of a development environment", status: :internal_server_error
end end
return unless secret return unless secret
unless request.headers["HTTP_X_CHAOS_SECRET"] == secret unless request.headers["HTTP_X_CHAOS_SECRET"] == secret
render text: "To experience chaos, please set X-Chaos-Secret header", content_type: 'text/plain', status: 401 render plain: "To experience chaos, please set X-Chaos-Secret header", status: :unauthorized
end end
end end
end end
...@@ -15,7 +15,7 @@ class MetricsController < ActionController::Base ...@@ -15,7 +15,7 @@ class MetricsController < ActionController::Base
"# Metrics are disabled, see: #{help_page}\n" "# Metrics are disabled, see: #{help_page}\n"
end end
render text: response, content_type: 'text/plain; version=0.0.4' render plain: response, content_type: 'text/plain; version=0.0.4'
end end
private private
......
...@@ -41,12 +41,12 @@ class Profiles::KeysController < Profiles::ApplicationController ...@@ -41,12 +41,12 @@ class Profiles::KeysController < Profiles::ApplicationController
user = UserFinder.new(params[:username]).find_by_username user = UserFinder.new(params[:username]).find_by_username
if user.present? if user.present?
headers['Content-Disposition'] = 'attachment' headers['Content-Disposition'] = 'attachment'
render text: user.all_ssh_keys.join("\n"), content_type: 'text/plain' render plain: user.all_ssh_keys.join("\n")
else else
return render_404 return render_404
end end
rescue => e rescue => e
render text: e.message render html: e.message
end end
else else
return render_404 return render_404
......
...@@ -124,7 +124,7 @@ class Projects::EnvironmentsController < Projects::ApplicationController ...@@ -124,7 +124,7 @@ class Projects::EnvironmentsController < Projects::ApplicationController
set_workhorse_internal_api_content_type set_workhorse_internal_api_content_type
render json: Gitlab::Workhorse.terminal_websocket(terminal) render json: Gitlab::Workhorse.terminal_websocket(terminal)
else else
render text: 'Not found', status: :not_found render html: 'Not found', status: :not_found
end end
end end
......
- sorted_by = sort_options_hash[@sort] - sorted_by = sort_options_hash[@sort]
.dropdown.inline.prepend-left-10 .dropdown.inline.prepend-left-10
%button.dropdown-toggle{ type: 'button', data: { toggle: 'dropdown', display: 'static' } } %button.dropdown-menu-toggle{ type: 'button', data: { toggle: 'dropdown', display: 'static' } }
= sorted_by = sorted_by
= icon('chevron-down') = icon('chevron-down')
%ul.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable.dropdown-menu-sort %ul.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable.dropdown-menu-sort
......
- if current_user - if current_user
.dropdown .dropdown
%button.dropdown-toggle{ href: '#', "data-toggle" => "dropdown", 'data-display' => 'static' } %button.dropdown-menu-toggle{ href: '#', "data-toggle" => "dropdown", 'data-display' => 'static' }
= icon('globe') = icon('globe', class: 'mt-1')
%span.light= _("Visibility:") %span.light.ml-3= _("Visibility:")
- if params[:visibility_level].present? - if params[:visibility_level].present?
= visibility_level_label(params[:visibility_level].to_i) = visibility_level_label(params[:visibility_level].to_i)
- else - else
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
spellcheck: false, data: { 'filter-selector' => 'span.namespace-name' } spellcheck: false, data: { 'filter-selector' => 'span.namespace-name' }
.dropdown .dropdown
%button.dropdown-toggle{ type: 'button', 'data-toggle' => 'dropdown' } %button.dropdown-menu-toggle{ type: 'button', 'data-toggle' => 'dropdown' }
%span.light sort: %span.light sort:
- if @sort.present? - if @sort.present?
= sort_options_hash[@sort] = sort_options_hash[@sort]
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
= link_to icon('question-circle'), help_page_path('user/project/protected_branches'), target: '_blank' = link_to icon('question-circle'), help_page_path('user/project/protected_branches'), target: '_blank'
.panel-footer .panel-footer
= f.submit _('Mirror repository'), class: 'btn btn-success', name: :update_remote_mirror = f.submit _('Mirror repository'), class: 'btn btn-success js-mirror-submit', name: :update_remote_mirror
.panel.panel-default .panel.panel-default
.table-responsive .table-responsive
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
= search_field_tag :search, params[:search], { placeholder: s_('TagsPage|Filter by tag name'), id: 'tag-search', class: 'form-control search-text-input input-short', spellcheck: false } = search_field_tag :search, params[:search], { placeholder: s_('TagsPage|Filter by tag name'), id: 'tag-search', class: 'form-control search-text-input input-short', spellcheck: false }
.dropdown .dropdown
%button.dropdown-toggle{ type: 'button', data: { toggle: 'dropdown'} } %button.dropdown-menu-toggle{ type: 'button', data: { toggle: 'dropdown'} }
%span.light %span.light
= tags_sort_options_hash[@sort] = tags_sort_options_hash[@sort]
= icon('chevron-down') = icon('chevron-down')
......
.dropdown.inline.prepend-left-10 .dropdown.inline.prepend-left-10
%button.dropdown-toggle{ type: 'button', data: { toggle: 'dropdown' } } %button.dropdown-menu-toggle{ type: 'button', data: { toggle: 'dropdown' } }
%span.light %span.light
- if @sort.present? - if @sort.present?
= milestone_sort_options_hash[@sort] = milestone_sort_options_hash[@sort]
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
- viewing_issues = controller.controller_name == 'issues' || controller.action_name == 'issues' - viewing_issues = controller.controller_name == 'issues' || controller.action_name == 'issues'
.dropdown.inline.prepend-left-10 .dropdown.inline.prepend-left-10
%button.dropdown-toggle{ type: 'button', data: { toggle: 'dropdown', display: 'static' } } %button.dropdown-menu-toggle{ type: 'button', data: { toggle: 'dropdown', display: 'static' } }
= sorted_by = sorted_by
= icon('chevron-down') = icon('chevron-down')
%ul.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable.dropdown-menu-sort %ul.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable.dropdown-menu-sort
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
- default_sort_by = sort_value_recently_created - default_sort_by = sort_value_recently_created
.dropdown.inline.js-group-filter-dropdown-wrap.append-right-10 .dropdown.inline.js-group-filter-dropdown-wrap.append-right-10
%button.dropdown-toggle{ type: 'button', 'data-toggle' => 'dropdown' } %button.dropdown-menu-toggle{ type: 'button', 'data-toggle' => 'dropdown' }
%span.dropdown-label %span.dropdown-label
= options_hash[default_sort_by] = options_hash[default_sort_by]
= icon('chevron-down') = icon('chevron-down')
......
...@@ -95,7 +95,10 @@ ...@@ -95,7 +95,10 @@
%ul{ data: { dropdown: true } } %ul{ data: { dropdown: true } }
%li.filter-dropdown-item{ data: { value: 'none' } } %li.filter-dropdown-item{ data: { value: 'none' } }
%button.btn.btn-link{ type: 'button' } %button.btn.btn-link{ type: 'button' }
= _('No Label') = _('None')
%li.filter-dropdown-item{ data: { value: 'any' } }
%button.btn.btn-link{ type: 'button' }
= _('Any')
%li.divider.droplab-item-ignore %li.divider.droplab-item-ignore
%ul.filter-dropdown{ data: { dynamic: true, dropdown: true } } %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } }
%li.filter-dropdown-item %li.filter-dropdown-item
......
- sort_title = label_sort_options_hash[@sort] || sort_title_name_desc - sort_title = label_sort_options_hash[@sort] || sort_title_name_desc
.dropdown.inline .dropdown.inline
%button.dropdown-toggle{ type: 'button', data: { toggle: 'dropdown' } } %button.dropdown-menu-toggle{ type: 'button', data: { toggle: 'dropdown' } }
= sort_title = sort_title
= icon('chevron-down') = icon('chevron-down')
%ul.dropdown-menu.dropdown-menu-right.dropdown-menu-sort %ul.dropdown-menu.dropdown-menu-right.dropdown-menu-sort
......
---
title: Adds Any option to label filters
merge_request: 23111
author: Jacopo Beschi @jacopo-beschi
type: added
---
title: 'Fix: Unstar icon button is misaligned'
merge_request: 23444
author:
type: fixed
---
title: Fix Order By dropdown menu styling in tablet and mobile screens
merge_request: 23446
author:
type: fixed
---
title: 'Fix deprecation: render :text is deprecated because it does not actually render
a text/plain response'
merge_request: 23425
author: Jasper Maes
type: other
---
title: Fix "protected branches only" checkbox not set properly at init
merge_request: 23409
author:
type: fixed
...@@ -114,7 +114,7 @@ describe ApplicationController do ...@@ -114,7 +114,7 @@ describe ApplicationController do
skip_before_action :authenticate_user!, only: :index skip_before_action :authenticate_user!, only: :index
def index def index
render text: 'authenticated' render html: 'authenticated'
end end
end end
...@@ -401,7 +401,7 @@ describe ApplicationController do ...@@ -401,7 +401,7 @@ describe ApplicationController do
context 'terms' do context 'terms' do
controller(described_class) do controller(described_class) do
def index def index
render text: 'authenticated' render html: 'authenticated'
end end
end end
...@@ -444,7 +444,7 @@ describe ApplicationController do ...@@ -444,7 +444,7 @@ describe ApplicationController do
attr_reader :last_payload attr_reader :last_payload
def index def index
render text: 'authenticated' render html: 'authenticated'
end end
def append_info_to_payload(payload) def append_info_to_payload(payload)
......
...@@ -176,7 +176,7 @@ describe 'Issue Boards add issue modal filtering', :js do ...@@ -176,7 +176,7 @@ describe 'Issue Boards add issue modal filtering', :js do
it 'filters by no label' do it 'filters by no label' do
set_filter('label') set_filter('label')
click_filter_link('No Label') click_filter_link('None')
submit_filter submit_filter
page.within('.add-issues-modal') do page.within('.add-issues-modal') do
......
...@@ -45,7 +45,8 @@ describe 'Dropdown label', :js do ...@@ -45,7 +45,8 @@ describe 'Dropdown label', :js do
bug_label = create(:label, project: project, title: 'bug-label') bug_label = create(:label, project: project, title: 'bug-label')
init_label_search init_label_search
filtered_search.native.send_keys(:down, :down, :enter) # navigate to the bug_label option and selects it
filtered_search.native.send_keys(:down, :down, :down, :enter)
expect_tokens([label_token(bug_label.title)]) expect_tokens([label_token(bug_label.title)])
expect_filtered_search_input_empty expect_filtered_search_input_empty
...@@ -234,12 +235,20 @@ describe 'Dropdown label', :js do ...@@ -234,12 +235,20 @@ describe 'Dropdown label', :js do
end end
it 'selects `no label`' do it 'selects `no label`' do
find("#{js_dropdown_label} .filter-dropdown-item", text: 'No Label').click find("#{js_dropdown_label} .filter-dropdown-item", text: 'None').click
expect(page).not_to have_css(js_dropdown_label) expect(page).not_to have_css(js_dropdown_label)
expect_tokens([label_token('none', false)]) expect_tokens([label_token('none', false)])
expect_filtered_search_input_empty expect_filtered_search_input_empty
end end
it 'selects `any label`' do
find("#{js_dropdown_label} .filter-dropdown-item", text: 'Any').click
expect(page).not_to have_css(js_dropdown_label)
expect_tokens([label_token('any', false)])
expect_filtered_search_input_empty
end
end end
describe 'input has existing content' do describe 'input has existing content' do
......
...@@ -430,10 +430,10 @@ describe 'Filter issues', :js do ...@@ -430,10 +430,10 @@ describe 'Filter issues', :js do
expect_issues_list_count(2) expect_issues_list_count(2)
sort_toggle = find('.filtered-search-wrapper .dropdown-toggle') sort_toggle = find('.filter-dropdown-container .dropdown-menu-toggle')
sort_toggle.click sort_toggle.click
find('.filtered-search-wrapper .dropdown-menu li a', text: 'Created date').click find('.filter-dropdown-container .dropdown-menu li a', text: 'Created date').click
wait_for_requests wait_for_requests
expect(find('.issues-list .issue:first-of-type .issue-title-text a')).to have_content(new_issue.title) expect(find('.issues-list .issue:first-of-type .issue-title-text a')).to have_content(new_issue.title)
......
...@@ -20,7 +20,7 @@ describe "User sorts issues" do ...@@ -20,7 +20,7 @@ describe "User sorts issues" do
end end
it 'keeps the sort option' do it 'keeps the sort option' do
find('button.dropdown-toggle').click find('.filter-dropdown-container button.dropdown-menu-toggle').click
page.within('.content ul.dropdown-menu.dropdown-menu-right li') do page.within('.content ul.dropdown-menu.dropdown-menu-right li') do
click_link('Milestone') click_link('Milestone')
...@@ -40,7 +40,7 @@ describe "User sorts issues" do ...@@ -40,7 +40,7 @@ describe "User sorts issues" do
end end
it "sorts by popularity" do it "sorts by popularity" do
find("button.dropdown-toggle").click find(".filter-dropdown-container button.dropdown-menu-toggle").click
page.within(".content ul.dropdown-menu.dropdown-menu-right li") do page.within(".content ul.dropdown-menu.dropdown-menu-right li") do
click_link("Popularity") click_link("Popularity")
......
...@@ -19,7 +19,7 @@ describe 'User sorts merge requests' do ...@@ -19,7 +19,7 @@ describe 'User sorts merge requests' do
end end
it 'keeps the sort option' do it 'keeps the sort option' do
find('button.dropdown-toggle').click find('.filter-dropdown-container button.dropdown-menu-toggle').click
page.within('.content ul.dropdown-menu.dropdown-menu-right li') do page.within('.content ul.dropdown-menu.dropdown-menu-right li') do
click_link('Milestone') click_link('Milestone')
...@@ -49,7 +49,7 @@ describe 'User sorts merge requests' do ...@@ -49,7 +49,7 @@ describe 'User sorts merge requests' do
it 'separates remember sorting with issues' do it 'separates remember sorting with issues' do
create(:issue, project: project) create(:issue, project: project)
find('button.dropdown-toggle').click find('.filter-dropdown-container button.dropdown-menu-toggle').click
page.within('.content ul.dropdown-menu.dropdown-menu-right li') do page.within('.content ul.dropdown-menu.dropdown-menu-right li') do
click_link('Milestone') click_link('Milestone')
...@@ -70,7 +70,7 @@ describe 'User sorts merge requests' do ...@@ -70,7 +70,7 @@ describe 'User sorts merge requests' do
end end
it 'sorts by popularity' do it 'sorts by popularity' do
find('button.dropdown-toggle').click find('.filter-dropdown-container button.dropdown-menu-toggle').click
page.within('.content ul.dropdown-menu.dropdown-menu-right li') do page.within('.content ul.dropdown-menu.dropdown-menu-right li') do
click_link('Popularity') click_link('Popularity')
......
...@@ -32,7 +32,7 @@ describe 'Issue prioritization' do ...@@ -32,7 +32,7 @@ describe 'Issue prioritization' do
visit project_issues_path(project, sort: 'label_priority') visit project_issues_path(project, sort: 'label_priority')
# Ensure we are indicating that issues are sorted by priority # Ensure we are indicating that issues are sorted by priority
expect(page).to have_selector('.dropdown-toggle', text: 'Label priority') expect(page).to have_selector('.dropdown-menu-toggle', text: 'Label priority')
page.within('.issues-holder') do page.within('.issues-holder') do
issue_titles = all('.issues-list .issue-title-text').map(&:text) issue_titles = all('.issues-list .issue-title-text').map(&:text)
...@@ -70,7 +70,7 @@ describe 'Issue prioritization' do ...@@ -70,7 +70,7 @@ describe 'Issue prioritization' do
sign_in user sign_in user
visit project_issues_path(project, sort: 'label_priority') visit project_issues_path(project, sort: 'label_priority')
expect(page).to have_selector('.dropdown-toggle', text: 'Label priority') expect(page).to have_selector('.dropdown-menu-toggle', text: 'Label priority')
page.within('.issues-holder') do page.within('.issues-holder') do
issue_titles = all('.issues-list .issue-title-text').map(&:text) issue_titles = all('.issues-list .issue-title-text').map(&:text)
......
...@@ -133,19 +133,50 @@ describe 'Projects > Settings > Repository settings' do ...@@ -133,19 +133,50 @@ describe 'Projects > Settings > Repository settings' do
expect(page).to have_selector('#mirror_direction') expect(page).to have_selector('#mirror_direction')
end end
it 'generates an SSH public key on submission', :js do it 'creates a push mirror that mirrors all branches', :js do
expect(find('.js-mirror-protected-hidden', visible: false).value).to eq('0')
fill_in 'url', with: 'ssh://user@localhost/project.git' fill_in 'url', with: 'ssh://user@localhost/project.git'
select 'SSH public key', from: 'Authentication method' select 'SSH public key', from: 'Authentication method'
direction_select = find('#mirror_direction') select_direction
# In CE, this select box is disabled, but in EE, it is enabled Sidekiq::Testing.fake! do
if direction_select.disabled? click_button 'Mirror repository'
expect(direction_select.value).to eq('push')
else
direction_select.select('Push')
end end
project.reload
expect(page).to have_content('Mirroring settings were successfully updated')
expect(project.remote_mirrors.first.only_protected_branches).to eq(false)
end
it 'creates a push mirror that only mirrors protected branches', :js do
find('#only_protected_branches').click
expect(find('.js-mirror-protected-hidden', visible: false).value).to eq('1')
fill_in 'url', with: 'ssh://user@localhost/project.git'
select 'SSH public key', from: 'Authentication method'
select_direction
Sidekiq::Testing.fake! do
click_button 'Mirror repository'
end
project.reload
expect(page).to have_content('Mirroring settings were successfully updated')
expect(project.remote_mirrors.first.only_protected_branches).to eq(true)
end
it 'generates an SSH public key on submission', :js do
fill_in 'url', with: 'ssh://user@localhost/project.git'
select 'SSH public key', from: 'Authentication method'
select_direction
Sidekiq::Testing.fake! do Sidekiq::Testing.fake! do
click_button 'Mirror repository' click_button 'Mirror repository'
end end
...@@ -153,6 +184,17 @@ describe 'Projects > Settings > Repository settings' do ...@@ -153,6 +184,17 @@ describe 'Projects > Settings > Repository settings' do
expect(page).to have_content('Mirroring settings were successfully updated') expect(page).to have_content('Mirroring settings were successfully updated')
expect(page).to have_selector('[title="Copy SSH public key"]') expect(page).to have_selector('[title="Copy SSH public key"]')
end end
def select_direction(direction = 'push')
direction_select = find('#mirror_direction')
# In CE, this select box is disabled, but in EE, it is enabled
if direction_select.disabled?
expect(direction_select.value).to eq(direction)
else
direction_select.select(direction.capitalize)
end
end
end end
end end
end end
...@@ -139,57 +139,17 @@ describe('pipeline graph job item', () => { ...@@ -139,57 +139,17 @@ describe('pipeline graph job item', () => {
}); });
}); });
describe('tooltip placement', () => {
it('does not set tooltip boundary by default', () => {
component = mountComponent(JobComponent, {
job: mockJob,
});
expect(component.tooltipBoundary).toBeNull();
});
it('sets tooltip boundary to viewport for small dropdowns', () => {
component = mountComponent(JobComponent, {
job: mockJob,
dropdownLength: 1,
});
expect(component.tooltipBoundary).toEqual('viewport');
});
it('does not set tooltip boundary for large lists', () => {
component = mountComponent(JobComponent, {
job: mockJob,
dropdownLength: 7,
});
expect(component.tooltipBoundary).toBeNull();
});
});
describe('for delayed job', () => { describe('for delayed job', () => {
beforeEach(() => { it('displays remaining time in tooltip', () => {
const fifteenMinutesInMilliseconds = 900000;
spyOn(Date, 'now').and.callFake(
() => new Date(delayedJobFixture.scheduled_at).getTime() - fifteenMinutesInMilliseconds,
);
});
it('displays remaining time in tooltip', done => {
component = mountComponent(JobComponent, { component = mountComponent(JobComponent, {
job: delayedJobFixture, job: delayedJobFixture,
}); });
Vue.nextTick() expect(
.then(() => { component.$el
expect( .querySelector('.js-pipeline-graph-job-link')
component.$el .getAttribute('data-original-title'),
.querySelector('.js-pipeline-graph-job-link') ).toEqual(`delayed job - delayed manual action (${component.remainingTime})`);
.getAttribute('data-original-title'),
).toEqual('delayed job - delayed manual action (00:15:00)');
})
.then(done)
.catch(done.fail);
}); });
}); });
}); });
...@@ -13,7 +13,7 @@ module Spec ...@@ -13,7 +13,7 @@ module Spec
module Features module Features
module SortingHelpers module SortingHelpers
def sort_by(value) def sort_by(value)
find('button.dropdown-toggle').click find('.filter-dropdown-container button.dropdown-menu-toggle').click
page.within('.content ul.dropdown-menu.dropdown-menu-right li') do page.within('.content ul.dropdown-menu.dropdown-menu-right li') do
click_link(value) click_link(value)
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
# #
module SortingHelper module SortingHelper
def sorting_by(value) def sorting_by(value)
find('button.dropdown-toggle').click find('.filter-dropdown-container button.dropdown-menu-toggle').click
page.within('.content ul.dropdown-menu.dropdown-menu-right li') do page.within('.content ul.dropdown-menu.dropdown-menu-right li') do
click_link value click_link value
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