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
2a263569
Commit
2a263569
authored
Sep 03, 2020
by
jeldergl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removing unnecessary imports from the test file
parent
2ceed9ac
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
17 deletions
+21
-17
ee/app/assets/javascripts/vue_shared/security_reports/components/modal_footer.vue
...s/vue_shared/security_reports/components/modal_footer.vue
+10
-10
ee/changelogs/unreleased/229210-replace-loadingbutton-with-gitlab-ui-s-glbutton-in-ee-app-asset.yml
...adingbutton-with-gitlab-ui-s-glbutton-in-ee-app-asset.yml
+5
-0
ee/spec/frontend/vue_shared/security_reports/components/modal_footer_spec.js
...e_shared/security_reports/components/modal_footer_spec.js
+6
-7
No files found.
ee/app/assets/javascripts/vue_shared/security_reports/components/modal_footer.vue
View file @
2a263569
<
script
>
import
{
Gl
Deprecated
Button
}
from
'
@gitlab/ui
'
;
import
{
GlButton
}
from
'
@gitlab/ui
'
;
import
DismissButton
from
'
ee/vue_shared/security_reports/components/dismiss_button.vue
'
;
import
SplitButton
from
'
ee/vue_shared/security_reports/components/split_button.vue
'
;
import
{
s__
}
from
'
~/locale
'
;
import
LoadingButton
from
'
~/vue_shared/components/loading_button.vue
'
;
export
default
{
name
:
'
ModalFooter
'
,
components
:
{
DismissButton
,
GlDeprecatedButton
,
LoadingButton
,
GlButton
,
SplitButton
,
},
props
:
{
...
...
@@ -102,9 +100,9 @@ export default {
<
template
>
<div>
<gl-
deprecated-
button
data-dismiss=
"modal"
:disabled=
"disabled"
>
<gl-button
data-dismiss=
"modal"
:disabled=
"disabled"
>
{{
__
(
'
Cancel
'
)
}}
</gl-
deprecated-
button>
</gl-button>
<dismiss-button
v-if=
"canDismissVulnerability"
...
...
@@ -127,15 +125,17 @@ export default {
@
downloadPatch=
"$emit('downloadPatch')"
/>
<
loading
-button
<
gl
-button
v-else-if=
"actionButtons.length > 0"
:loading=
"actionButtons[0].isLoading"
:disabled=
"actionButtons[0].isLoading || disabled"
:label=
"actionButtons[0].name
"
c
ontainer-class=
"btn btn-success btn-inverted
"
variant=
"success
"
c
ategory=
"secondary
"
class=
"js-action-button"
data-qa-selector=
"create_issue_button"
@
click=
"$emit(actionButtons[0].action)"
/>
>
{{
__
(
actionButtons
[
0
].
name
)
}}
</gl-button>
</div>
</
template
>
ee/changelogs/unreleased/229210-replace-loadingbutton-with-gitlab-ui-s-glbutton-in-ee-app-asset.yml
0 → 100644
View file @
2a263569
---
title
:
Replace deprecated buttons with new GlButton component from GitLab UI
merge_request
:
41154
author
:
type
:
other
ee/spec/frontend/vue_shared/security_reports/components/modal_footer_spec.js
View file @
2a263569
...
...
@@ -3,7 +3,6 @@ import component from 'ee/vue_shared/security_reports/components/modal_footer.vu
import
SplitButton
from
'
ee/vue_shared/security_reports/components/split_button.vue
'
;
import
DismissButton
from
'
ee/vue_shared/security_reports/components/dismiss_button.vue
'
;
import
createState
from
'
ee/vue_shared/security_reports/store/state
'
;
import
LoadingButton
from
'
~/vue_shared/components/loading_button.vue
'
;
describe
(
'
Security Reports modal footer
'
,
()
=>
{
let
wrapper
;
...
...
@@ -34,11 +33,11 @@ describe('Security Reports modal footer', () => {
it
(
'
only renders the create issue button
'
,
()
=>
{
expect
(
wrapper
.
vm
.
actionButtons
[
0
].
name
).
toBe
(
'
Create issue
'
);
expect
(
wrapper
.
find
(
LoadingButton
).
props
(
'
label
'
)).
toBe
(
'
Create issue
'
);
expect
(
wrapper
.
find
(
'
.js-action-button
'
).
text
(
)).
toBe
(
'
Create issue
'
);
});
it
(
'
emits createIssue when create issue button is clicked
'
,
()
=>
{
wrapper
.
find
(
LoadingButton
).
trigger
(
'
click
'
);
wrapper
.
find
(
'
.js-action-button
'
).
trigger
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
wrapper
.
emitted
().
createNewIssue
).
toBeTruthy
();
...
...
@@ -57,11 +56,11 @@ describe('Security Reports modal footer', () => {
it
(
'
only renders the create merge request button
'
,
()
=>
{
expect
(
wrapper
.
vm
.
actionButtons
[
0
].
name
).
toBe
(
'
Resolve with merge request
'
);
expect
(
wrapper
.
find
(
LoadingButton
).
props
(
'
label
'
)).
toBe
(
'
Resolve with merge request
'
);
expect
(
wrapper
.
find
(
'
.js-action-button
'
).
text
(
)).
toBe
(
'
Resolve with merge request
'
);
});
it
(
'
emits createMergeRequest when create merge request button is clicked
'
,
()
=>
{
wrapper
.
find
(
LoadingButton
).
trigger
(
'
click
'
);
wrapper
.
find
(
'
.js-action-button
'
).
trigger
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
wrapper
.
emitted
().
createMergeRequest
).
toBeTruthy
();
...
...
@@ -80,11 +79,11 @@ describe('Security Reports modal footer', () => {
it
(
'
renders the download patch button
'
,
()
=>
{
expect
(
wrapper
.
vm
.
actionButtons
[
0
].
name
).
toBe
(
'
Download patch to resolve
'
);
expect
(
wrapper
.
find
(
LoadingButton
).
props
(
'
label
'
)).
toBe
(
'
Download patch to resolve
'
);
expect
(
wrapper
.
find
(
'
.js-action-button
'
).
text
(
)).
toBe
(
'
Download patch to resolve
'
);
});
it
(
'
emits downloadPatch when download patch button is clicked
'
,
()
=>
{
wrapper
.
find
(
LoadingButton
).
trigger
(
'
click
'
);
wrapper
.
find
(
'
.js-action-button
'
).
trigger
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
wrapper
.
emitted
().
downloadPatch
).
toBeTruthy
();
...
...
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