aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>2017-10-27 09:13:05 +0200
committerGrégoire Aubert <gregoire.aubert@sonarsource.com>2017-10-27 16:03:44 +0200
commit38ef4f02e5feccc2d1e740ee12220b5088a2b8ba (patch)
tree10a564abf8a6a6689d7bf37258be1c2cffe903ba /server
parentd4799b6bd87a9c61e2d97594795450f9e60f1f73 (diff)
downloadsonarqube-38ef4f02e5feccc2d1e740ee12220b5088a2b8ba.tar.gz
sonarqube-38ef4f02e5feccc2d1e740ee12220b5088a2b8ba.zip
SONAR-9937 Display error message when license don't match selected edition in marketplace
Diffstat (limited to 'server')
-rw-r--r--server/sonar-web/src/main/js/apps/marketplace/components/LicenseEditionSet.tsx15
1 files changed, 13 insertions, 2 deletions
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 3ec3bb3485b..74e2874c1a0 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
@@ -67,10 +67,11 @@ export default class LicenseEditionSet extends React.PureComponent<Props, State>
getLicensePreview({ license }).then(
({ previewStatus, nextEditionKey }) => {
if (this.mounted) {
+ const { edition } = this.props;
this.updateLicense(
license,
this.props.editions.find(edition => edition.key === nextEditionKey),
- previewStatus
+ edition && edition.key !== nextEditionKey ? undefined : previewStatus
);
}
},
@@ -89,7 +90,7 @@ export default class LicenseEditionSet extends React.PureComponent<Props, State>
this.setState({ formData });
}
},
- () => { }
+ () => {}
);
};
@@ -122,8 +123,18 @@ export default class LicenseEditionSet extends React.PureComponent<Props, State>
renderAlert() {
const { licenseEdition, previewStatus } = this.state;
if (!previewStatus) {
+ const { edition } = this.props;
+ if (edition && licenseEdition && edition.key !== licenseEdition.key) {
+ return (
+ <p className="alert alert-danger spacer-top">
+ {translateWithParameters('marketplace.wrong_license_type_x', edition.name)}
+ </p>
+ );
+ }
+
return undefined;
}
+
return (
<p
className={classNames('alert spacer-top', {