All the channel approval

This commit is contained in:
2026-04-12 13:47:27 +02:00
parent 1edb5785e3
commit dbfa7560cf
9 changed files with 329 additions and 3 deletions

View File

@@ -6,6 +6,9 @@ import { StatusBadge } from "@/components/ui/status-badge";
import { UsageDisplay } from "@/components/dashboard/usage-display";
import { PackageList } from "@/components/packages/package-list";
import { WorkspaceEditor } from "@/components/packages/workspace-editor";
import { ChannelUsers } from "@/components/channel-users/channel-users";
const CHANNEL_PACKAGES = ["telegram", "discord", "email"];
export default async function TenantDetailPage({
params,
@@ -20,7 +23,6 @@ export default async function TenantDetailPage({
const tenant = await getTenant(name);
if (!tenant) notFound();
console.log("tenant spec:", JSON.stringify(tenant.spec));
// Scope check
if (
@@ -32,6 +34,10 @@ export default async function TenantDetailPage({
const enabledPackages = tenant.spec.packages || [];
const workspaceFiles = tenant.spec.workspaceFiles || {};
const enabledChannels = enabledPackages.filter((pkg) =>
CHANNEL_PACKAGES.includes(pkg)
);
const channelUsers = tenant.spec.channelUsers || {};
return (
<div>
@@ -70,8 +76,19 @@ export default async function TenantDetailPage({
/>
</section>
{/* Channel Users (authorized users per channel) */}
{enabledChannels.length > 0 && (
<section className="mb-8 animate-in animate-in-delay-3">
<ChannelUsers
tenantName={name}
enabledChannels={enabledChannels}
initialChannelUsers={channelUsers}
/>
</section>
)}
{/* Workspace files */}
<section className="animate-in animate-in-delay-3">
<section className="animate-in animate-in-delay-4">
<h2 className="text-xs font-semibold uppercase tracking-wider text-text-muted mb-3">
{t("workspaceFiles")}
</h2>
@@ -79,4 +96,4 @@ export default async function TenantDetailPage({
</section>
</div>
);
}
}

View File

@@ -67,6 +67,8 @@ export async function PATCH(
if (body.displayName !== undefined)
specPatch.displayName = body.displayName;
if (body.agentName !== undefined) specPatch.agentName = body.agentName;
if (body.channelUsers !== undefined)
specPatch.channelUsers = body.channelUsers;
const updated = await patchTenantSpec(name, specPatch);
return NextResponse.json(updated);