Commit 564304dd authored by lauraMon's avatar lauraMon

Fixes some linting

parent 46421574
...@@ -19,7 +19,7 @@ import { fetchPolicies } from '~/lib/graphql'; ...@@ -19,7 +19,7 @@ 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 glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { ALERTS_SEVERITY_LABELS } from '../constants'; import { ALERTS_SEVERITY_LABELS } from '../constants';
import updateAlertStatus from '../graphql/mutations/update_alert_status.graphql' import updateAlertStatus from '../graphql/mutations/update_alert_status.graphql';
export default { export default {
statuses: { statuses: {
...@@ -106,21 +106,21 @@ export default { ...@@ -106,21 +106,21 @@ export default {
}, },
updateAlertStatus(status) { updateAlertStatus(status) {
this.$apollo this.$apollo
.mutate({ .mutate({
mutation: updateAlertStatus, mutation: updateAlertStatus,
variables: { variables: {
iid: this.alertId, iid: this.alertId,
status: status.toUpperCase(), status: status.toUpperCase(),
projectPath: this.projectPath, projectPath: this.projectPath,
}, },
}) })
.catch(() => { .catch(() => {
createFlash( createFlash(
s__( s__(
'AlertManagement|There was an error while updating the status of the alert. Please try again.', 'AlertManagement|There was an error while updating the status of the alert. Please try again.',
), ),
); );
}); });
}, },
}, },
}; };
...@@ -170,20 +170,24 @@ export default { ...@@ -170,20 +170,24 @@ export default {
class="gl-display-flex gl-justify-content-space-between gl-align-items-center" class="gl-display-flex gl-justify-content-space-between gl-align-items-center"
> >
<h2 data-testid="title">{{ alert.title }}</h2> <h2 data-testid="title">{{ alert.title }}</h2>
<gl-dropdown :text="capitalizeFirstCharacter(alert.status.toLowerCase())" class="mt-2 mb-n2" right> <gl-dropdown
:text="capitalizeFirstCharacter(alert.status.toLowerCase())"
class="mt-2 mb-n2"
right
>
<gl-dropdown-item <gl-dropdown-item
v-for="(label, field) in $options.statuses" v-for="(label, field) in $options.statuses"
:key="field" :key="field"
data-testid="statusDropdownItem" data-testid="statusDropdownItem"
class="gl-vertical-align-middle" class="gl-vertical-align-middle"
@click="updateAlertStatus(label)" @click="updateAlertStatus(label)"
> >
<span class="d-flex"> <span class="d-flex">
<gl-icon <gl-icon
class="flex-shrink-0 append-right-4" class="flex-shrink-0 append-right-4"
:class="{ invisible: label.toUpperCase() !== alert.status }" :class="{ invisible: label.toUpperCase() !== alert.status }"
name="mobile-issue-close" name="mobile-issue-close"
/> />
{{ label }} {{ label }}
</span> </span>
</gl-dropdown-item> </gl-dropdown-item>
......
...@@ -115,10 +115,6 @@ describe('AlertDetails', () => { ...@@ -115,10 +115,6 @@ describe('AlertDetails', () => {
}); });
}); });
it('renders a status dropdown containing three items', () => {
expect(wrapper.findAll('[data-testid="statusDropdownItem"]').length).toBe(3);
});
describe('Create issue from alert', () => { describe('Create issue from alert', () => {
describe('createIssueFromAlertEnabled feature flag enabled', () => { describe('createIssueFromAlertEnabled feature flag enabled', () => {
it('should display a button that links to new issue page', () => { it('should display a button that links to new issue page', () => {
......
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