Commit 0f45d98a authored by Phil Hughes's avatar Phil Hughes

Merge branch 'kp-add-more-merging-status-phrases' into 'master'

Add more merging statuses to use randomly

See merge request gitlab-org/gitlab!60521
parents f804ed8b 15e353dd
<script> <script>
import { MERGE_ACTIVE_STATUS_PHRASES } from '../../constants';
import statusIcon from '../mr_widget_status_icon.vue'; import statusIcon from '../mr_widget_status_icon.vue';
export default { export default {
...@@ -13,6 +14,13 @@ export default { ...@@ -13,6 +14,13 @@ export default {
default: () => ({}), default: () => ({}),
}, },
}, },
data() {
const statusCount = MERGE_ACTIVE_STATUS_PHRASES.length;
return {
mergeStatus: MERGE_ACTIVE_STATUS_PHRASES[Math.floor(Math.random() * statusCount)],
};
},
}; };
</script> </script>
<template> <template>
...@@ -20,8 +28,8 @@ export default { ...@@ -20,8 +28,8 @@ export default {
<status-icon status="loading" /> <status-icon status="loading" />
<div class="media-body"> <div class="media-body">
<h4> <h4>
{{ s__('mrWidget|Merging! Drum roll, please…') }} {{ mergeStatus.message }}
<gl-emoji data-name="drum" /> <gl-emoji :data-name="mergeStatus.emoji" />
</h4> </h4>
<section class="mr-info-list"> <section class="mr-info-list">
<p> <p>
......
...@@ -25,3 +25,30 @@ export const SP_HELP_CONTENT = s__( ...@@ -25,3 +25,30 @@ export const SP_HELP_CONTENT = s__(
); );
export const SP_HELP_URL = 'https://about.gitlab.com/blog/2019/07/12/guide-to-ci-cd-pipelines/'; export const SP_HELP_URL = 'https://about.gitlab.com/blog/2019/07/12/guide-to-ci-cd-pipelines/';
export const SP_ICON_NAME = 'status_notfound'; export const SP_ICON_NAME = 'status_notfound';
export const MERGE_ACTIVE_STATUS_PHRASES = [
{
message: s__('mrWidget|Merging! Drum roll, please…'),
emoji: 'drum',
},
{
message: s__("mrWidget|Merging! We're almost there…"),
emoji: 'sparkles',
},
{
message: s__('mrWidget|Merging! Changes will land soon…'),
emoji: 'airplane_arriving',
},
{
message: s__('mrWidget|Merging! Changes are being shipped…'),
emoji: 'ship',
},
{
message: s__("mrWidget|Merging! Everything's good…"),
emoji: 'relieved',
},
{
message: s__('mrWidget|Merging! This is going to be great…'),
emoji: 'heart_eyes',
},
];
---
title: Show a random predefined message while MR merging is in progress
merge_request: 60521
author:
type: added
...@@ -38231,9 +38231,24 @@ msgstr "" ...@@ -38231,9 +38231,24 @@ msgstr ""
msgid "mrWidget|Merged by" msgid "mrWidget|Merged by"
msgstr "" msgstr ""
msgid "mrWidget|Merging! Changes are being shipped…"
msgstr ""
msgid "mrWidget|Merging! Changes will land soon…"
msgstr ""
msgid "mrWidget|Merging! Drum roll, please…" msgid "mrWidget|Merging! Drum roll, please…"
msgstr "" msgstr ""
msgid "mrWidget|Merging! Everything's good…"
msgstr ""
msgid "mrWidget|Merging! This is going to be great…"
msgstr ""
msgid "mrWidget|Merging! We're almost there…"
msgstr ""
msgid "mrWidget|More information" msgid "mrWidget|More information"
msgstr "" msgstr ""
......
...@@ -445,7 +445,7 @@ RSpec.describe 'Merge request > User sees merge widget', :js do ...@@ -445,7 +445,7 @@ RSpec.describe 'Merge request > User sees merge widget', :js do
wait_for_requests wait_for_requests
expect(page).not_to have_button('Merge') expect(page).not_to have_button('Merge')
expect(page).to have_content('Merging! Drum roll, please…') expect(page).to have_content('Merging!')
end end
end end
......
...@@ -31,7 +31,7 @@ describe('MRWidgetMerging', () => { ...@@ -31,7 +31,7 @@ describe('MRWidgetMerging', () => {
.trim() .trim()
.replace(/\s\s+/g, ' ') .replace(/\s\s+/g, ' ')
.replace(/[\r\n]+/g, ' '), .replace(/[\r\n]+/g, ' '),
).toContain('Merging! Drum roll, please…'); ).toContain('Merging!');
}); });
it('renders branch information', () => { it('renders branch information', () => {
......
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