mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 15:05:44 +01:00
Invalidate form when scope (group/user) is switched
This commit is contained in:
@@ -55,14 +55,11 @@ class CreatePermissionForm extends React.Component<Props, State> {
|
|||||||
permissionScopeChanged = event => {
|
permissionScopeChanged = event => {
|
||||||
const groupPermission = event.target.value === "GROUP_PERMISSION";
|
const groupPermission = event.target.value === "GROUP_PERMISSION";
|
||||||
this.setState({
|
this.setState({
|
||||||
|
value: undefined,
|
||||||
|
name: "",
|
||||||
groupPermission: groupPermission,
|
groupPermission: groupPermission,
|
||||||
valid: validator.isPermissionValid(
|
valid: false
|
||||||
this.state.name,
|
|
||||||
groupPermission,
|
|
||||||
this.props.currentPermissions
|
|
||||||
)
|
|
||||||
});
|
});
|
||||||
this.setState({ ...this.state, groupPermission, value: undefined});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
loadUserAutocompletion = (inputValue: string) => {
|
loadUserAutocompletion = (inputValue: string) => {
|
||||||
@@ -245,7 +242,7 @@ class CreatePermissionForm extends React.Component<Props, State> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
removeState = () => {
|
removeState = () => {
|
||||||
this.setState({...this.state,
|
this.setState({
|
||||||
name: "",
|
name: "",
|
||||||
verbs: this.props.availablePermissions.availableRoles[0].verbs,
|
verbs: this.props.availablePermissions.availableRoles[0].verbs,
|
||||||
valid: true,
|
valid: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user