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
de922747
Commit
de922747
authored
Oct 16, 2020
by
Marvin Karegyeya
Committed by
Phil Hughes
Oct 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Gldeprecateddropdown to Gldropdown in confidential_ merge_ request/components/dropdown.vue
parent
c3ac137b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
41 deletions
+26
-41
app/assets/javascripts/confidential_merge_request/components/dropdown.vue
...cripts/confidential_merge_request/components/dropdown.vue
+10
-21
changelogs/unreleased/Replace-GlDeprecatedDropdown-with-GlDropdown-in-app-assets-javascripts-co.yml
...Dropdown-with-GlDropdown-in-app-assets-javascripts-co.yml
+5
-0
spec/frontend/confidential_merge_request/components/dropdown_spec.js
...nd/confidential_merge_request/components/dropdown_spec.js
+11
-20
No files found.
app/assets/javascripts/confidential_merge_request/components/dropdown.vue
View file @
de922747
<
script
>
import
{
GlD
eprecatedDropdown
,
GlDeprecatedDropdownItem
,
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
GlD
ropdown
,
GlDropdownItem
}
from
'
@gitlab/ui
'
;
import
{
__
}
from
'
~/locale
'
;
export
default
{
components
:
{
GlDeprecatedDropdown
,
GlDeprecatedDropdownItem
,
GlIcon
,
GlDropdown
,
GlDropdownItem
,
},
props
:
{
projects
:
{
...
...
@@ -37,25 +36,15 @@ export default {
</
script
>
<
template
>
<gl-deprecated-dropdown
toggle-class=
"d-flex align-items-center w-100"
class=
"w-100"
>
<template
#button-content
>
<span
class=
"str-truncated-100 mr-2"
>
<gl-icon
name=
"lock"
/>
{{
dropdownText
}}
</span>
<gl-icon
name=
"chevron-down"
class=
"ml-auto"
/>
</
template
>
<gl-deprecated-dropdown-item
<gl-dropdown
block
icon=
"lock"
:text=
"dropdownText"
>
<gl-dropdown-item
v-for=
"project in projects"
:key=
"project.id"
:is-check-item=
"true"
:is-checked=
"project.id === selectedProject.id"
@
click=
"selectProject(project)"
>
<gl-icon
name=
"mobile-issue-close"
:class=
"{ icon: project.id !== selectedProject.id }"
class=
"js-active-project-check"
/>
<span
class=
"ml-1"
>
{{ project.name }}
</span>
</gl-deprecated-dropdown-item>
</gl-deprecated-dropdown>
{{
project
.
name
}}
</gl-dropdown-item>
</gl-dropdown>
</
template
>
changelogs/unreleased/Replace-GlDeprecatedDropdown-with-GlDropdown-in-app-assets-javascripts-co.yml
0 → 100644
View file @
de922747
---
title
:
Replace-GlDeprecatedDropdown-with-GlDropdown-in-app/assets/javascripts/confidential_merge_request/components/dropdown.vue
merge_request
:
41416
author
:
nuwe1
type
:
other
spec/frontend/confidential_merge_request/components/dropdown_spec.js
View file @
de922747
import
{
mount
}
from
'
@vue/test-utils
'
;
import
{
GlD
eprecated
DropdownItem
}
from
'
@gitlab/ui
'
;
import
{
GlD
ropdown
,
Gl
DropdownItem
}
from
'
@gitlab/ui
'
;
import
Dropdown
from
'
~/confidential_merge_request/components/dropdown.vue
'
;
let
vm
;
...
...
@@ -30,27 +30,18 @@ describe('Confidential merge request project dropdown component', () => {
},
]);
expect
(
vm
.
findAll
(
GlD
eprecatedD
ropdownItem
).
length
).
toBe
(
2
);
expect
(
vm
.
findAll
(
GlDropdownItem
).
length
).
toBe
(
2
);
});
it
(
'
renders selected project icon
'
,
()
=>
{
factory
([
{
id
:
1
,
name
:
'
test
'
,
},
{
id
:
2
,
name
:
'
test 2
'
,
},
]);
it
(
'
shows lock icon
'
,
()
=>
{
factory
();
expect
(
vm
.
find
(
GlDropdown
).
props
(
'
icon
'
)).
toBe
(
'
lock
'
);
});
it
(
'
has dropdown text
'
,
()
=>
{
factory
();
expect
(
vm
.
find
(
'
.js-active-project-check
'
).
classes
()).
not
.
toContain
(
'
icon
'
);
expect
(
vm
.
findAll
(
'
.js-active-project-check
'
)
.
at
(
1
)
.
classes
(),
).
toContain
(
'
icon
'
);
expect
(
vm
.
find
(
GlDropdown
).
props
(
'
text
'
)).
toBe
(
'
Select private project
'
);
});
});
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