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
e1cec276
Commit
e1cec276
authored
Oct 27, 2020
by
Kyle Mann
Committed by
Mark Florian
Oct 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use GlButton for approvals footer toggle
parent
cfc6a8bf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
15 deletions
+28
-15
ee/app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals_footer.vue
..._request_widget/components/approvals/approvals_footer.vue
+13
-10
ee/changelogs/unreleased/229316-migrate-bootstrap-button-to-gitlab-ui-glbutton-in-ee-app-assets.yml
...otstrap-button-to-gitlab-ui-glbutton-in-ee-app-assets.yml
+5
-0
ee/spec/frontend/vue_mr_widget/components/approvals/approvals_footer_spec.js
...e_mr_widget/components/approvals/approvals_footer_spec.js
+10
-5
No files found.
ee/app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals_footer.vue
View file @
e1cec276
<
script
>
import
{
Gl
DeprecatedButton
,
GlLoadingIcon
,
GlIc
on
}
from
'
@gitlab/ui
'
;
import
{
Gl
Button
,
GlDeprecatedButt
on
}
from
'
@gitlab/ui
'
;
import
{
__
}
from
'
~/locale
'
;
import
UserAvatarList
from
'
~/vue_shared/components/user_avatar/user_avatar_list.vue
'
;
import
ApprovalsList
from
'
./approvals_list.vue
'
;
export
default
{
components
:
{
Gl
Ic
on
,
Gl
Butt
on
,
GlDeprecatedButton
,
GlLoadingIcon
,
UserAvatarList
,
ApprovalsList
,
},
...
...
@@ -55,6 +54,9 @@ export default {
suggestedApproversTrimmed
()
{
return
this
.
suggestedApprovers
.
slice
(
0
,
Math
.
min
(
5
,
this
.
suggestedApprovers
.
length
));
},
shouldShowLoadingSpinner
()
{
return
!
this
.
isCollapsed
&&
this
.
isLoadingRules
;
},
},
methods
:
{
toggle
()
{
...
...
@@ -67,15 +69,16 @@ export default {
<
template
>
<div>
<div
class=
"mr-widget-extension d-flex align-items-center pl-3"
>
<button
class=
"btn btn-blank square s32 gl-mr-3"
type=
"button"
<!-- TODO: simplify button classes once https://gitlab.com/gitlab-org/gitlab-ui/-/issues/1029 is completed -->
<gl-button
class=
"gl-mr-3"
:class=
"
{ 'gl-shadow-none!': shouldShowLoadingSpinner }"
:aria-label="ariaLabel"
:loading="shouldShowLoadingSpinner"
:icon="angleIcon"
category="tertiary"
@click="toggle"
>
<gl-loading-icon
v-if=
"!isCollapsed && isLoadingRules"
/>
<gl-icon
v-else
:name=
"angleIcon"
:size=
"16"
/>
</button>
/>
<template
v-if=
"isCollapsed"
>
<user-avatar-list
:items=
"suggestedApproversTrimmed"
:breakpoint=
"0"
empty-text=
""
/>
<gl-deprecated-button
variant=
"link"
@
click=
"toggle"
>
{{
...
...
ee/changelogs/unreleased/229316-migrate-bootstrap-button-to-gitlab-ui-glbutton-in-ee-app-assets.yml
0 → 100644
View file @
e1cec276
---
title
:
Update approvals toggle button style
merge_request
:
42075
author
:
type
:
other
ee/spec/frontend/vue_mr_widget/components/approvals/approvals_footer_spec.js
View file @
e1cec276
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlDeprecatedButton
,
GlLoadingIcon
,
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
{
GlDeprecatedButton
,
GlButton
,
GlLoadingIcon
,
GlIcon
}
from
'
@gitlab/ui
'
;
import
stubChildren
from
'
helpers/stub_children
'
;
import
ApprovalsList
from
'
ee/vue_merge_request_widget/components/approvals/approvals_list.vue
'
;
import
ApprovalsFooter
from
'
ee/vue_merge_request_widget/components/approvals/approvals_footer.vue
'
;
import
UserAvatarList
from
'
~/vue_shared/components/user_avatar/user_avatar_list.vue
'
;
...
...
@@ -11,16 +12,20 @@ describe('EE MRWidget approvals footer', () => {
let
wrapper
;
const
createComponent
=
(
props
=
{})
=>
{
wrapper
=
shallowM
ount
(
ApprovalsFooter
,
{
wrapper
=
m
ount
(
ApprovalsFooter
,
{
propsData
:
{
suggestedApprovers
:
testSuggestedApprovers
(),
approvalRules
:
testApprovalRules
(),
...
props
,
},
stubs
:
{
...
stubChildren
(
ApprovalsFooter
),
GlButton
:
false
,
},
});
};
const
findToggle
=
()
=>
wrapper
.
find
(
'
button
'
);
const
findToggle
=
()
=>
wrapper
.
find
(
GlButton
);
const
findToggleIcon
=
()
=>
findToggle
().
find
(
GlIcon
);
const
findToggleLoadingIcon
=
()
=>
findToggle
().
find
(
GlLoadingIcon
);
const
findExpandButton
=
()
=>
wrapper
.
find
(
GlDeprecatedButton
);
...
...
@@ -138,7 +143,7 @@ describe('EE MRWidget approvals footer', () => {
it
(
'
expands when clicked
'
,
()
=>
{
const
button
=
findToggle
();
button
.
trigger
(
'
click
'
);
button
.
vm
.
$emit
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
wrapper
.
emitted
().
input
).
toEqual
([[
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