Commit 10838732 authored by Alexander Turinske's avatar Alexander Turinske

Fix dropdown not closing on status update

- added new ref

Changelog: added
parent cc6e4fca
...@@ -52,7 +52,7 @@ export default { ...@@ -52,7 +52,7 @@ export default {
}, },
toggleFormDropdown() { toggleFormDropdown() {
this.isDropdownShowing = !this.isDropdownShowing; this.isDropdownShowing = !this.isDropdownShowing;
const { dropdown } = this.$children[2].$refs.dropdown.$refs; const { dropdown } = this.$refs.status.$refs.dropdown.$refs;
if (dropdown && this.isDropdownShowing) { if (dropdown && this.isDropdownShowing) {
dropdown.show(); dropdown.show();
} }
...@@ -102,6 +102,7 @@ export default { ...@@ -102,6 +102,7 @@ export default {
</p> </p>
<alert-status <alert-status
ref="status"
:alert="alert" :alert="alert"
:project-path="projectPath" :project-path="projectPath"
:is-dropdown-showing="isDropdownShowing" :is-dropdown-showing="isDropdownShowing"
......
---
title: Fix dropdown not closing on status update
merge_request: 61404
author:
type: fixed
...@@ -10,9 +10,9 @@ const mockAlert = mockAlerts[0]; ...@@ -10,9 +10,9 @@ const mockAlert = mockAlerts[0];
describe('Alert Details Sidebar Status', () => { describe('Alert Details Sidebar Status', () => {
let wrapper; let wrapper;
const findStatusDropdown = () => wrapper.find(GlDropdown); const findStatusDropdown = () => wrapper.findComponent(GlDropdown);
const findStatusDropdownItem = () => wrapper.find(GlDropdownItem); const findStatusDropdownItem = () => wrapper.findComponent(GlDropdownItem);
const findStatusLoadingIcon = () => wrapper.find(GlLoadingIcon); const findStatusLoadingIcon = () => wrapper.findComponent(GlLoadingIcon);
const findStatusDropdownHeader = () => wrapper.findByTestId('dropdown-header'); const findStatusDropdownHeader = () => wrapper.findByTestId('dropdown-header');
const findAlertStatus = () => wrapper.findComponent(AlertStatus); const findAlertStatus = () => wrapper.findComponent(AlertStatus);
const findStatus = () => wrapper.findByTestId('status'); const findStatus = () => wrapper.findByTestId('status');
......
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