Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
69e97f4e
Commit
69e97f4e
authored
Oct 06, 2020
by
Savas Vedova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update split button styling
parent
b6afb1c5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
26 deletions
+17
-26
ee/app/assets/javascripts/vue_shared/security_reports/components/split_button.vue
...s/vue_shared/security_reports/components/split_button.vue
+13
-21
ee/spec/frontend/vue_shared/security_reports/components/split_button_spec.js
...e_shared/security_reports/components/split_button_spec.js
+4
-5
No files found.
ee/app/assets/javascripts/vue_shared/security_reports/components/split_button.vue
View file @
69e97f4e
<
script
>
import
{
GlD
eprecatedDropdown
,
GlDeprecatedDropdownItem
,
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
GlD
ropdown
,
GlDropdownItem
}
from
'
@gitlab/ui
'
;
export
default
{
components
:
{
GlDeprecatedDropdown
,
GlDeprecatedDropdownItem
,
GlIcon
,
GlDropdown
,
GlDropdownItem
,
},
props
:
{
buttons
:
{
...
...
@@ -36,31 +35,24 @@ export default {
</
script
>
<
template
>
<gl-d
eprecated-d
ropdown
<gl-dropdown
v-if=
"selectedButton"
:disabled=
"disabled"
no-caret
right
split
variant=
"success"
:text=
"selectedButton.name"
split
@
click=
"handleClick"
>
<gl-d
eprecated-d
ropdown-item
<gl-dropdown-item
v-for=
"button in buttons"
:key=
"button.action"
:is-checked=
"selectedButton === button"
is-check-item
@
click=
"setButton(button)"
>
<div
class=
"media"
>
<div>
<gl-icon
v-if=
"selectedButton === button"
class=
"gl-mr-2"
name=
"mobile-issue-close"
/>
</div>
<div
class=
"media-body"
:class=
"
{ 'prepend-left-20': selectedButton !== button }">
<strong>
{{
button
.
name
}}
</strong>
<br
/>
<span>
{{
button
.
tagline
}}
</span>
</div>
</div>
</gl-deprecated-dropdown-item>
</gl-deprecated-dropdown>
<strong>
{{
button
.
name
}}
</strong>
<br
/>
<span>
{{
button
.
tagline
}}
</span>
</gl-dropdown-item>
</gl-dropdown>
</
template
>
ee/spec/frontend/vue_shared/security_reports/components/split_button_spec.js
View file @
69e97f4e
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlD
eprecatedDropdown
,
GlDeprecatedDropdownItem
,
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
GlD
ropdown
,
GlDropdownItem
}
from
'
@gitlab/ui
'
;
import
SplitButton
from
'
ee/vue_shared/security_reports/components/split_button.vue
'
;
const
buttons
=
[
...
...
@@ -20,8 +20,8 @@ const buttons = [
describe
(
'
Split Button
'
,
()
=>
{
let
wrapper
;
const
findDropdown
=
()
=>
wrapper
.
find
(
GlD
eprecatedD
ropdown
);
const
findDropdownItems
=
()
=>
wrapper
.
findAll
(
GlD
eprecatedD
ropdownItem
);
const
findDropdown
=
()
=>
wrapper
.
find
(
GlDropdown
);
const
findDropdownItems
=
()
=>
wrapper
.
findAll
(
GlDropdownItem
);
const
createComponent
=
props
=>
{
wrapper
=
shallowMount
(
SplitButton
,
{
...
...
@@ -80,8 +80,7 @@ describe('Split Button', () => {
expect
(
findDropdownItems
()
.
at
(
0
)
.
find
(
GlIcon
)
.
exists
(),
.
props
(
'
isChecked
'
),
).
toBe
(
true
);
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment