mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 15:05:44 +01:00
renamed add to create
This commit is contained in:
@@ -4,7 +4,6 @@ import type { History } from "history";
|
|||||||
import { withRouter } from "react-router-dom";
|
import { withRouter } from "react-router-dom";
|
||||||
import classNames from "classnames";
|
import classNames from "classnames";
|
||||||
import injectSheet from "react-jss";
|
import injectSheet from "react-jss";
|
||||||
import { PageActions } from "./layout";
|
|
||||||
import { FilterInput } from "./forms";
|
import { FilterInput } from "./forms";
|
||||||
import { Button, urls } from "./index";
|
import { Button, urls } from "./index";
|
||||||
|
|
||||||
@@ -30,13 +29,12 @@ const styles = {
|
|||||||
class OverviewPageActions extends React.Component<Props> {
|
class OverviewPageActions extends React.Component<Props> {
|
||||||
render() {
|
render() {
|
||||||
const { history, location, link } = this.props;
|
const { history, location, link } = this.props;
|
||||||
let directory = link.substring(0, link.indexOf("/"));
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<FilterInput
|
<FilterInput
|
||||||
value={urls.getQueryStringFromLocation(location)}
|
value={urls.getQueryStringFromLocation(location)}
|
||||||
filter={filter => {
|
filter={filter => {
|
||||||
history.push(`/${directory}/?q=${filter}`);
|
history.push(`/${link}/?q=${filter}`);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{this.renderCreateButton()}
|
{this.renderCreateButton()}
|
||||||
@@ -49,7 +47,7 @@ class OverviewPageActions extends React.Component<Props> {
|
|||||||
if (showCreateButton) {
|
if (showCreateButton) {
|
||||||
return (
|
return (
|
||||||
<div className={classNames(classes.button, "input-button control")}>
|
<div className={classNames(classes.button, "input-button control")}>
|
||||||
<Button label={label} link={`/${link}`} color="primary" />
|
<Button label={label} link={`/${link}/create`} color="primary" />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
"setPermissionsNavLink": "Berechtigungen"
|
"setPermissionsNavLink": "Berechtigungen"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"addUser": {
|
"createUser": {
|
||||||
"title": "Benutzer erstellen",
|
"title": "Benutzer erstellen",
|
||||||
"subtitle": "Erstellen eines neuen Benutzers"
|
"subtitle": "Erstellen eines neuen Benutzers"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
"setPermissionsNavLink": "Permissions"
|
"setPermissionsNavLink": "Permissions"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"addUser": {
|
"createUser": {
|
||||||
"title": "Create User",
|
"title": "Create User",
|
||||||
"subtitle": "Create a new user"
|
"subtitle": "Create a new user"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -12,14 +12,14 @@ import Logout from "../containers/Logout";
|
|||||||
import { ProtectedRoute } from "@scm-manager/ui-components";
|
import { ProtectedRoute } from "@scm-manager/ui-components";
|
||||||
import { binder, ExtensionPoint } from "@scm-manager/ui-extensions";
|
import { binder, ExtensionPoint } from "@scm-manager/ui-extensions";
|
||||||
|
|
||||||
import AddUser from "../users/containers/AddUser";
|
import CreateUser from "../users/containers/CreateUser";
|
||||||
import SingleUser from "../users/containers/SingleUser";
|
import SingleUser from "../users/containers/SingleUser";
|
||||||
import RepositoryRoot from "../repos/containers/RepositoryRoot";
|
import RepositoryRoot from "../repos/containers/RepositoryRoot";
|
||||||
import Create from "../repos/containers/Create";
|
import Create from "../repos/containers/Create";
|
||||||
|
|
||||||
import Groups from "../groups/containers/Groups";
|
import Groups from "../groups/containers/Groups";
|
||||||
import SingleGroup from "../groups/containers/SingleGroup";
|
import SingleGroup from "../groups/containers/SingleGroup";
|
||||||
import AddGroup from "../groups/containers/AddGroup";
|
import CreateGroup from "../groups/containers/CreateGroup";
|
||||||
|
|
||||||
import Config from "../config/containers/Config";
|
import Config from "../config/containers/Config";
|
||||||
import Profile from "./Profile";
|
import Profile from "./Profile";
|
||||||
@@ -74,8 +74,8 @@ class Main extends React.Component<Props> {
|
|||||||
/>
|
/>
|
||||||
<ProtectedRoute
|
<ProtectedRoute
|
||||||
authenticated={authenticated}
|
authenticated={authenticated}
|
||||||
path="/users/add"
|
path="/users/create"
|
||||||
component={AddUser}
|
component={CreateUser}
|
||||||
/>
|
/>
|
||||||
<ProtectedRoute
|
<ProtectedRoute
|
||||||
exact
|
exact
|
||||||
@@ -102,8 +102,8 @@ class Main extends React.Component<Props> {
|
|||||||
/>
|
/>
|
||||||
<ProtectedRoute
|
<ProtectedRoute
|
||||||
authenticated={authenticated}
|
authenticated={authenticated}
|
||||||
path="/groups/add"
|
path="/groups/create"
|
||||||
component={AddGroup}
|
component={CreateGroup}
|
||||||
/>
|
/>
|
||||||
<ProtectedRoute
|
<ProtectedRoute
|
||||||
exact
|
exact
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ type Props = {
|
|||||||
|
|
||||||
type State = {};
|
type State = {};
|
||||||
|
|
||||||
class AddGroup extends React.Component<Props, State> {
|
class CreateGroup extends React.Component<Props, State> {
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this.props.resetForm();
|
this.props.resetForm();
|
||||||
}
|
}
|
||||||
@@ -104,4 +104,4 @@ const mapStateToProps = state => {
|
|||||||
export default connect(
|
export default connect(
|
||||||
mapStateToProps,
|
mapStateToProps,
|
||||||
mapDispatchToProps
|
mapDispatchToProps
|
||||||
)(translate("groups")(AddGroup));
|
)(translate("groups")(CreateGroup));
|
||||||
@@ -87,7 +87,7 @@ class Groups extends React.Component<Props> {
|
|||||||
<PageActions>
|
<PageActions>
|
||||||
<OverviewPageActions
|
<OverviewPageActions
|
||||||
showCreateButton={canAddGroups}
|
showCreateButton={canAddGroups}
|
||||||
link="groups/add"
|
link="groups"
|
||||||
label={t("create-group-button.label")}
|
label={t("create-group-button.label")}
|
||||||
/>
|
/>
|
||||||
</PageActions>
|
</PageActions>
|
||||||
@@ -118,7 +118,7 @@ class Groups extends React.Component<Props> {
|
|||||||
return (
|
return (
|
||||||
<CreateButton
|
<CreateButton
|
||||||
label={t("create-group-button.label")}
|
label={t("create-group-button.label")}
|
||||||
link="/groups/add"
|
link="/groups/create"
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ class Overview extends React.Component<Props> {
|
|||||||
<PageActions>
|
<PageActions>
|
||||||
<OverviewPageActions
|
<OverviewPageActions
|
||||||
showCreateButton={showCreateButton}
|
showCreateButton={showCreateButton}
|
||||||
link="repos/create"
|
link="repos"
|
||||||
label={t("overview.createButton")}
|
label={t("overview.createButton")}
|
||||||
/>
|
/>
|
||||||
</PageActions>
|
</PageActions>
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ type Props = {
|
|||||||
history: History
|
history: History
|
||||||
};
|
};
|
||||||
|
|
||||||
class AddUser extends React.Component<Props> {
|
class CreateUser extends React.Component<Props> {
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this.props.resetForm();
|
this.props.resetForm();
|
||||||
}
|
}
|
||||||
@@ -49,8 +49,8 @@ class AddUser extends React.Component<Props> {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Page
|
<Page
|
||||||
title={t("addUser.title")}
|
title={t("createUser.title")}
|
||||||
subtitle={t("addUser.subtitle")}
|
subtitle={t("createUser.subtitle")}
|
||||||
error={error}
|
error={error}
|
||||||
showContentOnError={true}
|
showContentOnError={true}
|
||||||
>
|
>
|
||||||
@@ -88,4 +88,4 @@ const mapStateToProps = (state, ownProps) => {
|
|||||||
export default connect(
|
export default connect(
|
||||||
mapStateToProps,
|
mapStateToProps,
|
||||||
mapDispatchToProps
|
mapDispatchToProps
|
||||||
)(translate("users")(AddUser));
|
)(translate("users")(CreateUser));
|
||||||
@@ -87,7 +87,7 @@ class Users extends React.Component<Props> {
|
|||||||
<PageActions>
|
<PageActions>
|
||||||
<OverviewPageActions
|
<OverviewPageActions
|
||||||
showCreateButton={canAddUsers}
|
showCreateButton={canAddUsers}
|
||||||
link="users/add"
|
link="users"
|
||||||
label={t("users.createButton")}
|
label={t("users.createButton")}
|
||||||
/>
|
/>
|
||||||
</PageActions>
|
</PageActions>
|
||||||
@@ -115,7 +115,9 @@ class Users extends React.Component<Props> {
|
|||||||
renderCreateButton() {
|
renderCreateButton() {
|
||||||
const { canAddUsers, t } = this.props;
|
const { canAddUsers, t } = this.props;
|
||||||
if (canAddUsers) {
|
if (canAddUsers) {
|
||||||
return <CreateButton label={t("users.createButton")} link="/users/add" />;
|
return (
|
||||||
|
<CreateButton label={t("users.createButton")} link="/users/create" />
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user