mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 06:25: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> {
|
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 (
|
||||||
<PageActions>
|
<PageActions>
|
||||||
<FilterInput
|
<FilterInput
|
||||||
value={urls.getQueryStringFromLocation(location)}
|
value={urls.getQueryStringFromLocation(location)}
|
||||||
filter={filter => {
|
filter={filter => {
|
||||||
history.push(`/${link}/?q=${filter}`);
|
history.push(`/${directory}/?q=${filter}`);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{this.renderCreateButton()}
|
{this.renderCreateButton()}
|
||||||
@@ -48,11 +49,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
|
<Button label={label} link={`/${link}`} color="primary" />
|
||||||
label={label} //t("overview.createButton")
|
|
||||||
link={`/${link}/create`}
|
|
||||||
color="primary"
|
|
||||||
/>
|
|
||||||
</div>
|
</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