diff --git a/scm-ui-components/packages/ui-types/src/Plugin.js b/scm-ui-components/packages/ui-types/src/Plugin.js index 157ef06098..0114716757 100644 --- a/scm-ui-components/packages/ui-types/src/Plugin.js +++ b/scm-ui-components/packages/ui-types/src/Plugin.js @@ -9,6 +9,7 @@ export type Plugin = { author: string, category: string, avatarUrl: string, + pending: boolean, dependencies: string[], _links: Links }; diff --git a/scm-ui/public/locales/de/admin.json b/scm-ui/public/locales/de/admin.json index 19e8a07751..20a1e0a004 100644 --- a/scm-ui/public/locales/de/admin.json +++ b/scm-ui/public/locales/de/admin.json @@ -29,6 +29,7 @@ "installedNavLink": "Installiert", "availableNavLink": "Verfügbar" }, + "installPending": "Austehende Plugins installieren", "noPlugins": "Keine Plugins gefunden.", "modal": { "title": "{{name}} Plugin installieren", @@ -42,7 +43,8 @@ "dependencies": "Abhängigkeiten", "successNotification": "Das Plugin wurde erfolgreich installiert. Um Änderungen an der UI zu sehen, muss die Seite neu geladen werden:", "reload": "jetzt new laden", - "restartNotification": "Der SCM-Manager Kontext sollte nur neu gestartet werden, wenn aktuell niemand damit arbeitet." + "restartNotification": "Der SCM-Manager Kontext sollte nur neu gestartet werden, wenn aktuell niemand damit arbeitet.", + "installPending": "Die folgenden Plugins werden installiert und anschließend wir der SCM-Manager Kontext neu gestartet." } }, "repositoryRole": { diff --git a/scm-ui/public/locales/en/admin.json b/scm-ui/public/locales/en/admin.json index afdc75585a..2c9304ac85 100644 --- a/scm-ui/public/locales/en/admin.json +++ b/scm-ui/public/locales/en/admin.json @@ -29,6 +29,7 @@ "installedNavLink": "Installed", "availableNavLink": "Available" }, + "installPending": "Install pending plugins", "noPlugins": "No plugins found.", "modal": { "title": "Install {{name}} Plugin", @@ -42,7 +43,8 @@ "dependencies": "Dependencies", "successNotification": "Successful installed plugin. You have to reload the page, to see ui changes:", "reload": "reload now", - "restartNotification": "Restarting the scm-manager context, should only be done if no one else is currently working with it." + "restartNotification": "Restarting the scm-manager context, should only be done if no one else is currently working with it.", + "installPending": "The following plugins will be installed and after installation the scm-manager context will be restarted." } }, "repositoryRole": { diff --git a/scm-ui/src/admin/plugins/components/InstallPendingAction.js b/scm-ui/src/admin/plugins/components/InstallPendingAction.js new file mode 100644 index 0000000000..b46b3fba53 --- /dev/null +++ b/scm-ui/src/admin/plugins/components/InstallPendingAction.js @@ -0,0 +1,68 @@ +// @flow +import React from "react"; +import { Button, ButtonGroup, Modal } from "@scm-manager/ui-components"; +import type { PluginCollection } from "@scm-manager/ui-types"; +import { translate } from "react-i18next"; +import InstallPendingModal from "./InstallPendingModal"; + +type Props = { + collection: PluginCollection, + + // context props + t: string => string +}; + +type State = { + showModal: boolean +}; + +class InstallPendingAction extends React.Component { + constructor(props: Props) { + super(props); + this.state = { + showModal: false + }; + } + + openModal = () => { + this.setState({ + showModal: true + }); + }; + + closeModal = () => { + this.setState({ + showModal: false + }); + }; + + renderModal = () => { + const { showModal } = this.state; + const { collection } = this.props; + if (showModal) { + return ( + + ); + } + return null; + }; + + render() { + const { t } = this.props; + return ( + <> + {this.renderModal()} +