add 'list_portal' AppOption modifier to add portal as a possible choice

This commit is contained in:
axolotle 2023-09-04 16:20:29 +02:00
parent 0645d18e67
commit 5562b61db0
2 changed files with 4 additions and 0 deletions

View file

@ -382,6 +382,7 @@ class ConfigPanel:
"filter", "filter",
"readonly", "readonly",
"enabled", "enabled",
"list_portal",
# "confirm", # TODO: to ask confirmation before running an action # "confirm", # TODO: to ask confirmation before running an action
], ],
"defaults": {}, "defaults": {},

View file

@ -914,6 +914,7 @@ class AppOption(BaseChoicesOption):
super().__init__(question) super().__init__(question)
self.filter = question.get("filter", None) self.filter = question.get("filter", None)
self.list_portal = question.get("list_portal", False)
apps = app_list(full=True)["apps"] apps = app_list(full=True)["apps"]
@ -929,6 +930,8 @@ class AppOption(BaseChoicesOption):
return app["label"] + domain_path_or_id return app["label"] + domain_path_or_id
self.choices = {"_none": "---"} 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}) self.choices.update({app["id"]: _app_display(app) for app in apps})