Commit c5d71bda authored by Olena Horal-Koretska's avatar Olena Horal-Koretska

Remove redundant code

parent cfe55c62
...@@ -32,8 +32,6 @@ export const ISSUABLE_TYPES = { ...@@ -32,8 +32,6 @@ export const ISSUABLE_TYPES = {
INCIDENT: 'incident', INCIDENT: 'incident',
}; };
export const SIDEBAR_ANIMATION_DURATION = 300;
export const I18N = { export const I18N = {
UPDATE_SEVERITY_ERROR: s__('SeverityWidget|There was an error while updating severity.'), UPDATE_SEVERITY_ERROR: s__('SeverityWidget|There was an error while updating severity.'),
TRY_AGAIN: __('Please try again'), TRY_AGAIN: __('Please try again'),
......
...@@ -7,7 +7,7 @@ import { ...@@ -7,7 +7,7 @@ import {
GlSprintf, GlSprintf,
GlLink, GlLink,
} from '@gitlab/ui'; } from '@gitlab/ui';
import { INCIDENT_SEVERITY, ISSUABLE_TYPES, SIDEBAR_ANIMATION_DURATION, I18N } from './constants'; import { INCIDENT_SEVERITY, ISSUABLE_TYPES, I18N } from './constants';
import updateIssuableSeverity from './graphql/mutations/update_issuable_severity.mutation.graphql'; import updateIssuableSeverity from './graphql/mutations/update_issuable_severity.mutation.graphql';
import SeverityToken from './severity.vue'; import SeverityToken from './severity.vue';
import createFlash from '~/flash'; import createFlash from '~/flash';
...@@ -91,15 +91,8 @@ export default { ...@@ -91,15 +91,8 @@ export default {
const event = new Event('hidden.gl.dropdown'); const event = new Event('hidden.gl.dropdown');
this.$el.dispatchEvent(event); this.$el.dispatchEvent(event);
}, },
toggleFormDropdown(collapsedSidebar) { toggleFormDropdown() {
this.isDropdownShowing = !this.isDropdownShowing; this.isDropdownShowing = !this.isDropdownShowing;
const timeout = collapsedSidebar ? SIDEBAR_ANIMATION_DURATION : 0;
setTimeout(() => {
const { dropdown } = this.$refs;
if (dropdown && this.isDropdownShowing) {
dropdown.show();
}
}, timeout);
}, },
updateSeverity(value) { updateSeverity(value) {
this.hideDropdown(); this.hideDropdown();
...@@ -143,7 +136,7 @@ export default { ...@@ -143,7 +136,7 @@ export default {
<template> <template>
<div ref="sidebarSeverity" class="block"> <div ref="sidebarSeverity" class="block">
<div ref="severity" class="sidebar-collapsed-icon" @click="toggleFormDropdown(true)"> <div ref="severity" class="sidebar-collapsed-icon" @click="toggleFormDropdown">
<severity-token :severity="selectedItem" :icon-size="14" :icon-only="true" /> <severity-token :severity="selectedItem" :icon-size="14" :icon-only="true" />
<gl-tooltip :target="() => $refs.severity" boundary="viewport" placement="left"> <gl-tooltip :target="() => $refs.severity" boundary="viewport" placement="left">
<gl-sprintf :message="$options.i18n.SEVERITY_VALUE"> <gl-sprintf :message="$options.i18n.SEVERITY_VALUE">
...@@ -168,7 +161,6 @@ export default { ...@@ -168,7 +161,6 @@ export default {
</p> </p>
<gl-dropdown <gl-dropdown
ref="dropdown"
:class="dropdownClass" :class="dropdownClass"
block block
:text="selectedItem.label" :text="selectedItem.label"
......
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