Skip to content

Commit

Permalink
✨ [#4991] Add selection of Referentielijsten services to general config
Browse files Browse the repository at this point in the history
the selected services will be shown as options when configuring select/selectboxes using Referentielijsten
  • Loading branch information
stevenbal committed Jan 7, 2025
1 parent a425cc6 commit 01c422b
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/openforms/config/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,15 @@ class GlobalConfigurationAdmin(TranslationAdmin, SingletonModelAdmin):
},
),
(_("Search engines"), {"fields": ("allow_indexing_form_detail",)}),
(_("Plugin configuration"), {"fields": ("plugin_configuration",)}),
(
_("Plugin configuration"),
{
"fields": (
"plugin_configuration",
"referentielijsten_services",
)
},
),
(
_("Registration"),
{
Expand Down Expand Up @@ -198,6 +206,7 @@ class GlobalConfigurationAdmin(TranslationAdmin, SingletonModelAdmin):
),
)
readonly_fields = ("feature_flags_link",)
filter_horizontal = ("referentielijsten_services",)

@admin.display(description=_("feature flags"))
def feature_flags_link(self, obj) -> str:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 4.2.17 on 2025-01-07 11:17

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("zgw_consumers", "0022_set_default_service_slug"),
("config", "0055_v270_to_v300"),
]

operations = [
migrations.AddField(
model_name="globalconfiguration",
name="referentielijsten_services",
field=models.ManyToManyField(
help_text="List of services that are instances of the Referentielijsten API. The selected services will be shown as options when configuring select or selectboxes components to be populated from Referentielijsten.",
to="zgw_consumers.service",
verbose_name="referentielijsten services",
),
),
]
11 changes: 11 additions & 0 deletions src/openforms/config/models/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from glom import glom
from solo.models import SingletonModel
from tinymce.models import HTMLField
from zgw_consumers.models import Service

from openforms.data_removal.constants import RemovalMethods
from openforms.emails.validators import URLSanitationValidator
Expand Down Expand Up @@ -558,6 +559,16 @@ class GlobalConfiguration(SingletonModel):
),
)

referentielijsten_services = models.ManyToManyField(
Service,
verbose_name=_("referentielijsten services"),
help_text=_(
"List of services that are instances of the Referentielijsten API. "
"The selected services will be shown as options when configuring "
"select or selectboxes components to be populated from Referentielijsten."
),
)

# search engine configuration
allow_indexing_form_detail = models.BooleanField(
_("Allow form page indexing"),
Expand Down

0 comments on commit 01c422b

Please sign in to comment.