mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 17:05:43 +01:00
Cleanup
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
// @flow
|
||||
|
||||
import React from "react";
|
||||
import MultiPluginActionModal from "./MultiPluginActionModal";
|
||||
import type {PendingPlugins} from "@scm-manager/ui-types";
|
||||
import PluginActionModal from "./PluginActionModal";
|
||||
import type { PendingPlugins } from "@scm-manager/ui-types";
|
||||
import waitForRestart from "./waitForRestart";
|
||||
import {apiClient, Notification} from "@scm-manager/ui-components";
|
||||
import {translate} from "react-i18next";
|
||||
import { apiClient, Notification } from "@scm-manager/ui-components";
|
||||
import { translate } from "react-i18next";
|
||||
|
||||
type Props = {
|
||||
onClose: () => void,
|
||||
@@ -15,23 +15,27 @@ type Props = {
|
||||
t: string => string
|
||||
};
|
||||
|
||||
|
||||
class ExecutePendingActionModal extends React.Component<Props> {
|
||||
|
||||
render() {
|
||||
const {onClose, pendingPlugins, t} = this.props;
|
||||
const { onClose, pendingPlugins, t } = this.props;
|
||||
|
||||
return <MultiPluginActionModal
|
||||
description={t("plugins.modal.executePending")} label={t("plugins.modal.executeAndRestart")}
|
||||
onClose={onClose} pendingPlugins={pendingPlugins} execute={this.executeAndRestart}>
|
||||
<Notification type="warning">
|
||||
{t("plugins.modal.restartNotification")}
|
||||
</Notification>
|
||||
</MultiPluginActionModal>;
|
||||
return (
|
||||
<PluginActionModal
|
||||
description={t("plugins.modal.executePending")}
|
||||
label={t("plugins.modal.executeAndRestart")}
|
||||
onClose={onClose}
|
||||
pendingPlugins={pendingPlugins}
|
||||
execute={this.executeAndRestart}
|
||||
>
|
||||
<Notification type="warning">
|
||||
{t("plugins.modal.restartNotification")}
|
||||
</Notification>
|
||||
</PluginActionModal>
|
||||
);
|
||||
}
|
||||
|
||||
executeAndRestart = () => {
|
||||
const {pendingPlugins} = this.props;
|
||||
const { pendingPlugins } = this.props;
|
||||
return apiClient
|
||||
.post(pendingPlugins._links.execute.href)
|
||||
.then(waitForRestart);
|
||||
|
||||
Reference in New Issue
Block a user