diff options
author | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-08-07 13:43:57 +0300 |
---|---|---|
committer | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-08-07 13:43:57 +0300 |
commit | d689f9a89ea816ccbe95d4334a608e8dcb0d41c4 (patch) | |
tree | a4a66d9458584200c630d363d1b53ff1e6e38be2 /app/assets | |
parent | f18b08aea77a6e29e4f3fba61184b54fbd4bb500 (diff) | |
parent | aac0bc09ae6f19b9d9c6de6628ff63d5daa43114 (diff) |
Merge branches 'ide' and 'ide' of gitlab.com:gitlab-org/gitlab-ce into ide
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/repo/components/repo_commit_section.vue | 7 | ||||
-rw-r--r-- | app/assets/javascripts/repo/services/repo_service.js | 8 |
2 files changed, 11 insertions, 4 deletions
diff --git a/app/assets/javascripts/repo/components/repo_commit_section.vue b/app/assets/javascripts/repo/components/repo_commit_section.vue index c939c5b6bb9..fa0b9acce58 100644 --- a/app/assets/javascripts/repo/components/repo_commit_section.vue +++ b/app/assets/javascripts/repo/components/repo_commit_section.vue @@ -1,9 +1,9 @@ <script> /* global Flash */ import Store from '../stores/repo_store'; -import Api from '../../api'; import RepoMixin from '../mixins/repo_mixin'; import Helper from '../helpers/repo_helper'; +import Service from '../services/repo_service'; const RepoCommitSection = { data: () => Store, @@ -17,7 +17,7 @@ const RepoCommitSection = { }, cantCommitYet() { - return !commitMessage || submitCommitsLoading; + return !this.commitMessage || this.submitCommitsLoading; }, filePluralize() { @@ -41,9 +41,8 @@ const RepoCommitSection = { actions, }; Store.submitCommitsLoading = true; - Api.commitMultiple(Store.projectId, payload, (data) => { + Service.commitFiles(payload, () => { Store.submitCommitsLoading = false; - Flash(`Your changes have been committed. Commit ${data.short_id} with ${data.stats.additions} additions, ${data.stats.deletions} deletions.`, 'notice'); this.changedFiles = []; this.openedFiles = []; this.commitMessage = ''; diff --git a/app/assets/javascripts/repo/services/repo_service.js b/app/assets/javascripts/repo/services/repo_service.js index 6cc8321deb5..234159ccd9b 100644 --- a/app/assets/javascripts/repo/services/repo_service.js +++ b/app/assets/javascripts/repo/services/repo_service.js @@ -1,5 +1,6 @@ import axios from 'axios'; import Store from '../stores/repo_store'; +import Api from '../../api'; const RepoService = { url: '', @@ -68,6 +69,13 @@ const RepoService = { return urlArray.join('/'); }, + + commitFiles(payload, cb) { + Api.commitMultiple(Store.projectId, payload, (data) => { + Flash(`Your changes have been committed. Commit ${data.short_id} with ${data.stats.additions} additions, ${data.stats.deletions} deletions.`, 'notice'); + cb(); + }); + }, }; export default RepoService; |