Commit c3a7d311 authored by Axel García's avatar Axel García Committed by Miguel Rincon

Wrap epic header buttons on mobile

This also replaces <gl-deprecated-button> with <gl-button>
parent 92decc3b
<script> <script>
import { mapState, mapGetters, mapActions } from 'vuex'; import { mapState, mapGetters, mapActions } from 'vuex';
import { GlDeprecatedButton, GlIcon } from '@gitlab/ui'; import { GlButton, GlIcon } from '@gitlab/ui';
import { __ } from '~/locale'; import { __ } from '~/locale';
...@@ -18,7 +18,7 @@ export default { ...@@ -18,7 +18,7 @@ export default {
}, },
components: { components: {
GlIcon, GlIcon,
GlDeprecatedButton, GlButton,
UserAvatarLink, UserAvatarLink,
TimeagoTooltip, TimeagoTooltip,
GitlabTeamMemberBadge: () => GitlabTeamMemberBadge: () =>
...@@ -48,7 +48,7 @@ export default { ...@@ -48,7 +48,7 @@ export default {
// False positive css classes // False positive css classes
// https://gitlab.com/gitlab-org/frontend/eslint-plugin-i18n/issues/24 // https://gitlab.com/gitlab-org/frontend/eslint-plugin-i18n/issues/24
// eslint-disable-next-line @gitlab/require-i18n-strings // eslint-disable-next-line @gitlab/require-i18n-strings
return `btn btn-grouped js-btn-epic-action qa-close-reopen-epic-button ${ return `js-btn-epic-action qa-close-reopen-epic-button ${
this.isEpicOpen ? 'btn-close' : 'btn-open' this.isEpicOpen ? 'btn-close' : 'btn-open'
}`; }`;
}, },
...@@ -83,7 +83,7 @@ export default { ...@@ -83,7 +83,7 @@ export default {
</script> </script>
<template> <template>
<div class="detail-page-header"> <div class="detail-page-header gl-flex-wrap gl-py-3">
<div class="detail-page-header-body"> <div class="detail-page-header-body">
<div <div
:class="{ 'status-box-open': isEpicOpen, 'status-box-issue-closed': !isEpicOpen }" :class="{ 'status-box-open': isEpicOpen, 'status-box-issue-closed': !isEpicOpen }"
...@@ -115,32 +115,38 @@ export default { ...@@ -115,32 +115,38 @@ export default {
</strong> </strong>
</div> </div>
</div> </div>
<div class="detail-page-header-actions js-issuable-actions"> <gl-button
<gl-deprecated-button :aria-label="__('Toggle sidebar')"
class="float-right gl-display-block d-sm-none gl-align-self-center gutter-toggle issuable-gutter-toggle js-sidebar-toggle"
type="button"
@click="toggleSidebar({ sidebarCollapsed })"
>
<i class="fa fa-angle-double-left"></i>
</gl-button>
<div
class="detail-page-header-actions gl-display-flex gl-flex-wrap gl-align-items-center gl-w-full gl-w-sm-auto js-issuable-actions"
>
<gl-button
v-if="canUpdate" v-if="canUpdate"
:loading="epicStatusChangeInProgress" :loading="epicStatusChangeInProgress"
:class="actionButtonClass" :class="actionButtonClass"
category="secondary"
variant="warning"
class="gl-mt-3 gl-mt-sm-0 gl-w-full gl-w-sm-auto"
@click="toggleEpicStatus(isEpicOpen)" @click="toggleEpicStatus(isEpicOpen)"
>{{ actionButtonText }}</gl-deprecated-button
> >
{{ actionButtonText }}
<gl-deprecated-button </gl-button>
<gl-button
v-if="userCanCreate" v-if="userCanCreate"
class="btn btn-grouped btn-success btn-inverted js-new-epic-button"
:href="newEpicWebUrl" :href="newEpicWebUrl"
data-testid="new-epic-button" data-testid="new-epic-button"
class="gl-mt-3 gl-mt-sm-0 gl-ml-sm-3 gl-w-full gl-w-sm-auto"
category="secondary"
variant="success"
> >
{{ __('New epic') }} {{ __('New epic') }}
</gl-deprecated-button> </gl-button>
</div> </div>
<gl-deprecated-button
:aria-label="__('Toggle sidebar')"
variant="secondary"
class="float-right d-block d-sm-none gutter-toggle issuable-gutter-toggle js-sidebar-toggle"
type="button"
@click="toggleSidebar({ sidebarCollapsed })"
>
<i class="fa fa-angle-double-left"></i>
</gl-deprecated-button>
</div> </div>
</template> </template>
...@@ -72,7 +72,6 @@ ...@@ -72,7 +72,6 @@
} }
.detail-page-header-actions { .detail-page-header-actions {
width: auto;
margin-top: 0; margin-top: 0;
} }
} }
......
...@@ -70,7 +70,7 @@ describe('EpicHeaderComponent', () => { ...@@ -70,7 +70,7 @@ describe('EpicHeaderComponent', () => {
vm.$store.state.state = statusType.open; vm.$store.state.state = statusType.open;
expect(vm.actionButtonClass).toBe( expect(vm.actionButtonClass).toBe(
'btn btn-grouped js-btn-epic-action qa-close-reopen-epic-button btn-close', 'js-btn-epic-action qa-close-reopen-epic-button btn-close',
); );
}); });
...@@ -78,7 +78,7 @@ describe('EpicHeaderComponent', () => { ...@@ -78,7 +78,7 @@ describe('EpicHeaderComponent', () => {
vm.$store.state.state = statusType.close; vm.$store.state.state = statusType.close;
expect(vm.actionButtonClass).toBe( expect(vm.actionButtonClass).toBe(
'btn btn-grouped js-btn-epic-action qa-close-reopen-epic-button btn-open', 'js-btn-epic-action qa-close-reopen-epic-button btn-open',
); );
}); });
}); });
......
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