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
776d0068
Commit
776d0068
authored
Dec 16, 2020
by
Paul Gascou-Vaillancourt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate to GlButton in environments dropdown
parent
e423e643
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
11 deletions
+12
-11
app/assets/javascripts/feature_flags/components/environments_dropdown.vue
...cripts/feature_flags/components/environments_dropdown.vue
+8
-7
spec/frontend/feature_flags/components/environments_dropdown_spec.js
...nd/feature_flags/components/environments_dropdown_spec.js
+4
-4
No files found.
app/assets/javascripts/feature_flags/components/environments_dropdown.vue
View file @
776d0068
<
script
>
import
{
debounce
}
from
'
lodash
'
;
import
{
Gl
Deprecated
Button
,
GlSearchBoxByType
}
from
'
@gitlab/ui
'
;
import
{
GlButton
,
GlSearchBoxByType
}
from
'
@gitlab/ui
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
{
__
}
from
'
~/locale
'
;
import
{
deprecatedCreateFlash
as
createFlash
}
from
'
~/flash
'
;
...
...
@@ -28,7 +28,7 @@ import { deprecatedCreateFlash as createFlash } from '~/flash';
export
default
{
name
:
'
EnvironmentsSearchableInput
'
,
components
:
{
Gl
Deprecated
Button
,
GlButton
,
GlSearchBoxByType
,
},
props
:
{
...
...
@@ -159,19 +159,20 @@ export default {
<div
class=
"dropdown-content"
>
<ul
v-if=
"results.length"
>
<li
v-for=
"(result, i) in results"
:key=
"i"
>
<gl-
deprecated-button
class=
"btn-transparent
"
@
click=
"selectEnvironment(result)"
>
{{
<gl-
button
category=
"tertiary
"
@
click=
"selectEnvironment(result)"
>
{{
result
}}
</gl-
deprecated-
button>
}}
</gl-button>
</li>
</ul>
<div
v-else-if=
"!results.length"
class=
"text-secondary gl-p-3"
>
{{
__
(
'
No matching results
'
)
}}
</div>
<div
v-if=
"shouldRenderCreateButton"
class=
"dropdown-footer"
>
<gl-deprecated-button
class=
"js-create-button btn-blank dropdown-item"
<gl-button
category=
"tertiary"
class=
"js-create-button dropdown-item"
@
click=
"createClicked"
>
{{
composedCreateButtonLabel
}}
</gl-
deprecated-
button
>
{{
composedCreateButtonLabel
}}
</gl-button
>
</div>
</div>
...
...
spec/frontend/feature_flags/components/environments_dropdown_spec.js
View file @
776d0068
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlLoadingIcon
,
Gl
Deprecated
Button
,
GlSearchBoxByType
}
from
'
@gitlab/ui
'
;
import
{
GlLoadingIcon
,
GlButton
,
GlSearchBoxByType
}
from
'
@gitlab/ui
'
;
import
{
TEST_HOST
}
from
'
spec/test_constants
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
EnvironmentsDropdown
from
'
~/feature_flags/components/environments_dropdown.vue
'
;
...
...
@@ -99,7 +99,7 @@ describe('Feature flags > Environments dropdown ', () => {
it
(
'
emits event when a suggestion is clicked
'
,
async
()
=>
{
const
button
=
wrapper
.
findAll
(
Gl
Deprecated
Button
)
.
findAll
(
GlButton
)
.
filter
(
b
=>
b
.
text
()
===
'
production
'
)
.
at
(
0
);
button
.
vm
.
$emit
(
'
click
'
);
...
...
@@ -110,7 +110,7 @@ describe('Feature flags > Environments dropdown ', () => {
describe
(
'
on click clear button
'
,
()
=>
{
beforeEach
(
async
()
=>
{
wrapper
.
find
(
Gl
Deprecated
Button
).
vm
.
$emit
(
'
click
'
);
wrapper
.
find
(
GlButton
).
vm
.
$emit
(
'
click
'
);
await
wrapper
.
vm
.
$nextTick
();
});
...
...
@@ -137,7 +137,7 @@ describe('Feature flags > Environments dropdown ', () => {
it
(
'
emits create event
'
,
async
()
=>
{
wrapper
.
findAll
(
Gl
Deprecated
Button
)
.
findAll
(
GlButton
)
.
at
(
0
)
.
vm
.
$emit
(
'
click
'
);
await
wrapper
.
vm
.
$nextTick
();
...
...
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