Commit c223f8a1 authored by GitLab Bot's avatar GitLab Bot

Add latest changes from gitlab-org/gitlab@12-3-stable-ee

parent 7099ecf7
This diff is collapsed.
......@@ -9,5 +9,7 @@ export default {
};
</script>
<template>
<div class="duration rounded align-self-start px-2 ml-2 flex-shrink-0">{{ duration }}</div>
<div class="log-duration-badge rounded align-self-start px-2 ml-2 flex-shrink-0">
{{ duration }}
</div>
</template>
......@@ -19,7 +19,7 @@ export default {
</script>
<template>
<div class="line">
<div class="log-line">
<line-number :line-number="line.lineNumber" :path="path" />
<span v-for="(content, i) in line.content" :key="i" :class="content.style">{{
content.text
......
......@@ -43,7 +43,7 @@ export default {
<template>
<div
class="line collapsible-line d-flex justify-content-between"
class="log-line collapsible-line d-flex justify-content-between"
role="button"
@click="handleOnClick"
>
......
......@@ -11,7 +11,7 @@
background-color: $builds-trace-bg;
}
.line {
.log-line {
padding: 1px $gl-padding 1px $job-log-line-padding;
}
......@@ -40,7 +40,7 @@
}
}
.duration {
.log-duration-badge {
background: $gl-gray-400;
}
......
......@@ -88,7 +88,7 @@ module BoardsHelper
end
def boards_link_text
if multiple_boards_available?
if current_board_parent.multiple_issue_boards_available?
s_("IssueBoards|Boards")
else
s_("IssueBoards|Board")
......
......@@ -4,10 +4,10 @@ module Boards
module Lists
class UpdateService < Boards::BaseService
def execute(list)
return not_authorized if preferences? && !can_read?(list)
return not_authorized if position? && !can_admin?(list)
update_preferences_result = update_preferences(list) if can_read?(list)
update_position_result = update_position(list) if can_admin?(list)
if update_preferences(list) || update_position(list)
if update_preferences_result || update_position_result
success(list: list)
else
error(list.errors.messages, 422)
......@@ -32,10 +32,6 @@ module Boards
{ collapsed: Gitlab::Utils.to_boolean(params[:collapsed]) }
end
def not_authorized
error("Not authorized", 403)
end
def preferences?
params.has_key?(:collapsed)
end
......
......@@ -3,6 +3,7 @@
- breadcrumb_title @cluster.name
- page_title _('Kubernetes Cluster')
- manage_prometheus_path = edit_project_service_path(@cluster.project, 'prometheus') if @project
- cluster_environments_path = clusterable.environments_cluster_path(@cluster)
- expanded = expanded_by_default?
......@@ -16,7 +17,7 @@
install_jupyter_path: clusterable.install_applications_cluster_path(@cluster, :jupyter),
install_knative_path: clusterable.install_applications_cluster_path(@cluster, :knative),
update_knative_path: clusterable.update_applications_cluster_path(@cluster, :knative),
cluster_environments_path: clusterable.environments_cluster_path(@cluster),
cluster_environments_path: cluster_environments_path,
toggle_status: @cluster.enabled? ? 'true': 'false',
has_rbac: has_rbac_enabled?(@cluster) ? 'true': 'false',
cluster_type: @cluster.cluster_type,
......@@ -37,7 +38,7 @@
%h4= @cluster.name
= render 'banner'
= render_if_exists 'clusters/clusters/group_cluster_environments', expanded: expanded
- unless Gitlab.ee?
- if cluster_environments_path.present?
= render_if_exists 'clusters/clusters/group_cluster_environments', expanded: expanded
- else
= render 'configure', expanded: expanded
......@@ -6,7 +6,7 @@
.issues-filters{ class: ("w-100" if type == :boards_modal) }
.issues-details-filters.filtered-search-block.d-flex.flex-column.flex-md-row{ class: block_css_class, "v-pre" => type == :boards_modal }
- if type == :boards && (multiple_boards_available? || current_board_parent.boards.size > 1)
- if type == :boards
= render "shared/boards/switcher", board: board
= form_tag page_filter_path, method: :get, class: 'filter-form js-filter-form w-100' do
- if params[:search].present?
......
---
title: Fix CSS leak in job log
merge_request:
author:
type: fixed
---
title: Fix ordering of issue board lists not being persisted
merge_request: 17356
author:
type: fixed
---
title: Fix bug that caused a merge to show an error message
merge_request: 17466
author:
type: fixed
---
title: Fix error when duplicate users are merged in approvers list
merge_request: 17406
author:
type: fixed
......@@ -162,10 +162,10 @@ describe Boards::ListsController do
end
context 'with unauthorized user' do
it 'returns a forbidden 403 response' do
it 'returns a 422 unprocessable entity response' do
move user: guest, board: board, list: planning, position: 6
expect(response).to have_gitlab_http_status(403)
expect(response).to have_gitlab_http_status(422)
end
end
......
......@@ -13,7 +13,7 @@ describe 'Clusterable > Show page' do
sign_in(current_user)
end
shared_examples 'editing domain' do
shared_examples 'show page' do
before do
clusterable.add_maintainer(current_user)
end
......@@ -53,6 +53,12 @@ describe 'Clusterable > Show page' do
end
end
end
it 'does not show the environments tab' do
visit cluster_path
expect(page).not_to have_selector('.js-cluster-nav-environments', text: 'Environments')
end
end
shared_examples 'editing a GCP cluster' do
......@@ -113,42 +119,30 @@ describe 'Clusterable > Show page' do
end
context 'when clusterable is a project' do
it_behaves_like 'editing domain' do
let(:clusterable) { create(:project) }
let(:cluster) { create(:cluster, :provided_by_gcp, :project, projects: [clusterable]) }
let(:cluster_path) { project_cluster_path(clusterable, cluster) }
end
let(:clusterable) { create(:project) }
let(:cluster_path) { project_cluster_path(clusterable, cluster) }
let(:cluster) { create(:cluster, :provided_by_gcp, :project, projects: [clusterable]) }
it_behaves_like 'editing a GCP cluster' do
let(:clusterable) { create(:project) }
let(:cluster) { create(:cluster, :provided_by_gcp, :project, projects: [clusterable]) }
let(:cluster_path) { project_cluster_path(clusterable, cluster) }
end
it_behaves_like 'show page'
it_behaves_like 'editing a GCP cluster'
it_behaves_like 'editing a user-provided cluster' do
let(:clusterable) { create(:project) }
let(:cluster) { create(:cluster, :provided_by_user, :project, projects: [clusterable]) }
let(:cluster_path) { project_cluster_path(clusterable, cluster) }
end
end
context 'when clusterable is a group' do
it_behaves_like 'editing domain' do
let(:clusterable) { create(:group) }
let(:cluster) { create(:cluster, :provided_by_gcp, :group, groups: [clusterable]) }
let(:cluster_path) { group_cluster_path(clusterable, cluster) }
end
let(:clusterable) { create(:group) }
let(:cluster_path) { group_cluster_path(clusterable, cluster) }
let(:cluster) { create(:cluster, :provided_by_gcp, :group, groups: [clusterable]) }
it_behaves_like 'editing a GCP cluster' do
let(:clusterable) { create(:group) }
let(:cluster) { create(:cluster, :provided_by_gcp, :group, groups: [clusterable]) }
let(:cluster_path) { group_cluster_path(clusterable, cluster) }
end
it_behaves_like 'show page'
it_behaves_like 'editing a GCP cluster'
it_behaves_like 'editing a user-provided cluster' do
let(:clusterable) { create(:group) }
let(:cluster) { create(:cluster, :provided_by_user, :group, groups: [clusterable]) }
let(:cluster_path) { group_cluster_path(clusterable, cluster) }
end
end
end
......@@ -10,9 +10,8 @@ describe Boards::Lists::UpdateService do
context 'when user can admin list' do
it 'calls Lists::MoveService to update list position' do
board.parent.add_developer(user)
service = described_class.new(board.parent, user, position: 1)
expect(Boards::Lists::MoveService).to receive(:new).with(board.parent, user, { position: 1 }).and_call_original
expect(Boards::Lists::MoveService).to receive(:new).with(board.parent, user, params).and_call_original
expect_any_instance_of(Boards::Lists::MoveService).to receive(:execute).with(list)
service.execute(list)
......@@ -21,8 +20,6 @@ describe Boards::Lists::UpdateService do
context 'when user cannot admin list' do
it 'does not call Lists::MoveService to update list position' do
service = described_class.new(board.parent, user, position: 1)
expect(Boards::Lists::MoveService).not_to receive(:new)
service.execute(list)
......@@ -34,7 +31,6 @@ describe Boards::Lists::UpdateService do
context 'when user can read list' do
it 'updates list preference for user' do
board.parent.add_guest(user)
service = described_class.new(board.parent, user, collapsed: true)
service.execute(list)
......@@ -44,8 +40,6 @@ describe Boards::Lists::UpdateService do
context 'when user cannot read list' do
it 'does not update list preference for user' do
service = described_class.new(board.parent, user, collapsed: true)
service.execute(list)
expect(list.preferences_for(user).collapsed).to be_nil
......@@ -54,35 +48,61 @@ describe Boards::Lists::UpdateService do
end
describe '#execute' do
let(:service) { described_class.new(board.parent, user, params) }
context 'when position parameter is present' do
let(:params) { { position: 1 } }
context 'for projects' do
it_behaves_like 'moving list' do
let(:project) { create(:project, :private) }
let(:board) { create(:board, project: project) }
end
let(:project) { create(:project, :private) }
let(:board) { create(:board, project: project) }
it_behaves_like 'moving list'
end
context 'for groups' do
it_behaves_like 'moving list' do
let(:group) { create(:group, :private) }
let(:board) { create(:board, group: group) }
end
let(:group) { create(:group, :private) }
let(:board) { create(:board, group: group) }
it_behaves_like 'moving list'
end
end
context 'when collapsed parameter is present' do
let(:params) { { collapsed: true } }
context 'for projects' do
it_behaves_like 'updating list preferences' do
let(:project) { create(:project, :private) }
let(:board) { create(:board, project: project) }
end
let(:project) { create(:project, :private) }
let(:board) { create(:board, project: project) }
it_behaves_like 'updating list preferences'
end
context 'for groups' do
it_behaves_like 'updating list preferences' do
let(:group) { create(:group, :private) }
let(:board) { create(:board, group: group) }
end
let(:project) { create(:project, :private) }
let(:board) { create(:board, project: project) }
it_behaves_like 'updating list preferences'
end
end
context 'when position and collapsed are both present' do
let(:params) { { collapsed: true, position: 1 } }
context 'for projects' do
let(:project) { create(:project, :private) }
let(:board) { create(:board, project: project) }
it_behaves_like 'moving list'
it_behaves_like 'updating list preferences'
end
context 'for groups' do
let(:group) { create(:group, :private) }
let(:board) { create(:board, group: group) }
it_behaves_like 'moving list'
it_behaves_like 'updating list preferences'
end
end
end
......
......@@ -11,10 +11,6 @@ shared_examples_for 'multiple issue boards' do
wait_for_requests
end
it 'shows board switcher' do
expect(page).to have_css('.boards-switcher')
end
it 'shows current board name' do
page.within('.boards-switcher') do
expect(page).to have_content(board.name)
......
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