feat: refocus remaining admin governance flows
This commit is contained in:
@@ -9411,6 +9411,7 @@ async function openAdminOverrideTargetAction() {
|
||||
await loadAgentControlSurfaces(getOneLinerProjectId());
|
||||
rememberAction("管理员覆盖目标已更新", `当前目标已切换到 ${formatAdminGovernanceTargetLabel(appState.adminOverrideTarget)}。`, "green");
|
||||
renderAll();
|
||||
focusAdminGovernanceAuditWorkspace("admin-override-audit-anchor");
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -9534,6 +9535,7 @@ async function openSystemMainPolicyHistoryAction(preferredVersionId = "") {
|
||||
await loadAgentControlSurfaces(getOneLinerProjectId());
|
||||
rememberAction("系统主 Agent 已回滚", `已回滚到版本 ${saved.current_version?.version_no || "所选版本"}。`, "green", saved);
|
||||
renderAll();
|
||||
focusAdminGovernanceAgentsWorkspace("admin-governance-anchor");
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -9572,6 +9574,7 @@ async function openSystemPlatformPolicyHistoryAction(platform, preferredVersionI
|
||||
await loadAgentControlSurfaces(getOneLinerProjectId());
|
||||
rememberAction(`${platformLabel(normalizedPlatform)} 系统平台策略已回滚`, `已回滚到版本 ${saved.current_version?.version_no || "所选版本"}。`, "green", saved);
|
||||
renderAll();
|
||||
focusAdminGovernanceAgentsWorkspace("admin-governance-anchor");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -709,6 +709,8 @@ test("admin governance actions apply local permission and empty-directory guards
|
||||
const targetPicker = extractBetween(APP, "async function openAdminOverrideTargetAction()", "function openAdminOverridePolicyAction()");
|
||||
const systemMain = extractBetween(APP, "function openSystemMainPolicyAction()", "function openSystemPlatformPolicyAction(platform)");
|
||||
const systemPlatform = extractBetween(APP, "function openSystemPlatformPolicyAction(platform)", "async function openAdminOverrideTargetAction()");
|
||||
const systemMainHistory = extractBetween(APP, "async function openSystemMainPolicyHistoryAction(preferredVersionId = \"\")", "async function openSystemPlatformPolicyHistoryAction(platform, preferredVersionId = \"\")");
|
||||
const systemPlatformHistory = extractBetween(APP, "async function openSystemPlatformPolicyHistoryAction(platform, preferredVersionId = \"\")", "function reopenPlatformAgentDetailSoon(platform)");
|
||||
const actionRegistry = extractBetween(APP, "function openActionRegistryEditAction(actionKey)", "function openTenantQuotaAction()");
|
||||
|
||||
assert.match(helpers, /function ensureAdminGovernanceAccess\(\)/);
|
||||
@@ -717,10 +719,13 @@ test("admin governance actions apply local permission and empty-directory guards
|
||||
assert.match(adminFocusHelper, /setScreen\("admin-workbench"\)/);
|
||||
assert.match(adminFocusHelper, /scrollIntoView/);
|
||||
assert.match(targetPicker, /hideSubmit:\s*!directoryItems\.length/);
|
||||
assert.match(targetPicker, /focusAdminGovernanceAuditWorkspace\("admin-override-audit-anchor"\)/);
|
||||
assert.match(systemMain, /if \(!ensureAdminGovernanceAccess\(\)\) return;/);
|
||||
assert.match(systemPlatform, /if \(!ensureAdminGovernanceAccess\(\)\) return;/);
|
||||
assert.match(systemMain, /focusAdminGovernanceAgentsWorkspace\("admin-governance-anchor"\)/);
|
||||
assert.match(systemPlatform, /focusAdminGovernanceAgentsWorkspace\("admin-governance-anchor"\)/);
|
||||
assert.match(systemMainHistory, /focusAdminGovernanceAgentsWorkspace\("admin-governance-anchor"\)/);
|
||||
assert.match(systemPlatformHistory, /focusAdminGovernanceAgentsWorkspace\("admin-governance-anchor"\)/);
|
||||
assert.match(actionRegistry, /focusAdminGovernanceAgentsWorkspace\("admin-action-registry-anchor"\)/);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user