Skip to content

Commit

Permalink
[#4418] Added addressNl specific mappings to ObjectsAPI variable conf…
Browse files Browse the repository at this point in the history
…iguration
  • Loading branch information
vaszig committed Nov 18, 2024
1 parent 22d641b commit 954d93e
Show file tree
Hide file tree
Showing 17 changed files with 1,263 additions and 207 deletions.
13 changes: 12 additions & 1 deletion src/openforms/api/drf_jsonschema.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
from drf_jsonschema_serializer.converters import (
BooleanFieldConverter,
PrimaryKeyRelatedFieldConverter,
SerializerJSONFieldConverter,
)
from rest_framework import serializers

from .fields import PrimaryKeyRelatedAsChoicesField
from .fields import JSONFieldWithSchema, PrimaryKeyRelatedAsChoicesField


@converter
Expand Down Expand Up @@ -60,3 +61,13 @@ def convert(self, field):
]

return result


@converter
class JSONFieldConverter(SerializerJSONFieldConverter):
field_class = JSONFieldWithSchema

def convert(self, field):
schema = super().convert(field)
schema.update(field.schema)
return schema
13 changes: 13 additions & 0 deletions src/openforms/api/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,19 @@ class PrimaryKeyRelatedAsChoicesField(serializers.PrimaryKeyRelatedField):
pass


class JSONFieldWithSchema(serializers.JSONField):
"""
Custom subclass to register a custom drf-jsonschema-serializer converter.
"""

@property
def schema(self):
return {
"type": "object",
"properties": {},
}


class RelatedFieldFromContext(serializers.HyperlinkedRelatedField):
"""
Look up the object in the serializer context.
Expand Down
60 changes: 60 additions & 0 deletions src/openforms/js/compiled-lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1973,6 +1973,12 @@
"value": "The text that will be displayed in the overview page to confirm the form is filled in correctly. Leave blank to get value from global configuration."
}
],
"Ggu4I8": [
{
"type": 0,
"value": "Whether to map the specific subfield of addressNl component"
}
],
"Gi+cvN": [
{
"type": 0,
Expand Down Expand Up @@ -2127,6 +2133,12 @@
"value": "Successful Submissions Removal Method field label"
}
],
"I3bGFV": [
{
"type": 0,
"value": "House number Schema target"
}
],
"I3zyib": [
{
"type": 0,
Expand Down Expand Up @@ -4369,6 +4381,12 @@
"value": "Name of the product request type. It is available in the JSON template as the 'productaanvraag_type' variable."
}
],
"eD5x1W": [
{
"type": 0,
"value": "House letter Schema target"
}
],
"eF9O7c": [
{
"type": 0,
Expand Down Expand Up @@ -4585,6 +4603,12 @@
"value": "Are you sure that you want to remove this mapping?"
}
],
"gdEbdr": [
{
"type": 0,
"value": "Map specific subfields"
}
],
"gheRkp": [
{
"type": 0,
Expand Down Expand Up @@ -5303,6 +5327,12 @@
"value": "Something went wrong while retrieving the available object type versions."
}
],
"ndWy6O": [
{
"type": 0,
"value": "City Schema target"
}
],
"neCqv9": [
{
"type": 0,
Expand All @@ -5327,12 +5357,24 @@
"value": "Tooltip"
}
],
"o4AUIi": [
{
"type": 0,
"value": "Multiple target paths configured"
}
],
"o5Mfn3": [
{
"type": 0,
"value": "Include children"
}
],
"o5iEgm": [
{
"type": 0,
"value": "JSON Schema object target"
}
],
"o6Ju6l": [
{
"type": 0,
Expand Down Expand Up @@ -5735,6 +5777,12 @@
"value": "If specified, the user must check at most this many options."
}
],
"sTZk2h": [
{
"type": 0,
"value": "Street name Schema target"
}
],
"sU/n0S": [
{
"type": 0,
Expand Down Expand Up @@ -5879,6 +5927,12 @@
"value": "Footer"
}
],
"u7m/jP": [
{
"type": 0,
"value": "Postcode Schema target"
}
],
"uBO/Al": [
{
"type": 0,
Expand Down Expand Up @@ -6161,6 +6215,12 @@
"value": "Create definition"
}
],
"xhwyFo": [
{
"type": 0,
"value": "House number addition Schema target"
}
],
"xxVNeU": [
{
"type": 0,
Expand Down
60 changes: 60 additions & 0 deletions src/openforms/js/compiled-lang/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -1994,6 +1994,12 @@
"value": "De tekst om de ingevulde gegevens te bevestigen op de overzichtspagina. Laat dit veld leeg om de standaardinstelling te gebruiken."
}
],
"Ggu4I8": [
{
"type": 0,
"value": "Whether to map the specific subfield of addressNl component"
}
],
"Gi+cvN": [
{
"type": 0,
Expand Down Expand Up @@ -2148,6 +2154,12 @@
"value": "Opschoonmethode voor voltooide inzendingen"
}
],
"I3bGFV": [
{
"type": 0,
"value": "House number Schema target"
}
],
"I3zyib": [
{
"type": 0,
Expand Down Expand Up @@ -4391,6 +4403,12 @@
"value": "Naam van het productaanvraagtype. Deze naam is in het JSON-inhoudsjabloon beschikbaar als de 'productaanvraag_type' variabele."
}
],
"eD5x1W": [
{
"type": 0,
"value": "House letter Schema target"
}
],
"eF9O7c": [
{
"type": 0,
Expand Down Expand Up @@ -4607,6 +4625,12 @@
"value": "Ben je zeker dat je deze koppeling wil verwijderen?"
}
],
"gdEbdr": [
{
"type": 0,
"value": "Map specific subfields"
}
],
"gheRkp": [
{
"type": 0,
Expand Down Expand Up @@ -5325,6 +5349,12 @@
"value": "Er ging iets fout bij het ophalen van de objecttypeversies."
}
],
"ndWy6O": [
{
"type": 0,
"value": "City Schema target"
}
],
"neCqv9": [
{
"type": 0,
Expand All @@ -5349,12 +5379,24 @@
"value": "Tooltip"
}
],
"o4AUIi": [
{
"type": 0,
"value": "Multiple target paths configured"
}
],
"o5Mfn3": [
{
"type": 0,
"value": "Inclusief kinderen"
}
],
"o5iEgm": [
{
"type": 0,
"value": "JSON Schema object target"
}
],
"o6Ju6l": [
{
"type": 0,
Expand Down Expand Up @@ -5757,6 +5799,12 @@
"value": "Indien opgegeven, dan mag de gebruiker maximaal dit aantal opties aanvinken."
}
],
"sTZk2h": [
{
"type": 0,
"value": "Street name Schema target"
}
],
"sU/n0S": [
{
"type": 0,
Expand Down Expand Up @@ -5901,6 +5949,12 @@
"value": "Voettekst"
}
],
"u7m/jP": [
{
"type": 0,
"value": "Postcode Schema target"
}
],
"uBO/Al": [
{
"type": 0,
Expand Down Expand Up @@ -6183,6 +6237,12 @@
"value": "Formulierdefinitie aanmaken"
}
],
"xhwyFo": [
{
"type": 0,
"value": "House number addition Schema target"
}
],
"xxVNeU": [
{
"type": 0,
Expand Down
Loading

0 comments on commit 954d93e

Please sign in to comment.