mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-11 07:55:47 +01:00
Move button to right side and small fixes
This commit is contained in:
@@ -2,7 +2,7 @@ import React from "react";
|
|||||||
import { WithTranslation, withTranslation } from "react-i18next";
|
import { WithTranslation, withTranslation } from "react-i18next";
|
||||||
import { ExtensionPoint } from "@scm-manager/ui-extensions";
|
import { ExtensionPoint } from "@scm-manager/ui-extensions";
|
||||||
import { RepositoryRole } from "@scm-manager/ui-types";
|
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";
|
import PermissionRoleDetailsTable from "./PermissionRoleDetailsTable";
|
||||||
|
|
||||||
type Props = WithTranslation & {
|
type Props = WithTranslation & {
|
||||||
@@ -14,7 +14,12 @@ class PermissionRoleDetails extends React.Component<Props> {
|
|||||||
renderEditButton() {
|
renderEditButton() {
|
||||||
const { t, url } = this.props;
|
const { t, url } = this.props;
|
||||||
if (!!this.props.role._links.update) {
|
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;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -25,7 +30,6 @@ class PermissionRoleDetails extends React.Component<Props> {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<PermissionRoleDetailsTable role={role} />
|
<PermissionRoleDetailsTable role={role} />
|
||||||
<hr />
|
|
||||||
{this.renderEditButton()}
|
{this.renderEditButton()}
|
||||||
<ExtensionPoint
|
<ExtensionPoint
|
||||||
name="repositoryRole.role-details.information"
|
name="repositoryRole.role-details.information"
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ class RepositoryForm extends React.Component<Props, State> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
isFalsy(value) {
|
isFalsy(value: string) {
|
||||||
return !value;
|
return !value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,9 +7,10 @@ import { fetchSources, getFetchSourcesFailure, getSources, isFetchSourcesPending
|
|||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { Loading, ErrorNotification } from "@scm-manager/ui-components";
|
import { Loading, ErrorNotification } from "@scm-manager/ui-components";
|
||||||
import Notification from "@scm-manager/ui-components/src/Notification";
|
import Notification from "@scm-manager/ui-components/src/Notification";
|
||||||
import {WithTranslation, withTranslation} from "react-i18next";
|
import { WithTranslation, withTranslation } from "react-i18next";
|
||||||
|
|
||||||
type Props = WithTranslation & RouteComponentProps & {
|
type Props = WithTranslation &
|
||||||
|
RouteComponentProps & {
|
||||||
repository: Repository;
|
repository: Repository;
|
||||||
|
|
||||||
// url params
|
// url params
|
||||||
@@ -24,7 +25,7 @@ type Props = WithTranslation & RouteComponentProps & {
|
|||||||
|
|
||||||
// dispatch props
|
// dispatch props
|
||||||
fetchSources: (repository: Repository, revision: string, path: string) => void;
|
fetchSources: (repository: Repository, revision: string, path: string) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
const extensionPointName = "repos.sources.extensions";
|
const extensionPointName = "repos.sources.extensions";
|
||||||
|
|
||||||
@@ -32,7 +33,7 @@ class SourceExtensions extends React.Component<Props> {
|
|||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
const { fetchSources, repository, revision, path } = this.props;
|
const { fetchSources, repository, revision, path } = this.props;
|
||||||
// TODO get typing right
|
// TODO get typing right
|
||||||
fetchSources(repository,revision || "", path || "");
|
fetchSources(repository, revision || "", path || "");
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|||||||
Reference in New Issue
Block a user