Commit 564304dd authored by lauraMon's avatar lauraMon

Fixes some linting

parent 46421574
......@@ -19,7 +19,7 @@ import { fetchPolicies } from '~/lib/graphql';
import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
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 {
statuses: {
......@@ -106,21 +106,21 @@ export default {
},
updateAlertStatus(status) {
this.$apollo
.mutate({
mutation: updateAlertStatus,
variables: {
iid: this.alertId,
status: status.toUpperCase(),
projectPath: this.projectPath,
},
})
.catch(() => {
createFlash(
.mutate({
mutation: updateAlertStatus,
variables: {
iid: this.alertId,
status: status.toUpperCase(),
projectPath: this.projectPath,
},
})
.catch(() => {
createFlash(
s__(
'AlertManagement|There was an error while updating the status of the alert. Please try again.',
),
);
});
);
});
},
},
};
......@@ -170,20 +170,24 @@ export default {
class="gl-display-flex gl-justify-content-space-between gl-align-items-center"
>
<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
v-for="(label, field) in $options.statuses"
:key="field"
data-testid="statusDropdownItem"
class="gl-vertical-align-middle"
@click="updateAlertStatus(label)"
>
>
<span class="d-flex">
<gl-icon
class="flex-shrink-0 append-right-4"
:class="{ invisible: label.toUpperCase() !== alert.status }"
name="mobile-issue-close"
/>
/>
{{ label }}
</span>
</gl-dropdown-item>
......
......@@ -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('createIssueFromAlertEnabled feature flag enabled', () => {
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