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
3ba5c205
Commit
3ba5c205
authored
Sep 03, 2020
by
Jarek Ostrowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update lock form buttons to gl-button
MR:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/41454
parent
51eebe52
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
17 deletions
+20
-17
app/assets/javascripts/sidebar/components/lock/edit_form_buttons.vue
...javascripts/sidebar/components/lock/edit_form_buttons.vue
+9
-9
changelogs/unreleased/229343-update-lock-form-buttons.yml
changelogs/unreleased/229343-update-lock-form-buttons.yml
+5
-0
spec/frontend/sidebar/lock/edit_form_buttons_spec.js
spec/frontend/sidebar/lock/edit_form_buttons_spec.js
+6
-8
No files found.
app/assets/javascripts/sidebar/components/lock/edit_form_buttons.vue
View file @
3ba5c205
<
script
>
import
$
from
'
jquery
'
;
import
{
Gl
LoadingIc
on
}
from
'
@gitlab/ui
'
;
import
{
Gl
Butt
on
}
from
'
@gitlab/ui
'
;
import
{
mapActions
}
from
'
vuex
'
;
import
{
__
,
sprintf
}
from
'
../../../locale
'
;
import
{
deprecatedCreateFlash
as
Flash
}
from
'
~/flash
'
;
...
...
@@ -8,7 +8,7 @@ import eventHub from '../../event_hub';
export
default
{
components
:
{
Gl
LoadingIc
on
,
Gl
Butt
on
,
},
inject
:
[
'
fullPath
'
],
props
:
{
...
...
@@ -65,19 +65,19 @@ export default {
<
template
>
<div
class=
"sidebar-item-warning-message-actions"
>
<
button
type=
"button"
class=
"btn btn-default
gl-mr-3"
@
click=
"closeForm"
>
<
gl-button
class=
"
gl-mr-3"
@
click=
"closeForm"
>
{{
__
(
'
Cancel
'
)
}}
</button>
</
gl-
button>
<button
type=
"button"
<gl-button
data-testid=
"lock-toggle"
class=
"btn btn-close"
category=
"secondary"
variant=
"warning"
:disabled=
"isLoading"
:loading=
"isLoading"
@
click.prevent=
"submitForm"
>
<gl-loading-icon
v-if=
"isLoading"
inline
/>
{{
buttonText
}}
</button>
</
gl-
button>
</div>
</
template
>
changelogs/unreleased/229343-update-lock-form-buttons.yml
0 → 100644
View file @
3ba5c205
---
title
:
Update lock form buttons to gl-button
merge_request
:
41454
author
:
type
:
changed
spec/frontend/sidebar/lock/edit_form_buttons_spec.js
View file @
3ba5c205
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
EditFormButtons
from
'
~/sidebar/components/lock/edit_form_buttons.vue
'
;
import
eventHub
from
'
~/sidebar/event_hub
'
;
import
{
deprecatedCreateFlash
as
flash
}
from
'
~/flash
'
;
...
...
@@ -22,7 +21,6 @@ describe('EditFormButtons', () => {
};
const
findLockToggle
=
()
=>
wrapper
.
find
(
'
[data-testid="lock-toggle"]
'
);
const
findGlLoadingIcon
=
()
=>
wrapper
.
find
(
GlLoadingIcon
);
const
createComponent
=
({
props
=
{},
data
=
{},
resolved
=
true
})
=>
{
store
=
issuableType
===
ISSUABLE_TYPE_ISSUE
?
createStore
()
:
createMrStore
();
...
...
@@ -33,7 +31,7 @@ describe('EditFormButtons', () => {
jest
.
spyOn
(
store
,
'
dispatch
'
).
mockRejectedValue
();
}
wrapper
=
shallowM
ount
(
EditFormButtons
,
{
wrapper
=
m
ount
(
EditFormButtons
,
{
store
,
provide
:
{
fullPath
:
''
,
...
...
@@ -78,8 +76,8 @@ describe('EditFormButtons', () => {
expect
(
findLockToggle
().
attributes
(
'
disabled
'
)).
toBe
(
'
disabled
'
);
});
it
(
'
displays the GlLoadingIc
on
'
,
()
=>
{
expect
(
find
GlLoadingIcon
().
exists
(
)).
toBe
(
true
);
it
(
'
sets loading on the toggle butt
on
'
,
()
=>
{
expect
(
find
LockToggle
().
props
(
'
loading
'
)).
toBe
(
true
);
});
});
...
...
@@ -121,7 +119,7 @@ describe('EditFormButtons', () => {
it
(
'
resets loading
'
,
async
()
=>
{
await
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
find
GlLoadingIcon
().
exists
(
)).
toBe
(
false
);
expect
(
find
LockToggle
().
props
(
'
loading
'
)).
toBe
(
false
);
});
});
...
...
@@ -156,7 +154,7 @@ describe('EditFormButtons', () => {
it
(
'
resets loading
'
,
async
()
=>
{
await
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
find
GlLoadingIcon
().
exists
(
)).
toBe
(
false
);
expect
(
find
LockToggle
().
props
(
'
loading
'
)).
toBe
(
false
);
});
});
...
...
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