Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-16 15:08:32 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-16 15:08:32 +0300
commitc158fa8d69c704663d289341a014c44c062cda88 (patch)
treed0cac82a9ac9e9ad28bb0030266eb8d5dc91fbbc /app/assets/javascripts/ide/components
parentb806264d29b8d52ccb78a41dcc3d67f2b040700c (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/ide/components')
-rw-r--r--app/assets/javascripts/ide/components/commit_sidebar/form.vue47
-rw-r--r--app/assets/javascripts/ide/components/file_row_extra.vue15
2 files changed, 39 insertions, 23 deletions
diff --git a/app/assets/javascripts/ide/components/commit_sidebar/form.vue b/app/assets/javascripts/ide/components/commit_sidebar/form.vue
index f7ed7006874..002c00599bb 100644
--- a/app/assets/javascripts/ide/components/commit_sidebar/form.vue
+++ b/app/assets/javascripts/ide/components/commit_sidebar/form.vue
@@ -6,6 +6,7 @@ import CommitMessageField from './message_field.vue';
import Actions from './actions.vue';
import SuccessMessage from './success_message.vue';
import { activityBarViews, MAX_WINDOW_HEIGHT_COMPACT } from '../../constants';
+import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
export default {
components: {
@@ -14,6 +15,7 @@ export default {
CommitMessageField,
SuccessMessage,
},
+ mixins: [glFeatureFlagsMixin()],
data() {
return {
isCompact: true,
@@ -27,9 +29,13 @@ export default {
...mapGetters('commit', ['discardDraftButtonDisabled', 'preBuiltCommitMessage']),
overviewText() {
return sprintf(
- __(
- '<strong>%{changedFilesLength} unstaged</strong> and <strong>%{stagedFilesLength} staged</strong> changes',
- ),
+ this.glFeatures.stageAllByDefault
+ ? __(
+ '<strong>%{stagedFilesLength} staged</strong> and <strong>%{changedFilesLength} unstaged</strong> changes',
+ )
+ : __(
+ '<strong>%{changedFilesLength} unstaged</strong> and <strong>%{stagedFilesLength} staged</strong> changes',
+ ),
{
stagedFilesLength: this.stagedFiles.length,
changedFilesLength: this.changedFiles.length,
@@ -39,6 +45,10 @@ export default {
commitButtonText() {
return this.stagedFiles.length ? __('Commit') : __('Stage & Commit');
},
+
+ currentViewIsCommitView() {
+ return this.currentActivityView === activityBarViews.commit;
+ },
},
watch: {
currentActivityView() {
@@ -46,27 +56,26 @@ export default {
this.isCompact = false;
} else {
this.isCompact = !(
- this.currentActivityView === activityBarViews.commit &&
- window.innerHeight >= MAX_WINDOW_HEIGHT_COMPACT
+ this.currentViewIsCommitView && window.innerHeight >= MAX_WINDOW_HEIGHT_COMPACT
);
}
},
- lastCommitMsg() {
- this.isCompact =
- this.currentActivityView !== activityBarViews.commit && this.lastCommitMsg === '';
- },
},
methods: {
...mapActions(['updateActivityBarView']),
...mapActions('commit', ['updateCommitMessage', 'discardDraft', 'commitChanges']),
- toggleIsSmall() {
- this.updateActivityBarView(activityBarViews.commit)
- .then(() => {
- this.isCompact = !this.isCompact;
- })
- .catch(e => {
- throw e;
- });
+ toggleIsCompact() {
+ if (this.currentViewIsCommitView) {
+ this.isCompact = !this.isCompact;
+ } else {
+ this.updateActivityBarView(activityBarViews.commit)
+ .then(() => {
+ this.isCompact = false;
+ })
+ .catch(e => {
+ throw e;
+ });
+ }
},
beforeEnterTransition() {
const elHeight = this.isCompact
@@ -114,7 +123,7 @@ export default {
:disabled="!hasChanges"
type="button"
class="btn btn-primary btn-sm btn-block qa-begin-commit-button"
- @click="toggleIsSmall"
+ @click="toggleIsCompact"
>
{{ __('Commit…') }}
</button>
@@ -148,7 +157,7 @@ export default {
v-else
type="button"
class="btn btn-default btn-sm float-right"
- @click="toggleIsSmall"
+ @click="toggleIsCompact"
>
{{ __('Collapse') }}
</button>
diff --git a/app/assets/javascripts/ide/components/file_row_extra.vue b/app/assets/javascripts/ide/components/file_row_extra.vue
index f0bedcfbd6b..33098eb1af0 100644
--- a/app/assets/javascripts/ide/components/file_row_extra.vue
+++ b/app/assets/javascripts/ide/components/file_row_extra.vue
@@ -6,6 +6,7 @@ import Icon from '~/vue_shared/components/icon.vue';
import ChangedFileIcon from '~/vue_shared/components/changed_file_icon.vue';
import NewDropdown from './new_dropdown/index.vue';
import MrFileIcon from './mr_file_icon.vue';
+import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
export default {
name: 'FileRowExtra',
@@ -18,6 +19,7 @@ export default {
ChangedFileIcon,
MrFileIcon,
},
+ mixins: [glFeatureFlagsMixin()],
props: {
file: {
type: Object,
@@ -55,10 +57,15 @@ export default {
return n__('%d staged change', '%d staged changes', this.folderStagedCount);
}
- return sprintf(__('%{unstaged} unstaged and %{staged} staged changes'), {
- unstaged: this.folderUnstagedCount,
- staged: this.folderStagedCount,
- });
+ return sprintf(
+ this.glFeatures.stageAllByDefault
+ ? __('%{staged} staged and %{unstaged} unstaged changes')
+ : __('%{unstaged} unstaged and %{staged} staged changes'),
+ {
+ unstaged: this.folderUnstagedCount,
+ staged: this.folderStagedCount,
+ },
+ );
},
showTreeChangesCount() {
return this.isTree && this.changesCount > 0 && !this.file.opened;