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
5694e19c
Commit
5694e19c
authored
Aug 27, 2020
by
Jeremy Elder
Committed by
Simon Knox
Aug 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace deprecated buttons with GlButton in …badge_form.vue
parent
82643f14
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
20 deletions
+24
-20
app/assets/javascripts/badges/components/badge_form.vue
app/assets/javascripts/badges/components/badge_form.vue
+14
-15
changelogs/unreleased/229215-replace-loadingbutton-with-gitlab-ui-s-glbutton-in-app-assets-java.yml
...ngbutton-with-gitlab-ui-s-glbutton-in-app-assets-java.yml
+5
-0
spec/frontend/badges/components/badge_settings_spec.js
spec/frontend/badges/components/badge_settings_spec.js
+5
-5
No files found.
app/assets/javascripts/badges/components/badge_form.vue
View file @
5694e19c
...
@@ -2,10 +2,9 @@
...
@@ -2,10 +2,9 @@
/* eslint-disable vue/no-v-html */
/* eslint-disable vue/no-v-html */
import
{
escape
,
debounce
}
from
'
lodash
'
;
import
{
escape
,
debounce
}
from
'
lodash
'
;
import
{
mapActions
,
mapState
}
from
'
vuex
'
;
import
{
mapActions
,
mapState
}
from
'
vuex
'
;
import
{
GlLoadingIcon
,
GlFormInput
,
GlFormGroup
}
from
'
@gitlab/ui
'
;
import
{
GlLoadingIcon
,
GlFormInput
,
GlFormGroup
,
GlButton
}
from
'
@gitlab/ui
'
;
import
{
deprecatedCreateFlash
as
createFlash
}
from
'
~/flash
'
;
import
{
deprecatedCreateFlash
as
createFlash
}
from
'
~/flash
'
;
import
{
s__
,
sprintf
}
from
'
~/locale
'
;
import
{
s__
,
sprintf
}
from
'
~/locale
'
;
import
LoadingButton
from
'
~/vue_shared/components/loading_button.vue
'
;
import
createEmptyBadge
from
'
../empty_badge
'
;
import
createEmptyBadge
from
'
../empty_badge
'
;
import
Badge
from
'
./badge.vue
'
;
import
Badge
from
'
./badge.vue
'
;
...
@@ -15,7 +14,7 @@ export default {
...
@@ -15,7 +14,7 @@ export default {
name
:
'
BadgeForm
'
,
name
:
'
BadgeForm
'
,
components
:
{
components
:
{
Badge
,
Badge
,
Loading
Button
,
Gl
Button
,
GlLoadingIcon
,
GlLoadingIcon
,
GlFormInput
,
GlFormInput
,
GlFormGroup
,
GlFormGroup
,
...
@@ -220,23 +219,23 @@ export default {
...
@@ -220,23 +219,23 @@ export default {
</div>
</div>
<div
v-if=
"isEditing"
class=
"row-content-block gl-display-flex gl-justify-content-end"
>
<div
v-if=
"isEditing"
class=
"row-content-block gl-display-flex gl-justify-content-end"
>
<
button
class=
"btn btn-cancel gl-mr-4"
type=
"button
"
@
click=
"onCancel"
>
<
gl-button
class=
"btn-cancel gl-mr-4"
data-testid=
"cancelEditing
"
@
click=
"onCancel"
>
{{
__
(
'
Cancel
'
)
}}
{{
__
(
'
Cancel
'
)
}}
</button>
</
gl-
button>
<
loading
-button
<
gl
-button
:loading=
"isSaving"
:loading=
"isSaving"
:label=
"s__('Badges|Save changes')"
type=
"submit"
type=
"submit"
container-class=
"btn btn-success"
variant=
"success"
/>
category=
"primary"
data-testid=
"saveEditing"
>
{{
s__
(
'
Badges|Save changes
'
)
}}
</gl-button>
</div>
</div>
<div
v-else
class=
"gl-display-flex gl-justify-content-end form-group"
>
<div
v-else
class=
"gl-display-flex gl-justify-content-end form-group"
>
<loading-button
<gl-button
:loading=
"isSaving"
type=
"submit"
variant=
"success"
category=
"primary"
>
:loading=
"isSaving"
{{
s__
(
'
Badges|Add badge
'
)
}}
:label=
"s__('Badges|Add badge')"
</gl-button>
type=
"submit"
container-class=
"btn btn-success"
/>
</div>
</div>
</form>
</form>
</
template
>
</
template
>
changelogs/unreleased/229215-replace-loadingbutton-with-gitlab-ui-s-glbutton-in-app-assets-java.yml
0 → 100644
View file @
5694e19c
---
title
:
Replacing deprecated buttons and loading buttons with new buttons
merge_request
:
40163
author
:
type
:
other
spec/frontend/badges/components/badge_settings_spec.js
View file @
5694e19c
...
@@ -82,14 +82,14 @@ describe('BadgeSettings component', () => {
...
@@ -82,14 +82,14 @@ describe('BadgeSettings component', () => {
const
form
=
vm
.
$el
.
querySelector
(
'
form:nth-of-type(1)
'
);
const
form
=
vm
.
$el
.
querySelector
(
'
form:nth-of-type(1)
'
);
expect
(
form
).
not
.
toBe
(
null
);
expect
(
form
).
not
.
toBe
(
null
);
const
submitButton
=
form
.
querySelector
(
'
.btn-success
'
);
const
cancelButton
=
form
.
querySelector
(
'
[data-testid="cancelEditing"]
'
);
expect
(
submitButton
).
not
.
toBe
(
null
);
expect
(
submitButton
).
toHaveText
(
/Save changes/
);
const
cancelButton
=
form
.
querySelector
(
'
.btn-cancel
'
);
expect
(
cancelButton
).
not
.
toBe
(
null
);
expect
(
cancelButton
).
not
.
toBe
(
null
);
expect
(
cancelButton
).
toHaveText
(
/Cancel/
);
expect
(
cancelButton
).
toHaveText
(
/Cancel/
);
const
submitButton
=
form
.
querySelector
(
'
[data-testid="saveEditing"]
'
);
expect
(
submitButton
).
not
.
toBe
(
null
);
expect
(
submitButton
).
toHaveText
(
/Save changes/
);
});
});
it
(
'
displays no badge list
'
,
()
=>
{
it
(
'
displays no badge list
'
,
()
=>
{
...
...
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