Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-08-26 21:11:43 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-08-26 21:11:43 +0300
commitbc75527dca77b2b72331ac6cbd5928d5b8c0c419 (patch)
tree000196faadb05f6e2ff60c08865b1a09506e5522 /app/assets/javascripts/blob
parentc82ca12a1c5a359325cb45aaf01b483d1fa0efcb (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/blob')
-rw-r--r--app/assets/javascripts/blob/pipeline_tour_success_modal.vue45
-rw-r--r--app/assets/javascripts/blob/suggest_gitlab_ci_yml/components/popover.vue4
-rw-r--r--app/assets/javascripts/blob/suggest_gitlab_ci_yml/index.js1
3 files changed, 42 insertions, 8 deletions
diff --git a/app/assets/javascripts/blob/pipeline_tour_success_modal.vue b/app/assets/javascripts/blob/pipeline_tour_success_modal.vue
index 90eafb75758..411241b72d5 100644
--- a/app/assets/javascripts/blob/pipeline_tour_success_modal.vue
+++ b/app/assets/javascripts/blob/pipeline_tour_success_modal.vue
@@ -1,5 +1,5 @@
<script>
-import { GlModal, GlSprintf, GlLink } from '@gitlab/ui';
+import { GlModal, GlSprintf, GlLink, GlButton } from '@gitlab/ui';
import Cookies from 'js-cookie';
import { sprintf, s__, __ } from '~/locale';
import { glEmojiTag } from '~/emoji';
@@ -18,6 +18,8 @@ export default {
helpMessage: s__(
`MR widget|Take a look at our %{beginnerLinkStart}Beginner's Guide to Continuous Integration%{beginnerLinkEnd} and our %{exampleLinkStart}examples of GitLab CI/CD%{exampleLinkEnd} to learn more.`,
),
+ pipelinesButton: s__('MR widget|See your pipeline in action'),
+ mergeRequestButton: s__('MR widget|Back to the Merge request'),
modalTitle: sprintf(
__("That's it, well done!%{celebrate}"),
{
@@ -25,11 +27,13 @@ export default {
},
false,
),
- goToTrackValue: 10,
+ goToTrackValuePipelines: 10,
+ goToTrackValueMergeRequest: 20,
trackEvent: 'click_button',
components: {
GlModal,
GlSprintf,
+ GlButton,
GlLink,
},
mixins: [trackingMixin],
@@ -38,6 +42,11 @@ export default {
type: String,
required: true,
},
+ projectMergeRequestsPath: {
+ type: String,
+ required: false,
+ default: '',
+ },
commitCookie: {
type: String,
required: true,
@@ -59,6 +68,15 @@ export default {
property: this.humanAccess,
};
},
+ goToMergeRequestPath() {
+ return this.commitCookiePath || this.projectMergeRequestsPath;
+ },
+ commitCookiePath() {
+ const cookieVal = Cookies.get(this.commitCookie);
+
+ if (cookieVal !== 'true') return cookieVal;
+ return '';
+ },
},
mounted() {
this.track();
@@ -100,17 +118,28 @@ export default {
</template>
</gl-sprintf>
<template #modal-footer>
- <a
- ref="goto"
+ <gl-button
+ v-if="projectMergeRequestsPath"
+ ref="goToMergeRequest"
+ :href="goToMergeRequestPath"
+ :data-track-property="humanAccess"
+ :data-track-value="$options.goToTrackValueMergeRequest"
+ :data-track-event="$options.trackEvent"
+ :data-track-label="trackLabel"
+ >
+ {{ $options.mergeRequestButton }}
+ </gl-button>
+ <gl-button
+ ref="goToPipelines"
:href="goToPipelinesPath"
- class="btn btn-success"
+ variant="success"
:data-track-property="humanAccess"
- :data-track-value="$options.goToTrackValue"
+ :data-track-value="$options.goToTrackValuePipelines"
:data-track-event="$options.trackEvent"
:data-track-label="trackLabel"
>
- {{ __('See your pipeline in action') }}
- </a>
+ {{ $options.pipelinesButton }}
+ </gl-button>
</template>
</gl-modal>
</template>
diff --git a/app/assets/javascripts/blob/suggest_gitlab_ci_yml/components/popover.vue b/app/assets/javascripts/blob/suggest_gitlab_ci_yml/components/popover.vue
index cda73ae9426..9251af01aff 100644
--- a/app/assets/javascripts/blob/suggest_gitlab_ci_yml/components/popover.vue
+++ b/app/assets/javascripts/blob/suggest_gitlab_ci_yml/components/popover.vue
@@ -50,6 +50,10 @@ export default {
type: String,
required: true,
},
+ mergeRequestPath: {
+ type: String,
+ required: true,
+ },
},
data() {
return {
diff --git a/app/assets/javascripts/blob/suggest_gitlab_ci_yml/index.js b/app/assets/javascripts/blob/suggest_gitlab_ci_yml/index.js
index 3b67b3dd259..55edb852ee6 100644
--- a/app/assets/javascripts/blob/suggest_gitlab_ci_yml/index.js
+++ b/app/assets/javascripts/blob/suggest_gitlab_ci_yml/index.js
@@ -10,6 +10,7 @@ export default el =>
target: el.dataset.target,
trackLabel: el.dataset.trackLabel,
dismissKey: el.dataset.dismissKey,
+ mergeRequestPath: el.dataset.mergeRequestPath,
humanAccess: el.dataset.humanAccess,
},
});