added additional applications to system settings

This commit is contained in:
Jakub Trllo 2022-02-07 11:52:15 +01:00
parent c419b5cea0
commit 76bf19a235
6 changed files with 128 additions and 8 deletions

View file

@ -280,12 +280,30 @@ class AppsEnumEntity(BaseEnumEntity):
valid_keys = set()
enum_items_list = []
applications_entity = system_settings_entity["applications"]
app_entities = {}
additional_app_names = set()
additional_apps_entity = None
for group_name, app_group in applications_entity.items():
if group_name != "additional_apps":
app_entities[group_name] = app_group
continue
additional_apps_entity = app_group
for _group_name, _group in app_group.items():
additional_app_names.add(_group_name)
app_entities[_group_name] = _group
for group_name, app_group in app_entities.items():
enabled_entity = app_group.get("enabled")
if enabled_entity and not enabled_entity.value:
continue
group_label = app_group["label"].value
if group_name in additional_app_names:
group_label = additional_apps_entity.get_key_label(group_name)
if not group_label:
group_label = group_name
else:
group_label = app_group["label"].value
variants_entity = app_group["variants"]
for variant_name, variant_entity in variants_entity.items():
enabled_entity = variant_entity.get("enabled")