From 84de08d367995b0b9fa374fc2ab9871bde86c9d4 Mon Sep 17 00:00:00 2001 From: Wouter Admiraal Date: Thu, 1 Oct 2020 17:02:42 +0200 Subject: [PATCH] SONAR-12122 Let users know that a restart is needed before they (un)install a plugin --- .../marketplace/components/PluginActions.tsx | 35 +++++++++------ .../components/PluginUpdateButton.tsx | 17 ++++--- .../__snapshots__/PluginActions-test.tsx.snap | 44 ++++++++++--------- .../resources/org/sonar/l10n/core.properties | 1 + 4 files changed, 56 insertions(+), 41 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/PluginActions.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/PluginActions.tsx index 06319354ad5..ac08fd563d4 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/PluginActions.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/components/PluginActions.tsx @@ -20,6 +20,7 @@ import * as React from 'react'; import { Button } from 'sonar-ui-common/components/controls/buttons'; import Checkbox from 'sonar-ui-common/components/controls/Checkbox'; +import Tooltip from 'sonar-ui-common/components/controls/Tooltip'; import CheckIcon from 'sonar-ui-common/components/icons/CheckIcon'; import { translate } from 'sonar-ui-common/helpers/l10n'; import { installPlugin, uninstallPlugin, updatePlugin } from '../../../api/plugins'; @@ -139,7 +140,7 @@ export default class PluginActions extends React.PureComponent { )} {loading && } {isInstalledPlugin(plugin) && ( -
+ <> {plugin.updates && plugin.updates.map((update, idx) => ( { update={update} /> ))} - -
+ + + + )} {isAvailablePlugin(plugin) && ( - + + + )} ); diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/PluginUpdateButton.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/PluginUpdateButton.tsx index e34e3f37bad..8d2144fccf3 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/PluginUpdateButton.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/components/PluginUpdateButton.tsx @@ -19,7 +19,8 @@ */ import * as React from 'react'; import { Button } from 'sonar-ui-common/components/controls/buttons'; -import { translateWithParameters } from 'sonar-ui-common/helpers/l10n'; +import Tooltip from 'sonar-ui-common/components/controls/Tooltip'; +import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n'; import { Update } from '../../../types/plugins'; interface Props { @@ -39,12 +40,14 @@ export default class PluginUpdateButton extends React.PureComponent { return null; } return ( - + + + ); } } diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/PluginActions-test.tsx.snap b/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/PluginActions-test.tsx.snap index 6f229d96527..d5a6548367e 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/PluginActions-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/PluginActions-test.tsx.snap @@ -30,13 +30,17 @@ exports[`should render available plugin correctly 1`] = ` marketplace.terms_and_conditions

- + + `; @@ -64,20 +68,20 @@ exports[`should render installed plugin correctly 1`] = `
-
- + } + /> + -
+
`; diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties index 2a0f4a15be5..2423825a8e4 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -2609,6 +2609,7 @@ marketplace.developed_by_x=Developed by {organization} marketplace.install_pending=Install Pending marketplace.update_pending=Update Pending marketplace.uninstall_pending=Uninstall Pending +marketplace.requires_restart=This requires a restart marketplace.updates=Updates marketplace.update_status.COMPATIBLE=Compatible marketplace.update_status.INCOMPATIBLE=Incompatible -- 2.39.5