From 5562b61db07de881f72405198156eecc80a0be7b Mon Sep 17 00:00:00 2001 From: axolotle Date: Mon, 4 Sep 2023 16:20:29 +0200 Subject: [PATCH] add 'list_portal' AppOption modifier to add portal as a possible choice --- src/utils/configpanel.py | 1 + src/utils/form.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/utils/configpanel.py b/src/utils/configpanel.py index 42a030cbc..02454bd0b 100644 --- a/src/utils/configpanel.py +++ b/src/utils/configpanel.py @@ -382,6 +382,7 @@ class ConfigPanel: "filter", "readonly", "enabled", + "list_portal", # "confirm", # TODO: to ask confirmation before running an action ], "defaults": {}, diff --git a/src/utils/form.py b/src/utils/form.py index 1ca03373e..64155d8e2 100644 --- a/src/utils/form.py +++ b/src/utils/form.py @@ -914,6 +914,7 @@ class AppOption(BaseChoicesOption): super().__init__(question) self.filter = question.get("filter", None) + self.list_portal = question.get("list_portal", False) apps = app_list(full=True)["apps"] @@ -929,6 +930,8 @@ class AppOption(BaseChoicesOption): return app["label"] + domain_path_or_id self.choices = {"_none": "---"} + if self.list_portal: + self.choices["portal_public_apps"] = "Portal" self.choices.update({app["id"]: _app_display(app) for app in apps})