diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-07 09:08:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-07 09:08:35 +0300 |
commit | bed53d96d214fd96ea688d3e86e53457ce50043e (patch) | |
tree | 8196df5e612e847c3da3e8f50a0d45d7ae9ea6e0 /app/assets/javascripts/diffs/components | |
parent | 83cd5db43517cfd977b0d288b179f794677ba1a7 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/diffs/components')
-rw-r--r-- | app/assets/javascripts/diffs/components/diff_expansion_cell.vue | 47 | ||||
-rw-r--r-- | app/assets/javascripts/diffs/components/diff_view.vue | 43 |
2 files changed, 5 insertions, 85 deletions
diff --git a/app/assets/javascripts/diffs/components/diff_expansion_cell.vue b/app/assets/javascripts/diffs/components/diff_expansion_cell.vue index 4e7dc578193..fc5766a23ef 100644 --- a/app/assets/javascripts/diffs/components/diff_expansion_cell.vue +++ b/app/assets/javascripts/diffs/components/diff_expansion_cell.vue @@ -3,7 +3,6 @@ import { GlTooltipDirective, GlSafeHtmlDirective, GlIcon, GlLoadingIcon } from ' import { mapActions } from 'vuex'; import createFlash from '~/flash'; import { s__, sprintf } from '~/locale'; -import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import { UNFOLD_COUNT, INLINE_DIFF_LINES_KEY } from '../constants'; import * as utils from '../store/utils'; @@ -24,7 +23,6 @@ export default { GlTooltip: GlTooltipDirective, SafeHtml: GlSafeHtmlDirective, }, - mixins: [glFeatureFlagsMixin()], props: { file: { type: Object, @@ -93,25 +91,16 @@ export default { nextLineNumbers = {}, ) { this.loadMoreLines({ endpoint, params, lineNumbers, fileHash, isExpandDown, nextLineNumbers }) - .then(() => { - this.isRequesting = false; - }) .catch(() => { createFlash({ message: s__('Diffs|Something went wrong while fetching diff lines.'), }); - this.isRequesting = false; }) .finally(() => { this.loading = { up: false, down: false, all: false }; }); }, handleExpandLines(type = EXPAND_ALL) { - if (this.isRequesting) { - return; - } - - this.isRequesting = true; const endpoint = this.file.context_lines_path; const oldLineNumber = this.line.meta_data.old_pos || 0; const newLineNumber = this.line.meta_data.new_pos || 0; @@ -228,10 +217,7 @@ export default { </script> <template> - <div - v-if="glFeatures.updatedDiffExpansionButtons" - class="diff-grid-row diff-grid-row-full diff-tr line_holder match expansion" - > + <div class="diff-grid-row diff-grid-row-full diff-tr line_holder match expansion"> <div :class="{ parallel: !inline }" class="diff-grid-left diff-grid-2-col left-side"> <div class="diff-td diff-line-num gl-text-center! gl-p-0! gl-w-full! gl-display-flex gl-flex-direction-column" @@ -240,6 +226,7 @@ export default { v-if="showExpandDown" v-gl-tooltip.left :title="s__('Diffs|Next 20 lines')" + :disabled="loading.down" type="button" class="js-unfold-down gl-rounded-0 gl-border-0 diff-line-expand-button" @click="handleExpandLines($options.EXPAND_DOWN)" @@ -251,6 +238,7 @@ export default { v-if="lineCountBetween !== -1 && lineCountBetween < 20" v-gl-tooltip.left :title="s__('Diffs|Expand all lines')" + :disabled="loading.all" type="button" class="js-unfold-all gl-rounded-0 gl-border-0 diff-line-expand-button" @click="handleExpandLines()" @@ -262,6 +250,7 @@ export default { v-if="showExpandUp" v-gl-tooltip.left :title="s__('Diffs|Previous 20 lines')" + :disabled="loading.up" type="button" class="js-unfold gl-rounded-0 gl-border-0 diff-line-expand-button" @click="handleExpandLines($options.EXPAND_UP)" @@ -276,32 +265,4 @@ export default { ></div> </div> </div> - <div v-else class="content js-line-expansion-content"> - <button - type="button" - :disabled="!canExpandDown" - class="js-unfold-down gl-mx-2 gl-py-4 gl-cursor-pointer" - @click="handleExpandLines($options.EXPAND_DOWN)" - > - <gl-icon :size="12" name="expand-down" /> - <span>{{ $options.i18n.showMore }}</span> - </button> - <button - type="button" - class="js-unfold-all gl-mx-2 gl-py-4 gl-cursor-pointer" - @click="handleExpandLines()" - > - <gl-icon :size="12" name="expand" /> - <span>{{ $options.i18n.showAll }}</span> - </button> - <button - type="button" - :disabled="!canExpandUp" - class="js-unfold gl-mx-2 gl-py-4 gl-cursor-pointer" - @click="handleExpandLines($options.EXPAND_UP)" - > - <gl-icon :size="12" name="expand-up" /> - <span>{{ $options.i18n.showMore }}</span> - </button> - </div> </template> diff --git a/app/assets/javascripts/diffs/components/diff_view.vue b/app/assets/javascripts/diffs/components/diff_view.vue index 529f8e0a2f9..d740d5adcb6 100644 --- a/app/assets/javascripts/diffs/components/diff_view.vue +++ b/app/assets/javascripts/diffs/components/diff_view.vue @@ -6,7 +6,6 @@ import DraftNote from '~/batch_comments/components/draft_note.vue'; import draftCommentsMixin from '~/diffs/mixins/draft_comments'; import { getCommentedLines } from '~/notes/components/multiline_comment_utils'; import { hide } from '~/tooltips'; -import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import { pickDirection } from '../utils/diff_line'; import DiffCommentCell from './diff_comment_cell.vue'; import DiffExpansionCell from './diff_expansion_cell.vue'; @@ -23,11 +22,7 @@ export default { directives: { SafeHtml, }, - mixins: [ - draftCommentsMixin, - glFeatureFlagsMixin(), - IdState({ idProp: (vm) => vm.diffFile.file_hash }), - ], + mixins: [draftCommentsMixin, IdState({ idProp: (vm) => vm.diffFile.file_hash })], props: { diffFile: { type: Object, @@ -171,7 +166,6 @@ export default { <template v-for="(line, index) in diffLines"> <template v-if="line.isMatchLineLeft || line.isMatchLineRight"> <diff-expansion-cell - v-if="glFeatures.updatedDiffExpansionButtons" :key="`expand-${index}`" :file="diffFile" :line="line.left" @@ -180,41 +174,6 @@ export default { :inline="inline" :line-count-between="getCountBetweenIndex(index)" /> - <template v-else> - <div :key="`expand-${index}`" class="diff-tr line_expansion old-line_expansion match"> - <div class="diff-td text-center gl-font-regular"> - <diff-expansion-cell - :file="diffFile" - :context-lines-path="diffFile.context_lines_path" - :line="line.left" - :is-top="index === 0" - :is-bottom="index + 1 === diffLinesLength" - :inline="inline" - /> - </div> - </div> - <div - v-if="line.left.rich_text" - :key="`expand-definition-${index}`" - class="diff-grid-row diff-tr line_holder match" - > - <div class="diff-grid-left diff-grid-3-col left-side"> - <div class="diff-td diff-line-num"></div> - <div v-if="inline" class="diff-td diff-line-num"></div> - <div - v-safe-html="line.left.rich_text" - class="diff-td line_content left-side gl-white-space-normal!" - ></div> - </div> - <div v-if="!inline" class="diff-grid-right diff-grid-3-col right-side"> - <div class="diff-td diff-line-num"></div> - <div - v-safe-html="line.left.rich_text" - class="diff-td line_content right-side gl-white-space-normal!" - ></div> - </div> - </div> - </template> </template> <diff-row v-if="!line.isMatchLineLeft && !line.isMatchLineRight" |