diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-15 18:07:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-15 18:07:42 +0300 |
commit | fa7c331b76ed59230cc56fc51bfc9e467c8bb9b4 (patch) | |
tree | eb03d2b6e8dd45f67864635c8b0b0de8d671edf7 /app/assets/javascripts | |
parent | f26f31d2fd8e3c91677e2629293b9e0562c1437a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts')
13 files changed, 89 insertions, 36 deletions
diff --git a/app/assets/javascripts/issues/constants.js b/app/assets/javascripts/issues/constants.js index 10d1a2d0dbf..ba05dd731f7 100644 --- a/app/assets/javascripts/issues/constants.js +++ b/app/assets/javascripts/issues/constants.js @@ -6,6 +6,7 @@ export const STATUS_REOPENED = 'reopened'; export const TITLE_LENGTH_MAX = 255; +export const TYPE_EPIC = 'epic'; export const TYPE_ISSUE = 'issue'; export const IssuableStatusText = { diff --git a/app/assets/javascripts/issues/show/components/app.vue b/app/assets/javascripts/issues/show/components/app.vue index a0db1ddcf6f..decb559ee81 100644 --- a/app/assets/javascripts/issues/show/components/app.vue +++ b/app/assets/javascripts/issues/show/components/app.vue @@ -4,8 +4,8 @@ import Visibility from 'visibilityjs'; import { createAlert } from '~/flash'; import { IssuableStatusText, - IssuableType, STATUS_CLOSED, + TYPE_EPIC, TYPE_ISSUE, WorkspaceType, } from '~/issues/constants'; @@ -277,7 +277,7 @@ export default { return IssuableStatusText[this.issuableStatus]; }, shouldShowStickyHeader() { - return [TYPE_ISSUE, IssuableType.Epic].includes(this.issuableType); + return [TYPE_ISSUE, TYPE_EPIC].includes(this.issuableType); }, }, created() { diff --git a/app/assets/javascripts/notes/components/sidebar_subscription.vue b/app/assets/javascripts/notes/components/sidebar_subscription.vue index a33f4364097..2a0a3d5414f 100644 --- a/app/assets/javascripts/notes/components/sidebar_subscription.vue +++ b/app/assets/javascripts/notes/components/sidebar_subscription.vue @@ -1,6 +1,6 @@ <script> import { mapActions } from 'vuex'; -import { IssuableType, TYPE_ISSUE } from '~/issues/constants'; +import { TYPE_EPIC, TYPE_ISSUE } from '~/issues/constants'; import { fetchPolicies } from '~/lib/graphql'; import { confidentialityQueries } from '~/sidebar/constants'; import { defaultClient as gqlClient } from '~/graphql_shared/issuable_client'; @@ -28,7 +28,7 @@ export default { }, }, created() { - if (this.issuableType !== TYPE_ISSUE && this.issuableType !== IssuableType.Epic) { + if (this.issuableType !== TYPE_ISSUE && this.issuableType !== TYPE_EPIC) { return; } diff --git a/app/assets/javascripts/pipelines/components/parsing_utils.js b/app/assets/javascripts/pipelines/components/parsing_utils.js index 83ba984ce07..e158f8809b5 100644 --- a/app/assets/javascripts/pipelines/components/parsing_utils.js +++ b/app/assets/javascripts/pipelines/components/parsing_utils.js @@ -171,11 +171,12 @@ export const generateColumnsFromLayersListBare = ({ stages, stagesLookup }, pipe export const generateColumnsFromLayersListMemoized = memoize(generateColumnsFromLayersListBare); -// TODO: handle REST / MR values -// See https://gitlab.com/gitlab-org/gitlab/-/issues/367547 export const keepLatestDownstreamPipelines = (downstreamPipelines = []) => { - // handles GraphQL return downstreamPipelines.filter((pipeline) => { + if (pipeline.source_job) { + return !pipeline?.source_job?.retried || false; + } + return !pipeline?.sourceJob?.retried || false; }); }; diff --git a/app/assets/javascripts/pipelines/components/pipelines_list/pipelines_table.vue b/app/assets/javascripts/pipelines/components/pipelines_list/pipelines_table.vue index ed32d643c0e..365572f194b 100644 --- a/app/assets/javascripts/pipelines/components/pipelines_list/pipelines_table.vue +++ b/app/assets/javascripts/pipelines/components/pipelines_list/pipelines_table.vue @@ -2,6 +2,7 @@ import { GlTableLite, GlTooltipDirective } from '@gitlab/ui'; import { s__, __ } from '~/locale'; import Tracking from '~/tracking'; +import { keepLatestDownstreamPipelines } from '~/pipelines/components/parsing_utils'; import PipelineMiniGraph from '~/pipelines/components/pipeline_mini_graph/pipeline_mini_graph.vue'; import eventHub from '../../event_hub'; import { TRACKING_CATEGORIES } from '../../constants'; @@ -115,6 +116,10 @@ export default { eventHub.$off('openConfirmationModal', this.setModalData); }, methods: { + getDownstreamPipelines(pipeline) { + const downstream = pipeline.triggered; + return keepLatestDownstreamPipelines(downstream); + }, setModalData(data) { this.pipelineId = data.pipeline.id; this.pipeline = data.pipeline; @@ -171,7 +176,7 @@ export default { <template #cell(stages)="{ item }"> <pipeline-mini-graph - :downstream-pipelines="item.triggered" + :downstream-pipelines="getDownstreamPipelines(item)" :pipeline-path="item.path" :stages="item.details.stages" :update-dropdown="updateGraphDropdown" diff --git a/app/assets/javascripts/sidebar/components/confidential/sidebar_confidentiality_content.vue b/app/assets/javascripts/sidebar/components/confidential/sidebar_confidentiality_content.vue index 6afaee91d7a..1eeb725d5c9 100644 --- a/app/assets/javascripts/sidebar/components/confidential/sidebar_confidentiality_content.vue +++ b/app/assets/javascripts/sidebar/components/confidential/sidebar_confidentiality_content.vue @@ -1,7 +1,7 @@ <script> import { GlIcon, GlAlert, GlTooltipDirective } from '@gitlab/ui'; import { __ } from '~/locale'; -import { IssuableType, WorkspaceType } from '~/issues/constants'; +import { TYPE_EPIC, WorkspaceType } from '~/issues/constants'; import { confidentialityInfoText } from '~/vue_shared/constants'; export default { @@ -25,7 +25,7 @@ export default { computed: { confidentialBodyText() { return confidentialityInfoText( - this.issuableType === IssuableType.Epic ? WorkspaceType.group : WorkspaceType.project, + this.issuableType === TYPE_EPIC ? WorkspaceType.group : WorkspaceType.project, this.issuableType, ); }, diff --git a/app/assets/javascripts/sidebar/components/labels/labels_select_widget/labels_select_root.vue b/app/assets/javascripts/sidebar/components/labels/labels_select_widget/labels_select_root.vue index 60361b7de67..bf916e26a15 100644 --- a/app/assets/javascripts/sidebar/components/labels/labels_select_widget/labels_select_root.vue +++ b/app/assets/javascripts/sidebar/components/labels/labels_select_widget/labels_select_root.vue @@ -4,7 +4,7 @@ import issuableLabelsSubscription from 'ee_else_ce/sidebar/queries/issuable_labe import { MutationOperationMode, getIdFromGraphQLId } from '~/graphql_shared/utils'; import { createAlert } from '~/flash'; import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; -import { IssuableType, TYPE_ISSUE } from '~/issues/constants'; +import { IssuableType, TYPE_EPIC, TYPE_ISSUE } from '~/issues/constants'; import { __ } from '~/locale'; import { issuableLabelsQueries } from '../../../constants'; @@ -269,7 +269,7 @@ export default { ...updateVariables, operationMode: MutationOperationMode.Replace, }; - case IssuableType.Epic: + case TYPE_EPIC: return { iid: currentIid, groupPath: this.fullPath, @@ -330,7 +330,7 @@ export default { labelIds: [labelId], operationMode: MutationOperationMode.Remove, }; - case IssuableType.Epic: + case TYPE_EPIC: return { iid: this.iid, removeLabelIds: [getIdFromGraphQLId(labelId)], diff --git a/app/assets/javascripts/sidebar/components/sidebar_dropdown.vue b/app/assets/javascripts/sidebar/components/sidebar_dropdown.vue index eaf87e4d4e0..d68e4974ea4 100644 --- a/app/assets/javascripts/sidebar/components/sidebar_dropdown.vue +++ b/app/assets/javascripts/sidebar/components/sidebar_dropdown.vue @@ -8,7 +8,7 @@ import { GlSearchBoxByType, } from '@gitlab/ui'; import { kebabCase, snakeCase } from 'lodash'; -import { IssuableType, TYPE_ISSUE, WorkspaceType } from '~/issues/constants'; +import { IssuableType, TYPE_EPIC, TYPE_ISSUE, WorkspaceType } from '~/issues/constants'; import { __ } from '~/locale'; import { defaultEpicSort, @@ -155,7 +155,7 @@ export default { }, isEpic() { // MV to EE https://gitlab.com/gitlab-org/gitlab/-/issues/345311 - return this.issuableAttribute === IssuableType.Epic; + return this.issuableAttribute === TYPE_EPIC; }, issuableAttributeQuery() { return this.issuableAttributesQueries[this.issuableAttribute]; diff --git a/app/assets/javascripts/sidebar/components/sidebar_dropdown_widget.vue b/app/assets/javascripts/sidebar/components/sidebar_dropdown_widget.vue index 994b96b7f30..5df65c4aaaf 100644 --- a/app/assets/javascripts/sidebar/components/sidebar_dropdown_widget.vue +++ b/app/assets/javascripts/sidebar/components/sidebar_dropdown_widget.vue @@ -3,7 +3,7 @@ import { GlButton, GlIcon, GlLink, GlPopover, GlTooltipDirective } from '@gitlab import { kebabCase, snakeCase } from 'lodash'; import { createAlert } from '~/flash'; import { getIdFromGraphQLId } from '~/graphql_shared/utils'; -import { IssuableType, TYPE_ISSUE } from '~/issues/constants'; +import { IssuableType, TYPE_EPIC, TYPE_ISSUE } from '~/issues/constants'; import { timeFor } from '~/lib/utils/datetime_utility'; import { __ } from '~/locale'; import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; @@ -153,7 +153,7 @@ export default { }, isEpic() { // MV to EE https://gitlab.com/gitlab-org/gitlab/-/issues/345311 - return this.issuableAttribute === IssuableType.Epic; + return this.issuableAttribute === TYPE_EPIC; }, formatIssuableAttribute() { return { diff --git a/app/assets/javascripts/sidebar/components/subscriptions/sidebar_subscriptions_widget.vue b/app/assets/javascripts/sidebar/components/subscriptions/sidebar_subscriptions_widget.vue index 0fba1cb5e4e..cbe839d1112 100644 --- a/app/assets/javascripts/sidebar/components/subscriptions/sidebar_subscriptions_widget.vue +++ b/app/assets/javascripts/sidebar/components/subscriptions/sidebar_subscriptions_widget.vue @@ -1,7 +1,7 @@ <script> import { GlDropdownForm, GlIcon, GlLoadingIcon, GlToggle, GlTooltipDirective } from '@gitlab/ui'; import { createAlert } from '~/flash'; -import { IssuableType } from '~/issues/constants'; +import { IssuableType, TYPE_EPIC } from '~/issues/constants'; import { isLoggedIn } from '~/lib/utils/common_utils'; import { __, sprintf } from '~/locale'; import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; @@ -105,7 +105,7 @@ export default { return ICON_ON; }, parentIsGroup() { - return this.issuableType === IssuableType.Epic; + return this.issuableType === TYPE_EPIC; }, subscribeDisabledDescription() { return sprintf(__('Disabled by %{parent} owner'), { diff --git a/app/assets/javascripts/sidebar/constants.js b/app/assets/javascripts/sidebar/constants.js index b2d6a111a0e..14491226b15 100644 --- a/app/assets/javascripts/sidebar/constants.js +++ b/app/assets/javascripts/sidebar/constants.js @@ -3,7 +3,7 @@ import { s__, __, sprintf } from '~/locale'; import updateIssueLabelsMutation from '~/boards/graphql/issue_set_labels.mutation.graphql'; import userSearchQuery from '~/graphql_shared/queries/users_search.query.graphql'; import userSearchWithMRPermissionsQuery from '~/graphql_shared/queries/users_search_with_mr_permissions.graphql'; -import { IssuableType, TYPE_ISSUE, WorkspaceType } from '~/issues/constants'; +import { IssuableType, TYPE_EPIC, TYPE_ISSUE, WorkspaceType } from '~/issues/constants'; import updateAlertAssigneesMutation from '~/vue_shared/alert_details/graphql/mutations/alert_set_assignees.mutation.graphql'; import updateTestCaseLabelsMutation from './components/labels/labels_select_widget/graphql/update_test_case_labels.mutation.graphql'; import epicLabelsQuery from './components/labels/labels_select_widget/graphql/epic_labels.query.graphql'; @@ -86,7 +86,7 @@ export const participantsQueries = { [IssuableType.MergeRequest]: { query: getMergeRequestParticipants, }, - [IssuableType.Epic]: { + [TYPE_EPIC]: { query: epicParticipantsQuery, }, [IssuableType.Alert]: { @@ -109,7 +109,7 @@ export const confidentialityQueries = { query: issueConfidentialQuery, mutation: updateIssueConfidentialMutation, }, - [IssuableType.Epic]: { + [TYPE_EPIC]: { query: epicConfidentialQuery, mutation: updateEpicConfidentialMutation, }, @@ -122,7 +122,7 @@ export const referenceQueries = { [IssuableType.MergeRequest]: { query: mergeRequestReferenceQuery, }, - [IssuableType.Epic]: { + [TYPE_EPIC]: { query: epicReferenceQuery, }, }; @@ -147,7 +147,7 @@ export const issuableLabelsQueries = { mutation: updateMergeRequestLabelsMutation, mutationName: 'mergeRequestSetLabels', }, - [IssuableType.Epic]: { + [TYPE_EPIC]: { issuableQuery: epicLabelsQuery, mutation: updateEpicLabelsMutation, mutationName: 'updateEpic', @@ -182,7 +182,7 @@ export const subscribedQueries = { query: issueSubscribedQuery, mutation: updateIssueSubscriptionMutation, }, - [IssuableType.Epic]: { + [TYPE_EPIC]: { query: epicSubscribedQuery, mutation: updateEpicSubscriptionMutation, }, @@ -211,14 +211,14 @@ export const dueDateQueries = { query: issueDueDateQuery, mutation: updateIssueDueDateMutation, }, - [IssuableType.Epic]: { + [TYPE_EPIC]: { query: epicDueDateQuery, mutation: updateEpicDueDateMutation, }, }; export const startDateQueries = { - [IssuableType.Epic]: { + [TYPE_EPIC]: { query: epicStartDateQuery, mutation: updateEpicStartDateMutation, }, @@ -283,7 +283,7 @@ export const issuableAttributesQueries = { }; export const todoQueries = { - [IssuableType.Epic]: { + [TYPE_EPIC]: { query: epicTodoQuery, }, [TYPE_ISSUE]: { diff --git a/app/assets/javascripts/super_sidebar/components/help_center.vue b/app/assets/javascripts/super_sidebar/components/help_center.vue index ed4b0d4772e..8e7c7efa631 100644 --- a/app/assets/javascripts/super_sidebar/components/help_center.vue +++ b/app/assets/javascripts/super_sidebar/components/help_center.vue @@ -1,5 +1,6 @@ <script> import { GlBadge, GlButton, GlDisclosureDropdown, GlDisclosureDropdownGroup } from '@gitlab/ui'; +import GitlabVersionCheckBadge from '~/gitlab_version_check/components/gitlab_version_check_badge.vue'; import { helpPagePath } from '~/helpers/help_page_helper'; import { PROMO_URL } from 'jh_else_ce/lib/utils/url_utility'; import { __ } from '~/locale'; @@ -11,6 +12,7 @@ export default { GlButton, GlDisclosureDropdown, GlDisclosureDropdownGroup, + GitlabVersionCheckBadge, }, i18n: { help: __('Help'), @@ -21,6 +23,7 @@ export default { contribute: __('Contribute to GitLab'), feedback: __('Provide feedback'), shortcuts: __('Keyboard shortcuts'), + version: __('Your GitLab version'), whatsnew: __("What's new"), }, props: { @@ -35,9 +38,18 @@ export default { }; }, computed: { - items() { - return [ - { + itemGroups() { + return { + versionCheck: { + items: [ + { + text: this.$options.i18n.version, + href: helpPagePath('update/index'), + version: `${this.sidebarData.gitlab_version.major}.${this.sidebarData.gitlab_version.minor}`, + }, + ], + }, + helpLinks: { items: [ { text: this.$options.i18n.help, href: helpPagePath() }, { text: this.$options.i18n.support, href: this.sidebarData.support_path }, @@ -51,7 +63,7 @@ export default { { text: this.$options.i18n.feedback, href: 'https://about.gitlab.com/submit-feedback' }, ], }, - { + helpActions: { items: [ { text: this.$options.i18n.shortcuts, @@ -67,7 +79,10 @@ export default { }, ].filter(Boolean), }, - ]; + }; + }, + updateSeverity() { + return this.sidebarData.gitlab_version_check?.severity; }, }, methods: { @@ -120,8 +135,34 @@ export default { </gl-button> </template> - <gl-disclosure-dropdown-group :group="items[0]" /> - <gl-disclosure-dropdown-group :group="items[1]" bordered @action="handleAction"> + <gl-disclosure-dropdown-group + v-if="sidebarData.show_version_check" + :group="itemGroups.versionCheck" + > + <template #list-item="{ item }"> + <a + :href="item.href" + tabindex="-1" + class="gl-display-flex gl-flex-direction-column gl-line-height-24 gl-text-gray-900 gl-hover-text-gray-900 gl-hover-text-decoration-none" + > + <span class="gl-font-sm gl-font-weight-bold"> + {{ item.text }} + <gl-emoji data-name="rocket" /> + </span> + <span> + <span class="gl-mr-2">{{ item.version }}</span> + <gitlab-version-check-badge v-if="updateSeverity" :status="updateSeverity" size="sm" /> + </span> + </a> + </template> + </gl-disclosure-dropdown-group> + + <gl-disclosure-dropdown-group + :group="itemGroups.helpLinks" + :bordered="sidebarData.show_version_check" + /> + + <gl-disclosure-dropdown-group :group="itemGroups.helpActions" bordered @action="handleAction"> <template #list-item="{ item }"> <button tabindex="-1" diff --git a/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline.vue b/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline.vue index 1093e7cb2ee..2dec95c3fda 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline.vue @@ -11,6 +11,7 @@ import { import SafeHtml from '~/vue_shared/directives/safe_html'; import { s__, n__ } from '~/locale'; import CiIcon from '~/vue_shared/components/ci_icon.vue'; +import { keepLatestDownstreamPipelines } from '~/pipelines/components/parsing_utils'; import PipelineArtifacts from '~/pipelines/components/pipelines_list/pipelines_artifacts.vue'; import PipelineMiniGraph from '~/pipelines/components/pipeline_mini_graph/pipeline_mini_graph.vue'; import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue'; @@ -86,6 +87,10 @@ export default { }, }, computed: { + downstreamPipelines() { + const downstream = this.pipeline.triggered; + return keepLatestDownstreamPipelines(downstream); + }, hasPipeline() { return this.pipeline && Object.keys(this.pipeline).length > 0; }, @@ -274,7 +279,7 @@ export default { <span class="gl-align-items-center gl-display-inline-flex"> <pipeline-mini-graph v-if="pipeline.details.stages" - :downstream-pipelines="pipeline.triggered" + :downstream-pipelines="downstreamPipelines" :is-merge-train="isMergeTrain" :pipeline-path="pipeline.path" :stages="pipeline.details.stages" |