From 4805c1068177a5f9975357f1f3263a6fa8c09f78 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gr=C3=A9goire=20Aubert?= Date: Tue, 12 Jun 2018 15:55:25 +0200 Subject: [PATCH] SONARCLOUD-65 Add pricing doc suggestion when on billing page --- server/sonar-docs/src/EmbedDocsSuggestions.json | 7 +++++++ .../src/main/js/app/components/extensions/Extension.js | 6 ++++++ server/sonar-web/src/main/js/app/utils/exposeLibraries.ts | 2 ++ 3 files changed, 15 insertions(+) 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 }; }; -- 2.39.5