Commit f9ff17b2 authored by Miguel Rincon's avatar Miguel Rincon

Allows users to single panels in a new tab

parent 071e8dac
......@@ -313,7 +313,12 @@ export default {
<template slot="button-content">
<gl-icon name="ellipsis_v" class="text-secondary" />
</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') }}
</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', () => {
});
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(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