Commit e0179a56 authored by André Luís's avatar André Luís

Remove duplicated sidebar toggle when signed out

When we copied the code from Assignees, the toggle
shown when signed out was carried over by accident.
This removes the logic for the toggle completely from
the reviewers sidebar widget.
parent a01d8a60
<script> <script>
// NOTE! For the first iteration, we are simply copying the implementation of Assignees // NOTE! For the first iteration, we are simply copying the implementation of Assignees
// It will soon be overhauled in Issue https://gitlab.com/gitlab-org/gitlab/-/issues/233736 // It will soon be overhauled in Issue https://gitlab.com/gitlab-org/gitlab/-/issues/233736
import { GlLoadingIcon, GlIcon } from '@gitlab/ui'; import { GlLoadingIcon } from '@gitlab/ui';
import { n__ } from '~/locale'; import { n__ } from '~/locale';
export default { export default {
name: 'ReviewerTitle', name: 'ReviewerTitle',
components: { components: {
GlLoadingIcon, GlLoadingIcon,
GlIcon,
}, },
props: { props: {
loading: { loading: {
...@@ -24,11 +23,6 @@ export default { ...@@ -24,11 +23,6 @@ export default {
type: Boolean, type: Boolean,
required: true, required: true,
}, },
showToggle: {
type: Boolean,
required: false,
default: false,
},
}, },
computed: { computed: {
reviewerTitle() { reviewerTitle() {
...@@ -52,14 +46,5 @@ export default { ...@@ -52,14 +46,5 @@ export default {
> >
{{ __('Edit') }} {{ __('Edit') }}
</a> </a>
<a
v-if="showToggle"
:aria-label="__('Toggle sidebar')"
class="gutter-toggle float-right js-sidebar-toggle"
href="#"
role="button"
>
<gl-icon data-hidden="true" name="chevron-double-lg-right" :size="12" />
</a>
</div> </div>
</template> </template>
...@@ -26,11 +26,6 @@ export default { ...@@ -26,11 +26,6 @@ export default {
type: String, type: String,
required: true, required: true,
}, },
signedIn: {
type: Boolean,
required: false,
default: false,
},
issuableType: { issuableType: {
type: String, type: String,
required: false, required: false,
...@@ -98,7 +93,6 @@ export default { ...@@ -98,7 +93,6 @@ export default {
:number-of-reviewers="store.reviewers.length" :number-of-reviewers="store.reviewers.length"
:loading="loading || store.isFetching.reviewers" :loading="loading || store.isFetching.reviewers"
:editable="store.editable" :editable="store.editable"
:show-toggle="!signedIn"
/> />
<reviewers <reviewers
v-if="!store.isFetching.reviewers" v-if="!store.isFetching.reviewers"
......
...@@ -77,7 +77,6 @@ function mountReviewersComponent(mediator) { ...@@ -77,7 +77,6 @@ function mountReviewersComponent(mediator) {
issuableIid: String(iid), issuableIid: String(iid),
projectPath: fullPath, projectPath: fullPath,
field: el.dataset.field, field: el.dataset.field,
signedIn: el.hasAttribute('data-signed-in'),
issuableType: isInIssuePage() ? 'issue' : 'merge_request', issuableType: isInIssuePage() ? 'issue' : 'merge_request',
}, },
}), }),
......
---
title: Fix duplicated toggle button showing on right sidebar when signed out
merge_request: 50892
author:
type: fixed
...@@ -41,27 +41,6 @@ describe('ReviewerTitle component', () => { ...@@ -41,27 +41,6 @@ describe('ReviewerTitle component', () => {
}); });
}); });
describe('gutter toggle', () => {
it('does not show toggle by default', () => {
wrapper = createComponent({
numberOfReviewers: 2,
editable: false,
});
expect(wrapper.vm.$el.querySelector('.gutter-toggle')).toBeNull();
});
it('shows toggle when showToggle is true', () => {
wrapper = createComponent({
numberOfReviewers: 2,
editable: false,
showToggle: true,
});
expect(wrapper.vm.$el.querySelector('.gutter-toggle')).toEqual(expect.any(Object));
});
});
it('does not render spinner by default', () => { it('does not render spinner by default', () => {
wrapper = createComponent({ wrapper = createComponent({
numberOfReviewers: 0, numberOfReviewers: 0,
......
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