remove nameDisabled prop and added disable check

This commit is contained in:
Florian Scholdei
2019-05-17 16:14:35 +02:00
parent 1f25ba6040
commit 0b76247345
2 changed files with 2 additions and 4 deletions

View File

@@ -19,7 +19,6 @@ import {
type Props = {
role?: RepositoryRole,
loading?: boolean,
nameDisabled: boolean,
availableVerbs: string[],
verbsLink: string,
submitForm: RepositoryRole => void,
@@ -103,7 +102,7 @@ class RepositoryRoleForm extends React.Component<Props, State> {
};
render() {
const { loading, availableVerbs, nameDisabled, t } = this.props;
const { loading, availableVerbs, t } = this.props;
const { role } = this.state;
const verbSelectBoxes = !availableVerbs
@@ -126,7 +125,7 @@ class RepositoryRoleForm extends React.Component<Props, State> {
label={t("repositoryRole.create.name")}
onChange={this.handleNameChange}
value={role.name ? role.name : ""}
disabled={nameDisabled}
disabled={!!this.props.role}
/>
</div>
</div>