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
Show 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
>
<
script
>
import
{
Gl
DeprecatedButton
,
GlLoadingIcon
,
GlIc
on
}
from
'
@gitlab/ui
'
;
import
{
Gl
Button
,
GlDeprecatedButt
on
}
from
'
@gitlab/ui
'
;
import
{
__
}
from
'
~/locale
'
;
import
{
__
}
from
'
~/locale
'
;
import
UserAvatarList
from
'
~/vue_shared/components/user_avatar/user_avatar_list.vue
'
;
import
UserAvatarList
from
'
~/vue_shared/components/user_avatar/user_avatar_list.vue
'
;
import
ApprovalsList
from
'
./approvals_list.vue
'
;
import
ApprovalsList
from
'
./approvals_list.vue
'
;
export
default
{
export
default
{
components
:
{
components
:
{
Gl
Ic
on
,
Gl
Butt
on
,
GlDeprecatedButton
,
GlDeprecatedButton
,
GlLoadingIcon
,
UserAvatarList
,
UserAvatarList
,
ApprovalsList
,
ApprovalsList
,
},
},
...
@@ -55,6 +54,9 @@ export default {
...
@@ -55,6 +54,9 @@ export default {
suggestedApproversTrimmed
()
{
suggestedApproversTrimmed
()
{
return
this
.
suggestedApprovers
.
slice
(
0
,
Math
.
min
(
5
,
this
.
suggestedApprovers
.
length
));
return
this
.
suggestedApprovers
.
slice
(
0
,
Math
.
min
(
5
,
this
.
suggestedApprovers
.
length
));
},
},
shouldShowLoadingSpinner
()
{
return
!
this
.
isCollapsed
&&
this
.
isLoadingRules
;
},
},
},
methods
:
{
methods
:
{
toggle
()
{
toggle
()
{
...
@@ -67,15 +69,16 @@ export default {
...
@@ -67,15 +69,16 @@ export default {
<
template
>
<
template
>
<div>
<div>
<div
class=
"mr-widget-extension d-flex align-items-center pl-3"
>
<div
class=
"mr-widget-extension d-flex align-items-center pl-3"
>
<button
<!-- TODO: simplify button classes once https://gitlab.com/gitlab-org/gitlab-ui/-/issues/1029 is completed -->
class=
"btn btn-blank square s32 gl-mr-3"
<gl-button
type=
"button"
class=
"gl-mr-3"
:class=
"
{ 'gl-shadow-none!': shouldShowLoadingSpinner }"
:aria-label="ariaLabel"
:aria-label="ariaLabel"
:loading="shouldShowLoadingSpinner"
:icon="angleIcon"
category="tertiary"
@click="toggle"
@click="toggle"
>
/>
<gl-loading-icon
v-if=
"!isCollapsed && isLoadingRules"
/>
<gl-icon
v-else
:name=
"angleIcon"
:size=
"16"
/>
</button>
<template
v-if=
"isCollapsed"
>
<template
v-if=
"isCollapsed"
>
<user-avatar-list
:items=
"suggestedApproversTrimmed"
:breakpoint=
"0"
empty-text=
""
/>
<user-avatar-list
:items=
"suggestedApproversTrimmed"
:breakpoint=
"0"
empty-text=
""
/>
<gl-deprecated-button
variant=
"link"
@
click=
"toggle"
>
{{
<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
{
mount
}
from
'
@vue/test-utils
'
;
import
{
GlDeprecatedButton
,
GlLoadingIcon
,
GlIcon
}
from
'
@gitlab/ui
'
;
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
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
ApprovalsFooter
from
'
ee/vue_merge_request_widget/components/approvals/approvals_footer.vue
'
;
import
UserAvatarList
from
'
~/vue_shared/components/user_avatar/user_avatar_list.vue
'
;
import
UserAvatarList
from
'
~/vue_shared/components/user_avatar/user_avatar_list.vue
'
;
...
@@ -11,16 +12,20 @@ describe('EE MRWidget approvals footer', () => {
...
@@ -11,16 +12,20 @@ describe('EE MRWidget approvals footer', () => {
let
wrapper
;
let
wrapper
;
const
createComponent
=
(
props
=
{})
=>
{
const
createComponent
=
(
props
=
{})
=>
{
wrapper
=
shallowM
ount
(
ApprovalsFooter
,
{
wrapper
=
m
ount
(
ApprovalsFooter
,
{
propsData
:
{
propsData
:
{
suggestedApprovers
:
testSuggestedApprovers
(),
suggestedApprovers
:
testSuggestedApprovers
(),
approvalRules
:
testApprovalRules
(),
approvalRules
:
testApprovalRules
(),
...
props
,
...
props
,
},
},
stubs
:
{
...
stubChildren
(
ApprovalsFooter
),
GlButton
:
false
,
},
});
});
};
};
const
findToggle
=
()
=>
wrapper
.
find
(
'
button
'
);
const
findToggle
=
()
=>
wrapper
.
find
(
GlButton
);
const
findToggleIcon
=
()
=>
findToggle
().
find
(
GlIcon
);
const
findToggleIcon
=
()
=>
findToggle
().
find
(
GlIcon
);
const
findToggleLoadingIcon
=
()
=>
findToggle
().
find
(
GlLoadingIcon
);
const
findToggleLoadingIcon
=
()
=>
findToggle
().
find
(
GlLoadingIcon
);
const
findExpandButton
=
()
=>
wrapper
.
find
(
GlDeprecatedButton
);
const
findExpandButton
=
()
=>
wrapper
.
find
(
GlDeprecatedButton
);
...
@@ -138,7 +143,7 @@ describe('EE MRWidget approvals footer', () => {
...
@@ -138,7 +143,7 @@ describe('EE MRWidget approvals footer', () => {
it
(
'
expands when clicked
'
,
()
=>
{
it
(
'
expands when clicked
'
,
()
=>
{
const
button
=
findToggle
();
const
button
=
findToggle
();
button
.
trigger
(
'
click
'
);
button
.
vm
.
$emit
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
wrapper
.
emitted
().
input
).
toEqual
([[
true
]]);
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