Commit c9d7d0be authored by Enrique Alcántara's avatar Enrique Alcántara

Merge branch '216750-open-single-panel-new-tab' into 'master'

Allows users to open single panels in a new tab

Closes #216750

See merge request gitlab-org/gitlab!31206
parents 946d423b f9ff17b2
...@@ -313,7 +313,12 @@ export default { ...@@ -313,7 +313,12 @@ export default {
<template slot="button-content"> <template slot="button-content">
<gl-icon name="ellipsis_v" class="text-secondary" /> <gl-icon name="ellipsis_v" class="text-secondary" />
</template> </template>
<gl-dropdown-item v-if="expandBtnAvailable" ref="expandBtn" @click="onExpand"> <gl-dropdown-item
v-if="expandBtnAvailable"
ref="expandBtn"
:href="clipboardText"
@click.prevent="onExpand"
>
{{ s__('Metrics|Expand panel') }} {{ s__('Metrics|Expand panel') }}
</gl-dropdown-item> </gl-dropdown-item>
<gl-dropdown-item <gl-dropdown-item
......
---
title: Allow monitoring dashboard users to open single panels in a new tab
merge_request: 31206
author:
type: added
...@@ -518,8 +518,10 @@ describe('Dashboard Panel', () => { ...@@ -518,8 +518,10 @@ describe('Dashboard Panel', () => {
}); });
it('emits the `expand` event', () => { it('emits the `expand` event', () => {
findExpandBtn().vm.$emit('click'); const preventDefault = jest.fn();
findExpandBtn().vm.$emit('click', { preventDefault });
expect(wrapper.emitted('expand')).toHaveLength(1); expect(wrapper.emitted('expand')).toHaveLength(1);
expect(preventDefault).toHaveBeenCalled();
}); });
}); });
}); });
......
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