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