diff options
author | Stas Vilchik <stas.vilchik@sonarsource.com> | 2017-06-19 05:48:01 -0700 |
---|---|---|
committer | Stas Vilchik <stas.vilchik@sonarsource.com> | 2017-06-20 04:10:53 -0700 |
commit | 472945cdd2331f0b1bf7eddeee1c744f588b4e2d (patch) | |
tree | a89b9d474b998fffd6c598163b26814f88f4a4c6 /server/sonar-web/src/main/js | |
parent | ac756ae021e7a9fadc7a2cbbcd80ce4278022edd (diff) | |
download | sonarqube-472945cdd2331f0b1bf7eddeee1c744f588b4e2d.tar.gz sonarqube-472945cdd2331f0b1bf7eddeee1c744f588b4e2d.zip |
apply more feedback on onboarding tutorial (#2179)
Diffstat (limited to 'server/sonar-web/src/main/js')
15 files changed, 148 insertions, 64 deletions
diff --git a/server/sonar-web/src/main/js/app/components/help/LinksHelp.js b/server/sonar-web/src/main/js/app/components/help/LinksHelp.js index e76ef2c6bb6..b84c28222d5 100644 --- a/server/sonar-web/src/main/js/app/components/help/LinksHelp.js +++ b/server/sonar-web/src/main/js/app/components/help/LinksHelp.js @@ -29,22 +29,35 @@ export default function LinksHelp({ onClose }: Props) { <div> <h2 className="spacer-top spacer-bottom">{translate('help.section.links')}</h2> - <a href="http://www.sonarqube.org">{translate('footer.community')}</a>{' - '} - <a href="https://redirect.sonarsource.com/doc/home.html"> - {translate('footer.documentation')} - </a> - {' - '} - <a href="https://redirect.sonarsource.com/doc/community.html"> - {translate('footer.support')} - </a> - {' - '} - <a href="https://redirect.sonarsource.com/doc/plugin-library.html"> - {translate('footer.plugins')} - </a> - {' - '} - <Link to="/web_api" onClick={onClose}>{translate('footer.web_api')}</Link> - {' - '} - <Link to="/about" onClick={onClose}>{translate('footer.about')}</Link> + <p className="spacer-bottom"> + <a href="http://www.sonarqube.org">{translate('footer.community')}</a> + </p> + + <p className="spacer-bottom"> + <a href="https://redirect.sonarsource.com/doc/home.html"> + {translate('footer.documentation')} + </a> + </p> + + <p className="spacer-bottom"> + <a href="https://redirect.sonarsource.com/doc/community.html"> + {translate('footer.support')} + </a> + </p> + + <p className="spacer-bottom"> + <a href="https://redirect.sonarsource.com/doc/plugin-library.html"> + {translate('footer.plugins')} + </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> </div> ); } 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 6efdac91b50..9fdf2751253 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 @@ -29,17 +29,29 @@ export default function LinksHelpSonarCloud({ onClose }: Props) { <div> <h2 className="spacer-top spacer-bottom">{translate('help.section.links')}</h2> - <a href="https://about.sonarcloud.io/news/">{translate('footer.news')}</a> - {' - '} - <a href="https://about.sonarcloud.io/terms.pdf">{translate('footer.terms')}</a> - {' - '} - <a href="https://twitter.com/sonarqube">{translate('footer.twitter')}</a> - {' - '} - <a href="https://about.sonarcloud.io/get-started/">{translate('footer.get_started')}</a> - {' - '} - <a href="https://about.sonarcloud.io/contact/">{translate('footer.help')}</a> - {' - '} - <Link to="/about" onClick={onClose}>{translate('footer.about')}</Link> + <p className="spacer-bottom"> + <a href="https://about.sonarcloud.io/news/">{translate('footer.news')}</a> + </p> + + <p className="spacer-bottom"> + <a href="https://about.sonarcloud.io/terms.pdf">{translate('footer.terms')}</a> + </p> + + <p className="spacer-bottom"> + <a href="https://twitter.com/sonarqube">{translate('footer.twitter')}</a> + </p> + + <p className="spacer-bottom"> + <a href="https://about.sonarcloud.io/get-started/">{translate('footer.get_started')}</a> + </p> + + <p className="spacer-bottom"> + <a href="https://about.sonarcloud.io/contact/">{translate('footer.help')}</a> + </p> + + <p> + <Link to="/about" onClick={onClose}>{translate('footer.about')}</Link> + </p> </div> ); } diff --git a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNav.js b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNav.js index cb2d2eca428..5f6de29a8f7 100644 --- a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNav.js +++ b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNav.js @@ -87,9 +87,7 @@ class GlobalNav extends React.PureComponent { openOnboardingTutorial = () => this.setState({ helpOpen: false, onboardingTutorialOpen: true }); - finishOnboardingTutorial = () => this.setState({ onboardingTutorialOpen: false }); - - skipOnboardingTutorial = () => { + closeOnboardingTutorial = () => { this.setState({ onboardingTutorialOpen: false, onboardingTutorialTooltip: true }); this.interval = setInterval(() => { this.setState({ onboardingTutorialTooltip: false }); @@ -131,10 +129,7 @@ class GlobalNav extends React.PureComponent { />} {this.state.onboardingTutorialOpen && - <OnboardingModal - onFinish={this.finishOnboardingTutorial} - onSkip={this.skipOnboardingTutorial} - />} + <OnboardingModal onFinish={this.closeOnboardingTutorial} />} </nav> ); } diff --git a/server/sonar-web/src/main/js/apps/overview/components/App.js b/server/sonar-web/src/main/js/apps/overview/components/App.js index 8a4adde9571..5e314f44351 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/App.js +++ b/server/sonar-web/src/main/js/apps/overview/components/App.js @@ -60,7 +60,7 @@ class App extends React.PureComponent { } if (!component.analysisDate) { - return <EmptyOverview {...this.props} />; + return <EmptyOverview component={component} />; } return <OverviewApp {...this.props} leakPeriodIndex="1" />; diff --git a/server/sonar-web/src/main/js/apps/overview/components/EmptyOverview.js b/server/sonar-web/src/main/js/apps/overview/components/EmptyOverview.js index 8bba1c5c7a5..ba9689b3b5e 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/EmptyOverview.js +++ b/server/sonar-web/src/main/js/apps/overview/components/EmptyOverview.js @@ -17,21 +17,40 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +// @flow import React from 'react'; +import { Link } from 'react-router'; import { translate } from '../../../helpers/l10n'; -const EmptyOverview = ({ component }) => { +type Props = { + component: { key: string } +}; + +export default function EmptyOverview({ component }: Props) { + const rawMessage = translate('provisioning.no_analysis.delete'); + const head = rawMessage.substr(0, rawMessage.indexOf('{0}')); + const tail = rawMessage.substr(rawMessage.indexOf('{0}') + 3); + return ( <div className="page page-limited"> <div className="alert alert-warning"> {translate('provisioning.no_analysis')} </div> + + <div className="big-spacer-top"> + {head} + <Link + className="text-danger" + to={{ pathname: '/project/deletion', query: { id: component.key } }}> + {translate('provisioning.no_analysis.delete_it')} + </Link> + {tail} + </div> + <div className="big-spacer-top"> <h4>{translate('key')}</h4> <code>{component.key}</code> </div> </div> ); -}; - -export default EmptyOverview; +} diff --git a/server/sonar-web/src/main/js/apps/tutorials/onboarding/AnalysisStep.js b/server/sonar-web/src/main/js/apps/tutorials/onboarding/AnalysisStep.js index 78733e66992..497f104b304 100644 --- a/server/sonar-web/src/main/js/apps/tutorials/onboarding/AnalysisStep.js +++ b/server/sonar-web/src/main/js/apps/tutorials/onboarding/AnalysisStep.js @@ -69,6 +69,7 @@ export default class AnalysisStep extends React.PureComponent { <LanguageStep onDone={this.handleLanguageSelect} onReset={this.handleLanguageReset} + organization={this.props.organization} sonarCloud={this.props.sonarCloud} /> </div> diff --git a/server/sonar-web/src/main/js/apps/tutorials/onboarding/Onboarding.js b/server/sonar-web/src/main/js/apps/tutorials/onboarding/Onboarding.js index 2f79f7add07..45df83f7dcd 100644 --- a/server/sonar-web/src/main/js/apps/tutorials/onboarding/Onboarding.js +++ b/server/sonar-web/src/main/js/apps/tutorials/onboarding/Onboarding.js @@ -33,7 +33,6 @@ import './styles.css'; type Props = {| currentUser: { login: string, isLoggedIn: boolean }, onFinish: () => void, - onSkip: () => void, organizationsEnabled: boolean, sonarCloud: boolean |}; @@ -76,16 +75,12 @@ export default class Onboarding extends React.PureComponent { this.mounted = false; } - finishOnboarding = (skipped: boolean = false) => { + finishOnboarding = () => { this.setState({ skipping: true }); skipOnboarding().then( () => { if (this.mounted) { - if (skipped) { - this.props.onSkip(); - } else { - this.props.onFinish(); - } + this.props.onFinish(); if (this.state.projectKey) { this.context.router.push(getProjectUrl(this.state.projectKey)); @@ -119,7 +114,7 @@ export default class Onboarding extends React.PureComponent { handleSkipClick = (event: Event) => { event.preventDefault(); - this.finishOnboarding(true); + this.finishOnboarding(); }; handleFinish = (projectKey?: string) => this.setState({ finished: true, projectKey }); diff --git a/server/sonar-web/src/main/js/apps/tutorials/onboarding/OnboardingModal.js b/server/sonar-web/src/main/js/apps/tutorials/onboarding/OnboardingModal.js index 3ec32829d17..7ae51334755 100644 --- a/server/sonar-web/src/main/js/apps/tutorials/onboarding/OnboardingModal.js +++ b/server/sonar-web/src/main/js/apps/tutorials/onboarding/OnboardingModal.js @@ -23,8 +23,7 @@ import Modal from 'react-modal'; import { translate } from '../../../helpers/l10n'; type Props = {| - onFinish: () => void, - onSkip: () => void + onFinish: () => void |}; type State = { @@ -63,8 +62,7 @@ export default class OnboardingModal extends React.PureComponent { contentLabel={translate('tutorials.onboarding')} className="modal modal-large" overlayClassName="modal-overlay"> - {OnboardingContainer != null && - <OnboardingContainer onFinish={this.props.onFinish} onSkip={this.props.onSkip} />} + {OnboardingContainer != null && <OnboardingContainer onFinish={this.props.onFinish} />} </Modal> ); } diff --git a/server/sonar-web/src/main/js/apps/tutorials/onboarding/__tests__/Onboarding-test.js b/server/sonar-web/src/main/js/apps/tutorials/onboarding/__tests__/Onboarding-test.js index f336d73a79b..ae21ca80fc9 100644 --- a/server/sonar-web/src/main/js/apps/tutorials/onboarding/__tests__/Onboarding-test.js +++ b/server/sonar-web/src/main/js/apps/tutorials/onboarding/__tests__/Onboarding-test.js @@ -34,7 +34,6 @@ it('guides for on-premise', () => { <Onboarding currentUser={currentUser} onFinish={jest.fn()} - onSkip={jest.fn()} organizationsEnabled={false} sonarCloud={false} /> @@ -52,7 +51,6 @@ it('guides for sonarcloud', () => { <Onboarding currentUser={currentUser} onFinish={jest.fn()} - onSkip={jest.fn()} organizationsEnabled={true} sonarCloud={true} /> @@ -70,19 +68,18 @@ it('guides for sonarcloud', () => { expect(wrapper).toMatchSnapshot(); }); -it('skips', () => { - const onSkip = jest.fn(); +it('finishes', () => { + const onFinish = jest.fn(); const wrapper = mount( <Onboarding currentUser={currentUser} - onFinish={jest.fn()} - onSkip={onSkip} + onFinish={onFinish} organizationsEnabled={false} sonarCloud={false} /> ); click(wrapper.find('.js-skip')); return doAsync(() => { - expect(onSkip).toBeCalled(); + expect(onFinish).toBeCalled(); }); }); diff --git a/server/sonar-web/src/main/js/apps/tutorials/onboarding/commands/JavaGradle.js b/server/sonar-web/src/main/js/apps/tutorials/onboarding/commands/JavaGradle.js index 3f89a2bb241..f7a710b9472 100644 --- a/server/sonar-web/src/main/js/apps/tutorials/onboarding/commands/JavaGradle.js +++ b/server/sonar-web/src/main/js/apps/tutorials/onboarding/commands/JavaGradle.js @@ -29,7 +29,7 @@ type Props = {| |}; export default function JavaGradle(props: Props) { - const config = 'plugins {\n id "org.sonarqube" version "2.2"\n}'; + const config = 'plugins {\n id "org.sonarqube" version "2.5"\n}'; const command = [ './gradlew sonarqube', @@ -54,6 +54,12 @@ export default function JavaGradle(props: Props) { className="big-spacer-top markdown" dangerouslySetInnerHTML={{ __html: translate('onboarding.analysis.java.gradle.docs') }} /> + <p + className="big-spacer-top markdown" + dangerouslySetInnerHTML={{ + __html: translate('onboarding.analysis.browse_url_after_analysis') + }} + /> </div> ); } diff --git a/server/sonar-web/src/main/js/apps/tutorials/onboarding/commands/JavaMaven.js b/server/sonar-web/src/main/js/apps/tutorials/onboarding/commands/JavaMaven.js index 6317b1bac2e..1166463012a 100644 --- a/server/sonar-web/src/main/js/apps/tutorials/onboarding/commands/JavaMaven.js +++ b/server/sonar-web/src/main/js/apps/tutorials/onboarding/commands/JavaMaven.js @@ -45,6 +45,12 @@ export default function JavaMaven(props: Props) { className="big-spacer-top markdown" dangerouslySetInnerHTML={{ __html: translate('onboarding.analysis.java.maven.docs') }} /> + <p + className="big-spacer-top markdown" + dangerouslySetInnerHTML={{ + __html: translate('onboarding.analysis.browse_url_after_analysis') + }} + /> </div> ); } diff --git a/server/sonar-web/src/main/js/apps/tutorials/onboarding/commands/Msvc.js b/server/sonar-web/src/main/js/apps/tutorials/onboarding/commands/Msvc.js index 00fba90474a..fe18afad6e3 100644 --- a/server/sonar-web/src/main/js/apps/tutorials/onboarding/commands/Msvc.js +++ b/server/sonar-web/src/main/js/apps/tutorials/onboarding/commands/Msvc.js @@ -41,7 +41,7 @@ export default function Msvc(props: Props) { `/d:"sonar.login=${props.token}"` ]; - const command2 = 'build-wrapper-win-x86-64.exe --out-dir bw-output MsBuild.exe /t:Rebuild'; + const command2 = ['build-wrapper-win-x86-64.exe', '--out-dir bw-output MsBuild.exe /t:Rebuild']; const command3 = ['SonarQube.Scanner.MSBuild.exe end', `/d:"sonar.login=${props.token}"`]; diff --git a/server/sonar-web/src/main/js/apps/tutorials/onboarding/commands/__tests__/__snapshots__/JavaGradle-test.js.snap b/server/sonar-web/src/main/js/apps/tutorials/onboarding/commands/__tests__/__snapshots__/JavaGradle-test.js.snap index df6bf9db47f..559864e0d90 100644 --- a/server/sonar-web/src/main/js/apps/tutorials/onboarding/commands/__tests__/__snapshots__/JavaGradle-test.js.snap +++ b/server/sonar-web/src/main/js/apps/tutorials/onboarding/commands/__tests__/__snapshots__/JavaGradle-test.js.snap @@ -17,7 +17,7 @@ exports[`renders correctly 1`] = ` /> <Command command="plugins { - id \\"org.sonarqube\\" version \\"2.2\\" + id \\"org.sonarqube\\" version \\"2.5\\" }" /> <p @@ -43,6 +43,14 @@ exports[`renders correctly 1`] = ` } } /> + <p + className="big-spacer-top markdown" + dangerouslySetInnerHTML={ + Object { + "__html": "onboarding.analysis.browse_url_after_analysis", + } + } + /> </div> `; @@ -63,7 +71,7 @@ exports[`renders correctly 2`] = ` /> <Command command="plugins { - id \\"org.sonarqube\\" version \\"2.2\\" + id \\"org.sonarqube\\" version \\"2.5\\" }" /> <p @@ -89,5 +97,13 @@ exports[`renders correctly 2`] = ` } } /> + <p + className="big-spacer-top markdown" + dangerouslySetInnerHTML={ + Object { + "__html": "onboarding.analysis.browse_url_after_analysis", + } + } + /> </div> `; diff --git a/server/sonar-web/src/main/js/apps/tutorials/onboarding/commands/__tests__/__snapshots__/JavaMaven-test.js.snap b/server/sonar-web/src/main/js/apps/tutorials/onboarding/commands/__tests__/__snapshots__/JavaMaven-test.js.snap index 3cd4796988b..60d6f6c8dfb 100644 --- a/server/sonar-web/src/main/js/apps/tutorials/onboarding/commands/__tests__/__snapshots__/JavaMaven-test.js.snap +++ b/server/sonar-web/src/main/js/apps/tutorials/onboarding/commands/__tests__/__snapshots__/JavaMaven-test.js.snap @@ -30,6 +30,14 @@ exports[`renders correctly 1`] = ` } } /> + <p + className="big-spacer-top markdown" + dangerouslySetInnerHTML={ + Object { + "__html": "onboarding.analysis.browse_url_after_analysis", + } + } + /> </div> `; @@ -63,5 +71,13 @@ exports[`renders correctly 2`] = ` } } /> + <p + className="big-spacer-top markdown" + dangerouslySetInnerHTML={ + Object { + "__html": "onboarding.analysis.browse_url_after_analysis", + } + } + /> </div> `; diff --git a/server/sonar-web/src/main/js/apps/tutorials/onboarding/commands/__tests__/__snapshots__/Msvc-test.js.snap b/server/sonar-web/src/main/js/apps/tutorials/onboarding/commands/__tests__/__snapshots__/Msvc-test.js.snap index c2f54b40496..564d75fb708 100644 --- a/server/sonar-web/src/main/js/apps/tutorials/onboarding/commands/__tests__/__snapshots__/Msvc-test.js.snap +++ b/server/sonar-web/src/main/js/apps/tutorials/onboarding/commands/__tests__/__snapshots__/Msvc-test.js.snap @@ -33,7 +33,12 @@ exports[`renders correctly 1`] = ` } /> <Command - command="build-wrapper-win-x86-64.exe --out-dir bw-output MsBuild.exe /t:Rebuild" + command={ + Array [ + "build-wrapper-win-x86-64.exe", + "--out-dir bw-output MsBuild.exe /t:Rebuild", + ] + } /> <Command command={ @@ -87,7 +92,12 @@ exports[`renders correctly 2`] = ` } /> <Command - command="build-wrapper-win-x86-64.exe --out-dir bw-output MsBuild.exe /t:Rebuild" + command={ + Array [ + "build-wrapper-win-x86-64.exe", + "--out-dir bw-output MsBuild.exe /t:Rebuild", + ] + } /> <Command command={ |