mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 15:05:44 +01:00
use radio component again and show type of permission instead of checkbox
This commit is contained in:
@@ -5,7 +5,8 @@ import {
|
|||||||
Autocomplete,
|
Autocomplete,
|
||||||
SubmitButton,
|
SubmitButton,
|
||||||
Button,
|
Button,
|
||||||
LabelWithHelpIcon
|
LabelWithHelpIcon,
|
||||||
|
Radio
|
||||||
} from "@scm-manager/ui-components";
|
} from "@scm-manager/ui-components";
|
||||||
import RoleSelector from "../components/RoleSelector";
|
import RoleSelector from "../components/RoleSelector";
|
||||||
import type {
|
import type {
|
||||||
@@ -158,28 +159,20 @@ class CreatePermissionForm extends React.Component<Props, State> {
|
|||||||
</h2>
|
</h2>
|
||||||
{advancedDialog}
|
{advancedDialog}
|
||||||
<form onSubmit={this.submit}>
|
<form onSubmit={this.submit}>
|
||||||
<div className="control">
|
<Radio
|
||||||
<label className="radio">
|
|
||||||
<input
|
|
||||||
type="radio"
|
|
||||||
name="permission_scope"
|
name="permission_scope"
|
||||||
checked={!this.state.groupPermission}
|
|
||||||
value="USER_PERMISSION"
|
value="USER_PERMISSION"
|
||||||
|
checked={!this.state.groupPermission}
|
||||||
|
label={t("permission.user-permission")}
|
||||||
onChange={this.permissionScopeChanged}
|
onChange={this.permissionScopeChanged}
|
||||||
/>
|
/>
|
||||||
{t("permission.user-permission")}
|
<Radio
|
||||||
</label>
|
|
||||||
<label className="radio">
|
|
||||||
<input
|
|
||||||
type="radio"
|
|
||||||
name="permission_scope"
|
name="permission_scope"
|
||||||
value="GROUP_PERMISSION"
|
value="GROUP_PERMISSION"
|
||||||
checked={this.state.groupPermission}
|
checked={this.state.groupPermission}
|
||||||
|
label={t("permission.group-permission")}
|
||||||
onChange={this.permissionScopeChanged}
|
onChange={this.permissionScopeChanged}
|
||||||
/>
|
/>
|
||||||
{t("permission.group-permission")}
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="columns">
|
<div className="columns">
|
||||||
<div className="column is-two-thirds">
|
<div className="column is-two-thirds">
|
||||||
|
|||||||
@@ -22,7 +22,11 @@ import AdvancedPermissionsDialog from "./AdvancedPermissionsDialog";
|
|||||||
type Props = {
|
type Props = {
|
||||||
availablePermissions: AvailableRepositoryPermissions,
|
availablePermissions: AvailableRepositoryPermissions,
|
||||||
submitForm: Permission => void,
|
submitForm: Permission => void,
|
||||||
modifyPermission: (permission: Permission, namespace: string, name: string) => void,
|
modifyPermission: (
|
||||||
|
permission: Permission,
|
||||||
|
namespace: string,
|
||||||
|
name: string
|
||||||
|
) => void,
|
||||||
permission: Permission,
|
permission: Permission,
|
||||||
t: string => string,
|
t: string => string,
|
||||||
namespace: string,
|
namespace: string,
|
||||||
@@ -30,7 +34,11 @@ type Props = {
|
|||||||
match: any,
|
match: any,
|
||||||
history: History,
|
history: History,
|
||||||
loading: boolean,
|
loading: boolean,
|
||||||
deletePermission: (permission: Permission, namespace: string, name: string) => void,
|
deletePermission: (
|
||||||
|
permission: Permission,
|
||||||
|
namespace: string,
|
||||||
|
name: string
|
||||||
|
) => void,
|
||||||
deleteLoading: boolean
|
deleteLoading: boolean
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -125,15 +133,15 @@ class SinglePermission extends React.Component<Props, State> {
|
|||||||
/>
|
/>
|
||||||
) : null;
|
) : null;
|
||||||
|
|
||||||
|
const type =
|
||||||
|
permission && permission.groupPermission
|
||||||
|
? t("permission.group")
|
||||||
|
: t("permission.user");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<tr>
|
<tr>
|
||||||
<td>{permission.name}</td>
|
<td>{permission.name}</td>
|
||||||
<td>
|
<td>{type}</td>
|
||||||
<Checkbox
|
|
||||||
checked={permission ? permission.groupPermission : false}
|
|
||||||
disabled={true}
|
|
||||||
/>
|
|
||||||
</td>
|
|
||||||
{roleSelector}
|
{roleSelector}
|
||||||
<td>
|
<td>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
Reference in New Issue
Block a user