mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-18 03:01:05 +01:00
show specific notification for each plugin action
This commit is contained in:
@@ -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.",
|
||||
|
||||
@@ -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.",
|
||||
|
||||
@@ -161,7 +161,7 @@ class PluginModal extends React.Component<Props, State> {
|
||||
}
|
||||
|
||||
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<Props, State> {
|
||||
} else if (success) {
|
||||
return (
|
||||
<div className="media">
|
||||
<SuccessNotification />
|
||||
<SuccessNotification pluginAction={pluginAction} />
|
||||
</div>
|
||||
);
|
||||
} else if (restart) {
|
||||
|
||||
@@ -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<Props> {
|
||||
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<WithTranslation> {
|
||||
render() {
|
||||
const { t } = this.props;
|
||||
return (
|
||||
<Notification type="success">
|
||||
{t("plugins.modal.successNotification")}{" "}
|
||||
{this.createMessageForPluginAction()}{" "}
|
||||
<a onClick={e => window.location.reload(true)}>{t("plugins.modal.reload")}</a>
|
||||
</Notification>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user