]> source.dussan.org Git - sonarqube.git/commitdiff
Add Web API link back to SonarCloud help popup
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>
Tue, 11 Jul 2017 08:41:12 +0000 (10:41 +0200)
committerGrégoire Aubert <gregoire.aubert@sonarsource.com>
Tue, 11 Jul 2017 12:43:47 +0000 (14:43 +0200)
server/sonar-web/src/main/js/app/components/help/LinksHelpSonarCloud.js
server/sonar-web/src/main/js/app/components/help/__tests__/GlobalHelp-test.js

index 9fdf2751253f603d07d3ed22d16269c2b9660a82..ac2a737796e86bfdd8926357999b0c4278bda589 100644 (file)
@@ -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>
index 96bbd9a27fee17407805f77f03d68a49ade17775..76f95d4accbb1a1d8d1ab03b819837d4f6c708dc 100644 (file)
@@ -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 } } });
 }