Commit 534b5758 authored by Illya Klymov's avatar Illya Klymov

Merge branch 'copy-for-mr-with-no-pipeline-experiment-first-nudge' into 'master'

Copy updates for VueMergeRequestWidget

See merge request gitlab-org/gitlab!34513
parents dad353e4 101224d4
<script> <script>
import { GlPopover, GlDeprecatedButton } from '@gitlab/ui'; import { GlPopover, GlDeprecatedButton, GlSprintf, GlLink } from '@gitlab/ui';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import { parseBoolean } from '~/lib/utils/common_utils'; import { parseBoolean } from '~/lib/utils/common_utils';
import Tracking from '~/tracking'; import Tracking from '~/tracking';
import { s__ } from '~/locale';
const trackingMixin = Tracking.mixin(); const trackingMixin = Tracking.mixin();
...@@ -14,10 +15,16 @@ export default { ...@@ -14,10 +15,16 @@ export default {
dismissTrackValue: 20, dismissTrackValue: 20,
showTrackValue: 10, showTrackValue: 10,
trackEvent: 'click_button', trackEvent: 'click_button',
helpContent: s__(
`mrWidget|Use %{linkStart}CI pipelines to test your code%{linkEnd}, simply add a GitLab CI configuration file to your project. It only takes a minute to make your code more secure and robust.`,
),
helpURL: 'https://about.gitlab.com/blog/2019/07/12/guide-to-ci-cd-pipelines/',
components: { components: {
GlPopover, GlPopover,
GlDeprecatedButton, GlDeprecatedButton,
Icon, Icon,
GlSprintf,
GlLink,
}, },
mixins: [trackingMixin], mixins: [trackingMixin],
props: { props: {
...@@ -97,13 +104,13 @@ export default { ...@@ -97,13 +104,13 @@ export default {
<div class="svg-content svg-150 pt-1"> <div class="svg-content svg-150 pt-1">
<img :src="pipelineSvgPath" /> <img :src="pipelineSvgPath" />
</div> </div>
<p> <gl-sprintf :message="$options.helpContent">
{{ <template #link="{ content }">
s__( <gl-link :href="$options.helpURL" target="_blank" class="font-size-inherit">{{
'mrWidget|Detect issues before deployment with a CI pipeline that continuously tests your code. We created a quick guide that will show you how to create one. Make your code more secure and more robust in just a minute.', content
) }}</gl-link>
}} </template>
</p> </gl-sprintf>
<gl-deprecated-button <gl-deprecated-button
ref="ok" ref="ok"
category="primary" category="primary"
...@@ -116,7 +123,7 @@ export default { ...@@ -116,7 +123,7 @@ export default {
:data-track-event="$options.trackEvent" :data-track-event="$options.trackEvent"
:data-track-label="trackLabel" :data-track-label="trackLabel"
> >
{{ __('Show me how') }} {{ __('Show me how to add a pipeline') }}
</gl-deprecated-button> </gl-deprecated-button>
<gl-deprecated-button <gl-deprecated-button
ref="no-thanks" ref="no-thanks"
...@@ -130,7 +137,7 @@ export default { ...@@ -130,7 +137,7 @@ export default {
:data-track-label="trackLabel" :data-track-label="trackLabel"
@click="dismissPopover" @click="dismissPopover"
> >
{{ __("No thanks, don't show this again") }} {{ __('No thanks') }}
</gl-deprecated-button> </gl-deprecated-button>
</gl-popover> </gl-popover>
</template> </template>
...@@ -15113,7 +15113,7 @@ msgstr "" ...@@ -15113,7 +15113,7 @@ msgstr ""
msgid "No test coverage" msgid "No test coverage"
msgstr "" msgstr ""
msgid "No thanks, don't show this again" msgid "No thanks"
msgstr "" msgstr ""
msgid "No vulnerabilities present" msgid "No vulnerabilities present"
...@@ -20598,7 +20598,7 @@ msgstr "" ...@@ -20598,7 +20598,7 @@ msgstr ""
msgid "Show me everything" msgid "Show me everything"
msgstr "" msgstr ""
msgid "Show me how" msgid "Show me how to add a pipeline"
msgstr "" msgstr ""
msgid "Show me more advanced stuff" msgid "Show me more advanced stuff"
...@@ -27218,9 +27218,6 @@ msgstr "" ...@@ -27218,9 +27218,6 @@ msgstr ""
msgid "mrWidget|Deployment statistics are not available currently" msgid "mrWidget|Deployment statistics are not available currently"
msgstr "" msgstr ""
msgid "mrWidget|Detect issues before deployment with a CI pipeline that continuously tests your code. We created a quick guide that will show you how to create one. Make your code more secure and more robust in just a minute."
msgstr ""
msgid "mrWidget|Did not close" msgid "mrWidget|Did not close"
msgstr "" msgstr ""
...@@ -27383,6 +27380,9 @@ msgstr "" ...@@ -27383,6 +27380,9 @@ msgstr ""
msgid "mrWidget|To approve this merge request, please enter your password. This project requires all approvals to be authenticated." msgid "mrWidget|To approve this merge request, please enter your password. This project requires all approvals to be authenticated."
msgstr "" msgstr ""
msgid "mrWidget|Use %{linkStart}CI pipelines to test your code%{linkEnd}, simply add a GitLab CI configuration file to your project. It only takes a minute to make your code more secure and robust."
msgstr ""
msgid "mrWidget|When this merge request is ready, remove the WIP: prefix from the title to allow it to be merged" msgid "mrWidget|When this merge request is ready, remove the WIP: prefix from the title to allow it to be merged"
msgstr "" msgstr ""
......
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import { GlLink } from '@gitlab/ui'; import { GlLink, GlSprintf } from '@gitlab/ui';
import suggestPipelineComponent from '~/vue_merge_request_widget/components/mr_widget_suggest_pipeline.vue'; import suggestPipelineComponent from '~/vue_merge_request_widget/components/mr_widget_suggest_pipeline.vue';
import stubChildren from 'helpers/stub_children'; import stubChildren from 'helpers/stub_children';
import PipelineTourState from '~/vue_merge_request_widget/components/states/mr_widget_pipeline_tour.vue'; import PipelineTourState from '~/vue_merge_request_widget/components/states/mr_widget_pipeline_tour.vue';
...@@ -18,6 +18,7 @@ describe('MRWidgetHeader', () => { ...@@ -18,6 +18,7 @@ describe('MRWidgetHeader', () => {
propsData: { pipelinePath, pipelineSvgPath, humanAccess }, propsData: { pipelinePath, pipelineSvgPath, humanAccess },
stubs: { stubs: {
...stubChildren(PipelineTourState), ...stubChildren(PipelineTourState),
GlSprintf,
}, },
}); });
}); });
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { GlPopover } from '@gitlab/ui'; import { GlPopover, GlLink, GlSprintf } from '@gitlab/ui';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import { mockTracking, triggerEvent, unmockTracking } from 'helpers/tracking_helper'; import { mockTracking, triggerEvent, unmockTracking } from 'helpers/tracking_helper';
import pipelineTourState from '~/vue_merge_request_widget/components/states/mr_widget_pipeline_tour.vue'; import pipelineTourState from '~/vue_merge_request_widget/components/states/mr_widget_pipeline_tour.vue';
...@@ -51,6 +51,9 @@ describe('MRWidgetPipelineTour', () => { ...@@ -51,6 +51,9 @@ describe('MRWidgetPipelineTour', () => {
Cookies.remove(cookieKey); Cookies.remove(cookieKey);
wrapper = shallowMount(pipelineTourState, { wrapper = shallowMount(pipelineTourState, {
propsData: popoverProps, propsData: popoverProps,
stubs: {
GlSprintf,
},
}); });
}); });
...@@ -60,6 +63,13 @@ describe('MRWidgetPipelineTour', () => { ...@@ -60,6 +63,13 @@ describe('MRWidgetPipelineTour', () => {
expect(popover.exists()).toBe(true); expect(popover.exists()).toBe(true);
}); });
it('renders the help link', () => {
const link = wrapper.find(GlLink);
expect(link.exists()).toBe(true);
expect(link.attributes('href')).toBe(wrapper.vm.$options.helpURL);
});
it('renders the show me how button', () => { it('renders the show me how button', () => {
const button = findOkBtn(); const button = findOkBtn();
......
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