diff --git a/CHANGELOG.md b/CHANGELOG.md index 8de0a1ae51..42479c8a5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Build on windows ([#1048](https://github.com/scm-manager/scm-manager/issues/1048), [#1049](https://github.com/scm-manager/scm-manager/issues/1049), [#1056](https://github.com/scm-manager/scm-manager/pull/1056)) +- Show specific notification for plugin actions on plugin administration ([#1057](https://github.com/scm-manager/scm-manager/pull/1057)) ## 2.0.0-rc5 - 2020-03-12 ### Added diff --git a/scm-ui/ui-webapp/public/locales/de/admin.json b/scm-ui/ui-webapp/public/locales/de/admin.json index 2bfc2d6b5b..e65a10eb85 100644 --- a/scm-ui/ui-webapp/public/locales/de/admin.json +++ b/scm-ui/ui-webapp/public/locales/de/admin.json @@ -61,7 +61,10 @@ "newVersion": "Neue Version", "dependencyNotification": "Mit diesem Plugin werden folgende Abhängigkeiten mit installiert, wenn sie noch nicht vorhanden sind!", "dependencies": "Abhängigkeiten", - "successNotification": "Das Plugin wurde erfolgreich installiert. Um Änderungen an der UI zu sehen, muss die Seite neu geladen werden:", + "installedNotification": "Das Plugin wurde erfolgreich installiert. Um Änderungen an der UI zu sehen, muss die Seite neu geladen werden:", + "updatedNotification": "Das Plugin wurde erfolgreich aktualisiert. Um Änderungen an der UI zu sehen, muss die Seite neu geladen werden:", + "uninstalledNotification": "Das Plugin wurde erfolgreich installiert. Um Änderungen an der UI zu sehen, muss die Seite neu geladen werden:", + "executedChangesNotification": "Die Plugin Änderungen wurden erfolgreich durchgeführt. Um Änderungen an der UI zu sehen, muss die Seite neu geladen werden:", "reload": "jetzt neu laden", "restartNotification": "Der SCM-Manager Kontext sollte nur neu gestartet werden, wenn aktuell niemand damit arbeitet.", "executePending": "Die folgenden Plugin-Änderungen werden ausgeführt. Anschließend wird der SCM-Manager Kontext neu gestartet.", diff --git a/scm-ui/ui-webapp/public/locales/en/admin.json b/scm-ui/ui-webapp/public/locales/en/admin.json index b061901df2..5e7e44dcd2 100644 --- a/scm-ui/ui-webapp/public/locales/en/admin.json +++ b/scm-ui/ui-webapp/public/locales/en/admin.json @@ -61,7 +61,10 @@ "newVersion": "New version", "dependencyNotification": "With this plugin, the following dependencies will be installed if they are not available yet!", "dependencies": "Dependencies", - "successNotification": "Successful installed plugin. You have to reload the page, to see ui changes:", + "installedNotification": "Successfully installed plugin. You have to reload the page, to see ui changes:", + "updatedNotification": "Successfully updated plugin. You have to reload the page, to see ui changes:", + "uninstalledNotification": "Successfully uninstalled plugin. You have to reload the page, to see ui changes:", + "executedChangesNotification": "Successfully executed plugin changes. You have to reload the page, to see ui changes:", "reload": "reload now", "restartNotification": "You should only restart the scm-manager context if no one else is currently working with it.", "executePending": "The following plugin changes will be executed and after that the scm-manager context will be restarted.", diff --git a/scm-ui/ui-webapp/src/admin/plugins/components/PluginModal.tsx b/scm-ui/ui-webapp/src/admin/plugins/components/PluginModal.tsx index 1863ce0843..d8dd1bdd9c 100644 --- a/scm-ui/ui-webapp/src/admin/plugins/components/PluginModal.tsx +++ b/scm-ui/ui-webapp/src/admin/plugins/components/PluginModal.tsx @@ -161,7 +161,7 @@ class PluginModal extends React.Component { } renderNotifications = () => { - const { t } = this.props; + const { t, pluginAction } = this.props; const { restart, error, success } = this.state; if (error) { return ( @@ -172,7 +172,7 @@ class PluginModal extends React.Component { } else if (success) { return (
- +
); } else if (restart) { diff --git a/scm-ui/ui-webapp/src/admin/plugins/components/SuccessNotification.tsx b/scm-ui/ui-webapp/src/admin/plugins/components/SuccessNotification.tsx index 8e01e84bbd..cbee8e3e15 100644 --- a/scm-ui/ui-webapp/src/admin/plugins/components/SuccessNotification.tsx +++ b/scm-ui/ui-webapp/src/admin/plugins/components/SuccessNotification.tsx @@ -1,13 +1,30 @@ import React from "react"; import { WithTranslation, withTranslation } from "react-i18next"; import { Notification } from "@scm-manager/ui-components"; +import { PluginAction } from "./PluginEntry"; + +type Props = WithTranslation & { + pluginAction?: string; +}; + +class InstallSuccessNotification extends React.Component { + createMessageForPluginAction = () => { + const { pluginAction, t } = this.props; + if (pluginAction === PluginAction.INSTALL) { + return t("plugins.modal.installedNotification"); + } else if (pluginAction === PluginAction.UPDATE) { + return t("plugins.modal.updatedNotification"); + } else if (pluginAction === PluginAction.UNINSTALL) { + return t("plugins.modal.uninstalledNotification"); + } + return t("plugins.modal.executedChangesNotification"); + }; -class InstallSuccessNotification extends React.Component { render() { const { t } = this.props; return ( - {t("plugins.modal.successNotification")}{" "} + {this.createMessageForPluginAction()}{" "} window.location.reload(true)}>{t("plugins.modal.reload")} );