Skip to content

Commit 3464af2

Browse files
[#523] Added help_text in Change Permission View
1 parent bdc1cad commit 3464af2

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/objects/js/components/admin/permissions/permission-form.js

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ const PermissionForm = ({objectFields, tokenChoices, objecttypeChoices, modeChoi
6565
id="id_object_type"
6666
label="Object type:"
6767
choices={objecttypeChoices}
68+
helpText="Changing the object_type will not maintain the previously selected authorization fields."
6869
initialValue={values["object_type"]}
6970
errors={errors["object_type"]}
7071
onChange={(value) => {

src/objects/js/components/forms/inputs.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React, { useState } from "react";
33
import { ErrorList } from "./error-list";
44

55

6-
const CheckboxInput = ({name, id, value, label, disabled, onChange}) => {
6+
const CheckboxInput = ({name, id, value, label, disabled, onChange, helpText}) => {
77
return (
88
<div className="checkbox-row">
99
<input
@@ -19,12 +19,13 @@ const CheckboxInput = ({name, id, value, label, disabled, onChange}) => {
1919
}}
2020
/>
2121
{label ? <label className="vCheckboxLabel" htmlFor={id}>{ label }</label> : null}
22+
{helpText ? <div><span className="help" htmlFor={id}>{helpText}</span></div>: null}
2223
</div>
2324
);
2425
};
2526

2627

27-
const TextInput = ({id, name, value, label, onChange, hidden}) => {
28+
const TextInput = ({id, name, value, label, onChange, hidden, helpText}) => {
2829

2930
return (
3031
<div>
@@ -41,12 +42,13 @@ const TextInput = ({id, name, value, label, onChange, hidden}) => {
4142
}}
4243
value={value}
4344
/>
45+
{helpText ? <div><span className="help" htmlFor={id}>{helpText}</span></div>: null}
4446
</div>
4547
);
4648
};
4749

4850

49-
const SelectInput = ({choices, name, id, label, onChange, initialValue, errors}) => {
51+
const SelectInput = ({choices, name, id, label, onChange, initialValue, errors, helpText}) => {
5052

5153
const [currentValue, setCurrentValue] = useState(initialValue || "");
5254
const [_errors, setErrors] = useState(errors || []);
@@ -74,6 +76,7 @@ const SelectInput = ({choices, name, id, label, onChange, initialValue, errors})
7476
>
7577
{options}
7678
</select>
79+
{helpText ? <div><span className="help" htmlFor={id}>{helpText}</span></div>: null}
7780
</div>
7881
)
7982
}

0 commit comments

Comments
 (0)