Fix gather rules edit UI and add missing table entity mapping

1. Gather rules edit: ensure expandedRuleId is explicitly set in
   startEditing() so the card stays expanded when entering edit mode.
   Add stopPropagation to Export/Edit/Delete action buttons as a
   defensive measure against click event bubbling.

2. Add missing EnrollmentSummaryLaunchRetrySeconds to both
   ConvertToTableEntity and ConvertFromTableEntity in
   TenantConfigurationService - this property was never persisted
   to Azure Table Storage.

https://claude.ai/code/session_01Xcix9bwMXijqN7xa57Vko6
This commit is contained in:
Claude
2026-03-13 20:30:24 +00:00
parent 023a76cbc7
commit 6c2883f833
3 changed files with 7 additions and 3 deletions
@@ -234,6 +234,7 @@ namespace AutopilotMonitor.Functions.Services
{ "ShowEnrollmentSummary", config.ShowEnrollmentSummary },
{ "EnrollmentSummaryTimeoutSeconds", config.EnrollmentSummaryTimeoutSeconds },
{ "EnrollmentSummaryBrandingImageUrl", config.EnrollmentSummaryBrandingImageUrl },
{ "EnrollmentSummaryLaunchRetrySeconds", config.EnrollmentSummaryLaunchRetrySeconds },
{ "HelloWaitTimeoutSeconds", config.HelloWaitTimeoutSeconds },
{ "AgentMaxLifetimeMinutes", config.AgentMaxLifetimeMinutes },
{ "SendTraceEvents", config.SendTraceEvents },
@@ -293,6 +294,7 @@ namespace AutopilotMonitor.Functions.Services
ShowEnrollmentSummary = entity.GetBoolean("ShowEnrollmentSummary"),
EnrollmentSummaryTimeoutSeconds = entity.GetInt32("EnrollmentSummaryTimeoutSeconds"),
EnrollmentSummaryBrandingImageUrl = entity.GetString("EnrollmentSummaryBrandingImageUrl"),
EnrollmentSummaryLaunchRetrySeconds = entity.GetInt32("EnrollmentSummaryLaunchRetrySeconds"),
HelloWaitTimeoutSeconds = entity.GetInt32("HelloWaitTimeoutSeconds") ?? 30,
AgentMaxLifetimeMinutes = entity.GetInt32("AgentMaxLifetimeMinutes"),
SendTraceEvents = entity.GetBoolean("SendTraceEvents") ?? true,
@@ -290,7 +290,7 @@ export function GatherRuleCard({
{!readOnly && (
<div className="flex items-center justify-end space-x-3 pt-4 border-t border-gray-200">
<button
onClick={onExport}
onClick={(e) => { e.stopPropagation(); onExport(); }}
className="px-4 py-2 text-sm bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 transition-colors flex items-center space-x-2"
title="Export rule as JSON"
>
@@ -301,7 +301,7 @@ export function GatherRuleCard({
</button>
{canEdit && (
<button
onClick={onStartEditing}
onClick={(e) => { e.stopPropagation(); onStartEditing(); }}
className="px-4 py-2 text-sm bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition-colors flex items-center space-x-2"
title="Edit rule"
>
@@ -313,7 +313,7 @@ export function GatherRuleCard({
)}
{!rule.isBuiltIn && !rule.isCommunity && (
<button
onClick={onDelete}
onClick={(e) => { e.stopPropagation(); onDelete(); }}
disabled={deletingRule === rule.ruleId}
className="px-4 py-2 text-sm bg-red-600 text-white rounded-lg hover:bg-red-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors flex items-center space-x-2"
title="Delete rule"
@@ -242,6 +242,8 @@ export default function GatherRulesPage() {
};
const startEditing = (rule: GatherRule) => {
// Ensure the card stays expanded when entering edit mode
setExpandedRuleId(rule.ruleId);
setEditingRuleId(rule.ruleId);
setEditForm({
ruleId: rule.ruleId,