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
d7a7b519
Commit
d7a7b519
authored
Aug 24, 2020
by
jackib
Committed by
Jarek Ostrowski
Aug 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update issue edit buttons
parent
2868b3a5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
36 deletions
+25
-36
app/assets/javascripts/issue_show/components/edit_actions.vue
...assets/javascripts/issue_show/components/edit_actions.vue
+20
-15
changelogs/unreleased/229342-update-issue-edit-buttons.yml
changelogs/unreleased/229342-update-issue-edit-buttons.yml
+5
-0
spec/frontend/issue_show/components/edit_actions_spec.js
spec/frontend/issue_show/components/edit_actions_spec.js
+0
-21
No files found.
app/assets/javascripts/issue_show/components/edit_actions.vue
View file @
d7a7b519
<
script
>
/* eslint-disable @gitlab/vue-require-i18n-strings */
import
{
GlButton
}
from
'
@gitlab/ui
'
;
import
{
__
,
sprintf
}
from
'
~/locale
'
;
import
updateMixin
from
'
../mixins/update
'
;
import
eventHub
from
'
../event_hub
'
;
...
...
@@ -10,6 +10,9 @@ const issuableTypes = {
};
export
default
{
components
:
{
GlButton
,
},
mixins
:
[
updateMixin
],
props
:
{
canDestroy
:
{
...
...
@@ -64,28 +67,30 @@ export default {
<
template
>
<div
class=
"gl-mt-3 gl-mb-3 clearfix"
>
<button
:
class=
"
{ disabled: formState.updateLoading || !isSubmitEnabled }
"
<
gl-
button
:
loading=
"formState.updateLoading
"
:disabled=
"formState.updateLoading || !isSubmitEnabled"
class="btn btn-success float-left qa-save-button"
category=
"primary"
variant=
"success"
class=
"float-left qa-save-button"
type=
"submit"
@
click.prevent=
"updateIssuable"
>
Save changes
<i
v-if=
"formState.updateLoading"
class=
"fa fa-spinner fa-spin"
aria-hidden=
"true"
>
</i>
</button>
<button
class=
"btn btn-default float-right"
type=
"button"
@
click=
"closeForm"
>
{{
__
(
'
Save changes
'
)
}}
</gl-button>
<gl-button
class=
"float-right"
@
click=
"closeForm"
>
{{
__
(
'
Cancel
'
)
}}
</button>
<button
</
gl-
button>
<
gl-
button
v-if=
"shouldShowDeleteButton"
:
class=
"
{ disabled: deleteLoading }
"
:
loading=
"deleteLoading
"
:disabled=
"deleteLoading"
class="btn btn-danger float-right gl-mr-3 qa-delete-button"
type="button"
category=
"primary"
variant=
"danger"
class=
"float-right gl-mr-3 qa-delete-button"
@
click=
"deleteIssuable"
>
Delete
<i
v-if=
"deleteLoading"
class=
"fa fa-spinner fa-spin"
aria-hidden=
"true"
>
</i>
</button>
{{
__
(
'
Delete
'
)
}}
</
gl-
button>
</div>
</
template
>
changelogs/unreleased/229342-update-issue-edit-buttons.yml
0 → 100644
View file @
d7a7b519
---
title
:
Update issue edit buttons
merge_request
:
40298
author
:
type
:
changed
spec/frontend/issue_show/components/edit_actions_spec.js
View file @
d7a7b519
...
...
@@ -70,16 +70,6 @@ describe('Edit Actions components', () => {
expect
(
eventHub
.
$emit
).
toHaveBeenCalledWith
(
'
update.issuable
'
);
});
it
(
'
shows loading icon after clicking save button
'
,
done
=>
{
vm
.
$el
.
querySelector
(
'
.btn-success
'
).
click
();
Vue
.
nextTick
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.btn-success .fa
'
)).
not
.
toBeNull
();
done
();
});
});
it
(
'
disabled button after clicking save button
'
,
done
=>
{
vm
.
$el
.
querySelector
(
'
.btn-success
'
).
click
();
...
...
@@ -107,17 +97,6 @@ describe('Edit Actions components', () => {
expect
(
eventHub
.
$emit
).
toHaveBeenCalledWith
(
'
delete.issuable
'
,
{
destroy_confirm
:
true
});
});
it
(
'
shows loading icon after clicking delete button
'
,
done
=>
{
jest
.
spyOn
(
window
,
'
confirm
'
).
mockReturnValue
(
true
);
vm
.
$el
.
querySelector
(
'
.btn-danger
'
).
click
();
Vue
.
nextTick
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.btn-danger .fa
'
)).
not
.
toBeNull
();
done
();
});
});
it
(
'
does no actions when confirm is false
'
,
done
=>
{
jest
.
spyOn
(
window
,
'
confirm
'
).
mockReturnValue
(
false
);
vm
.
$el
.
querySelector
(
'
.btn-danger
'
).
click
();
...
...
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