2019-05-08 09:34:07 +02:00
|
|
|
// @flow
|
|
|
|
|
import React from "react";
|
|
|
|
|
import { translate } from "react-i18next";
|
|
|
|
|
import type { Role } from "@scm-manager/ui-types";
|
2019-05-09 13:46:02 +02:00
|
|
|
import PermissionRoleRow from "./PermissionRoleRow";
|
2019-05-08 09:34:07 +02:00
|
|
|
|
|
|
|
|
type Props = {
|
2019-05-09 15:11:55 +02:00
|
|
|
baseUrl: string,
|
2019-05-09 13:46:02 +02:00
|
|
|
roles: Role[],
|
|
|
|
|
|
|
|
|
|
t: string => string
|
2019-05-08 09:34:07 +02:00
|
|
|
};
|
|
|
|
|
|
2019-05-08 13:13:50 +02:00
|
|
|
class PermissionRoleTable extends React.Component<Props> {
|
2019-05-08 09:34:07 +02:00
|
|
|
render() {
|
2019-05-09 15:11:55 +02:00
|
|
|
const { baseUrl, roles, t } = this.props;
|
2019-05-08 09:34:07 +02:00
|
|
|
return (
|
|
|
|
|
<table className="card-table table is-hoverable is-fullwidth">
|
|
|
|
|
<thead>
|
2019-05-09 15:11:55 +02:00
|
|
|
<tr>
|
2019-05-16 08:55:31 +02:00
|
|
|
<th>{t("repositoryRole.form.name")}</th>
|
2019-05-09 15:11:55 +02:00
|
|
|
</tr>
|
2019-05-08 09:34:07 +02:00
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
2019-05-09 15:11:55 +02:00
|
|
|
{roles.map((role, index) => {
|
|
|
|
|
return (
|
|
|
|
|
<PermissionRoleRow key={index} baseUrl={baseUrl} role={role} />
|
|
|
|
|
);
|
|
|
|
|
})}
|
2019-05-08 09:34:07 +02:00
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-08 13:13:50 +02:00
|
|
|
export default translate("config")(PermissionRoleTable);
|