Commit eafa50ed authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab-ce master

parents 5e70f77b 278fb457
<script>
import _ from 'underscore';
import GlModal from '~/vue_shared/components/gl_modal.vue';
import { GlLink } from '@gitlab/ui';
import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
import CiIcon from '~/vue_shared/components/ci_icon.vue';
import { s__, sprintf } from '~/locale';
/**
* Pipeline Stop Modal.
*
* Renders the modal used to confirm stopping a pipeline.
*/
export default {
components: {
GlModal,
GlLink,
ClipboardButton,
CiIcon,
},
props: {
pipeline: {
type: Object,
required: true,
deep: true,
},
},
computed: {
modalTitle() {
return sprintf(
s__('Pipeline|Stop pipeline #%{pipelineId}?'),
{
pipelineId: `${this.pipeline.id}`,
},
false,
);
},
modalText() {
return sprintf(
s__(`Pipeline|You’re about to stop pipeline %{pipelineId}.`),
{
pipelineId: `<strong>#${this.pipeline.id}</strong>`,
},
false,
);
},
hasRef() {
return !_.isEmpty(this.pipeline.ref);
},
},
methods: {
emitSubmit(event) {
this.$emit('submit', event);
},
},
};
</script>
<template>
<gl-modal
id="confirmation-modal"
:header-title-text="modalTitle"
:footer-primary-button-text="s__('Pipeline|Stop pipeline')"
footer-primary-button-variant="danger"
@submit="emitSubmit($event)"
>
<p v-html="modalText"></p>
<p v-if="pipeline">
<ci-icon
v-if="pipeline.details"
:status="pipeline.details.status"
class="vertical-align-middle"
/>
<span class="font-weight-bold">{{ __('Pipeline') }}</span>
<a :href="pipeline.path" class="js-pipeline-path link-commit qa-pipeline-path"
>#{{ pipeline.id }}</a
>
<template v-if="hasRef">
{{ __('from') }}
<a :href="pipeline.ref.path" class="link-commit ref-name">{{ pipeline.ref.name }}</a>
</template>
</p>
<template v-if="pipeline.commit">
<p>
<span class="font-weight-bold">{{ __('Commit') }}</span>
<gl-link :href="pipeline.commit.commit_path" class="js-commit-sha commit-sha link-commit">
{{ pipeline.commit.short_id }}
</gl-link>
</p>
<p>{{ pipeline.commit.title }}</p>
</template>
</gl-modal>
</template>
<script>
import Modal from '~/vue_shared/components/gl_modal.vue';
import { s__, sprintf } from '~/locale';
import PipelinesTableRowComponent from './pipelines_table_row.vue';
import PipelineStopModal from './pipeline_stop_modal.vue';
import eventHub from '../event_hub';
/**
......@@ -12,7 +11,7 @@ import eventHub from '../event_hub';
export default {
components: {
PipelinesTableRowComponent,
Modal,
PipelineStopModal,
},
props: {
pipelines: {
......@@ -36,30 +35,11 @@ export default {
data() {
return {
pipelineId: 0,
pipeline: {},
endpoint: '',
cancelingPipeline: null,
};
},
computed: {
modalTitle() {
return sprintf(
s__('Pipeline|Stop pipeline #%{pipelineId}?'),
{
pipelineId: `${this.pipelineId}`,
},
false,
);
},
modalText() {
return sprintf(
s__('Pipeline|You’re about to stop pipeline %{pipelineId}.'),
{
pipelineId: `<strong>#${this.pipelineId}</strong>`,
},
false,
);
},
},
created() {
eventHub.$on('openConfirmationModal', this.setModalData);
},
......@@ -68,7 +48,8 @@ export default {
},
methods: {
setModalData(data) {
this.pipelineId = data.pipelineId;
this.pipelineId = data.pipeline.id;
this.pipeline = data.pipeline;
this.endpoint = data.endpoint;
},
onSubmit() {
......@@ -103,15 +84,6 @@ export default {
:view-type="viewType"
:canceling-pipeline="cancelingPipeline"
/>
<modal
id="confirmation-modal"
:header-title-text="modalTitle"
:footer-primary-button-text="s__('Pipeline|Stop pipeline')"
footer-primary-button-variant="danger"
@submit="onSubmit"
>
<span v-html="modalText"></span>
</modal>
<pipeline-stop-modal :pipeline="pipeline" @submit="onSubmit" />
</div>
</template>
......@@ -243,7 +243,7 @@ export default {
methods: {
handleCancelClick() {
eventHub.$emit('openConfirmationModal', {
pipelineId: this.pipeline.id,
pipeline: this.pipeline,
endpoint: this.pipeline.cancel_path,
});
},
......
......@@ -125,6 +125,10 @@ const bindEvents = () => {
text: 'Spring',
icon: '.template-option .icon-spring',
},
iosswift: {
text: 'iOS (Swift)',
icon: '.template-option svg.icon-gitlab',
},
dotnetcore: {
text: '.NET Core',
icon: '.template-option .icon-dotnet',
......
---
title: Show pipeline ID, commit, and branch name on modal while stopping pipeline
merge_request: 25059
author:
type: changed
---
title: Add iOS project template
merge_request: 25872
author:
type: changed
......@@ -28,6 +28,7 @@ module Gitlab
ProjectTemplate.new('rails', 'Ruby on Rails', _('Includes an MVC structure, Gemfile, Rakefile, along with many others, to help you get started.'), 'https://gitlab.com/gitlab-org/project-templates/rails', 'illustrations/logos/rails.svg'),
ProjectTemplate.new('spring', 'Spring', _('Includes an MVC structure, mvnw and pom.xml to help you get started.'), 'https://gitlab.com/gitlab-org/project-templates/spring', 'illustrations/logos/spring.svg'),
ProjectTemplate.new('express', 'NodeJS Express', _('Includes an MVC structure to help you get started.'), 'https://gitlab.com/gitlab-org/project-templates/express', 'illustrations/logos/express.svg'),
ProjectTemplate.new('iosswift', 'iOS (Swift)', _('A ready-to-go template for use with iOS Swift apps.'), 'https://gitlab.com/gitlab-org/project-templates/iosswift'),
ProjectTemplate.new('dotnetcore', '.NET Core', _('A .NET Core console application template, customizable for any .NET Core project'), 'https://gitlab.com/gitlab-org/project-templates/dotnetcore', 'illustrations/logos/dotnet.svg'),
ProjectTemplate.new('gomicro', 'Go Micro', _('Go Micro is a framework for micro service development.'), 'https://gitlab.com/gitlab-org/project-templates/go-micro'),
ProjectTemplate.new('hugo', 'Pages/Hugo', _('Everything you need to create a GitLab Pages site using Hugo.'), 'https://gitlab.com/pages/hugo'),
......
......@@ -416,6 +416,9 @@ msgstr ""
msgid "A project is where you house your files (repository), plan your work (issues), and publish your documentation (wiki), %{among_other_things_link}."
msgstr ""
msgid "A ready-to-go template for use with iOS Swift apps."
msgstr ""
msgid "A regular expression that will be used to find the test coverage output in the job trace. Leave blank to disable"
msgstr ""
......
......@@ -195,8 +195,10 @@ describe('Pipelines Table Row', () => {
it('emits `openConfirmationModal` event when cancel button is clicked and toggles loading', () => {
eventHub.$once('openConfirmationModal', data => {
const { id, ref, commit } = pipeline;
expect(data.endpoint).toEqual('/cancel');
expect(data.pipelineId).toEqual(pipeline.id);
expect(data.pipeline).toEqual(jasmine.objectContaining({ id, ref, commit }));
});
component.$el.querySelector('.js-pipelines-cancel-button').click();
......
......@@ -7,6 +7,7 @@ describe Gitlab::ProjectTemplate do
described_class.new('rails', 'Ruby on Rails', 'Includes an MVC structure, .gitignore, Gemfile, and more great stuff', 'https://gitlab.com/gitlab-org/project-templates/rails'),
described_class.new('spring', 'Spring', 'Includes an MVC structure, .gitignore, Gemfile, and more great stuff', 'https://gitlab.com/gitlab-org/project-templates/spring'),
described_class.new('express', 'NodeJS Express', 'Includes an MVC structure, .gitignore, Gemfile, and more great stuff', 'https://gitlab.com/gitlab-org/project-templates/express'),
described_class.new('iosswift', 'iOS (Swift)', 'A ready-to-go template for use with iOS Swift apps.', 'https://gitlab.com/gitlab-org/project-templates/iosswift'),
described_class.new('dotnetcore', '.NET Core', 'A .NET Core console application template, customizable for any .NET Core project', 'https://gitlab.com/gitlab-org/project-templates/dotnetcore'),
described_class.new('gomicro', 'Go Micro', 'Go Micro is a framework for micro service development.', 'https://gitlab.com/gitlab-org/project-templates/go-micro'),
described_class.new('hugo', 'Pages/Hugo', 'Everything you need to get started using a Hugo Pages site.', 'https://gitlab.com/pages/hugo'),
......
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