Commit 5c5d8ad4 authored by Brandon Labuschagne's avatar Brandon Labuschagne

Merge branch 'mmj-careers-page-in-hello-message' into 'master'

Invite folks to come work at GitLab via the hello message presented in the browser console (on gitlab.com only)

See merge request gitlab-org/gitlab!70761
parents 05c4a025 2abe5eb2
import { s__, sprintf } from '~/locale';
const HANDSHAKE = String.fromCodePoint(0x1f91d); const HANDSHAKE = String.fromCodePoint(0x1f91d);
const MAG = String.fromCodePoint(0x1f50e); const MAG = String.fromCodePoint(0x1f50e);
const ROCKET = String.fromCodePoint(0x1f680);
export const logHello = () => { export const logHello = () => {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.log( console.log(
`%cWelcome to GitLab!%c `%c${s__('HelloMessage|Welcome to GitLab!')}%c
Does this page need fixes or improvements? Open an issue or contribute a merge request to help make GitLab more lovable. At GitLab, everyone can contribute! ${s__(
'HelloMessage|Does this page need fixes or improvements? Open an issue or contribute a merge request to help make GitLab more lovable. At GitLab, everyone can contribute!',
)}
${HANDSHAKE} Contribute to GitLab: https://about.gitlab.com/community/contribute/ ${sprintf(s__('HelloMessage|%{handshake_emoji} Contribute to GitLab: %{contribute_link}'), {
${MAG} Create a new GitLab issue: https://gitlab.com/gitlab-org/gitlab/-/issues/new`, handshake_emoji: `${HANDSHAKE}`,
contribute_link: 'https://about.gitlab.com/community/contribute/',
})}
${sprintf(s__('HelloMessage|%{magnifier_emoji} Create a new GitLab issue: %{new_issue_link}'), {
magnifier_emoji: `${MAG}`,
new_issue_link: 'https://gitlab.com/gitlab-org/gitlab/-/issues/new',
})}
${
window.gon?.dot_com
? `${sprintf(
s__(
'HelloMessage|%{rocket_emoji} We like your curiosity! Help us improve GitLab by joining the team: %{jobs_page_link}',
),
{ rocket_emoji: `${ROCKET}`, jobs_page_link: 'https://about.gitlab.com/jobs/' },
)}`
: ''
}`,
`padding-top: 0.5em; font-size: 2em;`, `padding-top: 0.5em; font-size: 2em;`,
'padding-bottom: 0.5em;', 'padding-bottom: 0.5em;',
); );
......
...@@ -16672,6 +16672,21 @@ msgstr "" ...@@ -16672,6 +16672,21 @@ msgstr ""
msgid "Hello, %{username}!" msgid "Hello, %{username}!"
msgstr "" msgstr ""
msgid "HelloMessage|%{handshake_emoji} Contribute to GitLab: %{contribute_link}"
msgstr ""
msgid "HelloMessage|%{magnifier_emoji} Create a new GitLab issue: %{new_issue_link}"
msgstr ""
msgid "HelloMessage|%{rocket_emoji} We like your curiosity! Help us improve GitLab by joining the team: %{jobs_page_link}"
msgstr ""
msgid "HelloMessage|Does this page need fixes or improvements? Open an issue or contribute a merge request to help make GitLab more lovable. At GitLab, everyone can contribute!"
msgstr ""
msgid "HelloMessage|Welcome to GitLab!"
msgstr ""
msgid "Help" msgid "Help"
msgstr "" msgstr ""
......
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`~/lib/logger/hello logHello console logs a friendly hello message 1`] = ` exports[`~/lib/logger/hello logHello when on dot_com console logs a friendly hello message including the careers page 1`] = `
Array [ Array [
Array [ Array [
"%cWelcome to GitLab!%c "%cWelcome to GitLab!%c
...@@ -8,7 +8,24 @@ Array [ ...@@ -8,7 +8,24 @@ Array [
Does this page need fixes or improvements? Open an issue or contribute a merge request to help make GitLab more lovable. At GitLab, everyone can contribute! Does this page need fixes or improvements? Open an issue or contribute a merge request to help make GitLab more lovable. At GitLab, everyone can contribute!
🤝 Contribute to GitLab: https://about.gitlab.com/community/contribute/ 🤝 Contribute to GitLab: https://about.gitlab.com/community/contribute/
🔎 Create a new GitLab issue: https://gitlab.com/gitlab-org/gitlab/-/issues/new", 🔎 Create a new GitLab issue: https://gitlab.com/gitlab-org/gitlab/-/issues/new
🚀 We like your curiosity! Help us improve GitLab by joining the team: https://about.gitlab.com/jobs/",
"padding-top: 0.5em; font-size: 2em;",
"padding-bottom: 0.5em;",
],
]
`;
exports[`~/lib/logger/hello logHello when on self managed console logs a friendly hello message without including the careers page 1`] = `
Array [
Array [
"%cWelcome to GitLab!%c
Does this page need fixes or improvements? Open an issue or contribute a merge request to help make GitLab more lovable. At GitLab, everyone can contribute!
🤝 Contribute to GitLab: https://about.gitlab.com/community/contribute/
🔎 Create a new GitLab issue: https://gitlab.com/gitlab-org/gitlab/-/issues/new
",
"padding-top: 0.5em; font-size: 2em;", "padding-top: 0.5em; font-size: 2em;",
"padding-bottom: 0.5em;", "padding-bottom: 0.5em;",
], ],
......
...@@ -9,12 +9,32 @@ describe('~/lib/logger/hello', () => { ...@@ -9,12 +9,32 @@ describe('~/lib/logger/hello', () => {
}); });
describe('logHello', () => { describe('logHello', () => {
it('console logs a friendly hello message', () => { describe('when on dot_com', () => {
expect(consoleLogSpy).not.toHaveBeenCalled(); beforeEach(() => {
gon.dot_com = true;
});
logHello(); it('console logs a friendly hello message including the careers page', () => {
expect(consoleLogSpy).not.toHaveBeenCalled();
expect(consoleLogSpy.mock.calls).toMatchSnapshot(); logHello();
expect(consoleLogSpy.mock.calls).toMatchSnapshot();
});
});
describe('when on self managed', () => {
beforeEach(() => {
gon.dot_com = false;
});
it('console logs a friendly hello message without including the careers page', () => {
expect(consoleLogSpy).not.toHaveBeenCalled();
logHello();
expect(consoleLogSpy.mock.calls).toMatchSnapshot();
});
}); });
}); });
}); });
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