mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 06:55:47 +01:00
refactoring
This commit is contained in:
@@ -16,7 +16,6 @@ import ErrorPage from "../../components/ErrorPage";
|
|||||||
import type { Config } from "../types/Config";
|
import type { Config } from "../types/Config";
|
||||||
import ConfigForm from "../components/form/ConfigForm";
|
import ConfigForm from "../components/form/ConfigForm";
|
||||||
import Loading from "../../components/Loading";
|
import Loading from "../../components/Loading";
|
||||||
import type { User } from "../../users/types/User";
|
|
||||||
import type { History } from "history";
|
import type { History } from "history";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
@@ -25,7 +24,7 @@ type Props = {
|
|||||||
config: Config,
|
config: Config,
|
||||||
configUpdatePermission: boolean,
|
configUpdatePermission: boolean,
|
||||||
// dispatch functions
|
// dispatch functions
|
||||||
modifyConfig: (config: User, callback?: () => void) => void,
|
modifyConfig: (config: Config, callback?: () => void) => void,
|
||||||
// context objects
|
// context objects
|
||||||
t: string => string,
|
t: string => string,
|
||||||
fetchConfig: void => void,
|
fetchConfig: void => void,
|
||||||
@@ -33,7 +32,7 @@ type Props = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
class GlobalConfig extends React.Component<Props> {
|
class GlobalConfig extends React.Component<Props> {
|
||||||
configModified = (config: Config) => () => {
|
configModified = () => () => {
|
||||||
this.props.fetchConfig();
|
this.props.fetchConfig();
|
||||||
this.props.history.push(`/config`);
|
this.props.history.push(`/config`);
|
||||||
};
|
};
|
||||||
@@ -43,8 +42,7 @@ class GlobalConfig extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
modifyConfig = (config: Config) => {
|
modifyConfig = (config: Config) => {
|
||||||
console.log(config);
|
this.props.modifyConfig(config, this.configModified());
|
||||||
this.props.modifyConfig(config, this.configModified(config));
|
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|||||||
Reference in New Issue
Block a user