only show helptext at creation

This commit is contained in:
Maren Süwer
2018-10-15 13:13:37 +02:00
parent 4404ac2529
commit f4ed4792bd
2 changed files with 6 additions and 3 deletions

View File

@@ -61,6 +61,7 @@ class CreatePermissionForm extends React.Component<Props, State> {
/>
<TypeSelector
label={t("permission.type")}
helpText={t("permission.help.typeHelpText")}
handleTypeChange={this.handleTypeChange}
type={type ? type : "READ"}
/>

View File

@@ -7,12 +7,14 @@ type Props = {
t: string => string,
handleTypeChange: string => void,
type: string,
label?: string,
helpText?: string,
loading?: boolean
};
class TypeSelector extends React.Component<Props> {
render() {
const { t, type, handleTypeChange, loading } = this.props;
const { t, type, handleTypeChange, loading, label, helpText } = this.props;
const types = ["READ", "OWNER", "WRITE"];
return (
@@ -21,8 +23,8 @@ class TypeSelector extends React.Component<Props> {
value={type ? type : "READ"}
options={this.createSelectOptions(types)}
loading={loading}
label={t("permission.type")}
helpText={t("permission.help.typeHelpText")}
label={label}
helpText={helpText}
/>
);
}