Move button to right side and small fixes

This commit is contained in:
Florian Scholdei
2019-11-28 02:01:49 +01:00
parent cae4f6abb4
commit 53147db0e2
3 changed files with 24 additions and 19 deletions

View File

@@ -2,7 +2,7 @@ import React from "react";
import { WithTranslation, withTranslation } from "react-i18next";
import { ExtensionPoint } from "@scm-manager/ui-extensions";
import { RepositoryRole } from "@scm-manager/ui-types";
import { Button } from "@scm-manager/ui-components";
import { Level, Button } from "@scm-manager/ui-components";
import PermissionRoleDetailsTable from "./PermissionRoleDetailsTable";
type Props = WithTranslation & {
@@ -14,7 +14,12 @@ class PermissionRoleDetails extends React.Component<Props> {
renderEditButton() {
const { t, url } = this.props;
if (!!this.props.role._links.update) {
return <Button label={t("repositoryRole.editButton")} link={`${url}/edit`} color="primary" />;
return (
<>
<hr />
<Level right={<Button label={t("repositoryRole.editButton")} link={`${url}/edit`} color="primary" />} />
</>
);
}
return null;
}
@@ -25,7 +30,6 @@ class PermissionRoleDetails extends React.Component<Props> {
return (
<>
<PermissionRoleDetailsTable role={role} />
<hr />
{this.renderEditButton()}
<ExtensionPoint
name="repositoryRole.role-details.information"

View File

@@ -52,7 +52,7 @@ class RepositoryForm extends React.Component<Props, State> {
}
}
isFalsy(value) {
isFalsy(value: string) {
return !value;
}

View File

@@ -9,7 +9,8 @@ import { Loading, ErrorNotification } from "@scm-manager/ui-components";
import Notification from "@scm-manager/ui-components/src/Notification";
import { WithTranslation, withTranslation } from "react-i18next";
type Props = WithTranslation & RouteComponentProps & {
type Props = WithTranslation &
RouteComponentProps & {
repository: Repository;
// url params