BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
725a4fef
Commit
725a4fef
authored
Aug 09, 2017
by
Jacob Schatz
Committed by
Mike Greiling
Aug 17, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add thenable ajax calls.
parent
91d3e6d9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
9 deletions
+8
-9
api.js
app/assets/javascripts/api.js
+2
-4
repo_commit_section.vue
...ssets/javascripts/repo/components/repo_commit_section.vue
+3
-2
repo_service.js
app/assets/javascripts/repo/services/repo_service.js
+3
-3
No files found.
app/assets/javascripts/api.js
View file @
725a4fef
...
...
@@ -99,15 +99,13 @@ const Api = {
commitMultiple
(
id
,
data
,
callback
)
{
const
url
=
Api
.
buildUrl
(
Api
.
commitPath
)
.
replace
(
':id'
,
id
);
return
$
.
ajax
({
return
this
.
wrapAjaxCall
({
url
,
type
:
'POST'
,
contentType
:
'application/json; charset=utf-8'
,
data
:
JSON
.
stringify
(
data
),
dataType
:
'json'
,
})
.
done
(
commitData
=>
callback
(
commitData
))
.
fail
(
message
=>
callback
(
message
.
responseJSON
));
});
},
// Return text for a specific license
...
...
app/assets/javascripts/repo/components/repo_commit_section.vue
View file @
725a4fef
...
...
@@ -42,10 +42,11 @@ export default {
actions
,
};
Store
.
submitCommitsLoading
=
true
;
Service
.
commitFiles
(
payload
,
this
.
resetCommitState
);
Service
.
commitFiles
(
payload
)
.
then
(
this
.
resetCommitState
);
},
resetCommitState
()
{
resetCommitState
(
data
)
{
this
.
submitCommitsLoading
=
false
;
this
.
changedFiles
=
[];
this
.
commitMessage
=
''
;
...
...
app/assets/javascripts/repo/services/repo_service.js
View file @
725a4fef
...
...
@@ -65,14 +65,14 @@ const RepoService = {
return
urlArray
.
join
(
'/'
);
},
commitFiles
(
payload
,
cb
)
{
Api
.
commitMultiple
(
Store
.
projectId
,
payload
,
(
data
)
=>
{
commitFiles
(
payload
)
{
return
Api
.
commitMultiple
(
Store
.
projectId
,
payload
)
.
then
((
data
)
=>
{
if
(
data
.
short_id
&&
data
.
stats
)
{
Flash
(
`Your changes have been committed. Commit
${
data
.
short_id
}
with
${
data
.
stats
.
additions
}
additions,
${
data
.
stats
.
deletions
}
deletions.`
,
'notice'
);
}
else
{
Flash
(
data
.
message
);
}
cb
();
});
},
};
...
...
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