Commit 7dc7cb0e authored by Florie Guibert's avatar Florie Guibert

Boards - Hide EE components in CE

Hide epic, weight and iteration in EE board sidebar
parent 1d48e365
......@@ -16,7 +16,7 @@ export default {
gon.features?.graphqlBoardLists || gon.features?.epicBoards
? BoardColumn
: BoardColumnDeprecated,
BoardContentSidebar: () => import('~/boards/components/board_content_sidebar.vue'),
BoardContentSidebar: () => import('ee_else_ce/boards/components/board_content_sidebar.vue'),
EpicBoardContentSidebar: () =>
import('ee_component/boards/components/epic_board_content_sidebar.vue'),
EpicsSwimlanes: () => import('ee_component/boards/components/epics_swimlanes.vue'),
......
......@@ -11,7 +11,6 @@ import { contentTop } from '~/lib/utils/common_utils';
import SidebarAssigneesWidget from '~/sidebar/components/assignees/sidebar_assignees_widget.vue';
import SidebarConfidentialityWidget from '~/sidebar/components/confidential/sidebar_confidentiality_widget.vue';
import SidebarSubscriptionsWidget from '~/sidebar/components/subscriptions/sidebar_subscriptions_widget.vue';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
export default {
headerHeight: `${contentTop()}px`,
......@@ -32,7 +31,11 @@ export default {
SidebarIterationWidget: () =>
import('ee_component/sidebar/components/sidebar_iteration_widget.vue'),
},
mixins: [glFeatureFlagsMixin()],
inject: {
weightFeatureAvailable: {
default: false,
},
},
computed: {
...mapGetters([
'isSidebarOpen',
......@@ -50,6 +53,15 @@ export default {
fullPath() {
return this.activeBoardItem?.referencePath?.split('#')[0] || '';
},
showEpicSelector() {
return false;
},
showIterationSelector() {
return false;
},
showWeightSelector() {
return false;
},
},
methods: {
...mapActions(['toggleBoardItem', 'setAssignees', 'setActiveItemConfidential']),
......@@ -77,10 +89,11 @@ export default {
class="assignee"
@assignees-updated="setAssignees"
/>
<board-sidebar-epic-select class="epic" />
<board-sidebar-epic-select v-if="showEpicSelector" class="epic" />
<div>
<board-sidebar-milestone-select />
<sidebar-iteration-widget
v-if="showIterationSelector"
:iid="activeBoardItem.iid"
:workspace-path="projectPathForActiveIssue"
:iterations-workspace-path="groupPathForActiveIssue"
......@@ -91,7 +104,10 @@ export default {
<board-sidebar-time-tracker class="swimlanes-sidebar-time-tracker" />
<board-sidebar-due-date />
<board-sidebar-labels-select class="labels" />
<board-sidebar-weight-input v-if="glFeatures.issueWeights" class="weight" />
<board-sidebar-weight-input
v-if="weightFeatureAvailable && showWeightSelector"
class="weight"
/>
<sidebar-confidentiality-widget
:iid="activeBoardItem.iid"
:full-path="fullPath"
......
<script>
// This is a false violation of @gitlab/no-runtime-template-compiler, since it
// extends a valid Vue single file component.
/* eslint-disable @gitlab/no-runtime-template-compiler */
import BoardContentSidebarFoss from '~/boards/components/board_content_sidebar.vue';
export default {
extends: BoardContentSidebarFoss,
computed: {
showEpicSelector() {
return true;
},
showIterationSelector() {
return true;
},
showWeightSelector() {
return true;
},
},
};
</script>
import { GlDrawer } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import Vuex from 'vuex';
import BoardContentSidebar from 'ee_component/boards/components/board_content_sidebar.vue';
import BoardSidebarEpicSelect from 'ee_component/boards/components/sidebar/board_sidebar_epic_select.vue';
import BoardSidebarWeightInput from 'ee_component/boards/components/sidebar/board_sidebar_weight_input.vue';
import SidebarIterationWidget from 'ee_component/sidebar/components/sidebar_iteration_widget';
import { stubComponent } from 'helpers/stub_component';
import BoardContentSidebar from '~/boards/components/board_content_sidebar.vue';
import { ISSUABLE, issuableTypes } from '~/boards/constants';
import { mockIssue, mockIssueGroupPath, mockIssueProjectPath } from '../mock_data';
......@@ -45,6 +47,7 @@ describe('ee/BoardContentSidebar', () => {
canUpdate: true,
rootPath: '/',
groupId: 1,
weightFeatureAvailable: true,
},
store,
stubs: {
......@@ -83,4 +86,12 @@ describe('ee/BoardContentSidebar', () => {
it('renders SidebarIterationWidget', () => {
expect(wrapper.find(SidebarIterationWidget).exists()).toBe(true);
});
it('renders BoardSidebarEpicSelect', () => {
expect(wrapper.find(BoardSidebarEpicSelect).exists()).toBe(true);
});
it('renders BoardSidebarWeightInput', () => {
expect(wrapper.find(BoardSidebarWeightInput).exists()).toBe(true);
});
});
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