Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"dependencies": {
"@base-ui/react": "^1.5.0",
"@icons-pack/react-simple-icons": "^13.13.0",
"@xyflow/react": "^12.11.1",
"foxact": "^0.3.5",
"react": "^19.2.6",
"react-dom": "^19.2.6",
Expand Down
184 changes: 184 additions & 0 deletions dashboard/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions dashboard/src/components/RoutingEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useEffect, useRef, useState } from "react";
import useSWR from "swr";
import useSWRMutation from "swr/mutation";
import { errMessage, mutateRequest } from "../lib/http";
import { RoutingMap } from "./RoutingMap";
import { Select } from "./Select";
import { Spinner } from "./Spinner";

Expand Down Expand Up @@ -80,13 +81,16 @@ export interface RoutingEditorProps {
/** Show the alert-labels section (default `true`). Unused by apps without
* label-triggered alerts (e.g. Linear). */
showAlertLabels?: boolean;
/** Show the read-only routing map preview (default `false`). */
showRoutingMap?: boolean;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

showRoutingMap is dead code at this head: no file imports RoutingEditor anymore, so this flag and the embedded map section are unreachable. Wiring the tabs back to RoutingEditor (see tab comments) makes this the live path.

}

export function RoutingEditor({
appName,
eventOptions,
showUserMap = true,
showAlertLabels = true,
showRoutingMap = false,
}: RoutingEditorProps) {
const url = `/api/apps/${appName}/routing`;
const { data, error, mutate } = useSWR<RoutingConfig>(url);
Expand Down Expand Up @@ -196,6 +200,24 @@ export function RoutingEditor({
restart. Delivery needs a bound <code>lark_app</code> bot.
</p>

{showRoutingMap && (
<section className="routing-section routing-map-section">
<div className="routing-section-head">
<span className="routing-section-title">Routing map</span>
<span className="routing-section-hint">
current rules rendered as event → rule → destination paths
</span>
</div>
<RoutingMap
appName={appName}
routing={edit}
eventOptions={eventOptions}
chats={chats}
users={users}
/>
</section>
)}

{/* ── Rules ── */}
<section className="routing-section">
<div className="routing-section-head">
Expand Down
Loading