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
bbfca76f
Commit
bbfca76f
authored
Nov 06, 2020
by
Marvin Karegyeya
Committed by
Scott Hampton
Nov 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace GlDeprecatedDropdown with GlDropdown in app/assets/javascripts/vue_ merge_request_widget
parent
f47f42c5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
26 deletions
+27
-26
app/assets/javascripts/vue_merge_request_widget/components/states/commit_message_dropdown.vue
...uest_widget/components/states/commit_message_dropdown.vue
+7
-7
changelogs/unreleased/Replace-GlDeprecatedDropdown-with-GlDropdown-in-app-assets-javascripts-vu.yml
...Dropdown-with-GlDropdown-in-app-assets-javascripts-vu.yml
+5
-0
ee/app/assets/javascripts/vue_merge_request_widget/components/visual_review_app_link.vue
...erge_request_widget/components/visual_review_app_link.vue
+10
-14
ee/spec/frontend/vue_mr_widget/components/visual_review_app_spec.js
...ontend/vue_mr_widget/components/visual_review_app_spec.js
+3
-3
spec/frontend/vue_mr_widget/components/states/mr_widget_commit_message_dropdown_spec.js
...mponents/states/mr_widget_commit_message_dropdown_spec.js
+2
-2
No files found.
app/assets/javascripts/vue_merge_request_widget/components/states/commit_message_dropdown.vue
View file @
bbfca76f
<
script
>
<
script
>
import
{
GlD
eprecatedDropdown
,
GlDeprecated
DropdownItem
}
from
'
@gitlab/ui
'
;
import
{
GlD
ropdown
,
Gl
DropdownItem
}
from
'
@gitlab/ui
'
;
export
default
{
export
default
{
components
:
{
components
:
{
GlD
eprecatedD
ropdown
,
GlDropdown
,
GlD
eprecatedD
ropdownItem
,
GlDropdownItem
,
},
},
props
:
{
props
:
{
commits
:
{
commits
:
{
...
@@ -18,20 +18,20 @@ export default {
...
@@ -18,20 +18,20 @@ export default {
<
template
>
<
template
>
<div>
<div>
<gl-d
eprecated-d
ropdown
<gl-dropdown
right
right
text=
"Use an existing commit message"
text=
"Use an existing commit message"
variant=
"link"
variant=
"link"
class=
"mr-commit-dropdown"
class=
"mr-commit-dropdown"
>
>
<gl-d
eprecated-d
ropdown-item
<gl-dropdown-item
v-for=
"commit in commits"
v-for=
"commit in commits"
:key=
"commit.short_id"
:key=
"commit.short_id"
class=
"text-nowrap text-truncate"
class=
"text-nowrap text-truncate"
@
click=
"$emit('input', commit.message)"
@
click=
"$emit('input', commit.message)"
>
>
<span
class=
"monospace mr-2"
>
{{
commit
.
short_id
}}
</span>
{{
commit
.
title
}}
<span
class=
"monospace mr-2"
>
{{
commit
.
short_id
}}
</span>
{{
commit
.
title
}}
</gl-d
eprecated-d
ropdown-item>
</gl-dropdown-item>
</gl-d
eprecated-d
ropdown>
</gl-dropdown>
</div>
</div>
</
template
>
</
template
>
changelogs/unreleased/Replace-GlDeprecatedDropdown-with-GlDropdown-in-app-assets-javascripts-vu.yml
0 → 100644
View file @
bbfca76f
---
title
:
Replace-GlDeprecatedDropdown-with-GlDropdown-in-app/assets/javascripts/vue_merge_request_widget
merge_request
:
41429
author
:
nuwe1
type
:
other
ee/app/assets/javascripts/vue_merge_request_widget/components/visual_review_app_link.vue
View file @
bbfca76f
...
@@ -2,12 +2,11 @@
...
@@ -2,12 +2,11 @@
/* eslint-disable vue/no-v-html */
/* eslint-disable vue/no-v-html */
import
{
import
{
GlButton
,
GlButton
,
GlD
eprecatedD
ropdown
,
GlDropdown
,
GlD
eprecatedD
ropdownItem
,
GlDropdownItem
,
GlModal
,
GlModal
,
GlSearchBoxByType
,
GlSearchBoxByType
,
GlModalDirective
,
GlModalDirective
,
GlIcon
,
}
from
'
@gitlab/ui
'
;
}
from
'
@gitlab/ui
'
;
import
ModalCopyButton
from
'
~/vue_shared/components/modal_copy_button.vue
'
;
import
ModalCopyButton
from
'
~/vue_shared/components/modal_copy_button.vue
'
;
import
ReviewAppLink
from
'
~/vue_merge_request_widget/components/review_app_link.vue
'
;
import
ReviewAppLink
from
'
~/vue_merge_request_widget/components/review_app_link.vue
'
;
...
@@ -16,11 +15,10 @@ import { s__, sprintf } from '~/locale';
...
@@ -16,11 +15,10 @@ import { s__, sprintf } from '~/locale';
export
default
{
export
default
{
components
:
{
components
:
{
GlButton
,
GlButton
,
GlD
eprecatedD
ropdown
,
GlDropdown
,
GlD
eprecatedD
ropdownItem
,
GlDropdownItem
,
GlModal
,
GlModal
,
GlSearchBoxByType
,
GlSearchBoxByType
,
GlIcon
,
ReviewAppLink
,
ReviewAppLink
,
ModalCopyButton
,
ModalCopyButton
,
},
},
...
@@ -204,8 +202,10 @@ export default {
...
@@ -204,8 +202,10 @@ export default {
<gl-button
category=
"secondary"
@
click=
"cancel"
>
<gl-button
category=
"secondary"
@
click=
"cancel"
>
{{
s__
(
'
VisualReviewApp|Cancel
'
)
}}
{{
s__
(
'
VisualReviewApp|Cancel
'
)
}}
</gl-button>
</gl-button>
<gl-d
eprecated-d
ropdown
<gl-dropdown
v-if=
"shouldShowChanges"
v-if=
"shouldShowChanges"
:text=
"s__('VisualReviewApp|Open review app')"
icon=
"external-link"
dropup
dropup
right
right
split
split
...
@@ -215,23 +215,19 @@ export default {
...
@@ -215,23 +215,19 @@ export default {
@
click=
"ok"
@
click=
"ok"
>
>
<gl-search-box-by-type
v-model.trim=
"changesSearchTerm"
/>
<gl-search-box-by-type
v-model.trim=
"changesSearchTerm"
/>
<template
#button-content
>
<gl-dropdown-item
{{
s__
(
'
VisualReviewApp|Open review app
'
)
}}
<gl-icon
class=
"fgray"
name=
"external-link"
/>
</
template
>
<gl-deprecated-dropdown-item
v-for=
"change in filteredChanges"
v-for=
"change in filteredChanges"
:key=
"change.path"
:key=
"change.path"
:href=
"change.external_url"
:href=
"change.external_url"
data-track-event=
"open_review_app"
data-track-event=
"open_review_app"
data-track-label=
"review_app"
data-track-label=
"review_app"
>
{{ change.path }}
</gl-d
eprecated-d
ropdown-item
>
{{
change
.
path
}}
</gl-dropdown-item
>
>
<div
v-show=
"isSearchEmpty"
class=
"text-secondary p-2"
>
<div
v-show=
"isSearchEmpty"
class=
"text-secondary p-2"
>
{{
s__
(
'
VisualReviewApp|No review app found or available.
'
)
}}
{{
s__
(
'
VisualReviewApp|No review app found or available.
'
)
}}
</div>
</div>
</gl-d
eprecated-d
ropdown>
</gl-dropdown>
<review-app-link
<review-app-link
v-else
v-else
:display=
"viewAppDisplay"
:display=
"viewAppDisplay"
...
...
ee/spec/frontend/vue_mr_widget/components/visual_review_app_spec.js
View file @
bbfca76f
import
{
mount
}
from
'
@vue/test-utils
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
VisualReviewAppLink
from
'
ee/vue_merge_request_widget/components/visual_review_app_link.vue
'
;
import
VisualReviewAppLink
from
'
ee/vue_merge_request_widget/components/visual_review_app_link.vue
'
;
import
{
GlButton
,
GlD
eprecatedD
ropdown
,
GlModal
}
from
'
@gitlab/ui
'
;
import
{
GlButton
,
GlDropdown
,
GlModal
}
from
'
@gitlab/ui
'
;
import
{
mockTracking
,
triggerEvent
}
from
'
helpers/tracking_helper
'
;
import
{
mockTracking
,
triggerEvent
}
from
'
helpers/tracking_helper
'
;
import
ModalCopyButton
from
'
~/vue_shared/components/modal_copy_button.vue
'
;
import
ModalCopyButton
from
'
~/vue_shared/components/modal_copy_button.vue
'
;
...
@@ -132,7 +132,7 @@ describe('Visual Review App Link', () => {
...
@@ -132,7 +132,7 @@ describe('Visual Review App Link', () => {
it
(
'
with review app split dropdown
'
,
()
=>
{
it
(
'
with review app split dropdown
'
,
()
=>
{
expect
(
expect
(
wrapper
wrapper
.
find
(
GlD
eprecatedD
ropdown
)
.
find
(
GlDropdown
)
.
find
(
`a[href='
${
propsData
.
link
}
']`
)
.
find
(
`a[href='
${
propsData
.
link
}
']`
)
.
exists
(),
.
exists
(),
).
toEqual
(
true
);
).
toEqual
(
true
);
...
@@ -141,7 +141,7 @@ describe('Visual Review App Link', () => {
...
@@ -141,7 +141,7 @@ describe('Visual Review App Link', () => {
it
(
'
contains a list of changed pages
'
,
()
=>
{
it
(
'
contains a list of changed pages
'
,
()
=>
{
expect
(
expect
(
wrapper
wrapper
.
find
(
GlD
eprecatedD
ropdown
)
.
find
(
GlDropdown
)
.
find
(
`a[href='
${
propsData
.
link
}
/example-path']`
)
.
find
(
`a[href='
${
propsData
.
link
}
/example-path']`
)
.
exists
(),
.
exists
(),
).
toEqual
(
true
);
).
toEqual
(
true
);
...
...
spec/frontend/vue_mr_widget/components/states/mr_widget_commit_message_dropdown_spec.js
View file @
bbfca76f
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlD
eprecatedD
ropdownItem
}
from
'
@gitlab/ui
'
;
import
{
GlDropdownItem
}
from
'
@gitlab/ui
'
;
import
CommitMessageDropdown
from
'
~/vue_merge_request_widget/components/states/commit_message_dropdown.vue
'
;
import
CommitMessageDropdown
from
'
~/vue_merge_request_widget/components/states/commit_message_dropdown.vue
'
;
const
commits
=
[
const
commits
=
[
...
@@ -39,7 +39,7 @@ describe('Commits message dropdown component', () => {
...
@@ -39,7 +39,7 @@ describe('Commits message dropdown component', () => {
wrapper
.
destroy
();
wrapper
.
destroy
();
});
});
const
findDropdownElements
=
()
=>
wrapper
.
findAll
(
GlD
eprecatedD
ropdownItem
);
const
findDropdownElements
=
()
=>
wrapper
.
findAll
(
GlDropdownItem
);
const
findFirstDropdownElement
=
()
=>
findDropdownElements
().
at
(
0
);
const
findFirstDropdownElement
=
()
=>
findDropdownElements
().
at
(
0
);
it
(
'
should have 3 elements in dropdown list
'
,
()
=>
{
it
(
'
should have 3 elements in dropdown list
'
,
()
=>
{
...
...
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