Commit 8914310b authored by Tom Quirk's avatar Tom Quirk

Fix title, value spacing of various sidebar blocks

Spacing between title and value of sidebar blocks
is inconsistent.

This commit changes most of the sidebar blocks on
Issues and MRs to be consistent.

gitlab-utility classes are used to achieve the
same result as the `.title` class.

Changelog: changed
MR: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/61650
EE: true
parent 9126b090
...@@ -45,7 +45,7 @@ export default { ...@@ -45,7 +45,7 @@ export default {
}; };
</script> </script>
<template> <template>
<div class="title hide-collapsed"> <div class="hide-collapsed gl-line-height-20 gl-mb-2 gl-text-gray-900">
{{ assigneeTitle }} {{ assigneeTitle }}
<gl-loading-icon v-if="loading" inline class="align-bottom" /> <gl-loading-icon v-if="loading" inline class="align-bottom" />
<a <a
......
...@@ -48,17 +48,15 @@ export default { ...@@ -48,17 +48,15 @@ export default {
<collapsed-assignee-list :users="sortedAssigness" :issuable-type="issuableType" /> <collapsed-assignee-list :users="sortedAssigness" :issuable-type="issuableType" />
<div data-testid="expanded-assignee" class="value hide-collapsed"> <div data-testid="expanded-assignee" class="value hide-collapsed">
<template v-if="hasNoUsers"> <span v-if="hasNoUsers" class="no-value" data-testid="no-value">
<span class="assign-yourself no-value"> {{ __('None') }}
{{ __('None') }} <template v-if="editable">
<template v-if="editable"> -
- <button type="button" class="btn-link" data-testid="assign-yourself" @click="assignSelf">
<button type="button" class="btn-link" @click="assignSelf"> {{ __('assign yourself') }}
{{ __('assign yourself') }} </button>
</button> </template>
</template> </span>
</span>
</template>
<uncollapsed-assignee-list v-else :users="sortedAssigness" :issuable-type="issuableType" /> <uncollapsed-assignee-list v-else :users="sortedAssigness" :issuable-type="issuableType" />
</div> </div>
......
...@@ -149,7 +149,6 @@ export default { ...@@ -149,7 +149,6 @@ export default {
:users="exposeAvailabilityStatus(store.assignees)" :users="exposeAvailabilityStatus(store.assignees)"
:editable="store.editable" :editable="store.editable"
:issuable-type="issuableType" :issuable-type="issuableType"
class="value"
@assign-self="assignSelf" @assign-self="assignSelf"
/> />
</div> </div>
......
...@@ -86,7 +86,7 @@ export default { ...@@ -86,7 +86,7 @@ export default {
<gl-icon :name="lockStatus.icon" class="sidebar-item-icon is-active" /> <gl-icon :name="lockStatus.icon" class="sidebar-item-icon is-active" />
</div> </div>
<div class="title hide-collapsed"> <div class="hide-collapsed gl-line-height-20 gl-mb-2 gl-text-gray-900">
{{ sprintf(__('Lock %{issuableDisplayName}'), { issuableDisplayName: issuableDisplayName }) }} {{ sprintf(__('Lock %{issuableDisplayName}'), { issuableDisplayName: issuableDisplayName }) }}
<a <a
v-if="isEditable" v-if="isEditable"
......
...@@ -33,7 +33,7 @@ export default { ...@@ -33,7 +33,7 @@ export default {
}; };
</script> </script>
<template> <template>
<div class="title hide-collapsed"> <div class="hide-collapsed gl-line-height-20 gl-mb-2 gl-text-gray-900">
{{ reviewerTitle }} {{ reviewerTitle }}
<gl-loading-icon v-if="loading" inline class="align-bottom" /> <gl-loading-icon v-if="loading" inline class="align-bottom" />
<a <a
......
...@@ -59,7 +59,7 @@ export default { ...@@ -59,7 +59,7 @@ export default {
<div class="value hide-collapsed"> <div class="value hide-collapsed">
<template v-if="hasNoUsers"> <template v-if="hasNoUsers">
<span class="assign-yourself no-value"> <span class="no-value">
{{ __('None') }} {{ __('None') }}
</span> </span>
</template> </template>
......
...@@ -103,7 +103,6 @@ export default { ...@@ -103,7 +103,6 @@ export default {
:users="store.reviewers" :users="store.reviewers"
:editable="store.editable" :editable="store.editable"
:issuable-type="issuableType" :issuable-type="issuableType"
class="value"
@request-review="requestReview" @request-review="requestReview"
/> />
</div> </div>
......
...@@ -109,8 +109,13 @@ export default { ...@@ -109,8 +109,13 @@ export default {
<template> <template>
<div> <div>
<div class="gl-display-flex gl-align-items-center" @click.self="collapse"> <div
<span class="hide-collapsed" data-testid="title" @click="collapse">{{ title }}</span> class="gl-display-flex gl-align-items-center gl-line-height-20 gl-mb-2 gl-text-gray-900"
@click.self="collapse"
>
<span class="hide-collapsed" data-testid="title" @click="collapse">
{{ title }}
</span>
<slot name="title-extra"></slot> <slot name="title-extra"></slot>
<gl-loading-icon v-if="loading || initialLoading" inline class="gl-ml-2 hide-collapsed" /> <gl-loading-icon v-if="loading || initialLoading" inline class="gl-ml-2 hide-collapsed" />
<gl-loading-icon <gl-loading-icon
...@@ -135,7 +140,7 @@ export default { ...@@ -135,7 +140,7 @@ export default {
</gl-button> </gl-button>
</div> </div>
<template v-if="!initialLoading"> <template v-if="!initialLoading">
<div v-show="!edit" data-testid="collapsed-content"> <div v-show="!edit" data-testid="collapsed-content" class="gl-line-height-14">
<slot name="collapsed">{{ __('None') }}</slot> <slot name="collapsed">{{ __('None') }}</slot>
</div> </div>
<div v-show="edit" data-testid="expanded-content" :class="{ 'gl-mt-3': !isClassicSidebar }"> <div v-show="edit" data-testid="expanded-content" :class="{ 'gl-mt-3': !isClassicSidebar }">
......
...@@ -70,7 +70,7 @@ export default { ...@@ -70,7 +70,7 @@ export default {
</script> </script>
<template> <template>
<div data-testid="timeTrackingComparisonPane"> <div class="gl-mt-2" data-testid="timeTrackingComparisonPane">
<div <div
v-gl-tooltip v-gl-tooltip
data-testid="compareMeter" data-testid="compareMeter"
......
...@@ -141,7 +141,7 @@ export default { ...@@ -141,7 +141,7 @@ export default {
:time-spent-human-readable="humanTimeSpent" :time-spent-human-readable="humanTimeSpent"
:time-estimate-human-readable="humanTimeEstimate" :time-estimate-human-readable="humanTimeEstimate"
/> />
<div class="title hide-collapsed gl-mb-3"> <div class="hide-collapsed gl-line-height-20 gl-text-gray-900">
{{ __('Time tracking') }} {{ __('Time tracking') }}
<div <div
v-if="!showHelpState" v-if="!showHelpState"
...@@ -160,7 +160,7 @@ export default { ...@@ -160,7 +160,7 @@ export default {
<gl-icon name="close" /> <gl-icon name="close" />
</div> </div>
</div> </div>
<div class="time-tracking-content hide-collapsed"> <div class="hide-collapsed">
<div v-if="showEstimateOnlyState" data-testid="estimateOnlyPane"> <div v-if="showEstimateOnlyState" data-testid="estimateOnlyPane">
<span class="gl-font-weight-bold">{{ $options.i18n.estimatedOnlyText }} </span <span class="gl-font-weight-bold">{{ $options.i18n.estimatedOnlyText }} </span
>{{ humanTimeEstimate }} >{{ humanTimeEstimate }}
...@@ -186,9 +186,9 @@ export default { ...@@ -186,9 +186,9 @@ export default {
v-gl-modal="'time-tracking-report'" v-gl-modal="'time-tracking-report'"
data-testid="reportLink" data-testid="reportLink"
href="#" href="#"
class="btn-link"
>{{ __('Time tracking report') }}</gl-link
> >
{{ __('Time tracking report') }}
</gl-link>
<gl-modal <gl-modal
modal-id="time-tracking-report" modal-id="time-tracking-report"
:title="__('Time tracking report')" :title="__('Time tracking report')"
......
...@@ -206,6 +206,7 @@ function mountConfidentialComponent() { ...@@ -206,6 +206,7 @@ function mountConfidentialComponent() {
}, },
provide: { provide: {
canUpdate: initialData.is_editable, canUpdate: initialData.is_editable,
isClassicSidebar: true,
}, },
render: (createElement) => render: (createElement) =>
......
...@@ -23,17 +23,18 @@ export default { ...@@ -23,17 +23,18 @@ export default {
</script> </script>
<template> <template>
<div class="title hide-collapsed gl-mb-3"> <div class="hide-collapsed gl-line-height-20 gl-mb-2 gl-text-gray-900">
{{ __('Labels') }} {{ __('Labels') }}
<template v-if="allowLabelEdit"> <template v-if="allowLabelEdit">
<gl-loading-icon v-show="labelsSelectInProgress" inline /> <gl-loading-icon v-show="labelsSelectInProgress" inline />
<gl-button <gl-button
variant="link" variant="link"
class="gl-text-gray-800! float-right js-sidebar-dropdown-toggle" class="float-right gl-text-gray-900! gl-hover-text-blue-800! js-sidebar-dropdown-toggle"
data-qa-selector="labels_edit_button" data-qa-selector="labels_edit_button"
@click="toggleDropdownContents" @click="toggleDropdownContents"
>{{ __('Edit') }}</gl-button
> >
{{ __('Edit') }}
</gl-button>
</template> </template>
</div> </div>
</template> </template>
...@@ -267,11 +267,6 @@ ...@@ -267,11 +267,6 @@
.value { .value {
line-height: 1; line-height: 1;
.assign-yourself {
margin-top: 10px;
display: block;
}
} }
.issuable-sidebar { .issuable-sidebar {
...@@ -288,10 +283,6 @@ ...@@ -288,10 +283,6 @@
} }
} }
.assign-yourself .btn-link {
padding-left: 0;
}
.light { .light {
font-weight: $gl-font-weight-normal; font-weight: $gl-font-weight-normal;
} }
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
= milestone[:title] = milestone[:title]
- else - else
= _('None') = _('None')
.title.hide-collapsed .hide-collapsed.gl-line-height-20.gl-mb-2.gl-text-gray-900{ data: { testid: "milestone_title" } }
= _('Milestone') = _('Milestone')
= loading_icon(css_class: 'gl-vertical-align-text-bottom hidden block-loading') = loading_icon(css_class: 'gl-vertical-align-text-bottom hidden block-loading')
- if can_edit_issuable - if can_edit_issuable
......
...@@ -153,7 +153,9 @@ export default { ...@@ -153,7 +153,9 @@ export default {
</div> </div>
<div class="hide-collapsed"> <div class="hide-collapsed">
<p class="title gl-display-flex justify-content-between"> <div
class="gl-display-flex gl-justify-content-space-between gl-align-items-center gl-line-height-20 gl-mb-2 gl-text-gray-900"
>
<span data-testid="statusTitle">{{ s__('Sidebar|Health status') }}</span> <span data-testid="statusTitle">{{ s__('Sidebar|Health status') }}</span>
<span <span
v-if="isEditable" v-if="isEditable"
...@@ -172,7 +174,7 @@ export default { ...@@ -172,7 +174,7 @@ export default {
{{ __('Edit') }} {{ __('Edit') }}
</gl-button> </gl-button>
</span> </span>
</p> </div>
<div <div
data-testid="dropdownWrapper" data-testid="dropdownWrapper"
......
...@@ -152,7 +152,7 @@ export default { ...@@ -152,7 +152,7 @@ export default {
}}<template v-if="weight > $options.maxDisplayWeight">&hellip;</template> }}<template v-if="weight > $options.maxDisplayWeight">&hellip;</template>
</span> </span>
</div> </div>
<div class="title hide-collapsed"> <div class="hide-collapsed gl-line-height-20 gl-mb-2 gl-text-gray-900">
{{ s__('Sidebar|Weight') }} {{ s__('Sidebar|Weight') }}
<gl-loading-icon v-if="fetching || loading" :inline="true" class="js-weight-loading-icon" /> <gl-loading-icon v-if="fetching || loading" :inline="true" class="js-weight-loading-icon" />
<a <a
......
...@@ -266,7 +266,7 @@ RSpec.describe 'Issue Sidebar' do ...@@ -266,7 +266,7 @@ RSpec.describe 'Issue Sidebar' do
let_it_be(:milestone3) { create(:milestone, project: project, title: 'Milestone-3', due_date: 10.days.from_now) } let_it_be(:milestone3) { create(:milestone, project: project, title: 'Milestone-3', due_date: 10.days.from_now) }
before do before do
page.within('.block.milestone > .title') do page.within('[data-testid="milestone_title"]') do
click_on 'Edit' click_on 'Edit'
end end
end end
......
...@@ -187,7 +187,8 @@ RSpec.describe "Issues > User edits issue", :js do ...@@ -187,7 +187,8 @@ RSpec.describe "Issues > User edits issue", :js do
click_link 'Edit' click_link 'Edit'
click_link 'Unassigned' click_link 'Unassigned'
first('.title').click
close_dropdown_menu_if_visible
expect(page).to have_content 'None - assign yourself' expect(page).to have_content 'None - assign yourself'
end end
...@@ -227,7 +228,7 @@ RSpec.describe "Issues > User edits issue", :js do ...@@ -227,7 +228,7 @@ RSpec.describe "Issues > User edits issue", :js do
close_dropdown_menu_if_visible close_dropdown_menu_if_visible
page.within '.value .assign-yourself' do page.within '[data-testid="no-value"]' do
expect(page).to have_content "None" expect(page).to have_content "None"
end end
end end
......
...@@ -19,7 +19,7 @@ describe('Assignee component', () => { ...@@ -19,7 +19,7 @@ describe('Assignee component', () => {
}); });
}; };
const findComponentTextNoUsers = () => wrapper.find('.assign-yourself'); const findComponentTextNoUsers = () => wrapper.find('[data-testid="no-value"]');
const findCollapsedChildren = () => wrapper.findAll('.sidebar-collapsed-icon > *'); const findCollapsedChildren = () => wrapper.findAll('.sidebar-collapsed-icon > *');
afterEach(() => { afterEach(() => {
...@@ -64,7 +64,7 @@ describe('Assignee component', () => { ...@@ -64,7 +64,7 @@ describe('Assignee component', () => {
}); });
jest.spyOn(wrapper.vm, '$emit'); jest.spyOn(wrapper.vm, '$emit');
wrapper.find('.assign-yourself .btn-link').trigger('click'); wrapper.find('[data-testid="assign-yourself"]').trigger('click');
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
expect(wrapper.emitted('assign-self')).toBeTruthy(); expect(wrapper.emitted('assign-self')).toBeTruthy();
......
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