added temp indexResource + RoleTable

This commit is contained in:
Florian Scholdei
2019-05-08 09:34:07 +02:00
parent d105ec784f
commit 4f5cb61348
2 changed files with 39 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
// @flow
import React from "react";
import { translate } from "react-i18next";
import type { Role } from "@scm-manager/ui-types";
type Props = {
t: string => string,
roles: Role[]
};
class RoleTable extends React.Component<Props> {
render() {
const { roles, t } = this.props;
return (
<table className="card-table table is-hoverable is-fullwidth">
<thead>
<tr>
<th className="is-hidden-mobile">{t("user.name")}</th>
<th>{t("user.displayName")}</th>
<th>{t("user.mail")}</th>
<th className="is-hidden-mobile">{t("user.active")}</th>
</tr>
</thead>
<tbody>
{roles.map((role, index) => {
return <p key={index}>role</p>;
})}
</tbody>
</table>
);
}
}
export default translate("config")(RoleTable);

View File

@@ -151,6 +151,11 @@ export function getSvnConfigLink(state: Object) {
return getLink(state, "svnConfig");
}
export function getRolesLink(state: Object) {
//return getLink(state, "availableRepositoryPermissions");
return "http://localhost:8081/scm/api/v2/repository-roles"; // TODO
}
export function getUserAutoCompleteLink(state: Object): string {
const link = getLinkCollection(state, "autocomplete").find(
i => i.name === "users"