mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-17 02:31:14 +01:00
added view and edit of admin user and groups
This commit is contained in:
47
scm-ui/src/config/components/table/AdminGroupTable.js
Normal file
47
scm-ui/src/config/components/table/AdminGroupTable.js
Normal file
@@ -0,0 +1,47 @@
|
||||
//@flow
|
||||
import React from "react";
|
||||
import { translate } from "react-i18next";
|
||||
import RemoveAdminGroupButton from "../buttons/RemoveAdminGroupButton";
|
||||
|
||||
type Props = {
|
||||
adminGroups: string[],
|
||||
t: string => string,
|
||||
onChange: (boolean, any, string) => void
|
||||
};
|
||||
|
||||
type State = {};
|
||||
|
||||
class AdminGroupTable extends React.Component<Props, State> {
|
||||
render() {
|
||||
const { t } = this.props;
|
||||
return (
|
||||
<div>
|
||||
<label className="label">{t("admin-settings.admin-groups")}</label>
|
||||
<table className="table is-hoverable is-fullwidth">
|
||||
<tbody>
|
||||
{this.props.adminGroups.map(group => {
|
||||
return (
|
||||
<tr key={group}>
|
||||
<td key={group}>{group}</td>
|
||||
<td>
|
||||
<RemoveAdminGroupButton
|
||||
groupname={group}
|
||||
removeGroup={this.removeGroup}
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
);
|
||||
})}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
removeGroup = (groupname: string) => {
|
||||
const newGroups = this.props.adminGroups.filter(name => name !== groupname);
|
||||
this.props.onChange(true, newGroups, "adminGroups");
|
||||
};
|
||||
}
|
||||
|
||||
export default translate("config")(AdminGroupTable);
|
||||
Reference in New Issue
Block a user