Commit a9697e60 authored by Clement Ho's avatar Clement Ho

Merge branch '218045-remove-create-issue-feature-flag-FE' into 'master'

Remove create issue feature flag

See merge request gitlab-org/gitlab!33213
parents 9d6ae6d6 cda08103
...@@ -14,7 +14,6 @@ import { s__ } from '~/locale'; ...@@ -14,7 +14,6 @@ import { s__ } from '~/locale';
import query from '../graphql/queries/details.query.graphql'; import query from '../graphql/queries/details.query.graphql';
import { fetchPolicies } from '~/lib/graphql'; import { fetchPolicies } from '~/lib/graphql';
import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue'; import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { ALERTS_SEVERITY_LABELS, trackAlertsDetailsViewsOptions } from '../constants'; import { ALERTS_SEVERITY_LABELS, trackAlertsDetailsViewsOptions } from '../constants';
import createIssueQuery from '../graphql/mutations/create_issue_from_alert.graphql'; import createIssueQuery from '../graphql/mutations/create_issue_from_alert.graphql';
import { visitUrl, joinPaths } from '~/lib/utils/url_utility'; import { visitUrl, joinPaths } from '~/lib/utils/url_utility';
...@@ -47,7 +46,6 @@ export default { ...@@ -47,7 +46,6 @@ export default {
TimeAgoTooltip, TimeAgoTooltip,
AlertSidebar, AlertSidebar,
}, },
mixins: [glFeatureFlagsMixin()],
props: { props: {
alertId: { alertId: {
type: String, type: String,
...@@ -204,7 +202,6 @@ export default { ...@@ -204,7 +202,6 @@ export default {
<template #tool>{{ alert.monitoringTool }}</template> <template #tool>{{ alert.monitoringTool }}</template>
</gl-sprintf> </gl-sprintf>
</div> </div>
<div v-if="glFeatures.alertManagementCreateAlertIssue">
<gl-button <gl-button
v-if="alert.issueIid" v-if="alert.issueIid"
class="gl-mt-3 mt-sm-0 align-self-center align-self-sm-baseline alert-details-issue-button" class="gl-mt-3 mt-sm-0 align-self-center align-self-sm-baseline alert-details-issue-button"
...@@ -226,7 +223,6 @@ export default { ...@@ -226,7 +223,6 @@ export default {
> >
{{ s__('AlertManagement|Create issue') }} {{ s__('AlertManagement|Create issue') }}
</gl-button> </gl-button>
</div>
<gl-button <gl-button
:aria-label="__('Toggle sidebar')" :aria-label="__('Toggle sidebar')"
category="primary" category="primary"
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
class Projects::AlertManagementController < Projects::ApplicationController class Projects::AlertManagementController < Projects::ApplicationController
before_action :authorize_read_alert_management_alert! before_action :authorize_read_alert_management_alert!
before_action do before_action do
push_frontend_feature_flag(:alert_management_create_alert_issue, project)
push_frontend_feature_flag(:alert_assignee, project) push_frontend_feature_flag(:alert_assignee, project)
end end
......
---
title: Create issue from alert
merge_request: 33213
author:
type: added
...@@ -17,13 +17,7 @@ describe('AlertDetails', () => { ...@@ -17,13 +17,7 @@ describe('AlertDetails', () => {
const findDetailsTable = () => wrapper.find(GlTable); const findDetailsTable = () => wrapper.find(GlTable);
function mountComponent({ function mountComponent({ data, loading = false, mountMethod = shallowMount, stubs = {} } = {}) {
data,
alertManagementCreateAlertIssue = false,
loading = false,
mountMethod = shallowMount,
stubs = {},
} = {}) {
wrapper = mountMethod(AlertDetails, { wrapper = mountMethod(AlertDetails, {
propsData: { propsData: {
alertId: 'alertId', alertId: 'alertId',
...@@ -33,9 +27,6 @@ describe('AlertDetails', () => { ...@@ -33,9 +27,6 @@ describe('AlertDetails', () => {
data() { data() {
return { alert: { ...mockAlert }, ...data }; return { alert: { ...mockAlert }, ...data };
}, },
provide: {
glFeatures: { alertManagementCreateAlertIssue },
},
mocks: { mocks: {
$apollo: { $apollo: {
mutate: jest.fn(), mutate: jest.fn(),
...@@ -123,17 +114,13 @@ describe('AlertDetails', () => { ...@@ -123,17 +114,13 @@ describe('AlertDetails', () => {
}); });
describe('Create issue from alert', () => { describe('Create issue from alert', () => {
describe('createIssueFromAlertEnabled feature flag enabled', () => {
it('should display "View issue" button that links the issue page when issue exists', () => { it('should display "View issue" button that links the issue page when issue exists', () => {
const issueIid = '3'; const issueIid = '3';
mountComponent({ mountComponent({
alertManagementCreateAlertIssue: true,
data: { alert: { ...mockAlert, issueIid } }, data: { alert: { ...mockAlert, issueIid } },
}); });
expect(findViewIssueBtn().exists()).toBe(true); expect(findViewIssueBtn().exists()).toBe(true);
expect(findViewIssueBtn().attributes('href')).toBe( expect(findViewIssueBtn().attributes('href')).toBe(joinPaths(projectIssuesPath, issueIid));
joinPaths(projectIssuesPath, issueIid),
);
expect(findCreateIssueBtn().exists()).toBe(false); expect(findCreateIssueBtn().exists()).toBe(false);
}); });
...@@ -141,7 +128,6 @@ describe('AlertDetails', () => { ...@@ -141,7 +128,6 @@ describe('AlertDetails', () => {
const issueIid = null; const issueIid = null;
mountComponent({ mountComponent({
mountMethod: mount, mountMethod: mount,
alertManagementCreateAlertIssue: true,
data: { alert: { ...mockAlert, issueIid } }, data: { alert: { ...mockAlert, issueIid } },
}); });
expect(findViewIssueBtn().exists()).toBe(false); expect(findViewIssueBtn().exists()).toBe(false);
...@@ -168,7 +154,6 @@ describe('AlertDetails', () => { ...@@ -168,7 +154,6 @@ describe('AlertDetails', () => {
const errorMsg = 'Something went wrong'; const errorMsg = 'Something went wrong';
mountComponent({ mountComponent({
mountMethod: mount, mountMethod: mount,
alertManagementCreateAlertIssue: true,
data: { alert: { ...mockAlert, alertIid: 1 } }, data: { alert: { ...mockAlert, alertIid: 1 } },
}); });
...@@ -181,15 +166,6 @@ describe('AlertDetails', () => { ...@@ -181,15 +166,6 @@ describe('AlertDetails', () => {
}); });
}); });
describe('createIssueFromAlertEnabled feature flag disabled', () => {
it('should not display a View or Create issue button', () => {
mountComponent({ alertManagementCreateAlertIssue: false });
expect(findCreateIssueBtn().exists()).toBe(false);
expect(findViewIssueBtn().exists()).toBe(false);
});
});
});
describe('View full alert details', () => { describe('View full alert details', () => {
beforeEach(() => { beforeEach(() => {
mountComponent({ data: { alert: mockAlert } }); mountComponent({ data: { alert: mockAlert } });
......
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