mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 14:35:45 +01:00
modified transferred link to include add/create information, added new CreateUserButton component
This commit is contained in:
@@ -30,12 +30,13 @@ const styles = {
|
||||
class OverviewPageActions extends React.Component<Props> {
|
||||
render() {
|
||||
const { history, location, link } = this.props;
|
||||
let directory = link.substring(0, link.indexOf("/"));
|
||||
return (
|
||||
<PageActions>
|
||||
<FilterInput
|
||||
value={urls.getQueryStringFromLocation(location)}
|
||||
filter={filter => {
|
||||
history.push(`/${link}/?q=${filter}`);
|
||||
history.push(`/${directory}/?q=${filter}`);
|
||||
}}
|
||||
/>
|
||||
{this.renderCreateButton()}
|
||||
@@ -48,11 +49,7 @@ class OverviewPageActions extends React.Component<Props> {
|
||||
if (showCreateButton) {
|
||||
return (
|
||||
<div className={classNames(classes.button, "input-button control")}>
|
||||
<Button
|
||||
label={label} //t("overview.createButton")
|
||||
link={`/${link}/create`}
|
||||
color="primary"
|
||||
/>
|
||||
<Button label={label} link={`/${link}`} color="primary" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
19
scm-ui/src/users/components/buttons/CreateUserButton.js
Normal file
19
scm-ui/src/users/components/buttons/CreateUserButton.js
Normal file
@@ -0,0 +1,19 @@
|
||||
//@flow
|
||||
import React from "react";
|
||||
import { translate } from "react-i18next";
|
||||
import { CreateButton } from "@scm-manager/ui-components";
|
||||
|
||||
type Props = {
|
||||
t: string => string
|
||||
};
|
||||
|
||||
class CreateUserButton extends React.Component<Props> {
|
||||
render() {
|
||||
const { t } = this.props;
|
||||
return (
|
||||
<CreateButton label={t("users.createButton")} link="/users/add" />
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default translate("users")(CreateUserButton);
|
||||
Reference in New Issue
Block a user