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
d056bcee
Commit
d056bcee
authored
Jun 14, 2017
by
Eric Eastwood
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable button after submission
parent
0f62e0eb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
3 deletions
+22
-3
app/assets/javascripts/issuable/related_issues/components/add_issuable_form.vue
.../issuable/related_issues/components/add_issuable_form.vue
+6
-1
app/assets/javascripts/issuable/related_issues/components/related_issues_block.vue
...suable/related_issues/components/related_issues_block.vue
+6
-0
app/assets/javascripts/issuable/related_issues/components/related_issues_root.vue
...ssuable/related_issues/components/related_issues_root.vue
+10
-2
No files found.
app/assets/javascripts/issuable/related_issues/components/add_issuable_form.vue
View file @
d056bcee
...
...
@@ -25,6 +25,11 @@ export default {
required
:
false
,
default
:
()
=>
({}),
},
isSubmitting
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
,
},
},
data
()
{
...
...
@@ -40,7 +45,7 @@ export default {
computed
:
{
isSubmitButtonDisabled
()
{
return
this
.
pendingReferences
.
length
===
0
;
return
this
.
pendingReferences
.
length
===
0
||
this
.
isSubmitting
;
},
},
...
...
app/assets/javascripts/issuable/related_issues/components/related_issues_block.vue
View file @
d056bcee
...
...
@@ -13,6 +13,11 @@ export default {
required
:
false
,
default
:
false
,
},
isSubmitting
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
,
},
relatedIssues
:
{
type
:
Array
,
required
:
false
,
...
...
@@ -139,6 +144,7 @@ export default {
'related-issues-add-related-issues-form-with-break': hasRelatedIssues
}">
<add-issuable-form
:is-submitting=
"isSubmitting"
:input-value=
"inputValue"
:pending-references=
"pendingReferences"
add-button-label=
"Add related issues"
...
...
app/assets/javascripts/issuable/related_issues/components/related_issues_root.vue
View file @
d056bcee
...
...
@@ -59,6 +59,7 @@ export default {
return
{
state
:
this
.
store
.
state
,
isFetching
:
false
,
isSubmitting
:
false
,
isFormVisible
:
false
,
inputValue
:
''
,
};
...
...
@@ -103,6 +104,7 @@ export default {
},
onPendingFormSubmit
()
{
if
(
this
.
state
.
pendingReferences
.
length
>
0
)
{
this
.
isSubmitting
=
true
;
this
.
service
.
addRelatedIssues
(
this
.
state
.
pendingReferences
)
.
then
(
res
=>
res
.
json
())
.
then
((
data
)
=>
{
...
...
@@ -110,10 +112,15 @@ export default {
this
.
store
.
setPendingReferences
([]);
this
.
store
.
setRelatedIssues
(
data
.
issues
);
this
.
isSubmitting
=
false
;
// Close the form on submission
this
.
isFormVisible
=
false
;
})
.
catch
(
res
=>
new
Flash
(
res
.
data
.
message
||
'
An error occurred while submitting related issues.
'
));
.
catch
((
res
)
=>
{
this
.
isSubmitting
=
false
;
// eslint-disable-next-line no-new
new
Flash
(
res
.
data
.
message
||
'
An error occurred while submitting related issues.
'
);
});
}
},
onPendingFormCancel
()
{
...
...
@@ -197,7 +204,8 @@ export default {
<
template
>
<related-issues-block
:help-path=
"helpPath"
:isFetching=
"isFetching"
:is-fetching=
"isFetching"
:is-submitting=
"isSubmitting"
:related-issues=
"state.relatedIssues"
:can-add-related-issues=
"canAddRelatedIssues"
:pending-references=
"state.pendingReferences"
...
...
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