Commit 8327c2c7 authored by Marin Jankovski's avatar Marin Jankovski

Merge branch 'ce-to-ee-2018-01-18' into 'master'

CE upstream - Thursday

Closes gitlab-ce#42158

See merge request gitlab-org/gitlab-ee!4156
parents bd12fbce dabb8aa7
...@@ -50,13 +50,13 @@ ...@@ -50,13 +50,13 @@
Pipeline Pipeline
</div> </div>
<div <div
class="table-section section-25 js-pipeline-commit pipeline-commit" class="table-section section-20 js-pipeline-commit pipeline-commit"
role="rowheader" role="rowheader"
> >
Commit Commit
</div> </div>
<div <div
class="table-section section-15 js-pipeline-stages pipeline-stages" class="table-section section-20 js-pipeline-stages pipeline-stages"
role="rowheader" role="rowheader"
> >
Stages Stages
......
...@@ -240,7 +240,7 @@ ...@@ -240,7 +240,7 @@
:auto-devops-help-path="autoDevopsHelpPath" :auto-devops-help-path="autoDevopsHelpPath"
/> />
<div class="table-section section-25"> <div class="table-section section-20">
<div <div
class="table-mobile-header" class="table-mobile-header"
role="rowheader"> role="rowheader">
...@@ -259,7 +259,7 @@ ...@@ -259,7 +259,7 @@
</div> </div>
</div> </div>
<div class="table-section section-wrap section-15 stage-cell"> <div class="table-section section-wrap section-20 stage-cell">
<div <div
class="table-mobile-header" class="table-mobile-header"
role="rowheader"> role="rowheader">
......
...@@ -255,7 +255,7 @@ ...@@ -255,7 +255,7 @@
.stage-cell { .stage-cell {
&.table-section { &.table-section {
@media (min-width: $screen-md-min) { @media (min-width: $screen-md-min) {
min-width: 148px; min-width: 160px; /* Hack alert: Without this the mini graph pipeline won't work properly*/
margin-right: -4px; margin-right: -4px;
} }
} }
......
...@@ -71,7 +71,7 @@ class LabelsFinder < UnionFinder ...@@ -71,7 +71,7 @@ class LabelsFinder < UnionFinder
end end
def projects? def projects?
params[:project_ids].present? params[:project_ids]
end end
def only_group_labels? def only_group_labels?
......
...@@ -307,6 +307,12 @@ module IssuablesHelper ...@@ -307,6 +307,12 @@ module IssuablesHelper
issuable.model_name.human.downcase issuable.model_name.human.downcase
end end
def selected_labels
Array(params[:label_name]).map do |label_name|
Label.new(title: label_name)
end
end
private private
def sidebar_gutter_collapsed? def sidebar_gutter_collapsed?
......
...@@ -3,23 +3,6 @@ ...@@ -3,23 +3,6 @@
= render 'profiles/head' = render 'profiles/head'
= form_for @user, url: profile_preferences_path, remote: true, method: :put, html: { class: 'row prepend-top-default js-preferences-form' } do |f| = form_for @user, url: profile_preferences_path, remote: true, method: :put, html: { class: 'row prepend-top-default js-preferences-form' } do |f|
.col-lg-4
%h4.prepend-top-0
Web IDE (Beta)
%p Enable the new web IDE on this device to make it possible to open and edit multiple files with a single commit
.col-lg-8.multi-file-editor-options
= label_tag do
.preview.append-bottom-10= image_tag "multi-editor-off.png"
= f.radio_button :multi_file, "off", checked: true
Off
= label_tag do
.preview.append-bottom-10= image_tag "multi-editor-on.png"
= f.radio_button :multi_file, "on", checked: false
On
.col-sm-12
%hr
.col-lg-4.application-theme .col-lg-4.application-theme
%h4.prepend-top-0 %h4.prepend-top-0
GitLab navigation theme GitLab navigation theme
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
= render "shared/issuable/milestone_dropdown", selected: finder.milestones.try(:first), name: :milestone_title, show_any: true, show_upcoming: true, board: board, show_started: true = render "shared/issuable/milestone_dropdown", selected: finder.milestones.try(:first), name: :milestone_title, show_any: true, show_upcoming: true, board: board, show_started: true
.filter-item.inline.labels-filter .filter-item.inline.labels-filter
= render "shared/issuable/label_dropdown", selected: finder.labels.select(:title).uniq, use_id: false, selected_toggle: params[:label_name], data_options: { field_name: "label_name[]" } = render "shared/issuable/label_dropdown", selected: selected_labels, use_id: false, selected_toggle: params[:label_name], data_options: { field_name: "label_name[]" }
- if issuable_filter_present? - if issuable_filter_present?
.filter-item.inline.reset-filters .filter-item.inline.reset-filters
......
---
title: Remove unecessary query from labels filter
merge_request:
author:
type: performance
...@@ -28,6 +28,8 @@ module Gitlab ...@@ -28,6 +28,8 @@ module Gitlab
UPDATE #{quoted_table} UPDATE #{quoted_table}
SET #{quoted_copy_to} = #{quoted_copy_from} SET #{quoted_copy_to} = #{quoted_copy_from}
WHERE id BETWEEN #{start_id} AND #{end_id} WHERE id BETWEEN #{start_id} AND #{end_id}
AND #{quoted_copy_from} IS NOT NULL
AND #{quoted_copy_to} IS NULL
SQL SQL
end end
......
...@@ -525,8 +525,9 @@ module Gitlab ...@@ -525,8 +525,9 @@ module Gitlab
install_rename_triggers(table, column, temp_column) install_rename_triggers(table, column, temp_column)
# Schedule the jobs that will copy the data from the old column to the # Schedule the jobs that will copy the data from the old column to the
# new one. # new one. Rows with NULL values in our source column are skipped since
relation.each_batch(of: batch_size) do |batch, index| # the target column is already NULL at this point.
relation.where.not(column => nil).each_batch(of: batch_size) do |batch, index|
start_id, end_id = batch.pluck('MIN(id), MAX(id)').first start_id, end_id = batch.pluck('MIN(id), MAX(id)').first
max_index = index max_index = index
......
...@@ -32,18 +32,6 @@ describe 'User visits the profile preferences page' do ...@@ -32,18 +32,6 @@ describe 'User visits the profile preferences page' do
end end
end end
describe 'User changes their multi file editor preferences', :js do
it 'set the new_repo cookie when the option is ON' do
choose 'user_multi_file_on'
expect(get_cookie('new_repo')).not_to be_nil
end
it 'deletes the new_repo cookie when the option is OFF' do
choose 'user_multi_file_off'
expect(get_cookie('new_repo')).to be_nil
end
end
describe 'User changes their default dashboard', :js do describe 'User changes their default dashboard', :js do
it 'creates a flash message' do it 'creates a flash message' do
select 'Starred Projects', from: 'user_dashboard' select 'Starred Projects', from: 'user_dashboard'
......
...@@ -218,4 +218,33 @@ describe IssuablesHelper do ...@@ -218,4 +218,33 @@ describe IssuablesHelper do
expect(JSON.parse(helper.issuable_initial_data(epic))).to eq(expected_data) expect(JSON.parse(helper.issuable_initial_data(epic))).to eq(expected_data)
end end
end end
describe '#selected_labels' do
context 'if label_name param is a string' do
it 'returns a new label with title' do
allow(helper).to receive(:params)
.and_return(ActionController::Parameters.new(label_name: 'test label'))
labels = helper.selected_labels
expect(labels).to be_an(Array)
expect(labels.size).to eq(1)
expect(labels.first.title).to eq('test label')
end
end
context 'if label_name param is an array' do
it 'returns a new label with title for each element' do
allow(helper).to receive(:params)
.and_return(ActionController::Parameters.new(label_name: ['test label 1', 'test label 2']))
labels = helper.selected_labels
expect(labels).to be_an(Array)
expect(labels.size).to eq(2)
expect(labels.first.title).to eq('test label 1')
expect(labels.second.title).to eq('test label 2')
end
end
end
end end
...@@ -1038,7 +1038,7 @@ describe Gitlab::Database::MigrationHelpers do ...@@ -1038,7 +1038,7 @@ describe Gitlab::Database::MigrationHelpers do
end end
describe '#change_column_type_using_background_migration' do describe '#change_column_type_using_background_migration' do
let!(:issue) { create(:issue) } let!(:issue) { create(:issue, :closed, closed_at: Time.zone.now) }
let(:issue_model) do let(:issue_model) do
Class.new(ActiveRecord::Base) do Class.new(ActiveRecord::Base) do
......
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