Skip to content

Commit

Permalink
🐛 Properly mark 'auth attribute path' required
Browse files Browse the repository at this point in the history
The field was missing the styling on the label that indicates it's a
required field.

For prefill, this field is always required. For registration, it's
required when the option to update the existing object is toggled.
  • Loading branch information
sergei-maertens committed Dec 30, 2024
1 parent 1cd0ee8 commit 82e76ec
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ const LegacyConfigFields = ({apiGroupChoices}) => {
objecttypeUuid={objecttype}
objecttypeVersion={objecttypeVersion}
disabled={!updateExistingObject}
required={updateExistingObject}
/>
</Fieldset>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ const V2ConfigFields = ({apiGroupChoices}) => {
objecttypeUuid={objecttype}
objecttypeVersion={objecttypeVersion}
disabled={!updateExistingObject}
required={updateExistingObject}
/>
</Fieldset>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ const ObjectsAPIFields = () => {
objectsApiGroup={objectsApiGroup}
objecttypeUuid={objecttypeUuid}
objecttypeVersion={objecttypeVersion}
style={{maxWidth: '10em'}}
required
/>
</Fieldset>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const AuthAttributePath = ({
objecttypeUuid,
objecttypeVersion,
disabled = false,
required = false,
}) => {
const intl = useIntl();
const {csrftoken} = useContext(APIContext);
Expand Down Expand Up @@ -66,6 +67,7 @@ const AuthAttributePath = ({
/>
}
disabled={disabled}
required={required}
>
<TargetPathSelect
name={name}
Expand All @@ -86,6 +88,7 @@ AuthAttributePath.propTypes = {
objecttypeUuid: PropTypes.string,
objecttypeVersion: PropTypes.number,
disabled: PropTypes.bool,
required: PropTypes.bool,
};

export default AuthAttributePath;

0 comments on commit 82e76ec

Please sign in to comment.