diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-13 12:09:22 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-13 12:09:22 +0000 |
commit | 286fe61013674fe2d245ffc8d2233baf09923e70 (patch) | |
tree | 2037291f5863105e54e75be056b49f7d62007cae /app/assets/javascripts/ide/components/commit_sidebar/editor_header.vue | |
parent | 4cb5e5011abfe8d50ac3a7ebd0018c563c6d7af4 (diff) | |
download | gitlab-ce-286fe61013674fe2d245ffc8d2233baf09923e70.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/ide/components/commit_sidebar/editor_header.vue')
-rw-r--r-- | app/assets/javascripts/ide/components/commit_sidebar/editor_header.vue | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/app/assets/javascripts/ide/components/commit_sidebar/editor_header.vue b/app/assets/javascripts/ide/components/commit_sidebar/editor_header.vue index 3398cd091ba..e618fb3daae 100644 --- a/app/assets/javascripts/ide/components/commit_sidebar/editor_header.vue +++ b/app/assets/javascripts/ide/components/commit_sidebar/editor_header.vue @@ -24,25 +24,19 @@ export default { discardModalTitle() { return sprintf(__('Discard changes to %{path}?'), { path: this.activeFile.path }); }, - actionButtonText() { - return this.activeFile.staged ? __('Unstage') : __('Stage'); - }, isStaged() { return !this.activeFile.changed && this.activeFile.staged; }, }, methods: { ...mapActions(['stageChange', 'unstageChange', 'discardFileChanges']), - actionButtonClicked() { - if (this.activeFile.staged) { - this.unstageChange(this.activeFile.path); - } else { - this.stageChange(this.activeFile.path); - } - }, showDiscardModal() { this.$refs.discardModal.show(); }, + discardChanges(path) { + this.unstageChange(path); + this.discardFileChanges(path); + }, }, }; </script> @@ -65,19 +59,7 @@ export default { class="btn btn-remove btn-inverted append-right-8" @click="showDiscardModal" > - {{ __('Discard') }} - </button> - <button - ref="actionButton" - :class="{ - 'btn-success': !isStaged, - 'btn-warning': isStaged, - }" - type="button" - class="btn btn-inverted" - @click="actionButtonClicked" - > - {{ actionButtonText }} + {{ __('Discard changes') }} </button> </div> <gl-modal @@ -87,7 +69,7 @@ export default { :ok-title="__('Discard changes')" :modal-id="discardModalId" :title="discardModalTitle" - @ok="discardFileChanges(activeFile.path)" + @ok="discardChanges(activeFile.path)" > {{ __("You will lose all changes you've made to this file. This action cannot be undone.") }} </gl-modal> |