summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/blob/pipeline_tour_success_modal.vue
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/blob/pipeline_tour_success_modal.vue')
-rw-r--r--app/assets/javascripts/blob/pipeline_tour_success_modal.vue45
1 files changed, 37 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>