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
);
}
},
this.setState({ formData });
}
},
- () => { }
+ () => {}
);
};
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', {
marketplace.status_x.MANUAL_IN_PROGRESS=Can't install {0} because of internet access issue. Please manually install the package in your SonarQube's plugins folder.
marketplace.how_to_install=How to install it?
marketplace.enter_license_for_x=Enter your license key for {0}
+marketplace.wrong_license_type_x=Your license is not compatible with the selected edition. Please provide a valid license for {0}.
marketplace.i_need_a_license=I need a license key
marketplace.download_package=Download package