Skip to content

Commit

Permalink
[#4396] Added basic plugin and necessary views and endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
vaszig committed Aug 23, 2024
1 parent 2752e19 commit bde4d64
Show file tree
Hide file tree
Showing 13 changed files with 311 additions and 238 deletions.
1 change: 1 addition & 0 deletions docs/configuration/prefill/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ Prefill plugins
kvk
stuf_bg
suwinet
objects_api
3 changes: 3 additions & 0 deletions docs/developers/plugins/prefill_plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ You can find an example implementation in :mod:`openforms.prefill.contrib.demo`.
Implementation
--------------

Plugins must be added to the INSTALLED_APPS :mod:`openforms.conf.base`. See the demo app as an example
("openforms.prefill.contrib.demo.apps.DemoApp")

Plugins must implement the interface from :class:`openforms.prefill.base.BasePlugin`.
It's safe to use this as a base class.

Expand Down
129 changes: 129 additions & 0 deletions src/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3586,6 +3586,123 @@ paths:
$ref: '#/components/headers/X-Is-Form-Designer'
Content-Language:
$ref: '#/components/headers/Content-Language'
/api/v2/prefill/plugins/objects-api/objecttypes:
get:
operationId: prefill_plugins_objects_api_objecttypes_list
description: List the available prefill objecttypes for Objects API plugin.
summary: List available objecttypes for Objects API
parameters:
- in: query
name: objects_api_group
schema:
type: string
description: Which Objects API group to use.
tags:
- registration
security:
- cookieAuth: []
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Objecttype'
description: ''
headers:
X-Session-Expires-In:
$ref: '#/components/headers/X-Session-Expires-In'
X-CSRFToken:
$ref: '#/components/headers/X-CSRFToken'
X-Is-Form-Designer:
$ref: '#/components/headers/X-Is-Form-Designer'
Content-Language:
$ref: '#/components/headers/Content-Language'
/api/v2/prefill/plugins/objects-api/objecttypes/{objects_api_objecttype_uuid}/versions:
get:
operationId: prefill_plugins_objects_api_objecttypes_versions_list
description: List the available prefill objecttype versions for Objects API
plugin.
summary: List available objecttype versions for Objects API
parameters:
- in: query
name: objects_api_group
schema:
type: string
description: Which Objects API group to use.
- in: path
name: objects_api_objecttype_uuid
schema:
type: string
format: uuid
required: true
tags:
- registration
security:
- cookieAuth: []
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/ObjecttypeVersion'
description: ''
headers:
X-Session-Expires-In:
$ref: '#/components/headers/X-Session-Expires-In'
X-CSRFToken:
$ref: '#/components/headers/X-CSRFToken'
X-Is-Form-Designer:
$ref: '#/components/headers/X-Is-Form-Designer'
Content-Language:
$ref: '#/components/headers/Content-Language'
? /api/v2/prefill/plugins/objects-api/objecttypes/{objects_api_objecttype_uuid}/versions/{objects_api_objecttype_version}/attributes
: get:
operationId: prefill_plugins_objects_api_objecttypes_versions_attributes_list
description: List the available attributes for Objects API plugin.
summary: List available attributes for Objects API
parameters:
- in: query
name: objects_api_group
schema:
type: string
description: Which Objects API group to use.
- in: path
name: objects_api_objecttype_uuid
schema:
type: string
format: uuid
required: true
- in: path
name: objects_api_objecttype_version
schema:
type: integer
required: true
tags:
- prefill
security:
- cookieAuth: []
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/PrefillObjectsAPIAttribute'
description: ''
headers:
X-Session-Expires-In:
$ref: '#/components/headers/X-Session-Expires-In'
X-CSRFToken:
$ref: '#/components/headers/X-CSRFToken'
X-Is-Form-Designer:
$ref: '#/components/headers/X-Is-Form-Designer'
Content-Language:
$ref: '#/components/headers/Content-Language'
/api/v2/products:
get:
operationId: products_list
Expand Down Expand Up @@ -9398,6 +9515,18 @@ components:
description: |-
* `main` - Main
* `authorizee` - Authorizee
PrefillObjectsAPIAttribute:
type: object
properties:
id:
type: string
description: The unique attribute identifier
label:
type: string
description: The human-readable name for an attribute.
required:
- id
- label
PrefillPlugin:
type: object
properties:
Expand Down
1 change: 1 addition & 0 deletions src/openforms/conf/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@
"openforms.prefill.contrib.stufbg.apps.StufBgApp",
"openforms.prefill.contrib.haalcentraal_brp.apps.HaalCentraalBRPApp",
"openforms.prefill.contrib.suwinet.apps.SuwinetApp",
"openforms.prefill.contrib.objects_api.apps.ObjectsApiApp",
"openforms.authentication",
"openforms.authentication.contrib.demo.apps.DemoApp",
"openforms.authentication.contrib.outage.apps.DemoOutageApp",
Expand Down
118 changes: 0 additions & 118 deletions src/openforms/js/compiled-lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,18 +131,6 @@
"value": "Whether to show this value in the confirmation PDF"
}
],
"0D+m56": [
{
"type": 0,
"value": "Regular expression for city"
}
],
"0FD2pY": [
{
"type": 0,
"value": "Validation for the postcode field"
}
],
"0M2B7B": [
{
"type": 0,
Expand Down Expand Up @@ -295,12 +283,6 @@
"value": "The minimum value this field can have before the form can be submitted."
}
],
"205QX5": [
{
"type": 0,
"value": "When email address verification is enabled, the user must verify their email address before they can submit the form. This proves the email address exists and that they have access to the account."
}
],
"20K9To": [
{
"type": 0,
Expand Down Expand Up @@ -473,12 +455,6 @@
"value": "Days"
}
],
"4DrI94": [
{
"type": 0,
"value": "Regular expression for postcode"
}
],
"4FQxD/": [
{
"type": 0,
Expand Down Expand Up @@ -1397,12 +1373,6 @@
"value": "length"
}
],
"Cf5zSF": [
{
"type": 0,
"value": "Verify"
}
],
"CiaAYL": [
{
"type": 0,
Expand Down Expand Up @@ -1997,26 +1967,6 @@
"value": "Remove"
}
],
"ISVTEk": [
{
"type": 0,
"value": "The component type "
},
{
"children": [
{
"type": 1,
"value": "type"
}
],
"type": 8,
"value": "code"
},
{
"type": 0,
"value": " is unknown. We can only display the JSON definition."
}
],
"IhIqdj": [
{
"type": 0,
Expand Down Expand Up @@ -3297,12 +3247,6 @@
"value": "In the past"
}
],
"Wb+QGm": [
{
"type": 0,
"value": "Require verification"
}
],
"WdVKZw": [
{
"type": 0,
Expand All @@ -3321,12 +3265,6 @@
"value": "URL that points to the INFORMATIEOBJECTTYPE in the Catalogi API to be used for the submission attachments"
}
],
"WxwqZJ": [
{
"type": 0,
"value": "The regular expression pattern test that the postcode field value must pass before the form can be submitted."
}
],
"Wz5QZo": [
{
"type": 0,
Expand Down Expand Up @@ -4021,12 +3959,6 @@
"value": "Remove item"
}
],
"dD9O3Q": [
{
"type": 0,
"value": "Regular expression for postcode"
}
],
"dGBYF7": [
{
"options": {
Expand Down Expand Up @@ -4297,12 +4229,6 @@
"value": "A JSON logic expression returning a variable (of array type) whose items should be used as the options for this component."
}
],
"fhVFUY": [
{
"type": 0,
"value": "City"
}
],
"fpX4ei": [
{
"type": 0,
Expand Down Expand Up @@ -4437,20 +4363,6 @@
"value": "JSON content template"
}
],
"hEVgKd": [
{
"type": 0,
"value": "Error message for \""
},
{
"type": 1,
"value": "key"
},
{
"type": 0,
"value": "\""
}
],
"hJtTwo": [
{
"type": 0,
Expand Down Expand Up @@ -4933,12 +4845,6 @@
"value": "Form field"
}
],
"mck25o": [
{
"type": 0,
"value": "Validation for the city field"
}
],
"mf9eF+": [
{
"type": 0,
Expand Down Expand Up @@ -5077,12 +4983,6 @@
"value": "City"
}
],
"osl4X2": [
{
"type": 0,
"value": "The regular expression pattern test that the city field value must pass before the form can be submitted."
}
],
"ow5AAO": [
{
"type": 0,
Expand Down Expand Up @@ -5345,12 +5245,6 @@
"value": "Update existing object"
}
],
"rW1edF": [
{
"type": 0,
"value": "Postcode"
}
],
"rZfe8Z": [
{
"type": 0,
Expand Down Expand Up @@ -5421,12 +5315,6 @@
"value": "Switching to the new registration options will remove the existing JSON templates. You will also not be able to save the form until the variables are correctly mapped. Are you sure you want to continue?"
}
],
"swKpQE": [
{
"type": 0,
"value": "Regular expression for city"
}
],
"t5fg/K": [
{
"type": 0,
Expand Down Expand Up @@ -5835,12 +5723,6 @@
"value": "Maximum length"
}
],
"yGAl1a": [
{
"type": 0,
"value": "Close"
}
],
"yIPUtA": [
{
"type": 0,
Expand Down
Loading

0 comments on commit bde4d64

Please sign in to comment.