diff options
Diffstat (limited to 'app/assets/javascripts/diffs/components')
7 files changed, 5 insertions, 206 deletions
diff --git a/app/assets/javascripts/diffs/components/app.vue b/app/assets/javascripts/diffs/components/app.vue index 978e6731e9d..50266e2c434 100644 --- a/app/assets/javascripts/diffs/components/app.vue +++ b/app/assets/javascripts/diffs/components/app.vue @@ -171,14 +171,10 @@ export default { return true; } - return ( - !this.sastReportsInInlineDiff || - (!this.codequalityReportAvailable && !this.sastReportAvailable) - ); + return !this.codequalityReportAvailable && !this.sastReportAvailable; }, update(data) { const { codequalityReportsComparer, sastReport } = data?.project?.mergeRequest || {}; - this.activeProject = data?.project?.mergeRequest?.project; if ( (sastReport?.status === FINDINGS_STATUS_PARSED || !this.sastReportAvailable) && @@ -307,9 +303,6 @@ export default { resourceId() { return convertToGraphQLId('MergeRequest', this.getNoteableData.id); }, - sastReportsInInlineDiff() { - return this.glFeatures.sastReportsInInlineDiff; - }, }, watch: { commit(newCommit, oldCommit) { @@ -347,10 +340,6 @@ export default { isLoading: 'adjustView', }, mounted() { - if (this.endpointCodequality) { - this.setCodequalityEndpoint(this.endpointCodequality); - } - if (this.shouldShow) { this.fetchData(); } @@ -423,14 +412,12 @@ export default { ...mapActions(['startTaskList']), ...mapActions('diffs', [ 'moveToNeighboringCommit', - 'setCodequalityEndpoint', 'fetchDiffFilesMeta', 'fetchDiffFilesBatch', 'fetchFileByFile', 'loadCollapsedDiff', 'setFileForcedOpen', 'fetchCoverageFiles', - 'fetchCodequality', 'rereadNoteHash', 'startRenderDiffsQueue', 'assignDiscussionsToDiff', @@ -576,10 +563,6 @@ export default { this.fetchCoverageFiles(); } - if (this.endpointCodequality && !this.sastReportsInInlineDiff) { - this.fetchCodequality(); - } - if (!this.isNotesFetched) { notesEventHub.$emit('fetchNotesData'); } diff --git a/app/assets/javascripts/diffs/components/diff_inline_findings.vue b/app/assets/javascripts/diffs/components/diff_inline_findings.vue deleted file mode 100644 index 59f92040776..00000000000 --- a/app/assets/javascripts/diffs/components/diff_inline_findings.vue +++ /dev/null @@ -1,32 +0,0 @@ -<script> -import DiffInlineFindingsItem from './diff_inline_findings_item.vue'; - -export default { - components: { DiffInlineFindingsItem }, - props: { - title: { - type: String, - required: true, - }, - findings: { - type: Array, - required: true, - }, - }, -}; -</script> - -<template> - <div> - <h4 data-testid="diff-inline-findings-heading" class="gl-my-0 gl-font-base gl-font-regular"> - {{ title }} - </h4> - <ul class="gl-list-style-none gl-mb-0 gl-p-0"> - <diff-inline-findings-item - v-for="finding in findings" - :key="finding.description" - :finding="finding" - /> - </ul> - </div> -</template> diff --git a/app/assets/javascripts/diffs/components/diff_inline_findings_item.vue b/app/assets/javascripts/diffs/components/diff_inline_findings_item.vue deleted file mode 100644 index 8a30d6ee7f8..00000000000 --- a/app/assets/javascripts/diffs/components/diff_inline_findings_item.vue +++ /dev/null @@ -1,39 +0,0 @@ -<script> -import { GlIcon } from '@gitlab/ui'; -import { getSeverity } from '~/ci/reports/utils'; - -export default { - components: { GlIcon }, - - props: { - finding: { - type: Object, - required: true, - }, - }, - computed: { - enhancedFinding() { - return getSeverity(this.finding); - }, - listText() { - return `${this.finding.severity} - ${this.finding.description}`; - }, - }, -}; -</script> - -<template> - <li class="gl-py-1 gl-font-regular gl-display-flex"> - <span class="gl-mr-3"> - <gl-icon - :size="12" - :name="enhancedFinding.name" - :class="enhancedFinding.class" - class="inline-findings-severity-icon" - /> - </span> - <span data-testid="description-plain-text" class="gl-display-flex"> - {{ listText }} - </span> - </li> -</template> diff --git a/app/assets/javascripts/diffs/components/diff_line.vue b/app/assets/javascripts/diffs/components/diff_line.vue deleted file mode 100644 index 4867a21493f..00000000000 --- a/app/assets/javascripts/diffs/components/diff_line.vue +++ /dev/null @@ -1,32 +0,0 @@ -<script> -import InlineFindings from './inline_findings.vue'; - -export default { - components: { - InlineFindings, - }, - props: { - line: { - type: Object, - required: true, - }, - }, - computed: { - parsedCodeQuality() { - return (this.line.left ?? this.line.right)?.codequality; - }, - codeQualityLineNumber() { - return this.parsedCodeQuality[0]?.line; - }, - }, - methods: { - hideInlineFindings() { - this.$emit('hideInlineFindings', this.codeQualityLineNumber); - }, - }, -}; -</script> - -<template> - <inline-findings :code-quality="parsedCodeQuality" @hideInlineFindings="hideInlineFindings" /> -</template> diff --git a/app/assets/javascripts/diffs/components/diff_row.vue b/app/assets/javascripts/diffs/components/diff_row.vue index a9da77104d4..58049929ac8 100644 --- a/app/assets/javascripts/diffs/components/diff_row.vue +++ b/app/assets/javascripts/diffs/components/diff_row.vue @@ -24,8 +24,8 @@ import * as utils from './diff_row_utils'; export default { DiffGutterAvatars, - InlineFindingsFlagSwitcher: () => - import('ee_component/diffs/components/inline_findings_flag_switcher.vue'), + InlineFindingsGutterIconDropdown: () => + import('ee_component/diffs/components/inline_findings_gutter_icon_dropdown.vue'), // Temporary mixin for migration from Vue.js 2 to @vue/compat mixins: [compatFunctionalMixin], @@ -80,11 +80,6 @@ export default { type: Function, required: true, }, - inlineFindingsExpanded: { - type: Boolean, - required: false, - default: false, - }, }, classNameMap: memoize( (props) => { @@ -336,9 +331,8 @@ export default { :class="$options.parallelViewLeftLineType(props)" > <component - :is="$options.InlineFindingsFlagSwitcher" + :is="$options.InlineFindingsGutterIconDropdown" v-if="$options.showCodequalityLeft(props) || $options.showSecurityLeft(props)" - :inline-findings-expanded="props.inlineFindingsExpanded" :code-quality="props.line.left.codequality" :sast="props.line.left.sast" :file-path="props.filePath" @@ -478,7 +472,7 @@ export default { :class="$options.classNameMapCellRight(props)" > <component - :is="$options.InlineFindingsFlagSwitcher" + :is="$options.InlineFindingsGutterIconDropdown" v-if="$options.showCodequalityRight(props) || $options.showSecurityRight(props)" :code-quality="props.line.right.codequality" :sast="props.line.right.sast" diff --git a/app/assets/javascripts/diffs/components/diff_view.vue b/app/assets/javascripts/diffs/components/diff_view.vue index 641616a34f5..83984cdf0d0 100644 --- a/app/assets/javascripts/diffs/components/diff_view.vue +++ b/app/assets/javascripts/diffs/components/diff_view.vue @@ -10,7 +10,6 @@ import { getCommentedLines } from '~/notes/components/multiline_comment_utils'; import { hide } from '~/tooltips'; import { pickDirection } from '../utils/diff_line'; import DiffCommentCell from './diff_comment_cell.vue'; -import DiffLine from './diff_line.vue'; import DiffExpansionCell from './diff_expansion_cell.vue'; import DiffRow from './diff_row.vue'; import { isHighlighted } from './diff_row_utils'; @@ -19,7 +18,6 @@ export default { components: { DiffExpansionCell, DiffRow, - DiffLine, DiffCommentCell, DraftNote, }, @@ -48,11 +46,6 @@ export default { default: false, }, }, - data() { - return { - inlineFindingsExpandedLines: [], - }; - }, idState() { return { dragStart: null, @@ -87,9 +80,6 @@ export default { this.sastDiff?.added?.length > 0 ); }, - sastReportsInInlineDiff() { - return this.glFeatures.sastReportsInInlineDiff; - }, }, created() { this.onDragOverThrottled = throttle((line) => this.onDragOver(line), 100, { leading: true }); @@ -109,19 +99,6 @@ export default { } this.idState.dragStart = line; }, - hideInlineFindings(line) { - const index = this.inlineFindingsExpandedLines.indexOf(line); - if (index > -1) { - this.inlineFindingsExpandedLines.splice(index, 1); - } - }, - toggleCodeQualityFindings(line) { - if (!this.inlineFindingsExpandedLines.includes(line)) { - this.inlineFindingsExpandedLines.push(line); - } else { - this.hideInlineFindings(line); - } - }, onDragOver(line) { if (line.chunk !== this.idState.dragStart.chunk) return; @@ -266,12 +243,10 @@ export default { :is-last-highlighted-line="isLastHighlightedLine(line) || index === commentedLines.endLine" :inline="inline" :index="index" - :inline-findings-expanded="inlineFindingsExpandedLines.includes(getCodeQualityLine(line))" :file-line-coverage="fileLineCoverage" :coverage-loaded="coverageLoaded" @showCommentForm="(code) => singleLineComment(code, line)" @setHighlightedRow="setHighlightedRow" - @toggleCodeQualityFindings="toggleCodeQualityFindings" @toggleLineDiscussions=" ({ lineCode, expanded }) => toggleLineDiscussions({ lineCode, fileHash: diffFile.file_hash, expanded }) @@ -280,15 +255,6 @@ export default { @startdragging="onStartDragging" @stopdragging="onStopDragging" /> - <!-- Don't display InlineFindings expanded section when sastReportsInInlineDiff is false --> - <diff-line - v-if=" - inlineFindingsExpandedLines.includes(getCodeQualityLine(line)) && !sastReportsInInlineDiff - " - :key="line.line_code" - :line="line" - @hideInlineFindings="hideInlineFindings" - /> <div v-if="line.renderCommentRow" :key="`dcr-${line.line_code || index}`" diff --git a/app/assets/javascripts/diffs/components/inline_findings.vue b/app/assets/javascripts/diffs/components/inline_findings.vue deleted file mode 100644 index efceedd1141..00000000000 --- a/app/assets/javascripts/diffs/components/inline_findings.vue +++ /dev/null @@ -1,41 +0,0 @@ -<script> -import { GlButton } from '@gitlab/ui'; -import { NEW_CODE_QUALITY_FINDINGS, NEW_SAST_FINDINGS } from '../i18n'; -import DiffInlineFindings from './diff_inline_findings.vue'; - -export default { - i18n: { - newCodeQualityFindings: NEW_CODE_QUALITY_FINDINGS, - newSastFindings: NEW_SAST_FINDINGS, - }, - components: { GlButton, DiffInlineFindings }, - props: { - codeQuality: { - type: Array, - required: true, - }, - }, -}; -</script> - -<template> - <div - data-testid="inline-findings" - class="gl-relative inline-findings-list gl-border-top-1 gl-border-bottom-1 gl-bg-gray-10 gl-text-black-normal gl-pl-5 gl-pt-4 gl-pb-4" - > - <diff-inline-findings - v-if="codeQuality.length" - :title="$options.i18n.newCodeQualityFindings" - :findings="codeQuality" - /> - - <gl-button - data-testid="inline-findings-close" - category="tertiary" - size="small" - icon="close" - class="gl-absolute gl-right-2 gl-top-2" - @click="$emit('hideInlineFindings')" - /> - </div> -</template> |