Commit a552864a authored by GitLab Bot's avatar GitLab Bot

Add latest changes from gitlab-org/gitlab@master

parent 4998f4e2
...@@ -132,8 +132,9 @@ gem 'seed-fu', '~> 2.3.7' ...@@ -132,8 +132,9 @@ gem 'seed-fu', '~> 2.3.7'
gem 'elasticsearch-model', '~> 6.1' gem 'elasticsearch-model', '~> 6.1'
gem 'elasticsearch-rails', '~> 6.1', require: 'elasticsearch/rails/instrumentation' gem 'elasticsearch-rails', '~> 6.1', require: 'elasticsearch/rails/instrumentation'
gem 'elasticsearch-api', '~> 6.8' gem 'elasticsearch-api', '~> 6.8'
gem 'aws-sdk' gem 'aws-sdk-core', '~> 3'
gem 'faraday_middleware-aws-signers-v4' gem 'aws-sdk-cloudformation', '~> 1'
gem 'faraday_middleware-aws-sigv4'
# Markdown and HTML processing # Markdown and HTML processing
gem 'html-pipeline', '~> 2.12' gem 'html-pipeline', '~> 2.12'
......
...@@ -81,13 +81,15 @@ GEM ...@@ -81,13 +81,15 @@ GEM
attr_required (1.0.1) attr_required (1.0.1)
awesome_print (1.8.0) awesome_print (1.8.0)
aws-eventstream (1.0.3) aws-eventstream (1.0.3)
aws-sdk (2.11.374) aws-partitions (1.263.0)
aws-sdk-resources (= 2.11.374) aws-sdk-cloudformation (1.29.0)
aws-sdk-core (2.11.374) aws-sdk-core (~> 3, >= 3.71.0)
aws-sigv4 (~> 1.0) aws-sigv4 (~> 1.1)
aws-sdk-core (3.88.0)
aws-eventstream (~> 1.0, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0) jmespath (~> 1.0)
aws-sdk-resources (2.11.374)
aws-sdk-core (= 2.11.374)
aws-sigv4 (1.1.0) aws-sigv4 (1.1.0)
aws-eventstream (~> 1.0, >= 1.0.2) aws-eventstream (~> 1.0, >= 1.0.2)
axiom-types (0.1.1) axiom-types (0.1.1)
...@@ -276,9 +278,9 @@ GEM ...@@ -276,9 +278,9 @@ GEM
faraday (~> 0.8) faraday (~> 0.8)
faraday_middleware (0.12.2) faraday_middleware (0.12.2)
faraday (>= 0.7.4, < 1.0) faraday (>= 0.7.4, < 1.0)
faraday_middleware-aws-signers-v4 (0.1.7) faraday_middleware-aws-sigv4 (0.3.0)
aws-sdk-resources (~> 2) aws-sigv4 (~> 1.0)
faraday (~> 0.9) faraday (>= 0.15)
faraday_middleware-multi_json (0.0.6) faraday_middleware-multi_json (0.0.6)
faraday_middleware faraday_middleware
multi_json multi_json
...@@ -1141,7 +1143,8 @@ DEPENDENCIES ...@@ -1141,7 +1143,8 @@ DEPENDENCIES
atlassian-jwt (~> 0.2.0) atlassian-jwt (~> 0.2.0)
attr_encrypted (~> 3.1.0) attr_encrypted (~> 3.1.0)
awesome_print awesome_print
aws-sdk aws-sdk-cloudformation (~> 1)
aws-sdk-core (~> 3)
babosa (~> 1.0.2) babosa (~> 1.0.2)
base32 (~> 0.3.0) base32 (~> 0.3.0)
batch-loader (~> 1.4.0) batch-loader (~> 1.4.0)
...@@ -1187,7 +1190,7 @@ DEPENDENCIES ...@@ -1187,7 +1190,7 @@ DEPENDENCIES
escape_utils (~> 1.1) escape_utils (~> 1.1)
factory_bot_rails (~> 5.1.0) factory_bot_rails (~> 5.1.0)
faraday (~> 0.12) faraday (~> 0.12)
faraday_middleware-aws-signers-v4 faraday_middleware-aws-sigv4
fast_blank fast_blank
ffaker (~> 2.10) ffaker (~> 2.10)
flipper (~> 0.17.1) flipper (~> 0.17.1)
......
...@@ -8,19 +8,23 @@ import AutoWidthDropdownSelect from './issuable/auto_width_dropdown_select'; ...@@ -8,19 +8,23 @@ import AutoWidthDropdownSelect from './issuable/auto_width_dropdown_select';
import { parsePikadayDate, pikadayToString } from './lib/utils/datetime_utility'; import { parsePikadayDate, pikadayToString } from './lib/utils/datetime_utility';
import { queryToObject, objectToQuery } from './lib/utils/url_utility'; import { queryToObject, objectToQuery } from './lib/utils/url_utility';
const MR_SOURCE_BRANCH = 'merge_request[source_branch]';
const MR_TARGET_BRANCH = 'merge_request[target_branch]';
function organizeQuery(obj, isFallbackKey = false) { function organizeQuery(obj, isFallbackKey = false) {
const sourceBranch = 'merge_request[source_branch]'; if (!obj[MR_SOURCE_BRANCH] && !obj[MR_TARGET_BRANCH]) {
const targetBranch = 'merge_request[target_branch]'; return obj;
}
if (isFallbackKey) { if (isFallbackKey) {
return { return {
[sourceBranch]: obj[sourceBranch], [MR_SOURCE_BRANCH]: obj[MR_SOURCE_BRANCH],
}; };
} }
return { return {
[sourceBranch]: obj[sourceBranch], [MR_SOURCE_BRANCH]: obj[MR_SOURCE_BRANCH],
[targetBranch]: obj[targetBranch], [MR_TARGET_BRANCH]: obj[MR_TARGET_BRANCH],
}; };
} }
...@@ -87,7 +91,8 @@ export default class IssuableForm { ...@@ -87,7 +91,8 @@ export default class IssuableForm {
} }
initAutosave() { initAutosave() {
const searchTerm = format(document.location.search); const { search } = document.location;
const searchTerm = format(search);
const fallbackKey = getFallbackKey(); const fallbackKey = getFallbackKey();
this.autosave = new Autosave( this.autosave = new Autosave(
......
...@@ -43,7 +43,7 @@ export default { ...@@ -43,7 +43,7 @@ export default {
downstream: 'downstream', downstream: 'downstream',
data() { data() {
return { return {
triggeredTopIndex: 1, downstreamMarginTop: null,
}; };
}, },
computed: { computed: {
...@@ -77,26 +77,34 @@ export default { ...@@ -77,26 +77,34 @@ export default {
expandedTriggered() { expandedTriggered() {
return this.pipeline.triggered && this.pipeline.triggered.find(el => el.isExpanded); return this.pipeline.triggered && this.pipeline.triggered.find(el => el.isExpanded);
}, },
/**
* Calculates the margin top of the clicked downstream pipeline by
* adding the height of each linked pipeline and the margin
*/
marginTop() {
return `${this.triggeredTopIndex * 52}px`;
},
pipelineTypeUpstream() { pipelineTypeUpstream() {
return this.type !== this.$options.downstream && this.expandedTriggeredBy; return this.type !== this.$options.downstream && this.expandedTriggeredBy;
}, },
pipelineTypeDownstream() { pipelineTypeDownstream() {
return this.type !== this.$options.upstream && this.expandedTriggered; return this.type !== this.$options.upstream && this.expandedTriggered;
}, },
pipelineProjectId() {
return this.pipeline.project.id;
},
}, },
methods: { methods: {
handleClickedDownstream(pipeline, clickedIndex) { handleClickedDownstream(pipeline, clickedIndex, downstreamNode) {
this.triggeredTopIndex = clickedIndex; /**
* Calculates the margin top of the clicked downstream pipeline by
* subtracting the clicked downstream pipelines offsetTop by it's parent's
* offsetTop and then subtracting either 15 (if child) or 30 (if not a child)
* due to the height of node and stage name margin bottom.
*/
this.downstreamMarginTop = this.calculateMarginTop(
downstreamNode,
downstreamNode.classList.contains('child-pipeline') ? 15 : 30,
);
this.$emit('onClickTriggered', this.pipeline, pipeline); this.$emit('onClickTriggered', this.pipeline, pipeline);
}, },
calculateMarginTop(downstreamNode, pixelDiff) {
return `${downstreamNode.offsetTop - downstreamNode.offsetParent.offsetTop - pixelDiff}px`;
},
hasOnlyOneJob(stage) { hasOnlyOneJob(stage) {
return stage.groups.length === 1; return stage.groups.length === 1;
}, },
...@@ -139,6 +147,7 @@ export default { ...@@ -139,6 +147,7 @@ export default {
v-if="hasTriggeredBy" v-if="hasTriggeredBy"
:linked-pipelines="triggeredByPipelines" :linked-pipelines="triggeredByPipelines"
:column-title="__('Upstream')" :column-title="__('Upstream')"
:project-id="pipelineProjectId"
graph-position="left" graph-position="left"
@linkedPipelineClick=" @linkedPipelineClick="
linkedPipeline => $emit('onClickTriggeredBy', pipeline, linkedPipeline) linkedPipeline => $emit('onClickTriggeredBy', pipeline, linkedPipeline)
...@@ -174,6 +183,7 @@ export default { ...@@ -174,6 +183,7 @@ export default {
v-if="hasTriggered" v-if="hasTriggered"
:linked-pipelines="triggeredPipelines" :linked-pipelines="triggeredPipelines"
:column-title="__('Downstream')" :column-title="__('Downstream')"
:project-id="pipelineProjectId"
graph-position="right" graph-position="right"
@linkedPipelineClick="handleClickedDownstream" @linkedPipelineClick="handleClickedDownstream"
/> />
...@@ -186,7 +196,7 @@ export default { ...@@ -186,7 +196,7 @@ export default {
:is-loading="false" :is-loading="false"
:pipeline="expandedTriggered" :pipeline="expandedTriggered"
:is-linked-pipeline="true" :is-linked-pipeline="true"
:style="{ 'margin-top': marginTop }" :style="{ 'margin-top': downstreamMarginTop }"
:mediator="mediator" :mediator="mediator"
@onClickTriggered=" @onClickTriggered="
(parentPipeline, pipeline) => clickTriggeredPipeline(parentPipeline, pipeline) (parentPipeline, pipeline) => clickTriggeredPipeline(parentPipeline, pipeline)
......
<script> <script>
import { GlLoadingIcon, GlTooltipDirective, GlButton } from '@gitlab/ui'; import { GlLoadingIcon, GlTooltipDirective, GlButton } from '@gitlab/ui';
import CiStatus from '~/vue_shared/components/ci_icon.vue'; import CiStatus from '~/vue_shared/components/ci_icon.vue';
import { __ } from '~/locale';
export default { export default {
directives: { directives: {
...@@ -16,6 +17,14 @@ export default { ...@@ -16,6 +17,14 @@ export default {
type: Object, type: Object,
required: true, required: true,
}, },
projectId: {
type: Number,
required: true,
},
columnTitle: {
type: String,
required: true,
},
}, },
computed: { computed: {
tooltipText() { tooltipText() {
...@@ -30,18 +39,45 @@ export default { ...@@ -30,18 +39,45 @@ export default {
projectName() { projectName() {
return this.pipeline.project.name; return this.pipeline.project.name;
}, },
parentPipeline() {
// Refactor string match when BE returns Upstream/Downstream indicators
return this.projectId === this.pipeline.project.id && this.columnTitle === __('Upstream');
},
childPipeline() {
// Refactor string match when BE returns Upstream/Downstream indicators
return this.projectId === this.pipeline.project.id && this.columnTitle === __('Downstream');
},
label() {
return this.parentPipeline ? __('Parent') : __('Child');
},
childTooltipText() {
return __('This pipeline was triggered by a parent pipeline');
},
parentTooltipText() {
return __('This pipeline triggered a child pipeline');
},
labelToolTipText() {
return this.label === __('Parent') ? this.parentTooltipText : this.childTooltipText;
},
}, },
methods: { methods: {
onClickLinkedPipeline() { onClickLinkedPipeline() {
this.$root.$emit('bv::hide::tooltip', this.buttonId); this.$root.$emit('bv::hide::tooltip', this.buttonId);
this.$emit('pipelineClicked'); this.$emit('pipelineClicked', this.$refs.linkedPipeline);
},
hideTooltips() {
this.$root.$emit('bv::hide::tooltip');
}, },
}, },
}; };
</script> </script>
<template> <template>
<li class="linked-pipeline build"> <li
ref="linkedPipeline"
class="linked-pipeline build"
:class="{ 'child-pipeline': childPipeline }"
>
<gl-button <gl-button
:id="buttonId" :id="buttonId"
v-gl-tooltip v-gl-tooltip
...@@ -59,6 +95,15 @@ export default { ...@@ -59,6 +95,15 @@ export default {
class="js-linked-pipeline-status" class="js-linked-pipeline-status"
/> />
<span class="str-truncated align-bottom"> {{ projectName }} &#8226; #{{ pipeline.id }} </span> <span class="str-truncated align-bottom"> {{ projectName }} &#8226; #{{ pipeline.id }} </span>
<div v-if="parentPipeline || childPipeline" class="parent-child-label-container">
<span
v-gl-tooltip.bottom
:title="labelToolTipText"
class="badge badge-primary"
@mouseover="hideTooltips"
>{{ label }}</span
>
</div>
</gl-button> </gl-button>
</li> </li>
</template> </template>
...@@ -19,6 +19,10 @@ export default { ...@@ -19,6 +19,10 @@ export default {
type: String, type: String,
required: true, required: true,
}, },
projectId: {
type: Number,
required: true,
},
}, },
computed: { computed: {
columnClass() { columnClass() {
...@@ -28,10 +32,16 @@ export default { ...@@ -28,10 +32,16 @@ export default {
}; };
return `graph-position-${this.graphPosition} ${positionValues[this.graphPosition]}`; return `graph-position-${this.graphPosition} ${positionValues[this.graphPosition]}`;
}, },
// Refactor string match when BE returns Upstream/Downstream indicators
isUpstream() { isUpstream() {
return this.columnTitle === __('Upstream'); return this.columnTitle === __('Upstream');
}, },
}, },
methods: {
onPipelineClick(downstreamNode, pipeline, index) {
this.$emit('linkedPipelineClick', pipeline, index, downstreamNode);
},
},
}; };
</script> </script>
...@@ -48,7 +58,9 @@ export default { ...@@ -48,7 +58,9 @@ export default {
'left-connector': pipeline.isExpanded && graphPosition === 'left', 'left-connector': pipeline.isExpanded && graphPosition === 'left',
}" }"
:pipeline="pipeline" :pipeline="pipeline"
@pipelineClicked="$emit('linkedPipelineClick', pipeline, index)" :column-title="columnTitle"
:project-id="projectId"
@pipelineClicked="onPipelineClick($event, pipeline, index)"
/> />
</ul> </ul>
</div> </div>
......
...@@ -1093,3 +1093,7 @@ button.mini-pipeline-graph-dropdown-toggle { ...@@ -1093,3 +1093,7 @@ button.mini-pipeline-graph-dropdown-toggle {
.progress-bar.bg-primary { .progress-bar.bg-primary {
background-color: $blue-500 !important; background-color: $blue-500 !important;
} }
.parent-child-label-container {
padding-top: $gl-padding-4;
}
---
title: Avoid pre-populating form for MR resolve issues
merge_request: 22593
author:
type: fixed
---
title: Update webpack from 4.40.2 to 4.41.5
merge_request: 22452
author: Takuya Noguchi
type: security
---
title: Add child and parent labels to pipelines
merge_request: 21332
author:
type: added
...@@ -25,7 +25,7 @@ Consider the following workflow: ...@@ -25,7 +25,7 @@ Consider the following workflow:
1. Your `master` branch is rock solid, your project is using GitLab CI/CD and 1. Your `master` branch is rock solid, your project is using GitLab CI/CD and
your pipelines indicate that there isn't anything broken. your pipelines indicate that there isn't anything broken.
1. Someone from you team submits a merge request, a test fails and the pipeline 1. Someone from your team submits a merge request, a test fails and the pipeline
gets the known red icon. To investigate more, you have to go through the job gets the known red icon. To investigate more, you have to go through the job
logs to figure out the cause of the failed test, which usually contain logs to figure out the cause of the failed test, which usually contain
thousands of lines. thousands of lines.
......
...@@ -7,8 +7,8 @@ Please check this [rules](https://github.com/vuejs/eslint-plugin-vue#bulb-rules) ...@@ -7,8 +7,8 @@ Please check this [rules](https://github.com/vuejs/eslint-plugin-vue#bulb-rules)
## Basic Rules ## Basic Rules
1. The service has it's own file 1. The service has its own file
1. The store has it's own file 1. The store has its own file
1. Use a function in the bundle file to instantiate the Vue component: 1. Use a function in the bundle file to instantiate the Vue component:
```javascript ```javascript
...@@ -268,7 +268,7 @@ Please check this [rules](https://github.com/vuejs/eslint-plugin-vue#bulb-rules) ...@@ -268,7 +268,7 @@ Please check this [rules](https://github.com/vuejs/eslint-plugin-vue#bulb-rules)
## Closing tags ## Closing tags
1. Prefer self closing component tags 1. Prefer self-closing component tags
```javascript ```javascript
// bad // bad
...@@ -411,8 +411,8 @@ The goal of this accord is to make sure we are all on the same page. ...@@ -411,8 +411,8 @@ The goal of this accord is to make sure we are all on the same page.
1. You may use a jQuery dependency in Vue.js following [this example from the docs](https://vuejs.org/v2/examples/select2.html). 1. You may use a jQuery dependency in Vue.js following [this example from the docs](https://vuejs.org/v2/examples/select2.html).
1. If an outside jQuery Event needs to be listen to inside the Vue application, you may use jQuery event listeners. 1. If an outside jQuery Event needs to be listen to inside the Vue application, you may use jQuery event listeners.
1. We will avoid adding new jQuery events when they are not required. Instead of adding new jQuery events take a look at [different methods to do the same task](https://vuejs.org/v2/api/#vm-emit). 1. We will avoid adding new jQuery events when they are not required. Instead of adding new jQuery events take a look at [different methods to do the same task](https://vuejs.org/v2/api/#vm-emit).
1. You may query the `window` object 1 time, while bootstrapping your application for application specific data (e.g. `scrollTo` is ok to access anytime). Do this access during the bootstrapping of your application. 1. You may query the `window` object one time, while bootstrapping your application for application specific data (e.g. `scrollTo` is ok to access anytime). Do this access during the bootstrapping of your application.
1. You may have a temporary but immediate need to create technical debt by writing code that does not follow our standards, to be refactored later. Maintainers need to be ok with the tech debt in the first place. An issue should be created for that tech debt to evaluate it further and discuss. In the coming months you should fix that tech debt, with it's priority to be determined by maintainers. 1. You may have a temporary but immediate need to create technical debt by writing code that does not follow our standards, to be refactored later. Maintainers need to be ok with the tech debt in the first place. An issue should be created for that tech debt to evaluate it further and discuss. In the coming months you should fix that tech debt, with its priority to be determined by maintainers.
1. When creating tech debt you must write the tests for that code before hand and those tests may not be rewritten. e.g. jQuery tests rewritten to Vue tests. 1. When creating tech debt you must write the tests for that code before hand and those tests may not be rewritten. e.g. jQuery tests rewritten to Vue tests.
1. You may choose to use VueX as a centralized state management. If you choose not to use VueX, you must use the *store pattern* which can be found in the [Vue.js documentation](https://vuejs.org/v2/guide/state-management.html#Simple-State-Management-from-Scratch). 1. You may choose to use VueX as a centralized state management. If you choose not to use VueX, you must use the *store pattern* which can be found in the [Vue.js documentation](https://vuejs.org/v2/guide/state-management.html#Simple-State-Management-from-Scratch).
1. Once you have chosen a centralized state management solution you must use it for your entire application. i.e. Don't mix and match your state management solutions. 1. Once you have chosen a centralized state-management solution you must use it for your entire application. i.e. Don't mix and match your state-management solutions.
...@@ -20,7 +20,7 @@ NGINX server metrics are detected, which tracks the pages and content directly s ...@@ -20,7 +20,7 @@ NGINX server metrics are detected, which tracks the pages and content directly s
## Configuring Prometheus to monitor for NGINX metrics ## Configuring Prometheus to monitor for NGINX metrics
To get started with NGINX monitoring, you should first enable the [VTS statistics](https://github.com/vozlt/nginx-module-vts)) module for your NGINX server. This will capture and display statistics in an HTML readable form. Next, you should install and configure the [NGINX VTS exporter](https://github.com/hnlq715/nginx-vts-exporter) which parses these statistics and translates them into a Prometheus monitoring endpoint. To get started with NGINX monitoring, you should first enable the [VTS statistics](https://github.com/vozlt/nginx-module-vts) module for your NGINX server. This will capture and display statistics in an HTML readable form. Next, you should install and configure the [NGINX VTS exporter](https://github.com/hnlq715/nginx-vts-exporter) which parses these statistics and translates them into a Prometheus monitoring endpoint.
If you are using NGINX as your Kubernetes Ingress, GitLab will [automatically detect](nginx_ingress.md) the metrics once enabled in 0.9.0 and later releases. If you are using NGINX as your Kubernetes Ingress, GitLab will [automatically detect](nginx_ingress.md) the metrics once enabled in 0.9.0 and later releases.
......
...@@ -3344,6 +3344,9 @@ msgstr "" ...@@ -3344,6 +3344,9 @@ msgstr ""
msgid "Cherry-pick this merge request" msgid "Cherry-pick this merge request"
msgstr "" msgstr ""
msgid "Child"
msgstr ""
msgid "Child epic does not exist." msgid "Child epic does not exist."
msgstr "" msgstr ""
...@@ -11370,6 +11373,9 @@ msgstr "" ...@@ -11370,6 +11373,9 @@ msgstr ""
msgid "Merge Requests created" msgid "Merge Requests created"
msgstr "" msgstr ""
msgid "Merge Requests in Review"
msgstr ""
msgid "Merge commit message" msgid "Merge commit message"
msgstr "" msgstr ""
...@@ -12876,6 +12882,9 @@ msgstr "" ...@@ -12876,6 +12882,9 @@ msgstr ""
msgid "Parameter \"job_id\" cannot exceed length of %{job_id_max_size}" msgid "Parameter \"job_id\" cannot exceed length of %{job_id_max_size}"
msgstr "" msgstr ""
msgid "Parent"
msgstr ""
msgid "Parent epic doesn't exist." msgid "Parent epic doesn't exist."
msgstr "" msgstr ""
...@@ -18875,6 +18884,12 @@ msgstr "" ...@@ -18875,6 +18884,12 @@ msgstr ""
msgid "This pipeline makes use of a predefined CI/CD configuration enabled by <b>Auto DevOps.</b>" msgid "This pipeline makes use of a predefined CI/CD configuration enabled by <b>Auto DevOps.</b>"
msgstr "" msgstr ""
msgid "This pipeline triggered a child pipeline"
msgstr ""
msgid "This pipeline was triggered by a parent pipeline"
msgstr ""
msgid "This project" msgid "This project"
msgstr "" msgstr ""
......
...@@ -8,6 +8,13 @@ const mockPipeline = mockData.triggered[0]; ...@@ -8,6 +8,13 @@ const mockPipeline = mockData.triggered[0];
describe('Linked pipeline', () => { describe('Linked pipeline', () => {
let wrapper; let wrapper;
const createWrapper = propsData => {
wrapper = mount(LinkedPipelineComponent, {
attachToDocument: true,
propsData,
});
};
afterEach(() => { afterEach(() => {
wrapper.destroy(); wrapper.destroy();
}); });
...@@ -15,13 +22,12 @@ describe('Linked pipeline', () => { ...@@ -15,13 +22,12 @@ describe('Linked pipeline', () => {
describe('rendered output', () => { describe('rendered output', () => {
const props = { const props = {
pipeline: mockPipeline, pipeline: mockPipeline,
projectId: 20,
columnTitle: 'Downstream',
}; };
beforeEach(() => { beforeEach(() => {
wrapper = mount(LinkedPipelineComponent, { createWrapper(props);
attachToDocument: true,
propsData: props,
});
}); });
it('should render a list item as the containing element', () => { it('should render a list item as the containing element', () => {
...@@ -73,18 +79,50 @@ describe('Linked pipeline', () => { ...@@ -73,18 +79,50 @@ describe('Linked pipeline', () => {
it('does not render the loading icon when isLoading is false', () => { it('does not render the loading icon when isLoading is false', () => {
expect(wrapper.find('.js-linked-pipeline-loading').exists()).toBe(false); expect(wrapper.find('.js-linked-pipeline-loading').exists()).toBe(false);
}); });
it('should not display child label when pipeline project id is not the same as triggered pipeline project id', () => {
const labelContainer = wrapper.find('.parent-child-label-container');
expect(labelContainer.exists()).toBe(false);
});
});
describe('parent/child', () => {
const downstreamProps = {
pipeline: mockPipeline,
projectId: 19,
columnTitle: 'Downstream',
};
const upstreamProps = {
...downstreamProps,
columnTitle: 'Upstream',
};
it('parent/child label container should exist', () => {
createWrapper(downstreamProps);
expect(wrapper.find('.parent-child-label-container').exists()).toBe(true);
});
it('should display child label when pipeline project id is the same as triggered pipeline project id', () => {
createWrapper(downstreamProps);
expect(wrapper.find('.parent-child-label-container').text()).toContain('Child');
});
it('should display parent label when pipeline project id is the same as triggered_by pipeline project id', () => {
createWrapper(upstreamProps);
expect(wrapper.find('.parent-child-label-container').text()).toContain('Parent');
});
}); });
describe('when isLoading is true', () => { describe('when isLoading is true', () => {
const props = { const props = {
pipeline: { ...mockPipeline, isLoading: true }, pipeline: { ...mockPipeline, isLoading: true },
projectId: 19,
columnTitle: 'Downstream',
}; };
beforeEach(() => { beforeEach(() => {
wrapper = mount(LinkedPipelineComponent, { createWrapper(props);
attachToDocument: true,
propsData: props,
});
}); });
it('renders a loading icon', () => { it('renders a loading icon', () => {
...@@ -95,20 +133,19 @@ describe('Linked pipeline', () => { ...@@ -95,20 +133,19 @@ describe('Linked pipeline', () => {
describe('on click', () => { describe('on click', () => {
const props = { const props = {
pipeline: mockPipeline, pipeline: mockPipeline,
projectId: 19,
columnTitle: 'Downstream',
}; };
beforeEach(() => { beforeEach(() => {
wrapper = mount(LinkedPipelineComponent, { createWrapper(props);
attachToDocument: true,
propsData: props,
});
}); });
it('emits `pipelineClicked` event', () => { it('emits `pipelineClicked` event', () => {
jest.spyOn(wrapper.vm, '$emit'); jest.spyOn(wrapper.vm, '$emit');
wrapper.find('button').trigger('click'); wrapper.find('button').trigger('click');
expect(wrapper.vm.$emit).toHaveBeenCalledWith('pipelineClicked'); expect(wrapper.emitted().pipelineClicked).toBeTruthy();
}); });
it('should emit `bv::hide::tooltip` to close the tooltip', () => { it('should emit `bv::hide::tooltip` to close the tooltip', () => {
......
export default { export default {
project: {
id: 19,
},
triggered_by: { triggered_by: {
id: 129, id: 129,
active: true, active: true,
...@@ -63,6 +66,7 @@ export default { ...@@ -63,6 +66,7 @@ export default {
path: '/gitlab-org/gitlab-foss/pipelines/132', path: '/gitlab-org/gitlab-foss/pipelines/132',
project: { project: {
name: 'GitLabCE', name: 'GitLabCE',
id: 19,
}, },
details: { details: {
status: { status: {
......
...@@ -190,6 +190,7 @@ describe('graph component', () => { ...@@ -190,6 +190,7 @@ describe('graph component', () => {
describe('on click', () => { describe('on click', () => {
it('should emit `onClickTriggered`', () => { it('should emit `onClickTriggered`', () => {
spyOn(component, '$emit'); spyOn(component, '$emit');
spyOn(component, 'calculateMarginTop').and.callFake(() => '16px');
component.$el.querySelector('#js-linked-pipeline-34993051').click(); component.$el.querySelector('#js-linked-pipeline-34993051').click();
......
...@@ -9,6 +9,7 @@ describe('Linked Pipelines Column', () => { ...@@ -9,6 +9,7 @@ describe('Linked Pipelines Column', () => {
columnTitle: 'Upstream', columnTitle: 'Upstream',
linkedPipelines: mockData.triggered, linkedPipelines: mockData.triggered,
graphPosition: 'right', graphPosition: 'right',
projectId: 19,
}; };
let vm; let vm;
......
...@@ -341,6 +341,9 @@ ...@@ -341,6 +341,9 @@
"commit_url": "https://gitlab.com/gitlab-org/gitlab-runner/commit/8083eb0a920572214d0dccedd7981f05d535ad46", "commit_url": "https://gitlab.com/gitlab-org/gitlab-runner/commit/8083eb0a920572214d0dccedd7981f05d535ad46",
"commit_path": "/gitlab-org/gitlab-runner/commit/8083eb0a920572214d0dccedd7981f05d535ad46" "commit_path": "/gitlab-org/gitlab-runner/commit/8083eb0a920572214d0dccedd7981f05d535ad46"
}, },
"project": {
"id": 1794617
},
"triggered_by": { "triggered_by": {
"id": 12, "id": 12,
"user": { "user": {
......
...@@ -10002,6 +10002,11 @@ serialize-javascript@^1.4.0, serialize-javascript@^1.7.0: ...@@ -10002,6 +10002,11 @@ serialize-javascript@^1.4.0, serialize-javascript@^1.7.0:
resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.7.0.tgz#d6e0dfb2a3832a8c94468e6eb1db97e55a192a65" resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.7.0.tgz#d6e0dfb2a3832a8c94468e6eb1db97e55a192a65"
integrity sha512-ke8UG8ulpFOxO8f8gRYabHQe/ZntKlcig2Mp+8+URDP1D8vJZ0KUt7LYo07q25Z/+JVSgpr/cui9PIp5H6/+nA== integrity sha512-ke8UG8ulpFOxO8f8gRYabHQe/ZntKlcig2Mp+8+URDP1D8vJZ0KUt7LYo07q25Z/+JVSgpr/cui9PIp5H6/+nA==
serialize-javascript@^2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-2.1.2.tgz#ecec53b0e0317bdc95ef76ab7074b7384785fa61"
integrity sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ==
serve-index@^1.9.1: serve-index@^1.9.1:
version "1.9.1" version "1.9.1"
resolved "https://registry.yarnpkg.com/serve-index/-/serve-index-1.9.1.tgz#d3768d69b1e7d82e5ce050fff5b453bea12a9239" resolved "https://registry.yarnpkg.com/serve-index/-/serve-index-1.9.1.tgz#d3768d69b1e7d82e5ce050fff5b453bea12a9239"
...@@ -10816,16 +10821,16 @@ term-size@^1.2.0: ...@@ -10816,16 +10821,16 @@ term-size@^1.2.0:
dependencies: dependencies:
execa "^0.7.0" execa "^0.7.0"
terser-webpack-plugin@^1.4.1: terser-webpack-plugin@^1.4.3:
version "1.4.1" version "1.4.3"
resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-1.4.1.tgz#61b18e40eaee5be97e771cdbb10ed1280888c2b4" resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-1.4.3.tgz#5ecaf2dbdc5fb99745fd06791f46fc9ddb1c9a7c"
integrity sha512-ZXmmfiwtCLfz8WKZyYUuuHf3dMYEjg8NrjHMb0JqHVHVOSkzp3cW2/XG1fP3tRhqEqSzMwzzRQGtAPbs4Cncxg== integrity sha512-QMxecFz/gHQwteWwSo5nTc6UaICqN1bMedC5sMtUc7y3Ha3Q8y6ZO0iCR8pq4RJC8Hjf0FEPEHZqcMB/+DFCrA==
dependencies: dependencies:
cacache "^12.0.2" cacache "^12.0.2"
find-cache-dir "^2.1.0" find-cache-dir "^2.1.0"
is-wsl "^1.1.0" is-wsl "^1.1.0"
schema-utils "^1.0.0" schema-utils "^1.0.0"
serialize-javascript "^1.7.0" serialize-javascript "^2.1.2"
source-map "^0.6.1" source-map "^0.6.1"
terser "^4.1.2" terser "^4.1.2"
webpack-sources "^1.4.0" webpack-sources "^1.4.0"
...@@ -11846,10 +11851,10 @@ webpack-stats-plugin@^0.3.0: ...@@ -11846,10 +11851,10 @@ webpack-stats-plugin@^0.3.0:
resolved "https://registry.yarnpkg.com/webpack-stats-plugin/-/webpack-stats-plugin-0.3.0.tgz#6952f63feb9a5393a328d774fb3eccac78d2f51b" resolved "https://registry.yarnpkg.com/webpack-stats-plugin/-/webpack-stats-plugin-0.3.0.tgz#6952f63feb9a5393a328d774fb3eccac78d2f51b"
integrity sha512-4a6mEl9HLtMukVjEPY8QPCSmtX2EDFJNhDTX5ZE2CLch2adKAZf53nUrpG6m7NattwigS0AodNcwNxlu9kMSDQ== integrity sha512-4a6mEl9HLtMukVjEPY8QPCSmtX2EDFJNhDTX5ZE2CLch2adKAZf53nUrpG6m7NattwigS0AodNcwNxlu9kMSDQ==
webpack@^4.40.2: webpack@^4.41.5:
version "4.40.2" version "4.41.5"
resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.40.2.tgz#d21433d250f900bf0facbabe8f50d585b2dc30a7" resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.41.5.tgz#3210f1886bce5310e62bb97204d18c263341b77c"
integrity sha512-5nIvteTDCUws2DVvP9Qe+JPla7kWPPIDFZv55To7IycHWZ+Z5qBdaBYPyuXWdhggTufZkQwfIK+5rKQTVovm2A== integrity sha512-wp0Co4vpyumnp3KlkmpM5LWuzvZYayDwM2n17EHFr4qxBBbRokC7DJawPJC7TfSFZ9HZ6GsdH40EBj4UV0nmpw==
dependencies: dependencies:
"@webassemblyjs/ast" "1.8.5" "@webassemblyjs/ast" "1.8.5"
"@webassemblyjs/helper-module-context" "1.8.5" "@webassemblyjs/helper-module-context" "1.8.5"
...@@ -11871,7 +11876,7 @@ webpack@^4.40.2: ...@@ -11871,7 +11876,7 @@ webpack@^4.40.2:
node-libs-browser "^2.2.1" node-libs-browser "^2.2.1"
schema-utils "^1.0.0" schema-utils "^1.0.0"
tapable "^1.1.3" tapable "^1.1.3"
terser-webpack-plugin "^1.4.1" terser-webpack-plugin "^1.4.3"
watchpack "^1.6.0" watchpack "^1.6.0"
webpack-sources "^1.4.1" webpack-sources "^1.4.1"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment