Remove raw IDs from some places

This commit is contained in:
2026-03-03 17:45:50 +00:00
parent 8ea2afb259
commit 506ea8a3b8
4 changed files with 87 additions and 69 deletions

View File

@@ -304,6 +304,7 @@
</div>
</div>
{% if profile.show_actions_editor %}
<div class="columns">
<div class="column">
<h3 class="title is-7">Actions</h3>
@@ -370,6 +371,7 @@
</table>
</div>
</div>
{% endif %}
<form method="post" style="margin-top: 0.75rem;" aria-label="Delete profile {{ profile.name }}">
{% csrf_token %}

View File

@@ -2,7 +2,7 @@
{% block content %}
<section class="section"><div class="container">
<h1 class="title is-4">Group Tasks: {{ channel_display_name }}</h1>
<p class="subtitle is-6">{{ service_label }} · {{ identifier }}</p>
<p class="subtitle is-6">{{ service_label }}</p>
<article class="box">
<h2 class="title is-6">Create Or Map Project</h2>
<form method="post" style="margin-bottom: 0.7rem;">
@@ -68,10 +68,7 @@
<td>{{ row.project.name }}</td>
<td>{% if row.epic %}{{ row.epic.name }}{% else %}-{% endif %}</td>
<td>
<div><code>{{ row.service }} · {{ row.channel_identifier }}</code></div>
{% if channel_display_name %}
<p class="is-size-7 has-text-dark" style="margin-top:0.2rem;">{{ channel_display_name }}</p>
{% endif %}
<div>{{ row.display_service_label }} · {{ row.display_channel_name }}</div>
</td>
<td>{{ row.enabled }}</td>
<td><a class="button is-small is-light" href="{% url 'tasks_project' project_id=row.project_id %}">Open Project</a></td>

View File

@@ -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",

View File

@@ -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,