mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-12-22 00:09:47 +01:00
merge 2.0.0-m3
This commit is contained in:
@@ -1,16 +1,13 @@
|
||||
//@flow
|
||||
import React from "react";
|
||||
import { withTranslation, WithTranslation } from "react-i18next";
|
||||
import { Repository } from "@scm-manager/ui-types";
|
||||
import { repositories } from "@scm-manager/ui-components";
|
||||
import type { Repository } from "@scm-manager/ui-types";
|
||||
import { translate } from "react-i18next";
|
||||
|
||||
type Props = {
|
||||
repository: Repository,
|
||||
t: string => string
|
||||
}
|
||||
type Props = WithTranslation & {
|
||||
repository: Repository;
|
||||
};
|
||||
|
||||
class ProtocolInformation extends React.Component<Props> {
|
||||
|
||||
render() {
|
||||
const { repository, t } = this.props;
|
||||
const href = repositories.getProtocolLinkByType(repository, "http");
|
||||
@@ -26,7 +23,6 @@ class ProtocolInformation extends React.Component<Props> {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default translate("plugins")(ProtocolInformation);
|
||||
export default withTranslation("plugins")(ProtocolInformation);
|
||||
@@ -1,16 +1,12 @@
|
||||
//@flow
|
||||
import React from "react";
|
||||
import {Image} from "@scm-manager/ui-components";
|
||||
import { Image } from "@scm-manager/ui-components";
|
||||
|
||||
type Props = {
|
||||
};
|
||||
type Props = {};
|
||||
|
||||
class SvnAvatar extends React.Component<Props> {
|
||||
|
||||
render() {
|
||||
return <Image src="/images/svn-logo.gif" alt="Subversion Logo" />;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default SvnAvatar;
|
||||
@@ -1,45 +1,48 @@
|
||||
//@flow
|
||||
import React from "react";
|
||||
import type { Links } from "@scm-manager/ui-types";
|
||||
import { translate } from "react-i18next";
|
||||
import { InputField, Checkbox, Select } from "@scm-manager/ui-components";
|
||||
import { withTranslation, WithTranslation } from "react-i18next";
|
||||
import { Links } from "@scm-manager/ui-types";
|
||||
import { Checkbox, Select } from "@scm-manager/ui-components";
|
||||
|
||||
type Configuration = {
|
||||
compatibility: string,
|
||||
enabledGZip: boolean,
|
||||
_links: Links
|
||||
compatibility: string;
|
||||
enabledGZip: boolean;
|
||||
_links: Links;
|
||||
};
|
||||
|
||||
type Props = {
|
||||
initialConfiguration: Configuration,
|
||||
readOnly: boolean,
|
||||
type Props = WithTranslation & {
|
||||
initialConfiguration: Configuration;
|
||||
readOnly: boolean;
|
||||
|
||||
onConfigurationChange: (Configuration, boolean) => void,
|
||||
|
||||
// context props
|
||||
t: (string) => string
|
||||
}
|
||||
onConfigurationChange: (p1: Configuration, p2: boolean) => void;
|
||||
};
|
||||
|
||||
type State = Configuration;
|
||||
|
||||
class SvnConfigurationForm extends React.Component<Props, State> {
|
||||
|
||||
constructor(props: Props) {
|
||||
super(props);
|
||||
this.state = { ...props.initialConfiguration, validationErrors: [] };
|
||||
this.state = {
|
||||
...props.initialConfiguration
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
handleChange = (value: any, name: string) => {
|
||||
this.setState({
|
||||
[name]: value
|
||||
}, () => this.props.onConfigurationChange(this.state, true));
|
||||
handleChange = (value: any, name?: string) => {
|
||||
if (!name) {
|
||||
throw new Error("required name not set");
|
||||
}
|
||||
this.setState(
|
||||
// @ts-ignore
|
||||
{
|
||||
[name]: value
|
||||
},
|
||||
() => this.props.onConfigurationChange(this.state, true)
|
||||
);
|
||||
};
|
||||
|
||||
compatibilityOptions = (values: string[]) => {
|
||||
const options = [];
|
||||
for (let value of values) {
|
||||
options.push( this.compatibilityOption(value) );
|
||||
for (const value of values) {
|
||||
options.push(this.compatibilityOption(value));
|
||||
}
|
||||
return options;
|
||||
};
|
||||
@@ -53,9 +56,7 @@ class SvnConfigurationForm extends React.Component<Props, State> {
|
||||
|
||||
render() {
|
||||
const { readOnly, t } = this.props;
|
||||
const compatibilityOptions = this.compatibilityOptions([
|
||||
"NONE", "PRE14", "PRE15", "PRE16", "PRE17", "WITH17"
|
||||
]);
|
||||
const compatibilityOptions = this.compatibilityOptions(["NONE", "PRE14", "PRE15", "PRE16", "PRE17", "WITH17"]);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -78,7 +79,6 @@ class SvnConfigurationForm extends React.Component<Props, State> {
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default translate("plugins")(SvnConfigurationForm);
|
||||
export default withTranslation("plugins")(SvnConfigurationForm);
|
||||
@@ -1,28 +0,0 @@
|
||||
//@flow
|
||||
import React from "react";
|
||||
import { translate } from "react-i18next";
|
||||
import { Title, Configuration } from "@scm-manager/ui-components";
|
||||
import SvnConfigurationForm from "./SvnConfigurationForm";
|
||||
|
||||
type Props = {
|
||||
link: string,
|
||||
|
||||
// context props
|
||||
t: (string) => string
|
||||
}
|
||||
|
||||
class SvnGlobalConfiguration extends React.Component<Props> {
|
||||
|
||||
render() {
|
||||
const { link, t } = this.props;
|
||||
return (
|
||||
<div>
|
||||
<Title title={t("scm-svn-plugin.config.title")}/>
|
||||
<Configuration link={link} render={props => <SvnConfigurationForm {...props} />}/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default translate("plugins")(SvnGlobalConfiguration);
|
||||
@@ -0,0 +1,22 @@
|
||||
import React from "react";
|
||||
import { WithTranslation, withTranslation } from "react-i18next";
|
||||
import { Title, Configuration } from "@scm-manager/ui-components";
|
||||
import SvnConfigurationForm from "./SvnConfigurationForm";
|
||||
|
||||
type Props = WithTranslation & {
|
||||
link: string;
|
||||
};
|
||||
|
||||
class SvnGlobalConfiguration extends React.Component<Props> {
|
||||
render() {
|
||||
const { link, t } = this.props;
|
||||
return (
|
||||
<div>
|
||||
<Title title={t("scm-svn-plugin.config.title")} />
|
||||
<Configuration link={link} render={(props: any) => <SvnConfigurationForm {...props} />} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default withTranslation("plugins")(SvnGlobalConfiguration);
|
||||
@@ -1,11 +1,10 @@
|
||||
// @flow
|
||||
import { binder } from "@scm-manager/ui-extensions";
|
||||
import { ConfigurationBinder as cfgBinder } from "@scm-manager/ui-components";
|
||||
import ProtocolInformation from "./ProtocolInformation";
|
||||
import SvnAvatar from "./SvnAvatar";
|
||||
import SvnGlobalConfiguration from "./SvnGlobalConfiguration";
|
||||
|
||||
const svnPredicate = (props: Object) => {
|
||||
const svnPredicate = (props: any) => {
|
||||
return props.repository && props.repository.type === "svn";
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user