Commit 22b272bd authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab master

parents c51d7f7d 0335e0c4
......@@ -46,6 +46,8 @@ export default {
return true;
},
statusIconName() {
if (this.isLoadingSummary) return null;
return this.statusIcon(this.collapsedData);
},
},
......
......@@ -19,7 +19,8 @@ export default {
},
iconName: {
type: String,
required: true,
required: false,
default: null,
},
},
computed: {
......
---
name: project_level_issues_analytics
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/25417
rollout_issue_url:
milestone: '12.9'
type: development
group: group::optimize
default_enabled: true
......@@ -65,8 +65,7 @@ module EE
end
def show_issues_analytics?
::Feature.enabled?(:project_level_issues_analytics, context.project, default_enabled: true) &&
context.project.licensed_feature_available?(:issues_analytics) &&
context.project.licensed_feature_available?(:issues_analytics) &&
can?(context.current_user, :read_project, context.project)
end
......
......@@ -50,10 +50,10 @@ RSpec.describe Sidebars::Projects::Menus::AnalyticsMenu do
describe 'Issue' do
let(:item_id) { :issues }
let(:flag_enabled) { true }
let(:licensed) { true }
before do
stub_licensed_features(issues_analytics: flag_enabled)
stub_licensed_features(issues_analytics: licensed)
end
specify { is_expected.not_to be_nil }
......@@ -64,16 +64,8 @@ RSpec.describe Sidebars::Projects::Menus::AnalyticsMenu do
specify { is_expected.to be_nil }
end
describe 'when feature flag :project_level_issues_analytics is not enabled' do
before do
stub_feature_flags(project_level_issues_analytics: false)
end
specify { is_expected.to be_nil }
end
describe 'when licensed feature issues analytics is not enabled' do
let(:flag_enabled) { false }
let(:licensed) { false }
specify { is_expected.to be_nil }
end
......
......@@ -10,7 +10,10 @@ import axios from '~/lib/utils/axios_utils';
import { setFaviconOverlay } from '~/lib/utils/favicon';
import notify from '~/lib/utils/notify';
import SmartInterval from '~/smart_interval';
import { registerExtension } from '~/vue_merge_request_widget/components/extensions';
import {
registerExtension,
registeredExtensions,
} from '~/vue_merge_request_widget/components/extensions';
import { SUCCESS } from '~/vue_merge_request_widget/components/deployment/constants';
import eventHub from '~/vue_merge_request_widget/event_hub';
import MrWidgetOptions from '~/vue_merge_request_widget/mr_widget_options.vue';
......@@ -886,20 +889,22 @@ describe('MrWidgetOptions', () => {
describe('mock extension', () => {
beforeEach(() => {
registerExtension(testExtension);
createComponent();
});
it('renders collapsed data', async () => {
registerExtension(testExtension);
afterEach(() => {
registeredExtensions.extensions = [];
});
it('renders collapsed data', async () => {
await waitForPromises();
expect(wrapper.text()).toContain('Test extension summary count: 1');
});
it('renders full data', async () => {
registerExtension(testExtension);
await waitForPromises();
wrapper
......
import { EXTENSION_ICONS } from '~/vue_merge_request_widget/constants';
export default {
name: 'WidgetTestExtension',
props: ['targetProjectFullPath'],
......@@ -6,7 +8,7 @@ export default {
return `Test extension summary count: ${count} & ${targetProjectFullPath}`;
},
statusIcon({ count }) {
return count > 0 ? 'warning' : 'success';
return count > 0 ? EXTENSION_ICONS.warning : EXTENSION_ICONS.success;
},
},
methods: {
......
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