Commit 80cc3c94 authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab master

parents ad750ebd 5eeb1b78
...@@ -21,7 +21,7 @@ module Mutations ...@@ -21,7 +21,7 @@ module Mutations
description: "The current state of the collection" description: "The current state of the collection"
def resolve(**args) def resolve(**args)
service = ::DesignManagement::MoveDesignsService.new(current_user, parameters(args)) service = ::DesignManagement::MoveDesignsService.new(current_user, parameters(**args))
{ design_collection: service.collection, errors: service.execute.errors } { design_collection: service.collection, errors: service.execute.errors }
end end
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
.js-notification-toggle-btns .js-notification-toggle-btns
%div{ class: ("btn-group" if notification_setting.custom?) } %div{ class: ("btn-group" if notification_setting.custom?) }
- if notification_setting.custom? - if notification_setting.custom?
%button.dropdown-new.btn.btn-defaul.btn-icon.gl-button.has-tooltip.notifications-btn.text-left#notifications-button{ type: "button", title: button_title, class: "#{btn_class}", "aria-label" => aria_label, data: { container: "body", toggle: "modal", target: "#" + notifications_menu_identifier("modal", notification_setting), display: 'static' } } %button.dropdown-new.btn.btn-default.btn-icon.gl-button.has-tooltip.notifications-btn.text-left#notifications-button{ type: "button", title: button_title, class: "#{btn_class}", "aria-label" => aria_label, data: { container: "body", toggle: "modal", target: "#" + notifications_menu_identifier("modal", notification_setting), display: 'static' } }
= sprite_icon("notifications", css_class: "js-notification-loading") = sprite_icon("notifications", css_class: "js-notification-loading")
= notification_title(notification_setting.level) = notification_title(notification_setting.level)
%button.btn.dropdown-toggle.d-flex{ data: { toggle: "dropdown", target: notifications_menu_identifier("dropdown", notification_setting), flip: "false" } } %button.btn.dropdown-toggle.d-flex{ data: { toggle: "dropdown", target: notifications_menu_identifier("dropdown", notification_setting), flip: "false" } }
......
---
title: Fix broken button default class
merge_request: 43977
author:
type: fixed
...@@ -6,9 +6,9 @@ Gitlab::Seeder.quiet do ...@@ -6,9 +6,9 @@ Gitlab::Seeder.quiet do
model_class = Analytics::InstanceStatistics::Measurement model_class = Analytics::InstanceStatistics::Measurement
recorded_at = Date.today recorded_at = Date.today
# Insert random counts for the last 10 weeks # Insert random counts for the last 60 days
measurements = 10.times.flat_map do measurements = 60.times.flat_map do
recorded_at = (recorded_at - 1.week).end_of_week.end_of_day - 5.minutes recorded_at = (recorded_at - 1.day).end_of_day - 5.minutes
model_class.identifiers.map do |_, id| model_class.identifiers.map do |_, id|
{ {
......
<script> <script>
import { s__ } from '~/locale'; import { s__ } from '~/locale';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import TestCoverageTable from './test_coverage_table.vue';
import DownloadTestCoverage from './download_test_coverage.vue'; import DownloadTestCoverage from './download_test_coverage.vue';
export default { export default {
name: 'GroupRepositoryAnalytics', name: 'GroupRepositoryAnalytics',
components: { components: {
TestCoverageTable,
DownloadTestCoverage, DownloadTestCoverage,
}, },
mixins: [glFeatureFlagsMixin()],
text: { text: {
codeCoverageHeader: s__('RepositoriesAnalytics|Test Code Coverage'), codeCoverageHeader: s__('RepositoriesAnalytics|Test Code Coverage'),
}, },
computed: {
shouldShowCoverageReport() {
return this.glFeatures.groupCoverageDataReport;
},
},
}; };
</script> </script>
...@@ -18,6 +27,7 @@ export default { ...@@ -18,6 +27,7 @@ export default {
<h4 data-testid="test-coverage-header"> <h4 data-testid="test-coverage-header">
{{ $options.text.codeCoverageHeader }} {{ $options.text.codeCoverageHeader }}
</h4> </h4>
<test-coverage-table v-if="shouldShowCoverageReport" />
<download-test-coverage /> <download-test-coverage />
</div> </div>
</template> </template>
<script>
import { GlCard } from '@gitlab/ui';
import { s__ } from '~/locale';
export default {
name: 'TestCoverageTable',
components: {
GlCard,
},
text: {
// This is a temporary placeholder until we actually implement the feature
header: s__('RepositoriesAnalytics|Test Code Coverage'),
},
};
</script>
<template>
<gl-card>
<template #header>
<h5>{{ $options.text.header }}</h5>
</template>
</gl-card>
</template>
...@@ -59,6 +59,9 @@ export default { ...@@ -59,6 +59,9 @@ export default {
isIssueAlreadyCreated() { isIssueAlreadyCreated() {
return Boolean(this.state.relatedIssues.find(i => i.lockIssueRemoval)); return Boolean(this.state.relatedIssues.find(i => i.lockIssueRemoval));
}, },
canCreateIssue() {
return !this.isIssueAlreadyCreated && !this.isFetching && Boolean(this.createIssueUrl);
},
}, },
inject: { inject: {
vulnerabilityId: { vulnerabilityId: {
...@@ -261,7 +264,7 @@ export default { ...@@ -261,7 +264,7 @@ export default {
<template #headerText> <template #headerText>
{{ $options.i18n.relatedIssues }} {{ $options.i18n.relatedIssues }}
</template> </template>
<template v-if="!isIssueAlreadyCreated && !isFetching" #headerActions> <template v-if="canCreateIssue" #headerActions>
<gl-button <gl-button
ref="createIssue" ref="createIssue"
variant="success" variant="success"
......
...@@ -8,6 +8,7 @@ class Groups::Analytics::RepositoryAnalyticsController < Groups::Analytics::Appl ...@@ -8,6 +8,7 @@ class Groups::Analytics::RepositoryAnalyticsController < Groups::Analytics::Appl
before_action :load_group before_action :load_group
before_action -> { check_feature_availability!(:group_repository_analytics) } before_action -> { check_feature_availability!(:group_repository_analytics) }
before_action -> { authorize_view_by_action!(:read_group_repository_analytics) } before_action -> { authorize_view_by_action!(:read_group_repository_analytics) }
before_action -> { push_frontend_feature_flag(:group_coverage_data_report, @group, default_enabled: false) }
def show def show
track_event(pageview_tracker_params) track_event(pageview_tracker_params)
......
...@@ -4,9 +4,6 @@ module Projects ...@@ -4,9 +4,6 @@ module Projects
class LicensesController < Projects::ApplicationController class LicensesController < Projects::ApplicationController
before_action :authorize_read_licenses!, only: [:index] before_action :authorize_read_licenses!, only: [:index]
before_action :authorize_admin_software_license_policy!, only: [:create, :update] before_action :authorize_admin_software_license_policy!, only: [:create, :update]
before_action do
push_frontend_feature_flag(:license_compliance_denies_mr, default_enabled: true)
end
def index def index
respond_to do |format| respond_to do |format|
......
...@@ -143,7 +143,6 @@ module EE ...@@ -143,7 +143,6 @@ module EE
end end
def has_denied_policies? def has_denied_policies?
return false if ::Feature.disabled?(:license_compliance_denies_mr, project, default_enabled: true)
return false unless has_license_scanning_reports? return false unless has_license_scanning_reports?
return false if has_approved_license_check? return false if has_approved_license_check?
......
---
title: Hide "Create Issue" On Vulnerability Page When Issues Are Disabled
merge_request: 43725
author: Kev @KevSlashNull
type: fixed
---
name: group_coverage_data_report
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/43774
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/215135/
type: development
group: group::testing
default_enabled: false
---
name: license_compliance_denies_mr
introduced_by_url:
rollout_issue_url:
group: composition_analysis
type: development
default_enabled: true
...@@ -33,7 +33,7 @@ describe('Vulnerability related issues component', () => { ...@@ -33,7 +33,7 @@ describe('Vulnerability related issues component', () => {
const issue1 = { id: 3, vulnerabilityLinkId: 987 }; const issue1 = { id: 3, vulnerabilityLinkId: 987 };
const issue2 = { id: 25, vulnerabilityLinkId: 876 }; const issue2 = { id: 25, vulnerabilityLinkId: 876 };
const createWrapper = async (data = {}, opts) => { const createWrapper = async (data = {}, provide = {}, opts) => {
wrapper = shallowMount(RelatedIssues, { wrapper = shallowMount(RelatedIssues, {
propsData, propsData,
data: () => data, data: () => data,
...@@ -44,6 +44,7 @@ describe('Vulnerability related issues component', () => { ...@@ -44,6 +44,7 @@ describe('Vulnerability related issues component', () => {
reportType, reportType,
issueTrackingHelpPath, issueTrackingHelpPath,
permissionsHelpPath, permissionsHelpPath,
...provide,
}, },
...opts, ...opts,
}); });
...@@ -270,6 +271,7 @@ describe('Vulnerability related issues component', () => { ...@@ -270,6 +271,7 @@ describe('Vulnerability related issues component', () => {
isFetching: false, isFetching: false,
state: { relatedIssues: [issue1, { ...issue2, vulnerabilityLinkType: 'created' }] }, state: { relatedIssues: [issue1, { ...issue2, vulnerabilityLinkType: 'created' }] },
}, },
{},
{ stubs: { RelatedIssuesBlock } }, { stubs: { RelatedIssuesBlock } },
); );
}); });
...@@ -289,7 +291,7 @@ describe('Vulnerability related issues component', () => { ...@@ -289,7 +291,7 @@ describe('Vulnerability related issues component', () => {
beforeEach(async () => { beforeEach(async () => {
mockAxios.onGet(propsData.endpoint).replyOnce(httpStatusCodes.OK, [issue1, issue2]); mockAxios.onGet(propsData.endpoint).replyOnce(httpStatusCodes.OK, [issue1, issue2]);
createWrapper({}, { stubs: { RelatedIssuesBlock } }); createWrapper({}, {}, { stubs: { RelatedIssuesBlock } });
await axios.waitForAll(); await axios.waitForAll();
}); });
...@@ -327,4 +329,17 @@ describe('Vulnerability related issues component', () => { ...@@ -327,4 +329,17 @@ describe('Vulnerability related issues component', () => {
expect(findAlert().exists()).toBe(false); expect(findAlert().exists()).toBe(false);
}); });
}); });
describe('when project issue tracking is disabled', () => {
it('hides the "Create Issue" button', () => {
createWrapper(
{},
{
createIssueUrl: undefined,
},
);
expect(findCreateIssueButton().exists()).toBe(false);
});
});
}); });
...@@ -25,7 +25,7 @@ RSpec.describe "Internal references", :js do ...@@ -25,7 +25,7 @@ RSpec.describe "Internal references", :js do
add_note("##{public_project_issue.to_reference(private_project)}") add_note("##{public_project_issue.to_reference(private_project)}")
end end
context "when user doesn't have access to private project" do context "when user doesn't have access to private project", quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/257832' do
before do before do
sign_in(public_project_user) sign_in(public_project_user)
...@@ -52,7 +52,7 @@ RSpec.describe "Internal references", :js do ...@@ -52,7 +52,7 @@ RSpec.describe "Internal references", :js do
visit(project_issue_path(public_project, public_project_issue)) visit(project_issue_path(public_project, public_project_issue))
end end
it "doesn't show any references" do it "doesn't show any references", quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/257832' do
page.within(".issue-details") do page.within(".issue-details") do
expect(page).not_to have_content("#merge-requests .merge-requests-title") expect(page).not_to have_content("#merge-requests .merge-requests-title")
end end
...@@ -94,7 +94,7 @@ RSpec.describe "Internal references", :js do ...@@ -94,7 +94,7 @@ RSpec.describe "Internal references", :js do
add_note("##{public_project_merge_request.to_reference(private_project)}") add_note("##{public_project_merge_request.to_reference(private_project)}")
end end
context "when user doesn't have access to private project" do context "when user doesn't have access to private project", quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/257832' do
before do before do
sign_in(public_project_user) sign_in(public_project_user)
...@@ -121,7 +121,7 @@ RSpec.describe "Internal references", :js do ...@@ -121,7 +121,7 @@ RSpec.describe "Internal references", :js do
visit(project_merge_request_path(public_project, public_project_merge_request)) visit(project_merge_request_path(public_project, public_project_merge_request))
end end
it "doesn't show any references" do it "doesn't show any references", quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/257832' do
page.within(".merge-request-details") do page.within(".merge-request-details") do
expect(page).not_to have_content("#merge-requests .merge-requests-title") expect(page).not_to have_content("#merge-requests .merge-requests-title")
end end
......
...@@ -18,7 +18,7 @@ RSpec.describe 'User creates release', :js do ...@@ -18,7 +18,7 @@ RSpec.describe 'User creates release', :js do
project.add_developer(user) project.add_developer(user)
gitlab_sign_in(user) sign_in(user)
visit new_page_url visit new_page_url
......
...@@ -13,7 +13,7 @@ RSpec.describe 'User edits Release', :js do ...@@ -13,7 +13,7 @@ RSpec.describe 'User edits Release', :js do
project.add_developer(user) project.add_developer(user)
gitlab_sign_in(user) sign_in(user)
visit edit_project_release_path(project, release) visit edit_project_release_path(project, release)
......
...@@ -16,7 +16,7 @@ RSpec.describe 'User views releases', :js do ...@@ -16,7 +16,7 @@ RSpec.describe 'User views releases', :js do
shared_examples 'releases page' do shared_examples 'releases page' do
context('when the user is a maintainer') do context('when the user is a maintainer') do
before do before do
gitlab_sign_in(maintainer) sign_in(maintainer)
end end
it 'sees the release' do it 'sees the release' do
...@@ -110,7 +110,7 @@ RSpec.describe 'User views releases', :js do ...@@ -110,7 +110,7 @@ RSpec.describe 'User views releases', :js do
context('when the user is a guest') do context('when the user is a guest') do
before do before do
gitlab_sign_in(guest) sign_in(guest)
end end
it 'renders release info except for Git-related data' do it 'renders release info except for Git-related data' 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