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
Hide 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
>
<
script
>
import
$
from
'
jquery
'
;
import
$
from
'
jquery
'
;
import
{
Gl
LoadingIc
on
}
from
'
@gitlab/ui
'
;
import
{
Gl
Butt
on
}
from
'
@gitlab/ui
'
;
import
{
mapActions
}
from
'
vuex
'
;
import
{
mapActions
}
from
'
vuex
'
;
import
{
__
,
sprintf
}
from
'
../../../locale
'
;
import
{
__
,
sprintf
}
from
'
../../../locale
'
;
import
{
deprecatedCreateFlash
as
Flash
}
from
'
~/flash
'
;
import
{
deprecatedCreateFlash
as
Flash
}
from
'
~/flash
'
;
...
@@ -8,7 +8,7 @@ import eventHub from '../../event_hub';
...
@@ -8,7 +8,7 @@ import eventHub from '../../event_hub';
export
default
{
export
default
{
components
:
{
components
:
{
Gl
LoadingIc
on
,
Gl
Butt
on
,
},
},
inject
:
[
'
fullPath
'
],
inject
:
[
'
fullPath
'
],
props
:
{
props
:
{
...
@@ -65,19 +65,19 @@ export default {
...
@@ -65,19 +65,19 @@ export default {
<
template
>
<
template
>
<div
class=
"sidebar-item-warning-message-actions"
>
<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
'
)
}}
{{
__
(
'
Cancel
'
)
}}
</button>
</
gl-
button>
<button
<gl-button
type=
"button"
data-testid=
"lock-toggle"
data-testid=
"lock-toggle"
class=
"btn btn-close"
category=
"secondary"
variant=
"warning"
:disabled=
"isLoading"
:disabled=
"isLoading"
:loading=
"isLoading"
@
click.prevent=
"submitForm"
@
click.prevent=
"submitForm"
>
>
<gl-loading-icon
v-if=
"isLoading"
inline
/>
{{
buttonText
}}
{{
buttonText
}}
</button>
</
gl-
button>
</div>
</div>
</
template
>
</
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
{
mount
}
from
'
@vue/test-utils
'
;
import
{
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
EditFormButtons
from
'
~/sidebar/components/lock/edit_form_buttons.vue
'
;
import
EditFormButtons
from
'
~/sidebar/components/lock/edit_form_buttons.vue
'
;
import
eventHub
from
'
~/sidebar/event_hub
'
;
import
eventHub
from
'
~/sidebar/event_hub
'
;
import
{
deprecatedCreateFlash
as
flash
}
from
'
~/flash
'
;
import
{
deprecatedCreateFlash
as
flash
}
from
'
~/flash
'
;
...
@@ -22,7 +21,6 @@ describe('EditFormButtons', () => {
...
@@ -22,7 +21,6 @@ describe('EditFormButtons', () => {
};
};
const
findLockToggle
=
()
=>
wrapper
.
find
(
'
[data-testid="lock-toggle"]
'
);
const
findLockToggle
=
()
=>
wrapper
.
find
(
'
[data-testid="lock-toggle"]
'
);
const
findGlLoadingIcon
=
()
=>
wrapper
.
find
(
GlLoadingIcon
);
const
createComponent
=
({
props
=
{},
data
=
{},
resolved
=
true
})
=>
{
const
createComponent
=
({
props
=
{},
data
=
{},
resolved
=
true
})
=>
{
store
=
issuableType
===
ISSUABLE_TYPE_ISSUE
?
createStore
()
:
createMrStore
();
store
=
issuableType
===
ISSUABLE_TYPE_ISSUE
?
createStore
()
:
createMrStore
();
...
@@ -33,7 +31,7 @@ describe('EditFormButtons', () => {
...
@@ -33,7 +31,7 @@ describe('EditFormButtons', () => {
jest
.
spyOn
(
store
,
'
dispatch
'
).
mockRejectedValue
();
jest
.
spyOn
(
store
,
'
dispatch
'
).
mockRejectedValue
();
}
}
wrapper
=
shallowM
ount
(
EditFormButtons
,
{
wrapper
=
m
ount
(
EditFormButtons
,
{
store
,
store
,
provide
:
{
provide
:
{
fullPath
:
''
,
fullPath
:
''
,
...
@@ -78,8 +76,8 @@ describe('EditFormButtons', () => {
...
@@ -78,8 +76,8 @@ describe('EditFormButtons', () => {
expect
(
findLockToggle
().
attributes
(
'
disabled
'
)).
toBe
(
'
disabled
'
);
expect
(
findLockToggle
().
attributes
(
'
disabled
'
)).
toBe
(
'
disabled
'
);
});
});
it
(
'
displays the GlLoadingIc
on
'
,
()
=>
{
it
(
'
sets loading on the toggle butt
on
'
,
()
=>
{
expect
(
find
GlLoadingIcon
().
exists
(
)).
toBe
(
true
);
expect
(
find
LockToggle
().
props
(
'
loading
'
)).
toBe
(
true
);
});
});
});
});
...
@@ -121,7 +119,7 @@ describe('EditFormButtons', () => {
...
@@ -121,7 +119,7 @@ describe('EditFormButtons', () => {
it
(
'
resets loading
'
,
async
()
=>
{
it
(
'
resets loading
'
,
async
()
=>
{
await
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
await
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
find
GlLoadingIcon
().
exists
(
)).
toBe
(
false
);
expect
(
find
LockToggle
().
props
(
'
loading
'
)).
toBe
(
false
);
});
});
});
});
...
@@ -156,7 +154,7 @@ describe('EditFormButtons', () => {
...
@@ -156,7 +154,7 @@ describe('EditFormButtons', () => {
it
(
'
resets loading
'
,
async
()
=>
{
it
(
'
resets loading
'
,
async
()
=>
{
await
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
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