Commit b0182221 authored by Phil Hughes's avatar Phil Hughes

Merge branch '6971-epic-sidebar-updates' into 'master'

Update epic sidebar collapse button to match issue sidebar

See merge request gitlab-org/gitlab!19656
parents f6910cf3 ddbc8804
...@@ -59,6 +59,9 @@ export default { ...@@ -59,6 +59,9 @@ export default {
collapsedButtonIcon() { collapsedButtonIcon() {
return this.isTodo ? 'todo-done' : 'todo-add'; return this.isTodo ? 'todo-done' : 'todo-add';
}, },
collapsedButtonIconVisible() {
return this.collapsed && !this.isActionActive;
},
}, },
methods: { methods: {
handleButtonClick() { handleButtonClick() {
...@@ -82,8 +85,12 @@ export default { ...@@ -82,8 +85,12 @@ export default {
data-boundary="viewport" data-boundary="viewport"
@click="handleButtonClick" @click="handleButtonClick"
> >
<icon v-show="collapsed" :class="collapsedButtonIconClasses" :name="collapsedButtonIcon" /> <icon
<span v-show="!collapsed" class="issuable-todo-inner"> {{ buttonLabel }} </span> v-show="collapsedButtonIconVisible"
:class="collapsedButtonIconClasses"
:name="collapsedButtonIcon"
/>
<span v-show="!collapsed" class="issuable-todo-inner">{{ buttonLabel }}</span>
<gl-loading-icon v-show="isActionActive" :inline="true" /> <gl-loading-icon v-show="isActionActive" :inline="true" />
</button> </button>
</template> </template>
...@@ -61,10 +61,6 @@ ...@@ -61,10 +61,6 @@
padding-right: 0; padding-right: 0;
z-index: 300; z-index: 300;
.btn-sidebar-action {
display: inline-flex;
}
@include media-breakpoint-only(sm) { @include media-breakpoint-only(sm) {
&:not(.wiki-sidebar):not(.build-sidebar):not(.issuable-bulk-update-sidebar) .content-wrapper { &:not(.wiki-sidebar):not(.build-sidebar):not(.issuable-bulk-update-sidebar) .content-wrapper {
padding-right: $gutter-collapsed-width; padding-right: $gutter-collapsed-width;
......
---
title: Vertically align collapse button on epic sidebar
merge_request: 19656
author:
type: fixed
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
color: $gl-text-color-secondary; color: $gl-text-color-secondary;
} }
.btn-sidebar-action { .btn-sidebar-action.btn-link {
line-height: $gl-font-size; line-height: $gl-font-size;
} }
......
...@@ -89,5 +89,11 @@ describe('SidebarTodo', () => { ...@@ -89,5 +89,11 @@ describe('SidebarTodo', () => {
expect(wrapper.find(GlLoadingIcon).exists()).toBe(true); expect(wrapper.find(GlLoadingIcon).exists()).toBe(true);
}); });
it('hides button icon when `isActionActive` prop is true', () => {
createComponent({ collapsed: true, isActionActive: true });
expect(wrapper.find(Icon).isVisible()).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