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
Show 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
>
import
{
GlD
eprecatedDropdown
,
GlDeprecated
DropdownItem
}
from
'
@gitlab/ui
'
;
import
{
GlD
ropdown
,
Gl
DropdownItem
}
from
'
@gitlab/ui
'
;
export
default
{
components
:
{
GlD
eprecatedD
ropdown
,
GlD
eprecatedD
ropdownItem
,
GlDropdown
,
GlDropdownItem
,
},
props
:
{
commits
:
{
...
...
@@ -18,20 +18,20 @@ export default {
<
template
>
<div>
<gl-d
eprecated-d
ropdown
<gl-dropdown
right
text=
"Use an existing commit message"
variant=
"link"
class=
"mr-commit-dropdown"
>
<gl-d
eprecated-d
ropdown-item
<gl-dropdown-item
v-for=
"commit in commits"
:key=
"commit.short_id"
class=
"text-nowrap text-truncate"
@
click=
"$emit('input', commit.message)"
>
<span
class=
"monospace mr-2"
>
{{
commit
.
short_id
}}
</span>
{{
commit
.
title
}}
</gl-d
eprecated-d
ropdown-item>
</gl-d
eprecated-d
ropdown>
</gl-dropdown-item>
</gl-dropdown>
</div>
</
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 @@
/* eslint-disable vue/no-v-html */
import
{
GlButton
,
GlD
eprecatedD
ropdown
,
GlD
eprecatedD
ropdownItem
,
GlDropdown
,
GlDropdownItem
,
GlModal
,
GlSearchBoxByType
,
GlModalDirective
,
GlIcon
,
}
from
'
@gitlab/ui
'
;
import
ModalCopyButton
from
'
~/vue_shared/components/modal_copy_button.vue
'
;
import
ReviewAppLink
from
'
~/vue_merge_request_widget/components/review_app_link.vue
'
;
...
...
@@ -16,11 +15,10 @@ import { s__, sprintf } from '~/locale';
export
default
{
components
:
{
GlButton
,
GlD
eprecatedD
ropdown
,
GlD
eprecatedD
ropdownItem
,
GlDropdown
,
GlDropdownItem
,
GlModal
,
GlSearchBoxByType
,
GlIcon
,
ReviewAppLink
,
ModalCopyButton
,
},
...
...
@@ -204,8 +202,10 @@ export default {
<gl-button
category=
"secondary"
@
click=
"cancel"
>
{{
s__
(
'
VisualReviewApp|Cancel
'
)
}}
</gl-button>
<gl-d
eprecated-d
ropdown
<gl-dropdown
v-if=
"shouldShowChanges"
:text=
"s__('VisualReviewApp|Open review app')"
icon=
"external-link"
dropup
right
split
...
...
@@ -215,23 +215,19 @@ export default {
@
click=
"ok"
>
<gl-search-box-by-type
v-model.trim=
"changesSearchTerm"
/>
<template
#button-content
>
{{
s__
(
'
VisualReviewApp|Open review app
'
)
}}
<gl-icon
class=
"fgray"
name=
"external-link"
/>
</
template
>
<gl-deprecated-dropdown-item
<gl-dropdown-item
v-for=
"change in filteredChanges"
:key=
"change.path"
:href=
"change.external_url"
data-track-event=
"open_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"
>
{{
s__
(
'
VisualReviewApp|No review app found or available.
'
)
}}
</div>
</gl-d
eprecated-d
ropdown>
</gl-dropdown>
<review-app-link
v-else
:display=
"viewAppDisplay"
...
...
ee/spec/frontend/vue_mr_widget/components/visual_review_app_spec.js
View file @
bbfca76f
import
{
mount
}
from
'
@vue/test-utils
'
;
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
ModalCopyButton
from
'
~/vue_shared/components/modal_copy_button.vue
'
;
...
...
@@ -132,7 +132,7 @@ describe('Visual Review App Link', () => {
it
(
'
with review app split dropdown
'
,
()
=>
{
expect
(
wrapper
.
find
(
GlD
eprecatedD
ropdown
)
.
find
(
GlDropdown
)
.
find
(
`a[href='
${
propsData
.
link
}
']`
)
.
exists
(),
).
toEqual
(
true
);
...
...
@@ -141,7 +141,7 @@ describe('Visual Review App Link', () => {
it
(
'
contains a list of changed pages
'
,
()
=>
{
expect
(
wrapper
.
find
(
GlD
eprecatedD
ropdown
)
.
find
(
GlDropdown
)
.
find
(
`a[href='
${
propsData
.
link
}
/example-path']`
)
.
exists
(),
).
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
{
GlD
eprecatedD
ropdownItem
}
from
'
@gitlab/ui
'
;
import
{
GlDropdownItem
}
from
'
@gitlab/ui
'
;
import
CommitMessageDropdown
from
'
~/vue_merge_request_widget/components/states/commit_message_dropdown.vue
'
;
const
commits
=
[
...
...
@@ -39,7 +39,7 @@ describe('Commits message dropdown component', () => {
wrapper
.
destroy
();
});
const
findDropdownElements
=
()
=>
wrapper
.
findAll
(
GlD
eprecatedD
ropdownItem
);
const
findDropdownElements
=
()
=>
wrapper
.
findAll
(
GlDropdownItem
);
const
findFirstDropdownElement
=
()
=>
findDropdownElements
().
at
(
0
);
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