Commit 6b45f448 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'ss/dont-render-label-in-sidebar' into 'master'

Do not render label in sidebar when not shown

See merge request gitlab-org/gitlab!22813
parents 77a84ebe 79f0fdad
...@@ -44,20 +44,12 @@ export default { ...@@ -44,20 +44,12 @@ export default {
return this.activeListId > 0; return this.activeListId > 0;
}, },
activeListLabel() { activeListLabel() {
if (this.activeList) {
return this.activeList.label; return this.activeList.label;
}
return { color: '', title: '' };
}, },
activeListWipLimit() { activeListWipLimit() {
if (this.activeList) {
return this.activeList.maxIssueCount === 0 return this.activeList.maxIssueCount === 0
? this.$options.noneText ? this.$options.noneText
: this.activeList.maxIssueCount; : this.activeList.maxIssueCount;
}
return this.$options.noneText;
}, },
}, },
methods: { methods: {
...@@ -111,7 +103,7 @@ export default { ...@@ -111,7 +103,7 @@ export default {
@close="closeSidebar" @close="closeSidebar"
> >
<template #header>{{ $options.listSettingsText }}</template> <template #header>{{ $options.listSettingsText }}</template>
<template> <template v-if="isSidebarOpen">
<div class="d-flex flex-column align-items-start"> <div class="d-flex flex-column align-items-start">
<label>{{ $options.labelListText }}</label> <label>{{ $options.labelListText }}</label>
<gl-label <gl-label
...@@ -136,9 +128,9 @@ export default { ...@@ -136,9 +128,9 @@ export default {
/> />
<p v-else class="js-wip-limit bold">{{ activeListWipLimit }}</p> <p v-else class="js-wip-limit bold">{{ activeListWipLimit }}</p>
</div> </div>
<gl-button class="h-100 border-0 gl-line-height-14" variant="link" @click="showInput"> <gl-button class="h-100 border-0 gl-line-height-14" variant="link" @click="showInput">{{
{{ $options.editLinkText }} $options.editLinkText
</gl-button> }}</gl-button>
</div> </div>
</template> </template>
</gl-drawer> </gl-drawer>
......
...@@ -110,6 +110,20 @@ describe('BoardSettingsSideBar', () => { ...@@ -110,6 +110,20 @@ describe('BoardSettingsSideBar', () => {
}); });
describe('when activeListId is greater than zero', () => { describe('when activeListId is greater than zero', () => {
beforeEach(() => {
mock = new MockAdapter(axios);
boardsStore.store.addList({
id: listId,
label: { title: labelTitle, color: labelColor },
list_type: 'label',
});
});
afterEach(() => {
boardsStore.store.removeList(listId);
});
it('renders GlDrawer with open false', () => { it('renders GlDrawer with open false', () => {
createComponent({ activeListId: 1 }); createComponent({ activeListId: 1 });
...@@ -156,12 +170,8 @@ describe('BoardSettingsSideBar', () => { ...@@ -156,12 +170,8 @@ describe('BoardSettingsSideBar', () => {
mock.restore(); mock.restore();
}); });
it('renders label title', () => { it('does not render GlLabel', () => {
expect(wrapper.find(GlLabel).props('title')).toEqual(''); expect(wrapper.find(GlLabel).exists()).toBe(false);
});
it('renders label background color', () => {
expect(wrapper.find(GlLabel).props('backgroundColor')).toEqual('');
}); });
}); });
}); });
......
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