Commit 79f0fdad authored by Scott Stern's avatar Scott Stern Committed by Kushal Pandya

Do not render label in sidebar when not shown

This is because of an upgrade in gitlab-ui
parent 77a84ebe
......@@ -44,20 +44,12 @@ export default {
return this.activeListId > 0;
},
activeListLabel() {
if (this.activeList) {
return this.activeList.label;
}
return { color: '', title: '' };
return this.activeList.label;
},
activeListWipLimit() {
if (this.activeList) {
return this.activeList.maxIssueCount === 0
? this.$options.noneText
: this.activeList.maxIssueCount;
}
return this.$options.noneText;
return this.activeList.maxIssueCount === 0
? this.$options.noneText
: this.activeList.maxIssueCount;
},
},
methods: {
......@@ -111,7 +103,7 @@ export default {
@close="closeSidebar"
>
<template #header>{{ $options.listSettingsText }}</template>
<template>
<template v-if="isSidebarOpen">
<div class="d-flex flex-column align-items-start">
<label>{{ $options.labelListText }}</label>
<gl-label
......@@ -136,9 +128,9 @@ export default {
/>
<p v-else class="js-wip-limit bold">{{ activeListWipLimit }}</p>
</div>
<gl-button class="h-100 border-0 gl-line-height-14" variant="link" @click="showInput">
{{ $options.editLinkText }}
</gl-button>
<gl-button class="h-100 border-0 gl-line-height-14" variant="link" @click="showInput">{{
$options.editLinkText
}}</gl-button>
</div>
</template>
</gl-drawer>
......
......@@ -110,6 +110,20 @@ describe('BoardSettingsSideBar', () => {
});
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', () => {
createComponent({ activeListId: 1 });
......@@ -156,12 +170,8 @@ describe('BoardSettingsSideBar', () => {
mock.restore();
});
it('renders label title', () => {
expect(wrapper.find(GlLabel).props('title')).toEqual('');
});
it('renders label background color', () => {
expect(wrapper.find(GlLabel).props('backgroundColor')).toEqual('');
it('does not render GlLabel', () => {
expect(wrapper.find(GlLabel).exists()).toBe(false);
});
});
});
......
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