Commit 27be7878 authored by Phil Hughes's avatar Phil Hughes

Merge branch '7066-fix-hover-state-of-license-management-dropdown' into 'master'

Resolve "Fix hover state of License Management dropdown"

Closes #7066

See merge request gitlab-org/gitlab-ee!9237
parents 4d7f3df2 121e9022
<script> <script>
import { mapActions } from 'vuex'; import { mapActions } from 'vuex';
import { GlDropdown, GlDropdownItem } from '@gitlab/ui';
import { s__ } from '~/locale'; import { s__ } from '~/locale';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
import IssueStatusIcon from '~/reports/components/issue_status_icon.vue'; import IssueStatusIcon from '~/reports/components/issue_status_icon.vue';
...@@ -13,6 +14,8 @@ const invisibleClass = 'invisible'; ...@@ -13,6 +14,8 @@ const invisibleClass = 'invisible';
export default { export default {
name: 'LicenseManagementRow', name: 'LicenseManagementRow',
components: { components: {
GlDropdown,
GlDropdownItem,
Icon, Icon,
IssueStatusIcon, IssueStatusIcon,
}, },
...@@ -56,27 +59,20 @@ export default { ...@@ -56,27 +59,20 @@ export default {
<span class="js-license-name">{{ license.name }}</span> <span class="js-license-name">{{ license.name }}</span>
<div class="float-right"> <div class="float-right">
<div class="d-flex"> <div class="d-flex">
<div class="dropdown"> <gl-dropdown
<button :text="dropdownText"
class="btn btn-secondary dropdown-toggle" toggle-class="d-flex justify-content-between align-items-center"
type="button" right
data-toggle="dropdown" >
aria-haspopup="true" <gl-dropdown-item @click="approveLicense(license)">
aria-expanded="false" <icon :class="approveIconClass" name="mobile-issue-close" />
> {{ $options[$options.LICENSE_APPROVAL_STATUS.APPROVED] }}
<icon class="float-right" name="chevron-down" /> {{ dropdownText }} </gl-dropdown-item>
</button> <gl-dropdown-item @click="blacklistLicense(license)">
<div class="dropdown-menu dropdown-menu-right"> <icon :class="blacklistIconClass" name="mobile-issue-close" />
<button class="dropdown-item" type="button" @click="approveLicense(license)"> {{ $options[$options.LICENSE_APPROVAL_STATUS.BLACKLISTED] }}
<icon :class="approveIconClass" name="mobile-issue-close" /> </gl-dropdown-item>
{{ $options[$options.LICENSE_APPROVAL_STATUS.APPROVED] }} </gl-dropdown>
</button>
<button class="dropdown-item" type="button" @click="blacklistLicense(license)">
<icon :class="blacklistIconClass" name="mobile-issue-close" />
{{ $options[$options.LICENSE_APPROVAL_STATUS.BLACKLISTED] }}
</button>
</div>
</div>
<button <button
class="btn btn-blank js-remove-button" class="btn btn-blank js-remove-button"
type="button" type="button"
......
---
title: Uses GLDropdown for licence management
merge_request: 9237
author:
type: other
...@@ -156,7 +156,7 @@ describe('LicenseManagementRow', () => { ...@@ -156,7 +156,7 @@ describe('LicenseManagementRow', () => {
}); });
it('renders computed property dropdownText into dropdown toggle', () => { it('renders computed property dropdownText into dropdown toggle', () => {
const dropdownEl = vm.$el.querySelector('.dropdown [data-toggle="dropdown"]'); const dropdownEl = vm.$el.querySelector('.dropdown-toggle');
expect(dropdownEl.innerText.trim()).toBe(vm.dropdownText); expect(dropdownEl.innerText.trim()).toBe(vm.dropdownText);
}); });
......
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