From 4555e1b21c365ed8303ffb7a3325d773c9b8bf31 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 19 May 2021 15:44:42 +0000 Subject: Add latest changes from gitlab-org/gitlab@13-12-stable-ee --- .../pipelines/components/graph/graph_component.vue | 40 ++---- .../components/graph/graph_component_wrapper.vue | 63 +++++++- .../components/graph/graph_view_selector.vue | 159 +++++++++++++++------ .../components/graph/job_group_dropdown.vue | 1 + .../components/graph/linked_pipelines_column.vue | 12 +- .../components/graph/stage_column_component.vue | 5 +- .../pipelines/components/graph/utils.js | 7 +- .../pipelines/components/graph_shared/api.js | 5 + .../components/graph_shared/drawing_utils.js | 1 + .../components/graph_shared/links_inner.vue | 89 ++---------- .../components/graph_shared/links_layer.vue | 61 ++------ .../notification/pipeline_notification.vue | 4 +- .../pipelines/components/parsing_utils.js | 25 +++- .../components/pipelines_list/empty_state.vue | 76 ++++++++-- .../pipelines_list/pipeline_multi_actions.vue | 115 +++++++++++++++ .../pipelines_list/pipeline_operations.vue | 21 +-- .../components/pipelines_list/pipelines.vue | 6 + .../pipelines_list/pipelines_artifacts.vue | 89 ++++++++++-- .../pipelines_list/pipelines_filtered_search.vue | 11 +- .../pipelines_list/pipelines_status_badge.vue | 37 ++++- .../components/test_reports/empty_state.vue | 60 ++++++++ .../components/test_reports/test_case_details.vue | 19 ++- .../components/test_reports/test_reports.vue | 10 +- 23 files changed, 648 insertions(+), 268 deletions(-) create mode 100644 app/assets/javascripts/pipelines/components/pipelines_list/pipeline_multi_actions.vue create mode 100644 app/assets/javascripts/pipelines/components/test_reports/empty_state.vue (limited to 'app/assets/javascripts/pipelines/components') diff --git a/app/assets/javascripts/pipelines/components/graph/graph_component.vue b/app/assets/javascripts/pipelines/components/graph/graph_component.vue index 63048777724..71ec81b8969 100644 --- a/app/assets/javascripts/pipelines/components/graph/graph_component.vue +++ b/app/assets/javascripts/pipelines/components/graph/graph_component.vue @@ -2,6 +2,7 @@ import { reportToSentry } from '../../utils'; import LinkedGraphWrapper from '../graph_shared/linked_graph_wrapper.vue'; import LinksLayer from '../graph_shared/links_layer.vue'; +import { generateColumnsFromLayersListMemoized } from '../parsing_utils'; import { DOWNSTREAM, MAIN, UPSTREAM, ONE_COL_WIDTH, STAGE_VIEW } from './constants'; import LinkedPipelinesColumn from './linked_pipelines_column.vue'; import StageColumnComponent from './stage_column_component.vue'; @@ -25,6 +26,10 @@ export default { type: Object, required: true, }, + showLinks: { + type: Boolean, + required: true, + }, viewType: { type: String, required: true, @@ -74,7 +79,9 @@ export default { return this.hasDownstreamPipelines ? this.pipeline.downstream : []; }, layout() { - return this.isStageView ? this.pipeline.stages : this.generateColumnsFromLayersList(); + return this.isStageView + ? this.pipeline.stages + : generateColumnsFromLayersListMemoized(this.pipeline, this.pipelineLayers); }, hasDownstreamPipelines() { return Boolean(this.pipeline?.downstream?.length > 0); @@ -91,8 +98,8 @@ export default { collectMetrics: true, }; }, - shouldHideLinks() { - return this.isStageView; + showJobLinks() { + return !this.isStageView && this.showLinks; }, shouldShowStageName() { return !this.isStageView; @@ -120,26 +127,6 @@ export default { this.getMeasurements(); }, methods: { - generateColumnsFromLayersList() { - return this.pipelineLayers.map((layers, idx) => { - /* - look up the groups in each layer, - then add each set of layer groups to a stage-like object - */ - - const groups = layers.map((id) => { - const { stageIdx, groupIdx } = this.pipeline.stagesLookup[id]; - return this.pipeline.stages?.[stageIdx]?.groups?.[groupIdx]; - }); - - return { - name: '', - id: `layer-${idx}`, - status: { action: null }, - groups: groups.filter(Boolean), - }; - }); - }, getMeasurements() { this.measurements = { width: this.$refs[this.containerId].scrollWidth, @@ -178,7 +165,7 @@ export default {
@@ -188,6 +175,7 @@ export default { :config-paths="configPaths" :linked-pipelines="upstreamPipelines" :column-title="__('Upstream')" + :show-links="showJobLinks" :type="$options.pipelineTypeConstants.UPSTREAM" :view-type="viewType" @error="onError" @@ -202,9 +190,8 @@ export default { :container-measurements="measurements" :highlighted-job="hoveredJobName" :metrics-config="metricsConfig" - :never-show-links="shouldHideLinks" + :show-links="showJobLinks" :view-type="viewType" - default-link-color="gl-stroke-transparent" @error="onError" @highlightedJobsChange="updateHighlightedJobs" > @@ -234,6 +221,7 @@ export default { :config-paths="configPaths" :linked-pipelines="downstreamPipelines" :column-title="__('Downstream')" + :show-links="showJobLinks" :type="$options.pipelineTypeConstants.DOWNSTREAM" :view-type="viewType" @downstreamHovered="setSourceJob" diff --git a/app/assets/javascripts/pipelines/components/graph/graph_component_wrapper.vue b/app/assets/javascripts/pipelines/components/graph/graph_component_wrapper.vue index 0bc6d883245..9329a35ba99 100644 --- a/app/assets/javascripts/pipelines/components/graph/graph_component_wrapper.vue +++ b/app/assets/javascripts/pipelines/components/graph/graph_component_wrapper.vue @@ -5,7 +5,9 @@ import { __ } from '~/locale'; import LocalStorageSync from '~/vue_shared/components/local_storage_sync.vue'; import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import { DEFAULT, DRAW_FAILURE, LOAD_FAILURE } from '../../constants'; -import { reportToSentry } from '../../utils'; +import DismissPipelineGraphCallout from '../../graphql/mutations/dismiss_pipeline_notification.graphql'; +import getUserCallouts from '../../graphql/queries/get_user_callouts.query.graphql'; +import { reportToSentry, reportMessageToSentry } from '../../utils'; import { listByLayers } from '../parsing_utils'; import { IID_FAILURE, LAYER_VIEW, STAGE_VIEW, VIEW_TYPE_KEY } from './constants'; import PipelineGraph from './graph_component.vue'; @@ -17,6 +19,9 @@ import { unwrapPipelineData, } from './utils'; +const featureName = 'pipeline_needs_hover_tip'; +const enumFeatureName = featureName.toUpperCase(); + export default { name: 'PipelineGraphWrapper', components: { @@ -44,10 +49,12 @@ export default { data() { return { alertType: null, + callouts: [], currentViewType: STAGE_VIEW, pipeline: null, pipelineLayers: null, showAlert: false, + showLinks: false, }; }, errorTexts: { @@ -59,6 +66,18 @@ export default { [DEFAULT]: __('An unknown error occurred while loading this graph.'), }, apollo: { + callouts: { + query: getUserCallouts, + update(data) { + return data?.currentUser?.callouts?.nodes.map((callout) => callout.featureName) || []; + }, + error(err) { + reportToSentry( + this.$options.name, + `type: callout_load_failure, info: ${serializeLoadErrors(err)}`, + ); + }, + }, pipeline: { context() { return getQueryHeaders(this.graphqlResourceEtag); @@ -90,9 +109,16 @@ export default { }, error(err) { this.reportFailure({ type: LOAD_FAILURE, skipSentry: true }); - reportToSentry( + + reportMessageToSentry( this.$options.name, - `type: ${LOAD_FAILURE}, info: ${serializeLoadErrors(err)}`, + `| type: ${LOAD_FAILURE} , info: ${serializeLoadErrors(err)}`, + { + projectPath: this.projectPath, + pipelineIid: this.pipelineIid, + pipelineStages: this.pipeline?.stages?.length || 0, + nbOfDownstreams: this.pipeline?.downstream?.length || 0, + }, ); }, result({ error }) { @@ -137,6 +163,13 @@ export default { metricsPath: this.metricsPath, }; }, + graphViewType() { + /* This prevents reading view type off the localStorage value if it does not apply. */ + return this.showGraphViewSelector ? this.currentViewType : STAGE_VIEW; + }, + hoverTipPreviouslyDismissed() { + return this.callouts.includes(enumFeatureName); + }, showLoadingIcon() { /* Shows the icon only when the graph is empty, not when it is is @@ -166,6 +199,18 @@ export default { return this.pipelineLayers; }, + handleTipDismissal() { + try { + this.$apollo.mutate({ + mutation: DismissPipelineGraphCallout, + variables: { + featureName, + }, + }); + } catch (err) { + reportToSentry(this.$options.name, `type: callout_dismiss_failure, info: ${err}`); + } + }, hideAlert() { this.showAlert = false; this.alertType = null; @@ -182,6 +227,9 @@ export default { } }, /* eslint-enable @gitlab/require-i18n-strings */ + updateShowLinksState(val) { + this.showLinks = val; + }, updateViewType(type) { this.currentViewType = type; }, @@ -201,8 +249,12 @@ export default { > @@ -211,7 +263,8 @@ export default { :config-paths="configPaths" :pipeline="pipeline" :pipeline-layers="getPipelineLayers()" - :view-type="currentViewType" + :show-links="showLinks" + :view-type="graphViewType" @error="reportFailure" @refreshPipelineGraph="refreshPipelineGraph" /> diff --git a/app/assets/javascripts/pipelines/components/graph/graph_view_selector.vue b/app/assets/javascripts/pipelines/components/graph/graph_view_selector.vue index f33e6290e37..1435276edd3 100644 --- a/app/assets/javascripts/pipelines/components/graph/graph_view_selector.vue +++ b/app/assets/javascripts/pipelines/components/graph/graph_view_selector.vue @@ -1,17 +1,25 @@ diff --git a/app/assets/javascripts/pipelines/components/graph/job_group_dropdown.vue b/app/assets/javascripts/pipelines/components/graph/job_group_dropdown.vue index 6451605a222..b2a3f27e079 100644 --- a/app/assets/javascripts/pipelines/components/graph/job_group_dropdown.vue +++ b/app/assets/javascripts/pipelines/components/graph/job_group_dropdown.vue @@ -53,6 +53,7 @@ export default { };