mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-16 02:06:18 +01:00
reorder directory structure, add PermissionRoleDetail and Root
This commit is contained in:
32
scm-ui/src/config/roles/components/PermissionRoleRow.js
Normal file
32
scm-ui/src/config/roles/components/PermissionRoleRow.js
Normal file
@@ -0,0 +1,32 @@
|
||||
// @flow
|
||||
import React from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import type { Role } from "@scm-manager/ui-types";
|
||||
import SystemRoleTag from "./SystemRoleTag";
|
||||
|
||||
type Props = {
|
||||
baseUrl: string,
|
||||
role: Role
|
||||
};
|
||||
|
||||
class PermissionRoleRow extends React.Component<Props> {
|
||||
renderLink(to: string, label: string, system?: boolean) {
|
||||
return (
|
||||
<Link to={to}>
|
||||
{label} <SystemRoleTag system={system} />
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
|
||||
render() {
|
||||
const { baseUrl, role } = this.props;
|
||||
const to = `${baseUrl}/${encodeURIComponent(role.name)}/info`;
|
||||
return (
|
||||
<tr>
|
||||
<td>{this.renderLink(to, role.name, !role._links.update)}</td>
|
||||
</tr>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default PermissionRoleRow;
|
||||
Reference in New Issue
Block a user