mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 08:55:44 +01:00
Peer review
This commit is contained in:
@@ -8,9 +8,9 @@ import {translate} from "react-i18next";
|
|||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
repository: Repository,
|
repository: Repository,
|
||||||
|
|
||||||
t: string => string
|
t: string => string
|
||||||
};
|
};
|
||||||
|
|
||||||
type State = {
|
type State = {
|
||||||
loadingBranches: boolean,
|
loadingBranches: boolean,
|
||||||
loadingDefaultBranch: boolean,
|
loadingDefaultBranch: boolean,
|
||||||
@@ -24,10 +24,6 @@ type State = {
|
|||||||
const GIT_CONFIG_CONTENT_TYPE = "application/vnd.scmm-gitConfig+json";
|
const GIT_CONFIG_CONTENT_TYPE = "application/vnd.scmm-gitConfig+json";
|
||||||
|
|
||||||
class RepositoryConfig extends React.Component<Props, State> {
|
class RepositoryConfig extends React.Component<Props, State> {
|
||||||
state = {
|
|
||||||
branches: []
|
|
||||||
};
|
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
const { repository } = this.props;
|
const { repository } = this.props;
|
||||||
this.setState({ ...this.state, loadingBranches: true });
|
this.setState({ ...this.state, loadingBranches: true });
|
||||||
@@ -56,7 +52,6 @@ class RepositoryConfig extends React.Component<Props, State> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
branchSelected = (branch: Branch) => {
|
branchSelected = (branch: Branch) => {
|
||||||
console.log(branch)
|
|
||||||
if (!branch) {
|
if (!branch) {
|
||||||
this.setState({ ...this.state, selectedBranchName: null });
|
this.setState({ ...this.state, selectedBranchName: null });
|
||||||
return;
|
return;
|
||||||
@@ -89,8 +84,8 @@ class RepositoryConfig extends React.Component<Props, State> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { t, error } = this.props;
|
const { t } = this.props;
|
||||||
const { loadingBranches, loadingDefaultBranch, submitPending } = this.state;
|
const { loadingBranches, loadingDefaultBranch, submitPending, error } = this.state;
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
return (
|
return (
|
||||||
@@ -136,7 +131,7 @@ class RepositoryConfig extends React.Component<Props, State> {
|
|||||||
this.setState({ ...this.state, defaultBranchChanged: false })
|
this.setState({ ...this.state, defaultBranchChanged: false })
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
Default branch changed!
|
{this.props.t("scm-git-plugin.repo-config.success")}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,8 @@
|
|||||||
"error": {
|
"error": {
|
||||||
"title": "Error",
|
"title": "Error",
|
||||||
"subtitle": "Something went wrong"
|
"subtitle": "Something went wrong"
|
||||||
}
|
},
|
||||||
|
"success": "Default branch changed!"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user