From 506ea8a3b84b03ca43ab730ef97b1ab9e52838aa Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Tue, 3 Mar 2026 17:45:50 +0000 Subject: [PATCH] Remove raw IDs from some places --- core/templates/pages/command-routing.html | 130 +++++++++++----------- core/templates/pages/tasks-group.html | 7 +- core/views/automation.py | 4 + core/views/tasks.py | 15 +++ 4 files changed, 87 insertions(+), 69 deletions(-) diff --git a/core/templates/pages/command-routing.html b/core/templates/pages/command-routing.html index 5c49525..f06d848 100644 --- a/core/templates/pages/command-routing.html +++ b/core/templates/pages/command-routing.html @@ -304,72 +304,74 @@ -
-
-

Actions

-

Enable/disable each step and use the reorder capsule to change execution order.

- - - - - - {% for action_row in profile.actions.all %} - - - - - + + + + + {% empty %} + + {% endfor %} + +
TypeEnabledReorderActions
- {% if action_row.action_type == "extract_bp" %}Extract Business Plan - {% elif action_row.action_type == "save_document" %}Save Document - {% elif action_row.action_type == "post_result" %}Post Result - {% else %}{{ action_row.action_type }} - {% endif %} - {{ action_row.enabled }} - -
- {% csrf_token %} - - - - {% if scope_service and scope_identifier %} - - - {% endif %} - -
-
- {% csrf_token %} - - - - {% if scope_service and scope_identifier %} - - - {% endif %} - -
-
-
-
- {% csrf_token %} - - - {% if scope_service and scope_identifier %} - - + {% if profile.show_actions_editor %} +
+
+

Actions

+

Enable/disable each step and use the reorder capsule to change execution order.

+ + + + + + {% for action_row in profile.actions.all %} + + - - {% empty %} - - {% endfor %} - -
TypeEnabledReorderActions
+ {% if action_row.action_type == "extract_bp" %}Extract Business Plan + {% elif action_row.action_type == "save_document" %}Save Document + {% elif action_row.action_type == "post_result" %}Post Result + {% else %}{{ action_row.action_type }} {% endif %} - - - -
No actions.
+
{{ action_row.enabled }} + +
+ {% csrf_token %} + + + + {% if scope_service and scope_identifier %} + + + {% endif %} + +
+
+ {% csrf_token %} + + + + {% if scope_service and scope_identifier %} + + + {% endif %} + +
+
+
+
+ {% csrf_token %} + + + {% if scope_service and scope_identifier %} + + + {% endif %} + + +
+
No actions.
+
- + {% endif %}
{% csrf_token %} diff --git a/core/templates/pages/tasks-group.html b/core/templates/pages/tasks-group.html index 5364f12..6140d0f 100644 --- a/core/templates/pages/tasks-group.html +++ b/core/templates/pages/tasks-group.html @@ -2,7 +2,7 @@ {% block content %}

Group Tasks: {{ channel_display_name }}

-

{{ service_label }} · {{ identifier }}

+

{{ service_label }}

Create Or Map Project

@@ -68,10 +68,7 @@ {{ row.project.name }} {% if row.epic %}{{ row.epic.name }}{% else %}-{% endif %} -
{{ row.service }} · {{ row.channel_identifier }}
- {% if channel_display_name %} -

{{ channel_display_name }}

- {% endif %} +
{{ row.display_service_label }} · {{ row.display_channel_name }}
{{ row.enabled }} Open Project diff --git a/core/views/automation.py b/core/views/automation.py index a2a80b9..6a8b3a4 100644 --- a/core/views/automation.py +++ b/core/views/automation.py @@ -79,6 +79,7 @@ class CommandRoutingSettings(LoginRequiredMixin, View): preview_profile_id = str(request.GET.get("preview_profile_id") or "").strip() for profile in profiles: policies = ensure_variant_policies_for_profile(profile) + profile.show_actions_editor = str(profile.slug or "").strip() != "bp" if str(profile.slug or "").strip() == "bp": keys = BP_VARIANT_KEYS else: @@ -172,6 +173,9 @@ class CommandRoutingSettings(LoginRequiredMixin, View): action_type="extract_bp", defaults={"enabled": True, "position": 0}, ) + # Keep legacy action rows in storage for compatibility and for + # potential reuse by non-bp commands; bp UI now relies on + # variant policies instead of exposing the generic action matrix. CommandAction.objects.get_or_create( profile=profile, action_type="save_document", diff --git a/core/views/tasks.py b/core/views/tasks.py index 82e7e12..0a337d0 100644 --- a/core/views/tasks.py +++ b/core/views/tasks.py @@ -683,6 +683,21 @@ class TaskGroupDetail(LoginRequiredMixin, View): service__in=service_keys, channel_identifier__in=variants, ).select_related("project", "epic") + mappings = list(mappings) + for row in mappings: + row_channel = _resolve_channel_display( + request.user, + str(getattr(row, "service", "") or ""), + str(getattr(row, "channel_identifier", "") or ""), + ) + row.display_service_label = row_channel.get("service_label") or _service_label( + str(getattr(row, "service", "") or "") + ) + row.display_channel_name = ( + str(row_channel.get("display_name") or "").strip() + or str(channel.get("display_name") or "").strip() + or "Unknown chat" + ) tasks = ( DerivedTask.objects.filter( user=request.user,