diff options
author | Grégoire Aubert <gregoire.aubert@sonarsource.com> | 2017-11-03 10:35:37 +0100 |
---|---|---|
committer | Grégoire Aubert <gregoire.aubert@sonarsource.com> | 2017-11-03 11:54:04 +0100 |
commit | 2b52fdc96d184e41be8854ca25603501429ec394 (patch) | |
tree | 721235250d37acac2fb472ed676cbe1ac2212638 /server/sonar-web/src/main/js | |
parent | d983b4247683913a2d43b3e08ba87d5e388b256f (diff) | |
download | sonarqube-2b52fdc96d184e41be8854ca25603501429ec394.tar.gz sonarqube-2b52fdc96d184e41be8854ca25603501429ec394.zip |
Update wording and links for datacenter edition
Diffstat (limited to 'server/sonar-web/src/main/js')
4 files changed, 54 insertions, 29 deletions
diff --git a/server/sonar-web/src/main/js/app/components/nav/settings/SettingsEditionsNotif.tsx b/server/sonar-web/src/main/js/app/components/nav/settings/SettingsEditionsNotif.tsx index 81b04d738cc..d2e8548ff72 100644 --- a/server/sonar-web/src/main/js/app/components/nav/settings/SettingsEditionsNotif.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/settings/SettingsEditionsNotif.tsx @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import { FormattedMessage } from 'react-intl'; import NavBarNotif from '../../../../components/nav/NavBarNotif'; import RestartForm from '../../../../components/common/RestartForm'; import { dismissErrorMessage, Edition, EditionStatus } from '../../../../api/marketplace'; @@ -81,12 +82,21 @@ export default class SettingsEditionsNotif extends React.PureComponent<Props, St </span> {edition && edition.key === 'datacenter' && ( - <a - className="spacer-left" - href="https://redirect.sonarsource.com/doc/how-to-install-an-edition.html" - target="_blank"> - {translate('marketplace.how_to_configure_cluster')} - </a> + <span className="little-spacer-left"> + <FormattedMessage + defaultMessage={translate('marketplace.see_documentation_to_enable_cluster')} + id="marketplace.see_documentation_to_enable_cluster" + values={{ + url: ( + <a + href="https://redirect.sonarsource.com/doc/data-center-edition.html" + target="_blank"> + {edition.name} + </a> + ) + }} + /> + </span> )} {!preventRestart && ( <button className="js-restart spacer-left" onClick={this.handleOpenRestart}> @@ -111,6 +121,18 @@ export default class SettingsEditionsNotif extends React.PureComponent<Props, St ) : ( translate('marketplace.status', editionStatus.installationStatus) )} + <a + className="spacer-left" + href={ + edition && edition.key === 'datacenter' ? ( + 'https://redirect.sonarsource.com/doc/data-center-edition.html' + ) : ( + 'https://redirect.sonarsource.com/doc/how-to-install-an-edition.html' + ) + } + target="_blank"> + {translate('marketplace.how_to_install')} + </a> {edition && ( <a className="button spacer-left" @@ -120,19 +142,12 @@ export default class SettingsEditionsNotif extends React.PureComponent<Props, St {translate('marketplace.download_package')} </a> )} - <a - className="spacer-left" - href="https://redirect.sonarsource.com/doc/how-to-install-an-edition.html" - target="_blank"> - {translate('marketplace.how_to_install')} - </a> </NavBarNotif> ); } renderStatusAlert() { - const { editionStatus } = this.props; - const { currentEditionKey, installationStatus, nextEditionKey } = editionStatus; + const { currentEditionKey, installationStatus, nextEditionKey } = this.props.editionStatus; const nextEdition = this.props.editions && this.props.editions.find(edition => edition.key === nextEditionKey); const currentEdition = diff --git a/server/sonar-web/src/main/js/app/components/nav/settings/__tests__/SettingsEditionsNotif-test.tsx b/server/sonar-web/src/main/js/app/components/nav/settings/__tests__/SettingsEditionsNotif-test.tsx index 46e6bee0deb..0ace0c6ee3c 100644 --- a/server/sonar-web/src/main/js/app/components/nav/settings/__tests__/SettingsEditionsNotif-test.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/settings/__tests__/SettingsEditionsNotif-test.tsx @@ -115,7 +115,7 @@ it('should not display the restart button', () => { expect(wrapper.find('button.js-restart').exists()).toBeFalsy(); }); -it('should a link to cluster documentation for datacenter edition', () => { +it('should have a link to cluster documentation for datacenter edition', () => { const editions = [{ key: 'datacenter' }] as any; const wrapper = shallow( <SettingsEditionsNotif @@ -125,5 +125,5 @@ it('should a link to cluster documentation for datacenter edition', () => { setEditionStatus={jest.fn()} /> ); - expect(wrapper.find('a').exists()).toBeTruthy(); + expect(wrapper.find('FormattedMessage').exists()).toBeTruthy(); }); diff --git a/server/sonar-web/src/main/js/app/components/nav/settings/__tests__/__snapshots__/SettingsEditionsNotif-test.tsx.snap b/server/sonar-web/src/main/js/app/components/nav/settings/__tests__/__snapshots__/SettingsEditionsNotif-test.tsx.snap index 51ab67171a5..dcef4f6806f 100644 --- a/server/sonar-web/src/main/js/app/components/nav/settings/__tests__/__snapshots__/SettingsEditionsNotif-test.tsx.snap +++ b/server/sonar-web/src/main/js/app/components/nav/settings/__tests__/__snapshots__/SettingsEditionsNotif-test.tsx.snap @@ -6,19 +6,19 @@ exports[`should display a manual installation notification 1`] = ` > marketplace.status_x.MANUAL_IN_PROGRESS.Foo <a - className="button spacer-left" - download="sonarqube-Foo.zip" - href="download_url" + className="spacer-left" + href="https://redirect.sonarsource.com/doc/how-to-install-an-edition.html" target="_blank" > - marketplace.download_package + marketplace.how_to_install </a> <a - className="spacer-left" - href="https://redirect.sonarsource.com/doc/how-to-install-an-edition.html" + className="button spacer-left" + download="sonarqube-Foo.zip" + href="download_url" target="_blank" > - marketplace.how_to_install + marketplace.download_package </a> </NavBarNotif> `; diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/LicenseEditionSet.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/LicenseEditionSet.tsx index 5b22e20f1e5..edcd13a3d03 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/LicenseEditionSet.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/components/LicenseEditionSet.tsx @@ -19,6 +19,7 @@ */ import * as React from 'react'; import * as classNames from 'classnames'; +import { FormattedMessage } from 'react-intl'; import { stringify } from 'querystring'; import { debounce } from 'lodash'; import DeferredSpinner from '../../../components/common/DeferredSpinner'; @@ -149,12 +150,21 @@ export default class LicenseEditionSet extends React.PureComponent<Props, State> {licenseEdition && licenseEdition.key === 'datacenter' && previewStatus !== 'NO_INSTALL' && ( - <a - className="spacer-left" - href="https://redirect.sonarsource.com/doc/how-to-install-an-edition.html" - target="_blank"> - {translate('marketplace.how_to_configure_cluster')} - </a> + <span className="little-spacer-left"> + <FormattedMessage + defaultMessage={translate('marketplace.how_to_setup_cluster_url')} + id="marketplace.how_to_setup_cluster_url" + values={{ + url: ( + <a + href="https://redirect.sonarsource.com/doc/data-center-edition.html" + target="_blank"> + {licenseEdition.name} + </a> + ) + }} + /> + </span> )} </p> ); |