Commit 1b300fa3 authored by Clement Ho's avatar Clement Ho

Merge branch 'update-learn-more-url' into 'master'

Updates Learn More link in the generic alert section

See merge request gitlab-org/gitlab!16484
parents e4f18b14 28d9c301
......@@ -54,10 +54,6 @@ export default {
},
computed: {
learnMoreDescription() {
if (!this.learnMoreUrl) {
return '';
}
return sprintf(
s__(
'AlertService|%{linkStart}Learn more%{linkEnd} about configuring this endpoint to receive alerts.',
......
......@@ -2,4 +2,4 @@
.js-alerts-service-settings{ data: { activated: @service.activated?.to_s,
form_path: project_service_path(@project, @service.to_param),
authorization_key: @service.token, url: @service.url } }
authorization_key: @service.token, url: @service.url, learn_more_url: 'https://docs.gitlab.com/ee/user/project/integrations/generic_alerts.html' } }
......@@ -6,6 +6,4 @@ exports[`AlertsServiceForm with default values renders "url" input 1`] = `"<glfo
exports[`AlertsServiceForm with default values renders toggle button 1`] = `"<togglebutton-stub id=\\"activated\\"></togglebutton-stub>"`;
exports[`AlertsServiceForm with default values shows description and "Learn More" link 1`] = `"Each alert source must be authorized using the following URL and authorization key. <a href=\\"example.com/learn-more\\" target=\\"_blank\\" rel=\\"noopener noreferrer\\">Learn more</a> about configuring this endpoint to receive alerts."`;
exports[`AlertsServiceForm without learnMoreUrl shows description but not "Learn More" link 1`] = `"Each alert source must be authorized using the following URL and authorization key."`;
exports[`AlertsServiceForm with default values shows description and "Learn More" link 1`] = `"Each alert source must be authorized using the following URL and authorization key. <a href=\\"https://docs.gitlab.com/ee/user/project/integrations/generic_alerts.md\\" target=\\"_blank\\" rel=\\"noopener noreferrer\\">Learn more</a> about configuring this endpoint to receive alerts."`;
......@@ -14,7 +14,7 @@ const defaultProps = {
initialAuthorizationKey: 'abcedfg123',
formPath: 'http://invalid',
url: 'https://gitlab.com/endpoint-url',
learnMoreUrl: 'example.com/learn-more',
learnMoreUrl: 'https://docs.gitlab.com/ee/user/project/integrations/generic_alerts.md',
initialActivated: false,
};
......@@ -75,16 +75,6 @@ describe('AlertsServiceForm', () => {
});
});
describe('without learnMoreUrl', () => {
beforeEach(() => {
createComponent({ learnMoreUrl: '' });
});
it('shows description but not "Learn More" link', () => {
expect(findDescription().element.innerHTML).toMatchSnapshot();
});
});
describe('reset key', () => {
it('triggers resetKey method', () => {
const resetKey = jest.fn();
......
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