Commit af2775a0 authored by Robert Hunt's avatar Robert Hunt

Tidied up dropdown titles so they line up properly

- Alert management
- Sidebar
_ Batch comments
parent c914e755
...@@ -101,12 +101,12 @@ export default { ...@@ -101,12 +101,12 @@ export default {
@keydown.esc.native="$emit('hide-dropdown')" @keydown.esc.native="$emit('hide-dropdown')"
@hide="$emit('hide-dropdown')" @hide="$emit('hide-dropdown')"
> >
<div v-if="isSidebar" class="dropdown-title text-center"> <div v-if="isSidebar" class="dropdown-title gl-display-flex">
<span class="alert-title">{{ s__('AlertManagement|Assign status') }}</span> <span class="alert-title gl-ml-auto">{{ s__('AlertManagement|Assign status') }}</span>
<gl-button <gl-button
:aria-label="__('Close')" :aria-label="__('Close')"
variant="link" variant="link"
class="dropdown-title-button dropdown-menu-close" class="dropdown-title-button dropdown-menu-close gl-ml-auto gl-text-black-normal!"
icon="close" icon="close"
@click="$emit('hide-dropdown')" @click="$emit('hide-dropdown')"
/> />
......
...@@ -225,12 +225,12 @@ export default { ...@@ -225,12 +225,12 @@ export default {
@keydown.esc.native="hideDropdown" @keydown.esc.native="hideDropdown"
@hide="hideDropdown" @hide="hideDropdown"
> >
<div class="dropdown-title"> <div class="dropdown-title gl-display-flex">
<span class="alert-title">{{ __('Assign To') }}</span> <span class="alert-title gl-ml-auto">{{ __('Assign To') }}</span>
<gl-button <gl-button
:aria-label="__('Close')" :aria-label="__('Close')"
variant="link" variant="link"
class="dropdown-title-button dropdown-menu-close" class="dropdown-title-button dropdown-menu-close gl-ml-auto gl-text-black-normal!"
icon="close" icon="close"
@click="hideDropdown" @click="hideDropdown"
/> />
......
<script> <script>
import { mapActions, mapGetters, mapState } from 'vuex'; import { mapActions, mapGetters, mapState } from 'vuex';
import { GlLoadingIcon, GlButton, GlIcon } from '@gitlab/ui'; import { GlButton, GlLoadingIcon, GlIcon } from '@gitlab/ui';
import { sprintf, n__ } from '~/locale'; import { sprintf, n__ } from '~/locale';
import DraftsCount from './drafts_count.vue'; import DraftsCount from './drafts_count.vue';
import PublishButton from './publish_button.vue'; import PublishButton from './publish_button.vue';
...@@ -8,8 +8,8 @@ import PreviewItem from './preview_item.vue'; ...@@ -8,8 +8,8 @@ import PreviewItem from './preview_item.vue';
export default { export default {
components: { components: {
GlLoadingIcon,
GlButton, GlButton,
GlLoadingIcon,
GlIcon, GlIcon,
DraftsCount, DraftsCount,
PublishButton, PublishButton,
...@@ -81,16 +81,17 @@ export default { ...@@ -81,16 +81,17 @@ export default {
show: showPreviewDropdown, show: showPreviewDropdown,
}" }"
> >
<div class="dropdown-title"> <div class="dropdown-title gl-display-flex gl-align-items-center">
{{ dropdownTitle }} <span class="gl-ml-auto">{{ dropdownTitle }}</span>
<button <gl-button
:aria-label="__('Close')" :aria-label="__('Close')"
type="button" type="button"
class="dropdown-title-button dropdown-menu-close" category="tertiary"
size="small"
class="dropdown-title-button gl-ml-auto gl-p-0!"
icon="close"
@click="toggleReviewDropdown" @click="toggleReviewDropdown"
> />
<gl-icon name="close" />
</button>
</div> </div>
<div class="dropdown-content"> <div class="dropdown-content">
<ul v-if="isNotesFetched"> <ul v-if="isNotesFetched">
......
...@@ -65,17 +65,20 @@ module DropdownsHelper ...@@ -65,17 +65,20 @@ module DropdownsHelper
has_back = options.fetch(:back, false) has_back = options.fetch(:back, false)
has_close = options.fetch(:close, true) has_close = options.fetch(:close, true)
container_class = 'dropdown-title gl-display-flex' container_class = %w[dropdown-title gl-display-flex]
margin_class = '' margin_class = []
if has_back && has_close if has_back && has_close
container_class += ' gl-justify-content-space-between' container_class << 'gl-justify-content-space-between'
elsif has_back elsif has_back
margin_class = ' gl-mr-auto' margin_class << 'gl-mr-auto'
elsif has_close elsif has_close
margin_class = ' gl-ml-auto' margin_class << ' gl-ml-auto'
end end
container_class = container_class.join(' ')
margin_class = margin_class.join(' ')
content_tag :div, class: container_class do content_tag :div, class: container_class do
title_output = [] title_output = []
......
...@@ -93,12 +93,12 @@ export default { ...@@ -93,12 +93,12 @@ export default {
@keydown.esc.native="hideDropdown" @keydown.esc.native="hideDropdown"
@hide="hideDropdown" @hide="hideDropdown"
> >
<div class="dropdown-title"> <div class="dropdown-title gl-display-flex">
<span class="health-title">{{ s__('Sidebar|Assign health status') }}</span> <span class="health-title gl-ml-auto">{{ s__('Sidebar|Assign health status') }}</span>
<gl-button <gl-button
:aria-label="__('Close')" :aria-label="__('Close')"
variant="link" variant="link"
class="dropdown-title-button dropdown-menu-close" class="dropdown-title-button dropdown-menu-close gl-ml-auto gl-text-gray-200!"
icon="close" icon="close"
@click="hideDropdown" @click="hideDropdown"
/> />
......
...@@ -173,12 +173,12 @@ export default { ...@@ -173,12 +173,12 @@ export default {
@keydown.esc.native="hideDropdown" @keydown.esc.native="hideDropdown"
@hide="hideDropdown" @hide="hideDropdown"
> >
<div class="dropdown-title"> <div class="dropdown-title gl-display-flex">
<span class="health-title">{{ s__('Sidebar|Assign health status') }}</span> <span class="health-title gl-ml-auto">{{ s__('Sidebar|Assign health status') }}</span>
<gl-button <gl-button
:aria-label="__('Close')" :aria-label="__('Close')"
variant="link" variant="link"
class="dropdown-title-button dropdown-menu-close" class="dropdown-title-button dropdown-menu-close gl-ml-auto gl-text-gray-200!"
icon="close" icon="close"
@click="hideDropdown" @click="hideDropdown"
/> />
......
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