Remove commit button loader and update title while committing.

This commit is contained in:
Fatih Acet 2016-08-12 21:48:02 +03:00
parent 1eaad45e71
commit a1d0b0398b
3 changed files with 11 additions and 3 deletions

View file

@ -239,6 +239,13 @@ class MergeConflictDataProvider {
isAllResolved() {
return !this.vueInstance.isSubmitting && this.getConflictsCount() === this.getResolvedCount();
getCommitButtonText() {
const initial = 'Commit conflict resolution';
const inProgress = 'Committing...';
const vue = this.vueInstance;
return vue ? vue.isSubmitting ? inProgress : initial : initial;
}

View file

@ -36,8 +36,9 @@ class MergeConflictResolver {
return {
conflictsCount() { return dp.getConflictsCount() },
resolvedCount() { return dp.getResolvedCount() },
allResolved() { return dp.isAllResolved() }
resolvedCount() { return dp.getResolvedCount() },
readyToCommit() { return dp.isReadyToCommit() },
commitButtonText() { return dp.getCommitButtonText() }
}
}

View file

@ -10,7 +10,7 @@
{{{conflictsData.commitMessage}}}
%button{type: "button", class: "btn btn-success js-submit-button", ":disabled" => "!allResolved", "@click" => "commit()"}
%span Commit conflict resolution
%a.fa.fa-spin.fa-spinner{":class" => "{'hidden': !isSubmitting}"}
%span {{commitButtonText}}
= link_to "Cancel", namespace_project_merge_request_path(@merge_request.project.namespace, @merge_request.project, @merge_request), class: "btn btn-cancel"