From: Grégoire Aubert Date: Tue, 12 Jun 2018 13:55:25 +0000 (+0200) Subject: SONARCLOUD-65 Add pricing doc suggestion when on billing page X-Git-Tag: 7.5~960 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4805c1068177a5f9975357f1f3263a6fa8c09f78;p=sonarqube.git SONARCLOUD-65 Add pricing doc suggestion when on billing page --- diff --git a/server/sonar-docs/src/EmbedDocsSuggestions.json b/server/sonar-docs/src/EmbedDocsSuggestions.json index 8408b1cde58..12d1258f959 100644 --- a/server/sonar-docs/src/EmbedDocsSuggestions.json +++ b/server/sonar-docs/src/EmbedDocsSuggestions.json @@ -25,6 +25,13 @@ ], "custom_measures": [], "custom_metrics": [], + "extension_billing": [ + { + "link": "/documentation/sonarcloud-pricing", + "text": "Pricing", + "scope": "sonarcloud" + } + ], "global_permissions": [ { "link": "/documentation/organizations/manage-team", diff --git a/server/sonar-web/src/main/js/app/components/extensions/Extension.js b/server/sonar-web/src/main/js/app/components/extensions/Extension.js index e1a0ab878e8..db2d7080033 100644 --- a/server/sonar-web/src/main/js/app/components/extensions/Extension.js +++ b/server/sonar-web/src/main/js/app/components/extensions/Extension.js @@ -20,6 +20,7 @@ // @flow import React from 'react'; import Helmet from 'react-helmet'; +import * as PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { withRouter } from 'react-router'; import { injectIntl } from 'react-intl'; @@ -49,6 +50,10 @@ class Extension extends React.PureComponent { /*:: props: Props; */ /*:: stop: ?Function; */ + static contextTypes = { + suggestions: PropTypes.object.isRequired + }; + componentDidMount() { this.startExtension(); } @@ -79,6 +84,7 @@ class Extension extends React.PureComponent { intl: this.props.intl, location: this.props.location, router: this.props.router, + suggestions: this.context.suggestions, ...this.props.options }); }; diff --git a/server/sonar-web/src/main/js/app/utils/exposeLibraries.ts b/server/sonar-web/src/main/js/app/utils/exposeLibraries.ts index 2716c21be7d..fc7e79a9be3 100644 --- a/server/sonar-web/src/main/js/app/utils/exposeLibraries.ts +++ b/server/sonar-web/src/main/js/app/utils/exposeLibraries.ts @@ -21,6 +21,7 @@ import * as ReactRedux from 'react-redux'; import * as ReactRouter from 'react-router'; import throwGlobalError from './throwGlobalError'; import addGlobalSuccessMessage from './addGlobalSuccessMessage'; +import Suggestions from '../components/embed-docs-modal/Suggestions'; import * as measures from '../../helpers/measures'; import * as request from '../../helpers/request'; import DateFromNow from '../../components/intl/DateFromNow'; @@ -94,6 +95,7 @@ const exposeLibraries = () => { Select, SelectList, SubmitButton, + Suggestions, Tooltip }; };