Commit dd34ca6b authored by Gabriel Mazetto's avatar Gabriel Mazetto

Merge branch 'pl-remove-feature-flag-alert-integration-dropdown' into 'master'

Enable Alerts dropdown in Operations Settings

See merge request gitlab-org/gitlab!36296
parents 576ce320 1b4274fa
...@@ -14,7 +14,6 @@ import { ...@@ -14,7 +14,6 @@ import {
GlFormSelect, GlFormSelect,
} from '@gitlab/ui'; } from '@gitlab/ui';
import { debounce } from 'lodash'; import { debounce } from 'lodash';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import ClipboardButton from '~/vue_shared/components/clipboard_button.vue'; import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
import ToggleButton from '~/vue_shared/components/toggle_button.vue'; import ToggleButton from '~/vue_shared/components/toggle_button.vue';
import csrf from '~/lib/utils/csrf'; import csrf from '~/lib/utils/csrf';
...@@ -42,7 +41,6 @@ export default { ...@@ -42,7 +41,6 @@ export default {
directives: { directives: {
'gl-modal': GlModalDirective, 'gl-modal': GlModalDirective,
}, },
mixins: [glFeatureFlagsMixin()],
props: { props: {
prometheus: { prometheus: {
type: Object, type: Object,
...@@ -129,7 +127,7 @@ export default { ...@@ -129,7 +127,7 @@ export default {
return !this.isGeneric ? this.$options.i18n.prometheusInfo : ''; return !this.isGeneric ? this.$options.i18n.prometheusInfo : '';
}, },
prometheusFeatureEnabled() { prometheusFeatureEnabled() {
return !this.isGeneric && this.glFeatures.alertIntegrationsDropdown; return !this.isGeneric;
}, },
jsonIsValid() { jsonIsValid() {
return this.testAlert.error === null; return this.testAlert.error === null;
...@@ -147,13 +145,9 @@ export default { ...@@ -147,13 +145,9 @@ export default {
}, JSON_VALIDATE_DELAY), }, JSON_VALIDATE_DELAY),
}, },
created() { created() {
if (this.glFeatures.alertIntegrationsDropdown) {
this.selectedEndpoint = this.prometheus.prometheusIsActivated this.selectedEndpoint = this.prometheus.prometheusIsActivated
? this.options[1].value ? this.options[1].value
: this.options[0].value; : this.options[0].value;
} else {
this.selectedEndpoint = this.options[0].value;
}
}, },
methods: { methods: {
clearJson() { clearJson() {
...@@ -187,9 +181,6 @@ export default { ...@@ -187,9 +181,6 @@ export default {
}, },
toggleService(value) { toggleService(value) {
this.canSaveForm = true; this.canSaveForm = true;
if (!this.glFeatures.alertIntegrationsDropdown) {
this.toggleActivated(value);
}
if (this.isGeneric) { if (this.isGeneric) {
this.activated.generic = value; this.activated.generic = value;
...@@ -334,7 +325,6 @@ export default { ...@@ -334,7 +325,6 @@ export default {
</div> </div>
<gl-form @submit.prevent="onSubmit" @reset.prevent="onReset"> <gl-form @submit.prevent="onSubmit" @reset.prevent="onReset">
<gl-form-group <gl-form-group
v-if="glFeatures.alertIntegrationsDropdown"
:label="$options.i18n.integrationsLabel" :label="$options.i18n.integrationsLabel"
label-for="integrations" label-for="integrations"
label-class="label-bold" label-class="label-bold"
...@@ -433,7 +423,6 @@ export default { ...@@ -433,7 +423,6 @@ export default {
</gl-modal> </gl-modal>
</gl-form-group> </gl-form-group>
<gl-form-group <gl-form-group
v-if="glFeatures.alertIntegrationsDropdown"
:label="$options.i18n.alertJson" :label="$options.i18n.alertJson"
label-for="alert-json" label-for="alert-json"
label-class="label-bold" label-class="label-bold"
...@@ -452,10 +441,7 @@ export default { ...@@ -452,10 +441,7 @@ export default {
<gl-button :disabled="!canTestAlert" @click="validateTestAlert">{{ <gl-button :disabled="!canTestAlert" @click="validateTestAlert">{{
$options.i18n.testAlertInfo $options.i18n.testAlertInfo
}}</gl-button> }}</gl-button>
<div <div class="footer-block row-content-block gl-display-flex gl-justify-content-space-between">
v-if="glFeatures.alertIntegrationsDropdown"
class="footer-block row-content-block gl-display-flex gl-justify-content-space-between"
>
<gl-button type="submit" variant="success" category="primary" :disabled="!canSaveConfig"> <gl-button type="submit" variant="success" category="primary" :disabled="!canSaveConfig">
{{ __('Save changes') }} {{ __('Save changes') }}
</gl-button> </gl-button>
......
...@@ -5,10 +5,6 @@ module Projects ...@@ -5,10 +5,6 @@ module Projects
class OperationsController < Projects::ApplicationController class OperationsController < Projects::ApplicationController
before_action :authorize_admin_operations! before_action :authorize_admin_operations!
before_action :authorize_read_prometheus_alerts!, only: [:reset_alerting_token] before_action :authorize_read_prometheus_alerts!, only: [:reset_alerting_token]
before_action do
push_frontend_feature_flag(:alert_integrations_dropdown, project)
end
respond_to :json, only: [:reset_alerting_token] respond_to :json, only: [:reset_alerting_token]
helper_method :error_tracking_setting helper_method :error_tracking_setting
......
...@@ -5,4 +5,4 @@ ...@@ -5,4 +5,4 @@
- authorization_key = @project.alerting_setting.try(:token) - authorization_key = @project.alerting_setting.try(:token)
- learn_more_url = help_page_path('user/project/integrations/prometheus', anchor: 'external-prometheus-instances') - learn_more_url = help_page_path('user/project/integrations/prometheus', anchor: 'external-prometheus-instances')
#js-settings-prometheus-alerts{ data: { notify_url: notify_url, authorization_key: authorization_key, change_key_url: reset_alerting_token_project_settings_operations_path(@project), learn_more_url: learn_more_url, disabled: Feature.enabled?(:alert_integrations_dropdown, @service.project) && @service.manual_configuration? } } #js-settings-prometheus-alerts{ data: { notify_url: notify_url, authorization_key: authorization_key, change_key_url: reset_alerting_token_project_settings_operations_path(@project), learn_more_url: learn_more_url, disabled: true } }
- return unless Feature.enabled?(:alert_integrations_dropdown, @service.project) && @service.manual_configuration? - return unless @service.manual_configuration?
.row .row
.col-lg-12 .col-lg-12
......
---
title: Enable Alerts dropdown in Operations Settings
merge_request: 36296
author:
type: added
...@@ -12,7 +12,9 @@ exports[`AlertsSettingsForm with default values renders the initial template 1`] ...@@ -12,7 +12,9 @@ exports[`AlertsSettingsForm with default values renders the initial template 1`]
</p> </p>
</div> </div>
<gl-form-stub> <gl-form-stub>
<!----> <gl-form-group-stub label=\\"Integrations\\" label-for=\\"integrations\\" label-class=\\"label-bold\\">
<gl-form-select-stub options=\\"[object Object],[object Object]\\" data-testid=\\"alert-settings-select\\" value=\\"generic\\"></gl-form-select-stub> <span class=\\"gl-text-gray-400\\"><gl-sprintf-stub message=\\"Learn more about our %{linkStart}upcoming integrations%{linkEnd}\\"></gl-sprintf-stub></span>
</gl-form-group-stub>
<gl-form-group-stub label=\\"Active\\" label-for=\\"activated\\" label-class=\\"label-bold\\"> <gl-form-group-stub label=\\"Active\\" label-for=\\"activated\\" label-class=\\"label-bold\\">
<toggle-button-stub id=\\"activated\\"></toggle-button-stub> <toggle-button-stub id=\\"activated\\"></toggle-button-stub>
</gl-form-group-stub> </gl-form-group-stub>
...@@ -29,9 +31,18 @@ exports[`AlertsSettingsForm with default values renders the initial template 1`] ...@@ -29,9 +31,18 @@ exports[`AlertsSettingsForm with default values renders the initial template 1`]
Resetting the authorization key for this project will require updating the authorization key in every alert source it is enabled in. Resetting the authorization key for this project will require updating the authorization key in every alert source it is enabled in.
</gl-modal-stub> </gl-modal-stub>
</gl-form-group-stub> </gl-form-group-stub>
<!----> <gl-form-group-stub label=\\"Alert test payload\\" label-for=\\"alert-json\\" label-class=\\"label-bold\\">
<gl-form-textarea-stub noresize=\\"true\\" id=\\"alert-json\\" disabled=\\"true\\" state=\\"true\\" placeholder=\\"Enter test alert JSON....\\" rows=\\"6\\" max-rows=\\"10\\"></gl-form-textarea-stub>
</gl-form-group-stub>
<gl-button-stub category=\\"tertiary\\" variant=\\"default\\" size=\\"medium\\" icon=\\"\\" disabled=\\"true\\">Test alert payload</gl-button-stub> <gl-button-stub category=\\"tertiary\\" variant=\\"default\\" size=\\"medium\\" icon=\\"\\" disabled=\\"true\\">Test alert payload</gl-button-stub>
<!----> <div class=\\"footer-block row-content-block gl-display-flex gl-justify-content-space-between\\">
<gl-button-stub category=\\"primary\\" variant=\\"success\\" size=\\"medium\\" icon=\\"\\" disabled=\\"true\\" type=\\"submit\\">
Save changes
</gl-button-stub>
<gl-button-stub category=\\"primary\\" variant=\\"default\\" size=\\"medium\\" icon=\\"\\" type=\\"reset\\">
Cancel
</gl-button-stub>
</div>
</gl-form-stub> </gl-form-stub>
</div>" </div>"
`; `;
...@@ -32,12 +32,7 @@ describe('AlertsSettingsForm', () => { ...@@ -32,12 +32,7 @@ describe('AlertsSettingsForm', () => {
let wrapper; let wrapper;
let mockAxios; let mockAxios;
const createComponent = ( const createComponent = (props = defaultProps, { methods } = {}, data) => {
props = defaultProps,
{ methods } = {},
alertIntegrationsDropdown = false,
data,
) => {
wrapper = shallowMount(AlertsSettingsForm, { wrapper = shallowMount(AlertsSettingsForm, {
data() { data() {
return { ...data }; return { ...data };
...@@ -47,11 +42,6 @@ describe('AlertsSettingsForm', () => { ...@@ -47,11 +42,6 @@ describe('AlertsSettingsForm', () => {
...props, ...props,
}, },
methods, methods,
provide: {
glFeatures: {
alertIntegrationsDropdown,
},
},
}); });
}; };
......
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