diff options
author | Grégoire Aubert <gregoire.aubert@sonarsource.com> | 2017-07-11 10:41:12 +0200 |
---|---|---|
committer | Grégoire Aubert <gregoire.aubert@sonarsource.com> | 2017-07-11 14:43:47 +0200 |
commit | 36935a2ab83bcb2c5aa391386a8872cba00cc400 (patch) | |
tree | abe3098c63b681a6c0658f3e4577c2aa232cefa3 /server | |
parent | 9c931dbc8415d59265309c8f330bc958e7b3492e (diff) | |
download | sonarqube-36935a2ab83bcb2c5aa391386a8872cba00cc400.tar.gz sonarqube-36935a2ab83bcb2c5aa391386a8872cba00cc400.zip |
Add Web API link back to SonarCloud help popup
Diffstat (limited to 'server')
-rw-r--r-- | server/sonar-web/src/main/js/app/components/help/LinksHelpSonarCloud.js | 4 | ||||
-rw-r--r-- | server/sonar-web/src/main/js/app/components/help/__tests__/GlobalHelp-test.js | 13 |
2 files changed, 17 insertions, 0 deletions
diff --git a/server/sonar-web/src/main/js/app/components/help/LinksHelpSonarCloud.js b/server/sonar-web/src/main/js/app/components/help/LinksHelpSonarCloud.js index 9fdf2751253..ac2a737796e 100644 --- a/server/sonar-web/src/main/js/app/components/help/LinksHelpSonarCloud.js +++ b/server/sonar-web/src/main/js/app/components/help/LinksHelpSonarCloud.js @@ -49,6 +49,10 @@ export default function LinksHelpSonarCloud({ onClose }: Props) { <a href="https://about.sonarcloud.io/contact/">{translate('footer.help')}</a> </p> + <p className="spacer-bottom"> + <Link to="/web_api" onClick={onClose}>{translate('footer.web_api')}</Link> + </p> + <p> <Link to="/about" onClick={onClose}>{translate('footer.about')}</Link> </p> diff --git a/server/sonar-web/src/main/js/app/components/help/__tests__/GlobalHelp-test.js b/server/sonar-web/src/main/js/app/components/help/__tests__/GlobalHelp-test.js index 96bbd9a27fe..76f95d4accb 100644 --- a/server/sonar-web/src/main/js/app/components/help/__tests__/GlobalHelp-test.js +++ b/server/sonar-web/src/main/js/app/components/help/__tests__/GlobalHelp-test.js @@ -52,6 +52,19 @@ it('does not show tutorials for anonymous', () => { ).toMatchSnapshot(); }); +it('display special links page for SonarCloud', () => { + const wrapper = shallow( + <GlobalHelp + currentUser={{ isLoggedIn: false }} + onClose={jest.fn()} + onTutorialSelect={jest.fn()} + sonarCloud={true} + /> + ); + clickOnSection(wrapper, 'links'); + expect(wrapper.find('LinksHelpSonarCloud')).toHaveLength(1); +}); + function clickOnSection(wrapper: Object, section: string) { click(wrapper.find(`[data-section="${section}"]`), { currentTarget: { dataset: { section } } }); } |