Skip to content

Commit

Permalink
🚚 [#4908] Rename api endpoint to relative api endpoint
Browse files Browse the repository at this point in the history
API endpoint is relative, name should reflect that
  • Loading branch information
viktorvanwijk committed Dec 19, 2024
1 parent df91e88 commit 0ab6dfa
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ export const ConfiguredBackends = {
key: 'backend11',
name: 'JSON',
backend: 'json',
options: {extraLine: 'We are checking.'},
options: {relativeApiEndpoint: 'Example endpoint'},
},
],
validationErrors: [
Expand Down Expand Up @@ -941,7 +941,7 @@ export const JSON = {
name: 'JSON',
backend: 'json',
options: {
extraLine: 'We are checking.',
relativeApiEndpoint: 'We are checking.',
},
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,21 @@ import {
} from 'components/admin/forms/ValidationErrors';


const ExtraLine = () => {
const [fieldProps] = useField('extraLine');
const RelativeAPIEndpoint = () => {
// TODO-4098: is this the serializer name?
const [fieldProps] = useField('relativeApiEndpoint');
return (
<FormRow>
<Field
name="extraLine"
name="relativeApiEndpoint"
label={
<FormattedMessage
description="Demo registration options 'extraLine' label"
defaultMessage="Extra print statement"
description="JSON registration options 'relativeApiEndpoint' label"
defaultMessage="Relative API Endpoint"
/>
}
>
<TextInput id="id_extraLine" {...fieldProps} />
<TextInput id="id_relativeApiEndpoint" {...fieldProps} />
</Field>
</FormRow>
);
Expand All @@ -49,13 +50,13 @@ const JSONOptionsForm = ({name, label, formData, onChange}) => {
defaultMessage="Plugin configuration: JSON"
/>
}
initialFormData={{extraLine: '', ...formData}}
initialFormData={{relativeApiEndpoint: '', ...formData}}
onSubmit={values => onChange({formData: values})}
modalSize="small"
>
<ValidationErrorsProvider errors={relevantErrors}>
<Fieldset>
<ExtraLine />
<RelativeAPIEndpoint />
</Fieldset>
</ValidationErrorsProvider>
</ModalOptionsConfiguration>
Expand All @@ -66,7 +67,7 @@ JSONOptionsForm.propTypes = {
name: PropTypes.string.isRequired,
label: PropTypes.node.isRequired,
formData: PropTypes.shape({
extraLine: PropTypes.string,
apiEndpoint: PropTypes.string,
}),
onChange: PropTypes.func.isRequired,
};
Expand Down
2 changes: 1 addition & 1 deletion src/openforms/registrations/contrib/json/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class JSONOptionsSerializer(JsonSchemaSerializerMixin, serializers.Serializer):
help_text=_("Which service to use."),
)
# TODO-4098: show the complete API endpoint as a (tooltip) hint after user entry?
api_endpoint = serializers.CharField(
relative_api_endpoint = serializers.CharField(
max_length=255,
label=_("Relative API endpoint"),
help_text=_("The API endpoint to send the data to (relative to the service API root)."),
Expand Down
2 changes: 1 addition & 1 deletion src/openforms/registrations/contrib/json/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

@register("json")
class JSONPlugin(BasePlugin):
verbose_name = _("New fancy plugin")
verbose_name = _("JSON registration")
configuration_options = JSONOptionsSerializer

def register_submission(self, submission: Submission, options: OptionsT) -> None:
Expand Down

0 comments on commit 0ab6dfa

Please sign in to comment.