diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-03 18:11:31 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-03 18:11:31 +0300 |
commit | e6fa9529b4922a4c552e8908a2929ff995e8b53d (patch) | |
tree | 9ccfea4d253faa8c202f753631961a794af44ad6 /app | |
parent | 720cf698151643831bf36e3bd4ccd1c8e9246184 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
11 files changed, 56 insertions, 148 deletions
diff --git a/app/assets/javascripts/boards/components/board_content.vue b/app/assets/javascripts/boards/components/board_content.vue index d99afa8455d..0d2e49c966f 100644 --- a/app/assets/javascripts/boards/components/board_content.vue +++ b/app/assets/javascripts/boards/components/board_content.vue @@ -1,6 +1,6 @@ <script> import { GlAlert } from '@gitlab/ui'; -import { sortBy } from 'lodash'; +import { sortBy, throttle } from 'lodash'; import Draggable from 'vuedraggable'; import { mapState, mapGetters, mapActions } from 'vuex'; import BoardAddNewColumn from 'ee_else_ce/boards/components/board_add_new_column.vue'; @@ -26,6 +26,11 @@ export default { required: true, }, }, + data() { + return { + boardHeight: null, + }; + }, computed: { ...mapState(['boardLists', 'error', 'addColumnForm']), ...mapGetters(['isSwimlanesOn', 'isEpicBoard', 'isIssueBoard']), @@ -55,12 +60,28 @@ export default { return this.canDragColumns ? options : {}; }, }, + mounted() { + this.setBoardHeight(); + + this.resizeObserver = new ResizeObserver( + throttle(() => { + this.setBoardHeight(); + }, 150), + ); + this.resizeObserver.observe(document.body); + }, + unmounted() { + this.resizeObserver.disconnect(); + }, methods: { ...mapActions(['moveList', 'unsetError']), afterFormEnters() { const el = this.canDragColumns ? this.$refs.list.$el : this.$refs.list; el.scrollTo({ left: el.scrollWidth, behavior: 'smooth' }); }, + setBoardHeight() { + this.boardHeight = `${window.innerHeight - this.$el.getBoundingClientRect().top}px`; + }, }, }; </script> @@ -76,6 +97,7 @@ export default { ref="list" v-bind="draggableOptions" class="boards-list gl-w-full gl-py-5 gl-pr-3 gl-white-space-nowrap gl-overflow-x-scroll" + :style="{ height: boardHeight }" @end="moveList" > <board-column @@ -99,6 +121,7 @@ export default { :lists="boardListsToUse" :can-admin-list="canAdminList" :disabled="disabled" + :style="{ height: boardHeight }" /> <board-content-sidebar v-if="isIssueBoard" data-testid="issue-boards-sidebar" /> diff --git a/app/assets/javascripts/reports/codequality_report/grouped_codequality_reports_app.vue b/app/assets/javascripts/reports/codequality_report/grouped_codequality_reports_app.vue deleted file mode 100644 index 599e8d35708..00000000000 --- a/app/assets/javascripts/reports/codequality_report/grouped_codequality_reports_app.vue +++ /dev/null @@ -1,84 +0,0 @@ -<script> -import { mapState, mapActions, mapGetters } from 'vuex'; -import { s__, sprintf } from '~/locale'; -import { componentNames } from '~/reports/components/issue_body'; -import ReportSection from '~/reports/components/report_section.vue'; -import createStore from './store'; - -export default { - name: 'GroupedCodequalityReportsApp', - store: createStore(), - components: { - ReportSection, - }, - props: { - headBlobPath: { - type: String, - required: true, - }, - baseBlobPath: { - type: String, - required: false, - default: null, - }, - codequalityReportsPath: { - type: String, - required: false, - default: '', - }, - codequalityHelpPath: { - type: String, - required: true, - }, - }, - componentNames, - computed: { - ...mapState(['newIssues', 'resolvedIssues', 'hasError', 'statusReason']), - ...mapGetters([ - 'hasCodequalityIssues', - 'codequalityStatus', - 'codequalityText', - 'codequalityPopover', - ]), - }, - created() { - this.setPaths({ - baseBlobPath: this.baseBlobPath, - headBlobPath: this.headBlobPath, - reportsPath: this.codequalityReportsPath, - helpPath: this.codequalityHelpPath, - }); - - this.fetchReports(); - }, - methods: { - ...mapActions(['fetchReports', 'setPaths']), - }, - loadingText: sprintf(s__('ciReport|Loading %{reportName} report'), { - // eslint-disable-next-line @gitlab/require-i18n-strings - reportName: 'Code quality', - }), - errorText: sprintf(s__('ciReport|Failed to load %{reportName} report'), { - // eslint-disable-next-line @gitlab/require-i18n-strings - reportName: 'Code quality', - }), -}; -</script> -<template> - <report-section - :status="codequalityStatus" - :loading-text="$options.loadingText" - :error-text="$options.errorText" - :success-text="codequalityText" - :unresolved-issues="newIssues" - :resolved-issues="resolvedIssues" - :has-issues="hasCodequalityIssues" - :component="$options.componentNames.CodequalityIssueBody" - :popover-options="codequalityPopover" - :show-report-section-status-icon="false" - track-action="users_expanding_testing_code_quality_report" - class="js-codequality-widget mr-widget-border-top mr-report" - > - <template v-if="hasError" #sub-heading>{{ statusReason }}</template> - </report-section> -</template> diff --git a/app/assets/javascripts/vue_merge_request_widget/components/widget/widget.vue b/app/assets/javascripts/vue_merge_request_widget/components/widget/widget.vue index 94359d7d6ac..5111e2609e8 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/widget/widget.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/widget/widget.vue @@ -6,6 +6,7 @@ import { sprintf, __ } from '~/locale'; import Poll from '~/lib/utils/poll'; import ActionButtons from '../action_buttons.vue'; import { EXTENSION_ICONS } from '../../constants'; +import { createTelemetryHub } from '../extensions/telemetry'; import ContentRow from './widget_content_row.vue'; import DynamicContent from './dynamic_content.vue'; import StatusIcon from './status_icon.vue'; @@ -89,6 +90,11 @@ export default { type: String, required: true, }, + telemetry: { + type: Boolean, + required: false, + default: true, + }, }, data() { return { @@ -98,6 +104,7 @@ export default { isLoadingExpandedContent: false, summaryError: null, contentError: null, + telemetryHub: null, }; }, computed: { @@ -113,8 +120,14 @@ export default { this.$emit('is-loading', newValue); }, }, + created() { + if (this.telemetry) { + this.telemetryHub = createTelemetryHub(this.widgetName); + } + }, async mounted() { this.isLoading = true; + this.telemetryHub?.viewed(); try { await this.fetch(this.fetchCollapsedData, FETCH_TYPE_COLLAPSED); @@ -125,12 +138,21 @@ export default { this.isLoading = false; }, methods: { + onActionClick(action) { + if (action.fullReport) { + this.telemetryHub?.fullReportClicked(); + } + }, toggleCollapsed() { this.isCollapsed = !this.isCollapsed; - if (this.isExpandedForTheFirstTime && typeof this.fetchExpandedData === 'function') { - this.isExpandedForTheFirstTime = false; - this.fetchExpandedContent(); + if (this.isExpandedForTheFirstTime) { + this.telemetryHub?.expanded({ type: this.summaryStatusIcon }); + + if (typeof this.fetchExpandedData === 'function') { + this.isExpandedForTheFirstTime = false; + this.fetchExpandedContent(); + } } }, async fetchExpandedContent() { @@ -208,6 +230,7 @@ export default { v-if="actionButtons.length > 0" :widget="widgetName" :tertiary-buttons="actionButtons" + @clickedAction="onActionClick" /> <div v-if="isCollapsible" diff --git a/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue b/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue index 62ad22c637b..af0328edb23 100644 --- a/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue +++ b/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue @@ -82,8 +82,6 @@ export default { MrWidgetAutoMergeFailed: AutoMergeFailed, MrWidgetRebase: RebaseState, SourceBranchRemovalStatus, - GroupedCodequalityReportsApp: () => - import('../reports/codequality_report/grouped_codequality_reports_app.vue'), GroupedTestReportsApp: () => import('../reports/grouped_test_report/grouped_test_reports_app.vue'), MrWidgetApprovals, @@ -218,9 +216,6 @@ export default { shouldShowSecurityExtension() { return window.gon?.features?.refactorSecurityExtension; }, - shouldShowCodeQualityExtension() { - return window.gon?.features?.refactorCodeQualityExtension; - }, shouldShowMergeDetails() { if (this.mr.state === 'readyToMerge') return true; @@ -519,7 +514,7 @@ export default { } }, registerCodeQualityExtension() { - if (this.shouldRenderCodeQuality && this.shouldShowCodeQualityExtension) { + if (this.shouldRenderCodeQuality) { registerExtension(codeQualityExtension); } }, @@ -592,14 +587,6 @@ export default { <widget-container v-if="mr" :mr="mr" /> - <grouped-codequality-reports-app - v-if="shouldRenderCodeQuality && !shouldShowCodeQualityExtension" - :head-blob-path="mr.headBlobPath" - :base-blob-path="mr.baseBlobPath" - :codequality-reports-path="mr.codequalityReportsPath" - :codequality-help-path="mr.codequalityHelpPath" - /> - <security-reports-app v-if="shouldRenderSecurityReport && !shouldShowSecurityExtension" :pipeline-id="mr.pipeline.id" diff --git a/app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js b/app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js index 731d3886f61..9221b87014b 100644 --- a/app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js +++ b/app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js @@ -299,7 +299,6 @@ export default class MergeRequestStore { this.headBlobPath = blobPath.head_path || ''; this.baseBlobPath = blobPath.base_path || ''; this.codequalityReportsPath = data.codequality_reports_path; - this.codequalityHelpPath = data.codequality_help_path; // Security reports this.sastComparisonPath = data.sast_comparison_path; diff --git a/app/assets/stylesheets/framework/variables.scss b/app/assets/stylesheets/framework/variables.scss index 95e03abbb48..0f2a818d582 100644 --- a/app/assets/stylesheets/framework/variables.scss +++ b/app/assets/stylesheets/framework/variables.scss @@ -674,18 +674,7 @@ $ci-skipped-color: #888; */ $issue-boards-font-size: 14px; $issue-boards-card-shadow: rgba(0, 0, 0, 0.1); -/* - The following heights are used in boards.scss and are used for calculation of the board height. - They probably should be derived in a smarter way. -*/ $issue-boards-filter-height: 68px; -$issue-boards-filter-height-md: 110px; -$issue-boards-filter-height-sm: 299px; -$issue-boards-breadcrumbs-height-xs: 63px; -$issue-board-list-difference-xs: calc(#{$header-height} + #{$issue-boards-breadcrumbs-height-xs}); -$issue-board-list-difference-sm: calc(#{$header-height} + #{$breadcrumb-min-height}); -$issue-board-list-difference-md: calc(#{$issue-board-list-difference-sm} + #{$issue-boards-filter-height-md}); -$issue-board-list-difference-lg: calc(#{$issue-board-list-difference-sm} + #{$issue-boards-filter-height}); /* The following heights are used in environment_logs.scss and are used for calculation of the log viewer height. */ diff --git a/app/assets/stylesheets/page_bundles/boards.scss b/app/assets/stylesheets/page_bundles/boards.scss index d45bc865da5..0cc1fb40e4a 100644 --- a/app/assets/stylesheets/page_bundles/boards.scss +++ b/app/assets/stylesheets/page_bundles/boards.scss @@ -18,38 +18,9 @@ .boards-list, .board-swimlanes { - height: calc(100vh - #{$issue-board-list-difference-xs}); overflow-x: scroll; min-height: 200px; border-left: 8px solid var(--gray-10, $white); - - @include media-breakpoint-only(sm) { - height: calc(100vh - #{$issue-board-list-difference-sm}); - } - - @include media-breakpoint-up(md) { - height: calc(100vh - #{$issue-board-list-difference-md}); - } - - @include media-breakpoint-up(lg) { - height: calc(100vh - #{$issue-board-list-difference-lg}); - } - - .with-performance-bar & { - height: calc(100vh - #{$issue-board-list-difference-xs} - #{$performance-bar-height}); - - @include media-breakpoint-only(sm) { - height: calc(100vh - #{$issue-board-list-difference-sm} - #{$performance-bar-height}); - } - - @include media-breakpoint-up(md) { - height: calc(100vh - #{$issue-board-list-difference-md} - #{$performance-bar-height}); - } - - @include media-breakpoint-up(lg) { - height: calc(100vh - #{$issue-board-list-difference-lg} - #{$performance-bar-height}); - } - } } .board { diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb index 3251b1483c3..cfc565a8b56 100644 --- a/app/controllers/projects/merge_requests_controller.rb +++ b/app/controllers/projects/merge_requests_controller.rb @@ -34,7 +34,6 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo before_action only: [:show] do push_frontend_feature_flag(:merge_request_widget_graphql, project) push_frontend_feature_flag(:core_security_mr_widget_counts, project) - push_frontend_feature_flag(:refactor_code_quality_extension, project) push_frontend_feature_flag(:refactor_mr_widget_test_summary, project) push_frontend_feature_flag(:issue_assignees_widget, @project) push_frontend_feature_flag(:realtime_labels, project) diff --git a/app/models/concerns/pg_full_text_searchable.rb b/app/models/concerns/pg_full_text_searchable.rb index f533791c2ee..562c8cf23f3 100644 --- a/app/models/concerns/pg_full_text_searchable.rb +++ b/app/models/concerns/pg_full_text_searchable.rb @@ -25,7 +25,7 @@ module PgFullTextSearchable TSVECTOR_MAX_LENGTH = 1.megabyte.freeze TEXT_SEARCH_DICTIONARY = 'english' URL_SCHEME_REGEX = %r{(?<=\A|\W)\w+://(?=\w+)}.freeze - TSQUERY_DISALLOWED_CHARACTERS_REGEX = %r{[^a-zA-Z0-9 .@/\-"]}.freeze + TSQUERY_DISALLOWED_CHARACTERS_REGEX = %r{[^a-zA-Z0-9 .@/\-_"]}.freeze def update_search_data! tsvector_sql_nodes = self.class.pg_full_text_searchable_columns.map do |column, weight| diff --git a/app/services/groups/update_service.rb b/app/services/groups/update_service.rb index 2135892a95a..925a2acbb58 100644 --- a/app/services/groups/update_service.rb +++ b/app/services/groups/update_service.rb @@ -10,6 +10,8 @@ module Groups reject_parent_id! remove_unallowed_params + before_assignment_hook(group, params) + if renaming_group_with_container_registry_images? group.errors.add(:base, container_images_error) return false @@ -25,8 +27,6 @@ module Groups handle_changes - before_assignment_hook(group, params) - handle_namespace_settings group.assign_attributes(params) diff --git a/app/services/incident_management/timeline_events/create_service.rb b/app/services/incident_management/timeline_events/create_service.rb index c625b0d15bd..ef6f48bd741 100644 --- a/app/services/incident_management/timeline_events/create_service.rb +++ b/app/services/incident_management/timeline_events/create_service.rb @@ -52,7 +52,8 @@ module IncidentManagement def change_severity(incident, user) return if Feature.disabled?(:incident_timeline_events_for_severity, incident.project) - note = "@#{user.username} changed the incident severity to **#{incident.severity.humanize}**" + severity_label = IssuableSeverity::SEVERITY_LABELS[incident.severity.to_sym] + note = "@#{user.username} changed the incident severity to **#{severity_label}**" occurred_at = incident.updated_at action = 'severity' |