Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

fix(control-ui): r7-m1 deduplicate channel detail action

Josué3b73ed779d9f
diff --git a/control-ui/app/communication-channels/page.tsx b/control-ui/app/communication-channels/page.tsx
index f5da2b0ca..d5540305f 100644
--- a/control-ui/app/communication-channels/page.tsx
+++ b/control-ui/app/communication-channels/page.tsx
@@ -59,7 +59,6 @@ export default function CommunicationChannelsPage() {
onCreateChannel={() => router.push(CONTROL_ROUTES.externalChannels.new())}
onCopyChannel={copyChannel}
onOpenChannel={name => router.push(CONTROL_ROUTES.externalChannels.edit(name))}
- onEditChannel={name => router.push(CONTROL_ROUTES.externalChannels.edit(name))}
/>
</DashboardLayout>
</AuthGate>
diff --git a/control-ui/components/CommunicationChannelsTable.tsx b/control-ui/components/CommunicationChannelsTable.tsx
index c47f25da3..6ceefb99b 100644
--- a/control-ui/components/CommunicationChannelsTable.tsx
+++ b/control-ui/components/CommunicationChannelsTable.tsx
@@ -86,7 +86,6 @@ export function CommunicationChannelsTable({
refreshing,
onCreateChannel,
onCopyChannel,
- onEditChannel,
onOpenChannel,
}: {
items: CommunicationChannelItem[]
@@ -96,7 +95,6 @@ export function CommunicationChannelsTable({
refreshing?: boolean
onCreateChannel?: () => void
onCopyChannel?: (name: string, provider: CommunicationChannelProvider) => void
- onEditChannel?: (name: string) => void
onOpenChannel?: (name: string) => void
}) {
const [deletingKey, setDeletingKey] = useState<string | null>(null)
@@ -290,15 +288,6 @@ export function CommunicationChannelsTable({
},
]
: []),
- ...(onEditChannel
- ? [
- {
- key: 'edit',
- label: 'Edit',
- onClick: () => onEditChannel(name),
- },
- ]
- : []),
...copyTargetsForChannel(item).map(provider => ({
key: `copy-${provider}`,
label: `Copy config into ${communicationChannelProviderLabel(provider)}`,
diff --git a/control-ui/components/__tests__/CommunicationChannelsTable.test.tsx b/control-ui/components/__tests__/CommunicationChannelsTable.test.tsx
index 40a1cff2b..b4d4f6b7e 100644
--- a/control-ui/components/__tests__/CommunicationChannelsTable.test.tsx
+++ b/control-ui/components/__tests__/CommunicationChannelsTable.test.tsx
@@ -197,14 +197,14 @@ describe('CommunicationChannelsTable — row actions kebab', () => {
} as unknown as CommunicationChannelItem
}
- it('opens the kebab with Edit + Delete and routes Edit through the matching handler', () => {
- const onEditChannel = vi.fn()
+ it('exposes one canonical detail action for the row navigation destination', () => {
+ const onOpenChannel = vi.fn()
render(
<ToastProvider>
<CommunicationChannelsTable
items={[teamsChannelItem()]}
onChanged={vi.fn().mockResolvedValue(undefined)}
- onEditChannel={onEditChannel}
+ onOpenChannel={onOpenChannel}
onRefresh={vi.fn()}
refreshing={false}
/>
@@ -213,12 +213,14 @@ describe('CommunicationChannelsTable — row actions kebab', () => {
fireEvent.click(screen.getByRole('button', { name: 'Actions for channel teams-channel' }))
- const editItem = screen.getByRole('menuitem', { name: 'Edit' })
+ const detailItems = screen.getAllByRole('menuitem', { name: 'View details' })
const deleteItem = screen.getByRole('menuitem', { name: 'Delete' })
+ expect(detailItems).toHaveLength(1)
+ expect(screen.queryByRole('menuitem', { name: 'Edit' })).not.toBeInTheDocument()
expect(deleteItem).toHaveClass('eft-row-actions__item--danger')
- fireEvent.click(editItem)
- expect(onEditChannel).toHaveBeenCalledWith('teams-channel')
+ fireEvent.click(detailItems[0])
+ expect(onOpenChannel).toHaveBeenCalledWith('teams-channel')
})
it('opens the confirm dialog when Delete is clicked on the kebab', () => {
@@ -227,7 +229,7 @@ describe('CommunicationChannelsTable — row actions kebab', () => {
<CommunicationChannelsTable
items={[teamsChannelItem()]}
onChanged={vi.fn().mockResolvedValue(undefined)}
- onEditChannel={vi.fn()}
+ onOpenChannel={vi.fn()}
onRefresh={vi.fn()}
refreshing={false}
/>
@@ -240,7 +242,7 @@ describe('CommunicationChannelsTable — row actions kebab', () => {
expect(screen.getByRole('alertdialog')).toHaveTextContent(/Delete communication channel/)
})
- it('still renders the kebab without Edit when onEditChannel is omitted', () => {
+ it('still renders the kebab without a detail action when row navigation is omitted', () => {
render(
<ToastProvider>
<CommunicationChannelsTable
@@ -254,7 +256,7 @@ describe('CommunicationChannelsTable — row actions kebab', () => {
fireEvent.click(screen.getByRole('button', { name: 'Actions for channel teams-channel' }))
- expect(screen.queryByRole('menuitem', { name: 'Edit' })).not.toBeInTheDocument()
+ expect(screen.queryByRole('menuitem', { name: 'View details' })).not.toBeInTheDocument()
expect(screen.getByRole('menuitem', { name: 'Delete' })).toBeInTheDocument()
})
diff --git a/control-ui/package-lock.json b/control-ui/package-lock.json
index 60970e484..4f8df1a85 100644
--- a/control-ui/package-lock.json
+++ b/control-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-ui",
- "version": "0.1.505",
+ "version": "0.1.506",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-ui",
- "version": "0.1.505",
+ "version": "0.1.506",
"dependencies": {
"@clerum/display-field": "file:../packages/display-field",
"@clerum/frontend-table-system": "file:../packages/frontend-table-system",
diff --git a/control-ui/package.json b/control-ui/package.json
index 632ee8645..c07e8144b 100644
--- a/control-ui/package.json
+++ b/control-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-ui",
- "version": "0.1.505",
+ "version": "0.1.506",
"private": true,
"scripts": {
"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",