Commit 69a23cbe authored by GitLab Bot's avatar GitLab Bot

Add latest changes from gitlab-org/gitlab@master

parent ea4762d4
...@@ -82,9 +82,7 @@ export default { ...@@ -82,9 +82,7 @@ export default {
return n__('Milestone', 'Milestones', this.release.milestones.length); return n__('Milestone', 'Milestones', this.release.milestones.length);
}, },
shouldShowEditButton() { shouldShowEditButton() {
return Boolean( return Boolean(this.release._links && this.release._links.edit_url);
this.glFeatures.releaseEditPage && this.release._links && this.release._links.edit_url,
);
}, },
shouldShowEvidence() { shouldShowEvidence() {
return this.glFeatures.releaseEvidenceCollection; return this.glFeatures.releaseEvidenceCollection;
......
...@@ -552,6 +552,11 @@ ...@@ -552,6 +552,11 @@
svg { svg {
vertical-align: text-top; vertical-align: text-top;
} }
a.trial-link gl-emoji {
font-size: $gl-font-size;
vertical-align: baseline;
}
} }
} }
......
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
background: none; background: none;
.select2-search-field input { .select2-search-field input {
padding: 5px $gl-padding / 2; padding: 5px $gl-input-padding;
height: auto; height: auto;
font-family: inherit; font-family: inherit;
font-size: inherit; font-size: inherit;
......
...@@ -6,7 +6,6 @@ class Projects::ReleasesController < Projects::ApplicationController ...@@ -6,7 +6,6 @@ class Projects::ReleasesController < Projects::ApplicationController
before_action :release, only: %i[edit update] before_action :release, only: %i[edit update]
before_action :authorize_read_release! before_action :authorize_read_release!
before_action do before_action do
push_frontend_feature_flag(:release_edit_page, project, default_enabled: true)
push_frontend_feature_flag(:release_issue_summary, project) push_frontend_feature_flag(:release_issue_summary, project)
push_frontend_feature_flag(:release_evidence_collection, project) push_frontend_feature_flag(:release_evidence_collection, project)
end end
...@@ -44,7 +43,6 @@ class Projects::ReleasesController < Projects::ApplicationController ...@@ -44,7 +43,6 @@ class Projects::ReleasesController < Projects::ApplicationController
private private
def authorize_update_release! def authorize_update_release!
access_denied! unless Feature.enabled?(:release_edit_page, project, default_enabled: true)
access_denied! unless can?(current_user, :update_release, release) access_denied! unless can?(current_user, :update_release, release)
end end
......
...@@ -27,6 +27,16 @@ module MergeRequestsHelper ...@@ -27,6 +27,16 @@ module MergeRequestsHelper
classes.join(' ') classes.join(' ')
end end
def state_name_with_icon(merge_request)
if merge_request.merged?
[_("Merged"), "git-merge"]
elsif merge_request.closed?
[_("Closed"), "close"]
else
[_("Open"), "issue-open-m"]
end
end
def ci_build_details_path(merge_request) def ci_build_details_path(merge_request)
build_url = merge_request.source_project.ci_service.build_page(merge_request.diff_head_sha, merge_request.source_branch) build_url = merge_request.source_project.ci_service.build_page(merge_request.diff_head_sha, merge_request.source_branch)
return unless build_url return unless build_url
......
...@@ -1149,26 +1149,6 @@ class MergeRequest < ApplicationRecord ...@@ -1149,26 +1149,6 @@ class MergeRequest < ApplicationRecord
actual_head_pipeline.environments actual_head_pipeline.environments
end end
def state_human_name
if merged?
"Merged"
elsif closed?
"Closed"
else
"Open"
end
end
def state_icon_name
if merged?
"git-merge"
elsif closed?
"close"
else
"issue-open-m"
end
end
def fetch_ref! def fetch_ref!
target_project.repository.fetch_source_branch!(source_project.repository, source_branch, ref_path) target_project.repository.fetch_source_branch!(source_project.repository, source_branch, ref_path)
end end
......
...@@ -58,7 +58,6 @@ class ReleasePresenter < Gitlab::View::Presenter::Delegated ...@@ -58,7 +58,6 @@ class ReleasePresenter < Gitlab::View::Presenter::Delegated
end end
def release_edit_page_available? def release_edit_page_available?
::Feature.enabled?(:release_edit_page, project, default_enabled: true) &&
can?(current_user, :update_release, release) can?(current_user, :update_release, release)
end end
end end
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
= link_to s_("CurrentUser|Profile"), current_user, class: 'profile-link', data: { user: current_user.username } = link_to s_("CurrentUser|Profile"), current_user, class: 'profile-link', data: { user: current_user.username }
- if current_user_menu?(:start_trial) - if current_user_menu?(:start_trial)
%li %li
%a.profile-link{ href: trials_link_url } %a.trial-link{ href: trials_link_url }
= s_("CurrentUser|Start a Gold trial") = s_("CurrentUser|Start a Gold trial")
= emoji_icon('rocket') = emoji_icon('rocket')
- if current_user_menu?(:settings) - if current_user_menu?(:settings)
......
- can_update_merge_request = can?(current_user, :update_merge_request, @merge_request) - can_update_merge_request = can?(current_user, :update_merge_request, @merge_request)
- can_reopen_merge_request = can?(current_user, :reopen_merge_request, @merge_request) - can_reopen_merge_request = can?(current_user, :reopen_merge_request, @merge_request)
- state_human_name, state_icon_name = state_name_with_icon(@merge_request)
- if @merge_request.closed_without_fork? - if @merge_request.closed_without_fork?
.alert.alert-danger .alert.alert-danger
...@@ -8,9 +9,9 @@ ...@@ -8,9 +9,9 @@
.detail-page-header .detail-page-header
.detail-page-header-body .detail-page-header-body
.issuable-status-box.status-box{ class: status_box_class(@merge_request) } .issuable-status-box.status-box{ class: status_box_class(@merge_request) }
= sprite_icon(@merge_request.state_icon_name, size: 16, css_class: 'd-block d-sm-none') = sprite_icon(state_icon_name, size: 16, css_class: 'd-block d-sm-none')
%span.d-none.d-sm-block %span.d-none.d-sm-block
= @merge_request.state_human_name = state_human_name
.issuable-meta .issuable-meta
- if @merge_request.discussion_locked? - if @merge_request.discussion_locked?
......
---
title: Reduce start a trial rocket emoji size
merge_request: 20579
author:
type: changed
---
title: Fix multi select input padding in project and group user select
merge_request: 20520
author: Kevin Lee
type: fixed
...@@ -63,7 +63,7 @@ module Gitlab ...@@ -63,7 +63,7 @@ module Gitlab
def has_capability?(project, category, kind, labels) def has_capability?(project, category, kind, labels)
case category case category
when :test when :test
area = role[/Test Automation Engineer(?:.*?, (\w+))/, 1] area = role[/Software Engineer in Test(?:.*?, (\w+))/, 1]
area && labels.any?("devops::#{area.downcase}") if kind == :reviewer area && labels.any?("devops::#{area.downcase}") if kind == :reviewer
when :engineering_productivity when :engineering_productivity
......
...@@ -30,7 +30,6 @@ describe('Release block', () => { ...@@ -30,7 +30,6 @@ describe('Release block', () => {
}, },
provide: { provide: {
glFeatures: { glFeatures: {
releaseEditPage: true,
releaseIssueSummary: true, releaseIssueSummary: true,
...featureFlags, ...featureFlags,
}, },
...@@ -180,11 +179,6 @@ describe('Release block', () => { ...@@ -180,11 +179,6 @@ describe('Release block', () => {
}); });
}); });
it('does not render an edit button if the releaseEditPage feature flag is disabled', () =>
factory(releaseClone, { releaseEditPage: false }).then(() => {
expect(editButton().exists()).toBe(false);
}));
it('does not render the milestone list if no milestones are associated to the release', () => { it('does not render the milestone list if no milestones are associated to the release', () => {
delete releaseClone.milestones; delete releaseClone.milestones;
......
...@@ -26,6 +26,31 @@ describe MergeRequestsHelper do ...@@ -26,6 +26,31 @@ describe MergeRequestsHelper do
end end
end end
describe '#state_name_with_icon' do
using RSpec::Parameterized::TableSyntax
let(:merge_request) { MergeRequest.new }
where(:state, :expected_name, :expected_icon) do
:merged? | 'Merged' | 'git-merge'
:closed? | 'Closed' | 'close'
:opened? | 'Open' | 'issue-open-m'
end
with_them do
before do
allow(merge_request).to receive(state).and_return(true)
end
it 'returns name and icon' do
name, icon = helper.state_name_with_icon(merge_request)
expect(name).to eq(expected_name)
expect(icon).to eq(expected_icon)
end
end
end
describe '#format_mr_branch_names' do describe '#format_mr_branch_names' do
describe 'within the same project' do describe 'within the same project' do
let(:merge_request) { create(:merge_request) } let(:merge_request) { create(:merge_request) }
......
...@@ -33,8 +33,8 @@ describe Gitlab::Danger::Teammate do ...@@ -33,8 +33,8 @@ describe Gitlab::Danger::Teammate do
context 'when labels contain devops::create and the category is test' do context 'when labels contain devops::create and the category is test' do
let(:labels) { ['devops::create'] } let(:labels) { ['devops::create'] }
context 'when role is Test Automation Engineer, Create' do context 'when role is Software Engineer in Test, Create' do
let(:role) { 'Test Automation Engineer, Create' } let(:role) { 'Software Engineer in Test, Create' }
it '#reviewer? returns true' do it '#reviewer? returns true' do
expect(subject.reviewer?(project, :test, labels)).to be_truthy expect(subject.reviewer?(project, :test, labels)).to be_truthy
...@@ -45,7 +45,7 @@ describe Gitlab::Danger::Teammate do ...@@ -45,7 +45,7 @@ describe Gitlab::Danger::Teammate do
end end
context 'when hyperlink is mangled in the role' do context 'when hyperlink is mangled in the role' do
let(:role) { '<a href="#">Test Automation Engineer</a>, Create' } let(:role) { '<a href="#">Software Engineer in Test</a>, Create' }
it '#reviewer? returns true' do it '#reviewer? returns true' do
expect(subject.reviewer?(project, :test, labels)).to be_truthy expect(subject.reviewer?(project, :test, labels)).to be_truthy
...@@ -53,16 +53,16 @@ describe Gitlab::Danger::Teammate do ...@@ -53,16 +53,16 @@ describe Gitlab::Danger::Teammate do
end end
end end
context 'when role is Test Automation Engineer' do context 'when role is Software Engineer in Test' do
let(:role) { 'Test Automation Engineer' } let(:role) { 'Software Engineer in Test' }
it '#reviewer? returns false' do it '#reviewer? returns false' do
expect(subject.reviewer?(project, :test, labels)).to be_falsey expect(subject.reviewer?(project, :test, labels)).to be_falsey
end end
end end
context 'when role is Test Automation Engineer, Manage' do context 'when role is Software Engineer in Test, Manage' do
let(:role) { 'Test Automation Engineer, Manage' } let(:role) { 'Software Engineer in Test, Manage' }
it '#reviewer? returns false' do it '#reviewer? returns false' do
expect(subject.reviewer?(project, :test, labels)).to be_falsey expect(subject.reviewer?(project, :test, labels)).to be_falsey
......
...@@ -90,14 +90,6 @@ describe ReleasePresenter do ...@@ -90,14 +90,6 @@ describe ReleasePresenter do
is_expected.to match /#{edit_project_release_url(project, release)}/ is_expected.to match /#{edit_project_release_url(project, release)}/
end end
context 'when release_edit_page feature flag is disabled' do
before do
stub_feature_flags(release_edit_page: false)
end
it { is_expected.to be_nil }
end
context 'when a user is not allowed to update a release' do context 'when a user is not allowed to update a release' do
let(:presenter) { described_class.new(release, current_user: guest) } let(:presenter) { described_class.new(release, current_user: guest) }
......
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