mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-01 19:15:52 +01:00
fixed review notes
This commit is contained in:
@@ -20,16 +20,14 @@
|
|||||||
"error-title": "Error",
|
"error-title": "Error",
|
||||||
"error-subtitle": "Unknown repository error",
|
"error-subtitle": "Unknown repository error",
|
||||||
"actions-label": "Actions",
|
"actions-label": "Actions",
|
||||||
"back-label": "Back"
|
"back-label": "Back",
|
||||||
|
"navigation-label": "Navigation",
|
||||||
|
"information": "Information"
|
||||||
},
|
},
|
||||||
"create": {
|
"create": {
|
||||||
"title": "Create Repository",
|
"title": "Create Repository",
|
||||||
"subtitle": "Create a new repository"
|
"subtitle": "Create a new repository"
|
||||||
},
|
},
|
||||||
"edit": {
|
|
||||||
"title": "Edit Repository",
|
|
||||||
"subtitle": "Edit an existing repository"
|
|
||||||
},
|
|
||||||
"repository-form": {
|
"repository-form": {
|
||||||
"submit": "Save"
|
"submit": "Save"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -9,8 +9,6 @@ import classNames from "classnames";
|
|||||||
|
|
||||||
import icon from "../../../images/blib.jpg";
|
import icon from "../../../images/blib.jpg";
|
||||||
|
|
||||||
// TODO we need a variable or something central for the hover
|
|
||||||
|
|
||||||
const styles = {
|
const styles = {
|
||||||
outer: {
|
outer: {
|
||||||
position: "relative"
|
position: "relative"
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { translate } from "react-i18next";
|
import { translate } from "react-i18next";
|
||||||
import { Page } from "../../components/layout";
|
|
||||||
import RepositoryForm from "../components/form";
|
import RepositoryForm from "../components/form";
|
||||||
import type { Repository } from "../types/Repositories";
|
import type { Repository } from "../types/Repositories";
|
||||||
import {
|
import {
|
||||||
@@ -12,11 +11,12 @@ import {
|
|||||||
} from "../modules/repos";
|
} from "../modules/repos";
|
||||||
import { withRouter } from "react-router-dom";
|
import { withRouter } from "react-router-dom";
|
||||||
import type { History } from "history";
|
import type { History } from "history";
|
||||||
|
import ErrorNotification from "../../components/ErrorNotification";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
repository: Repository,
|
repository: Repository,
|
||||||
modifyRepo: (Repository, () => void) => void,
|
modifyRepo: (Repository, () => void) => void,
|
||||||
modifyLoading: boolean,
|
loading: boolean,
|
||||||
error: Error,
|
error: Error,
|
||||||
|
|
||||||
// context props
|
// context props
|
||||||
@@ -25,43 +25,34 @@ type Props = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
class Edit extends React.Component<Props> {
|
class Edit extends React.Component<Props> {
|
||||||
componentDidMount() {}
|
|
||||||
|
|
||||||
repoModified = () => {
|
repoModified = () => {
|
||||||
const { history, repository } = this.props;
|
const { history, repository } = this.props;
|
||||||
history.push(`/repo/${repository.namespace}/${repository.name}`);
|
history.push(`/repo/${repository.namespace}/${repository.name}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { t, modifyLoading, error } = this.props;
|
const { loading, error } = this.props;
|
||||||
return (
|
return (
|
||||||
<Page
|
<div>
|
||||||
title={t("edit.title")}
|
<ErrorNotification error={error} />
|
||||||
subtitle={t("edit.subtitle")}
|
|
||||||
error={error}
|
|
||||||
showContentOnError={true}
|
|
||||||
>
|
|
||||||
<RepositoryForm
|
<RepositoryForm
|
||||||
repository={this.props.repository}
|
repository={this.props.repository}
|
||||||
loading={modifyLoading}
|
loading={loading}
|
||||||
submitForm={repo => {
|
submitForm={repo => {
|
||||||
this.props.modifyRepo(repo, this.repoModified);
|
this.props.modifyRepo(repo, this.repoModified);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Page>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const mapStateToProps = (state, ownProps) => {
|
const mapStateToProps = (state, ownProps) => {
|
||||||
const { namespace, name } = ownProps.repository;
|
const { namespace, name } = ownProps.repository;
|
||||||
|
const loading = isModifyRepoPending(state, namespace, name);
|
||||||
const modifyLoading = isModifyRepoPending(state, namespace, name);
|
|
||||||
|
|
||||||
const error = getModifyRepoFailure(state, namespace, name);
|
const error = getModifyRepoFailure(state, namespace, name);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
modifyLoading,
|
loading,
|
||||||
error
|
error
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -100,8 +100,11 @@ class RepositoryRoot extends React.Component<Props> {
|
|||||||
</div>
|
</div>
|
||||||
<div className="column">
|
<div className="column">
|
||||||
<Navigation>
|
<Navigation>
|
||||||
<Section label={t("repository-root.actions-label")}>
|
<Section label={t("repository-root.navigation-label")}>
|
||||||
|
<NavLink to={url} label={t("repository-root.information")} />
|
||||||
<EditNavLink repository={repository} editUrl={`${url}/edit`} />
|
<EditNavLink repository={repository} editUrl={`${url}/edit`} />
|
||||||
|
</Section>
|
||||||
|
<Section label={t("repository-root.actions-label")}>
|
||||||
<DeleteNavAction repository={repository} delete={this.delete} />
|
<DeleteNavAction repository={repository} delete={this.delete} />
|
||||||
<NavLink to="/repos" label={t("repository-root.back-label")} />
|
<NavLink to="/repos" label={t("repository-root.back-label")} />
|
||||||
</Section>
|
</Section>
|
||||||
|
|||||||
@@ -38,7 +38,10 @@ function fetchRepositoryTypes(dispatch: any) {
|
|||||||
dispatch(fetchRepositoryTypesSuccess(repositoryTypes));
|
dispatch(fetchRepositoryTypesSuccess(repositoryTypes));
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
dispatch(fetchRepositoryTypesFailure(err));
|
const error = new Error(
|
||||||
|
`failed to fetch repository types: ${err.message}`
|
||||||
|
);
|
||||||
|
dispatch(fetchRepositoryTypesFailure(error));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user