Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ const PermissionForm = ({objectFields, tokenChoices, objecttypeChoices, modeChoi
id="id_object_type"
label="Object type:"
choices={objecttypeChoices}
helpText="Changing the Object type will not maintain the previously selected authorization fields."
initialValue={values["object_type"]}
errors={errors["object_type"]}
onChange={(value) => {
Expand Down
9 changes: 6 additions & 3 deletions src/objects/js/components/forms/inputs.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, { useState } from "react";
import { ErrorList } from "./error-list";


const CheckboxInput = ({name, id, value, label, disabled, onChange}) => {
const CheckboxInput = ({name, id, value, label, disabled, onChange, helpText}) => {
return (
<div className="checkbox-row">
<input
Expand All @@ -19,12 +19,13 @@ const CheckboxInput = ({name, id, value, label, disabled, onChange}) => {
}}
/>
{label ? <label className="vCheckboxLabel" htmlFor={id}>{ label }</label> : null}
{helpText ? <div><span className="help" htmlFor={id}>{helpText}</span></div>: null}
</div>
);
};


const TextInput = ({id, name, value, label, onChange, hidden}) => {
const TextInput = ({id, name, value, label, onChange, hidden, helpText}) => {

return (
<div>
Expand All @@ -41,12 +42,13 @@ const TextInput = ({id, name, value, label, onChange, hidden}) => {
}}
value={value}
/>
{helpText ? <div><span className="help" htmlFor={id}>{helpText}</span></div>: null}
</div>
);
};


const SelectInput = ({choices, name, id, label, onChange, initialValue, errors}) => {
const SelectInput = ({choices, name, id, label, onChange, initialValue, errors, helpText}) => {

const [currentValue, setCurrentValue] = useState(initialValue || "");
const [_errors, setErrors] = useState(errors || []);
Expand Down Expand Up @@ -74,6 +76,7 @@ const SelectInput = ({choices, name, id, label, onChange, initialValue, errors})
>
{options}
</select>
{helpText ? <div><span className="help" htmlFor={id}>{helpText}</span></div>: null}
</div>
)
}
Expand Down