From 96d09bc3cff645e80c07c07a6386ede497d77614 Mon Sep 17 00:00:00 2001 From: Jeremy Davis Date: Mon, 12 Apr 2021 17:20:36 +0200 Subject: [PATCH] SONAR-14661 Restrict plugin installation to CE --- .../src/main/js/apps/marketplace/App.tsx | 11 +- .../apps/marketplace/__tests__/App-test.tsx | 6 + .../__tests__/__snapshots__/App-test.tsx.snap | 255 ++++++++++++++++++ 3 files changed, 271 insertions(+), 1 deletion(-) create mode 100644 server/sonar-web/src/main/js/apps/marketplace/__tests__/__snapshots__/App-test.tsx.snap diff --git a/server/sonar-web/src/main/js/apps/marketplace/App.tsx b/server/sonar-web/src/main/js/apps/marketplace/App.tsx index 6c837133eb2..bcb8929fcaf 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/App.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/App.tsx @@ -147,6 +147,15 @@ export class App extends React.PureComponent { const query = parseQuery(this.props.location.query); const filteredPlugins = filterPlugins(plugins, query.search); + /* + * standalone mode is true when cluster mode is not active. We preserve this + * condition if it ever becomes possible to have a community edition NOT in standalone mode. + */ + const allowActions = + currentEdition === EditionKey.community && + Boolean(standaloneMode) && + riskConsent === RiskConsent.Accepted; + return (
@@ -196,7 +205,7 @@ export class App extends React.PureComponent {