mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 22:45:45 +01:00
Fix repo config for user without permission
Disable fields and remove submit buttons when user has not permission, aka no config links.
This commit is contained in:
@@ -14,7 +14,8 @@ type Props = {
|
||||
value?: string,
|
||||
autofocus?: boolean,
|
||||
onChange: (value: string, name?: string) => void,
|
||||
helpText?: string
|
||||
helpText?: string,
|
||||
disabled?: boolean
|
||||
};
|
||||
|
||||
class Textarea extends React.Component<Props> {
|
||||
@@ -31,7 +32,7 @@ class Textarea extends React.Component<Props> {
|
||||
};
|
||||
|
||||
render() {
|
||||
const { placeholder, value, label, helpText } = this.props;
|
||||
const { placeholder, value, label, helpText, disabled } = this.props;
|
||||
|
||||
return (
|
||||
<div className="field">
|
||||
@@ -45,6 +46,7 @@ class Textarea extends React.Component<Props> {
|
||||
placeholder={placeholder}
|
||||
onChange={this.handleInput}
|
||||
value={value}
|
||||
disabled={!!disabled}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user