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
7fcd16b0
Commit
7fcd16b0
authored
Aug 06, 2020
by
Annabel Dunstone Gray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace deprecated-button with button in commits_header.vue
parent
16d095e2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
15 deletions
+11
-15
app/assets/javascripts/vue_merge_request_widget/components/states/commits_header.vue
...merge_request_widget/components/states/commits_header.vue
+9
-11
spec/frontend/vue_mr_widget/components/states/mr_widget_commits_header_spec.js
...widget/components/states/mr_widget_commits_header_spec.js
+2
-4
No files found.
app/assets/javascripts/vue_merge_request_widget/components/states/commits_header.vue
View file @
7fcd16b0
<
script
>
/* eslint-disable vue/no-v-html */
import
{
Gl
DeprecatedButton
,
GlIc
on
}
from
'
@gitlab/ui
'
;
import
{
Gl
Butt
on
}
from
'
@gitlab/ui
'
;
import
{
escape
}
from
'
lodash
'
;
import
{
__
,
n__
,
sprintf
,
s__
}
from
'
~/locale
'
;
export
default
{
components
:
{
GlIcon
,
GlDeprecatedButton
,
GlButton
,
},
props
:
{
isSquashEnabled
:
{
...
...
@@ -80,20 +79,19 @@ export default {
class=
"js-mr-widget-commits-count mr-widget-extension clickable d-flex align-items-center px-3 py-2"
@
click=
"toggle()"
>
<gl-
deprecated-
button
<gl-button
:aria-label=
"ariaLabel"
variant=
"blank"
class=
"commit-edit-toggle square s24 gl-mr-3"
category=
"tertiary"
class=
"commit-edit-toggle gl-mr-3"
:icon=
"collapseIcon"
@
click.stop=
"toggle()"
>
<gl-icon
:name=
"collapseIcon"
:size=
"16"
/>
</gl-deprecated-button>
/>
<span
v-if=
"expanded"
>
{{
__
(
'
Collapse
'
)
}}
</span>
<span
v-else
>
<span
class=
"vertical-align-middle"
v-html=
"message"
></span>
<gl-
deprecated-
button
variant=
"link"
class=
"modify-message-button"
>
<gl-button
variant=
"link"
class=
"modify-message-button"
>
{{
modifyLinkMessage
}}
</gl-
deprecated-
button>
</gl-button>
</span>
</div>
<div
v-show=
"expanded"
><slot></slot></div>
...
...
spec/frontend/vue_mr_widget/components/states/mr_widget_commits_header_spec.js
View file @
7fcd16b0
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlIcon
}
from
'
@gitlab/ui
'
;
import
CommitsHeader
from
'
~/vue_merge_request_widget/components/states/commits_header.vue
'
;
describe
(
'
Commits header component
'
,
()
=>
{
...
...
@@ -23,7 +22,6 @@ describe('Commits header component', () => {
const
findHeaderWrapper
=
()
=>
wrapper
.
find
(
'
.js-mr-widget-commits-count
'
);
const
findCommitToggle
=
()
=>
wrapper
.
find
(
'
.commit-edit-toggle
'
);
const
findIcon
=
()
=>
wrapper
.
find
(
GlIcon
);
const
findCommitsCountMessage
=
()
=>
wrapper
.
find
(
'
.commits-count-message
'
);
const
findTargetBranchMessage
=
()
=>
wrapper
.
find
(
'
.label-branch
'
);
const
findModifyButton
=
()
=>
wrapper
.
find
(
'
.modify-message-button
'
);
...
...
@@ -61,7 +59,7 @@ describe('Commits header component', () => {
wrapper
.
setData
({
expanded
:
false
});
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
find
Icon
().
props
(
'
name
'
)).
toBe
(
'
chevron-right
'
);
expect
(
find
CommitToggle
().
props
(
'
icon
'
)).
toBe
(
'
chevron-right
'
);
});
});
...
...
@@ -119,7 +117,7 @@ describe('Commits header component', () => {
it
(
'
has a chevron-down icon
'
,
done
=>
{
wrapper
.
vm
.
$nextTick
(()
=>
{
expect
(
find
Icon
().
props
(
'
name
'
)).
toBe
(
'
chevron-down
'
);
expect
(
find
CommitToggle
().
props
(
'
icon
'
)).
toBe
(
'
chevron-down
'
);
done
();
});
});
...
...
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