Commit 56cd0fac authored by Miguel Rincon's avatar Miguel Rincon

Remove metricsDashboardNewPanelPage from FE component

This commit removes the metricsDashboardNewPanelPage feature flag
from the frontend so the button is displayed to all users.
parent 7b6be4d2
...@@ -11,7 +11,6 @@ import { ...@@ -11,7 +11,6 @@ import {
GlTooltipDirective, GlTooltipDirective,
} from '@gitlab/ui'; } from '@gitlab/ui';
import CustomMetricsFormFields from '~/custom_metrics/components/custom_metrics_form_fields.vue'; import CustomMetricsFormFields from '~/custom_metrics/components/custom_metrics_form_fields.vue';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { PANEL_NEW_PAGE } from '../router/constants'; import { PANEL_NEW_PAGE } from '../router/constants';
import DuplicateDashboardModal from './duplicate_dashboard_modal.vue'; import DuplicateDashboardModal from './duplicate_dashboard_modal.vue';
import CreateDashboardModal from './create_dashboard_modal.vue'; import CreateDashboardModal from './create_dashboard_modal.vue';
...@@ -38,7 +37,6 @@ export default { ...@@ -38,7 +37,6 @@ export default {
GlTooltip: GlTooltipDirective, GlTooltip: GlTooltipDirective,
TrackEvent: TrackEventDirective, TrackEvent: TrackEventDirective,
}, },
mixins: [glFeatureFlagsMixin()],
props: { props: {
addingMetricsAvailable: { addingMetricsAvailable: {
type: Boolean, type: Boolean,
...@@ -86,7 +84,6 @@ export default { ...@@ -86,7 +84,6 @@ export default {
}, },
isMenuItemShown() { isMenuItemShown() {
return { return {
addPanel: this.glFeatures.metricsDashboardNewPanelPage,
duplicateDashboard: this.isOutOfTheBoxDashboard, duplicateDashboard: this.isOutOfTheBoxDashboard,
}; };
}, },
...@@ -192,31 +189,29 @@ export default { ...@@ -192,31 +189,29 @@ export default {
</gl-modal> </gl-modal>
</template> </template>
<template v-if="isMenuItemShown.addPanel"> <gl-new-dropdown-item
v-if="isMenuItemEnabled.addPanel"
data-testid="add-panel-item-enabled"
:to="newPanelPageLocation"
>
{{ $options.i18n.addPanel }}
</gl-new-dropdown-item>
<!--
wrapper for tooltip as button can be `disabled`
https://bootstrap-vue.org/docs/components/tooltip#disabled-elements
-->
<div v-else v-gl-tooltip :title="$options.i18n.addPanelInfo">
<gl-new-dropdown-item <gl-new-dropdown-item
v-if="isMenuItemEnabled.addPanel" :alt="$options.i18n.addPanelInfo"
data-testid="add-panel-item-enabled"
:to="newPanelPageLocation" :to="newPanelPageLocation"
data-testid="add-panel-item-disabled"
disabled
class="gl-cursor-not-allowed"
> >
{{ $options.i18n.addPanel }} <span class="gl-text-gray-400">{{ $options.i18n.addPanel }}</span>
</gl-new-dropdown-item> </gl-new-dropdown-item>
</div>
<!--
wrapper for tooltip as button can be `disabled`
https://bootstrap-vue.org/docs/components/tooltip#disabled-elements
-->
<div v-else v-gl-tooltip :title="$options.i18n.addPanelInfo">
<gl-new-dropdown-item
:alt="$options.i18n.addPanelInfo"
:to="newPanelPageLocation"
data-testid="add-panel-item-disabled"
disabled
class="gl-cursor-not-allowed"
>
<span class="gl-text-gray-400">{{ $options.i18n.addPanel }}</span>
</gl-new-dropdown-item>
</div>
</template>
<gl-new-dropdown-item <gl-new-dropdown-item
v-if="isMenuItemEnabled.editDashboard" v-if="isMenuItemEnabled.editDashboard"
...@@ -230,7 +225,7 @@ export default { ...@@ -230,7 +225,7 @@ export default {
<!-- <!--
wrapper for tooltip as button can be `disabled` wrapper for tooltip as button can be `disabled`
https://bootstrap-vue.org/docs/components/tooltip#disabled-elements https://bootstrap-vue.org/docs/components/tooltip#disabled-elements
--> -->
<div v-else v-gl-tooltip :title="$options.i18n.editDashboardInfo"> <div v-else v-gl-tooltip :title="$options.i18n.editDashboardInfo">
<gl-new-dropdown-item <gl-new-dropdown-item
:alt="$options.i18n.editDashboardInfo" :alt="$options.i18n.editDashboardInfo"
......
...@@ -42,9 +42,6 @@ describe('Actions menu', () => { ...@@ -42,9 +42,6 @@ describe('Actions menu', () => {
const createShallowWrapper = (props = {}, options = {}) => { const createShallowWrapper = (props = {}, options = {}) => {
wrapper = shallowMount(ActionsMenu, { wrapper = shallowMount(ActionsMenu, {
propsData: { ...dashboardActionsMenuProps, ...props }, propsData: { ...dashboardActionsMenuProps, ...props },
provide: {
glFeatures: { metricsDashboardNewPanelPage: true },
},
store, store,
...options, ...options,
}); });
......
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