Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
fix(control-ui): distinguish access action menus
Josué1a0a841f0ba2
diff --git a/control-ui/components/GfsGrantPanel.tsx b/control-ui/components/GfsGrantPanel.tsxindex 457d6d161..e25953b9e 100644--- a/control-ui/components/GfsGrantPanel.tsx+++ b/control-ui/components/GfsGrantPanel.tsx@@ -497,7 +497,7 @@ export function GfsGrantPanel({onSelect: () => void revokeAccess(item),},]}- ariaLabel={`Actions for ${label}`}+ ariaLabel={`Actions for ${item.kind === 'grant' ? 'direct grant to' : 'direct share to'} ${label}`}/></RecordListRow>)diff --git a/control-ui/components/HostAccessTab/index.tsx b/control-ui/components/HostAccessTab/index.tsxindex f57ac1a16..c554b3c64 100644--- a/control-ui/components/HostAccessTab/index.tsx+++ b/control-ui/components/HostAccessTab/index.tsx@@ -408,7 +408,7 @@ export function HostAccessTab({ hostName }: HostAccessTabProps) {</td><td className="cu-table__cell-actions"><RowActionsMenu- ariaLabel={`Actions for ${user.displayName || user.name || user.email}`}+ ariaLabel={`Actions for member ${user.displayName || user.name || user.email}`}actions={[{key: 'view',@@ -449,7 +449,7 @@ export function HostAccessTab({ hostName }: HostAccessTabProps) {</td><td className="cu-table__cell-actions"><RowActionsMenu- ariaLabel={`Actions for ${team.name}`}+ ariaLabel={`Actions for team ${team.name}`}actions={[{key: 'view',diff --git a/control-ui/components/WorkflowAccessPanel/index.tsx b/control-ui/components/WorkflowAccessPanel/index.tsxindex 808b94f40..1367ddedf 100644--- a/control-ui/components/WorkflowAccessPanel/index.tsx+++ b/control-ui/components/WorkflowAccessPanel/index.tsx@@ -703,7 +703,7 @@ function AccessUserSection({onSelect: () => void onRevoke(user.id),},]}- ariaLabel={`Actions for ${userLabel(user)}`}+ ariaLabel={`Actions for ${definition.revokeLabel.replace(/^Remove /, '')}: ${userLabel(user)}`}/></RecordListRow>))}@@ -801,7 +801,7 @@ function AccessTeamSection({onSelect: () => void onRevoke(team.id),},]}- ariaLabel={`Actions for ${teamLabel(team)}`}+ ariaLabel={`Actions for ${definition.revokeLabel.replace(/^Remove /, '')}: ${teamLabel(team)}`}/></RecordListRow>))}diff --git a/control-ui/components/__tests__/GfsGrantPanel.bulk.test.tsx b/control-ui/components/__tests__/GfsGrantPanel.bulk.test.tsxindex 02d28685d..d97599c64 100644--- a/control-ui/components/__tests__/GfsGrantPanel.bulk.test.tsx+++ b/control-ui/components/__tests__/GfsGrantPanel.bulk.test.tsx@@ -184,7 +184,9 @@ describe('GfsGrantPanel bulk access', () => {expect(within(existing).getByText('Direct grant · user')).toBeTruthy()expect(within(existing).getByText('Read')).toBeTruthy()expect(within(existing).getByText('Write')).toBeTruthy()- fireEvent.click(within(existing).getByRole('button', { name: 'Actions for Ada Lovelace' }))+ fireEvent.click(+ within(existing).getByRole('button', { name: 'Actions for direct grant to Ada Lovelace' })+ )fireEvent.click(await screen.findByRole('menuitem', { name: 'Remove access' }))const dialog = await screen.findByRole('alertdialog')fireEvent.click(within(dialog).getByRole('button', { name: 'Remove access' }))@@ -199,6 +201,43 @@ describe('GfsGrantPanel bulk access', () => {expect(mockGetGfsShares).toHaveBeenCalledTimes(2)})+ it('distinguishes direct grant and share menus for the same principal', async () => {+ mockGetGfsGrants.mockResolvedValue({+ items: [+ {+ id: '33333333-3333-3333-3333-333333333333',+ drive: 'main',+ resourceId: resource.resourceId,+ subject: userSubject,+ permissions: ['read'],+ inherit: false,+ },+ ],+ })+ mockGetGfsShares.mockResolvedValue({+ items: [+ {+ id: '44444444-4444-4444-4444-444444444444',+ drive: 'main',+ resourceId: resource.resourceId,+ subject: userSubject,+ permissions: ['read'],+ includeDescendants: false,+ },+ ],+ })++ renderPanel()++ const existing = await screen.findByRole('region', { name: 'Who has access' })+ expect(+ within(existing).getByRole('button', { name: 'Actions for direct grant to Ada Lovelace' })+ ).toBeInTheDocument()+ expect(+ within(existing).getByRole('button', { name: 'Actions for direct share to Ada Lovelace' })+ ).toBeInTheDocument()+ })+it('sorts access records by visible principal identity', async () => {mockGetAdminUsers.mockResolvedValue({items: [@@ -288,7 +327,9 @@ describe('GfsGrantPanel bulk access', () => {)renderPanel()const existing = await screen.findByRole('region', { name: 'Who has access' })- fireEvent.click(within(existing).getByRole('button', { name: 'Actions for Ada Lovelace' }))+ fireEvent.click(+ within(existing).getByRole('button', { name: 'Actions for direct grant to Ada Lovelace' })+ )fireEvent.click(await screen.findByRole('menuitem', { name: 'Remove access' }))const dialog = await screen.findByRole('alertdialog')fireEvent.click(within(dialog).getByRole('button', { name: 'Remove access' }))@@ -322,7 +363,9 @@ describe('GfsGrantPanel bulk access', () => {)renderPanel()const existing = await screen.findByRole('region', { name: 'Who has access' })- fireEvent.click(within(existing).getByRole('button', { name: 'Actions for Ada Lovelace' }))+ fireEvent.click(+ within(existing).getByRole('button', { name: 'Actions for direct grant to Ada Lovelace' })+ )fireEvent.click(await screen.findByRole('menuitem', { name: 'Remove access' }))const dialog = await screen.findByRole('alertdialog')fireEvent.click(within(dialog).getByRole('button', { name: 'Remove access' }))diff --git a/control-ui/components/__tests__/HostAccessTab.test.tsx b/control-ui/components/__tests__/HostAccessTab.test.tsxindex 52818438c..5b480cae6 100644--- a/control-ui/components/__tests__/HostAccessTab.test.tsx+++ b/control-ui/components/__tests__/HostAccessTab.test.tsx@@ -165,7 +165,7 @@ describe('HostAccessTab — extracted access behavior', () => {await waitFor(() => expect(screen.getByText('Alice')).toBeInTheDocument())- fireEvent.click(screen.getByRole('button', { name: 'Actions for Alice' }))+ fireEvent.click(screen.getByRole('button', { name: 'Actions for member Alice' }))fireEvent.click(screen.getByRole('menuitem', { name: 'Revoke access' }))// ConfirmDialog opens; click the danger "Revoke" button.@@ -223,7 +223,7 @@ describe('HostAccessTab — extracted access behavior', () => {await waitFor(() => expect(screen.getByText('Alice')).toBeInTheDocument())fireEvent.click(screen.getByRole('tab', { name: 'Teams' }))await waitFor(() => expect(screen.getByText('Platform')).toBeInTheDocument())- fireEvent.click(screen.getByRole('button', { name: 'Actions for Platform' }))+ fireEvent.click(screen.getByRole('button', { name: 'Actions for team Platform' }))fireEvent.click(screen.getByRole('menuitem', { name: 'Revoke access' }))const confirmDialog = await screen.findByRole('alertdialog')diff --git a/control-ui/components/__tests__/WorkflowAccessPanel.test.tsx b/control-ui/components/__tests__/WorkflowAccessPanel.test.tsxindex 1c491a822..5a5c2b08b 100644--- a/control-ui/components/__tests__/WorkflowAccessPanel.test.tsx+++ b/control-ui/components/__tests__/WorkflowAccessPanel.test.tsx@@ -153,7 +153,9 @@ describe('WorkflowAccessPanel', () => {const section = screen.getByTestId('workflow-access-trigger-users')await waitFor(() => expect(within(section).getByText(/alice@example\.com/)).toBeInTheDocument())- fireEvent.click(within(section).getByRole('button', { name: 'Actions for Alice' }))+ fireEvent.click(+ within(section).getByRole('button', { name: 'Actions for member trigger access: Alice' })+ )fireEvent.click(await screen.findByRole('menuitem', { name: 'Remove member trigger access' }))expect(setWorkflowGrants).not.toHaveBeenCalled()expect(diff --git a/control-ui/package-lock.json b/control-ui/package-lock.jsonindex c7316261e..41e577c2d 100644--- a/control-ui/package-lock.json+++ b/control-ui/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-control-ui",- "version": "0.1.563",+ "version": "0.1.564","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-control-ui",- "version": "0.1.563",+ "version": "0.1.564","dependencies": {"@clerum/display-field": "file:../packages/display-field","@clerum/frontend-components": "file:../packages/frontend-components",diff --git a/control-ui/package.json b/control-ui/package.jsonindex 7a79284c7..48f6afc2f 100644--- a/control-ui/package.json+++ b/control-ui/package.json@@ -1,6 +1,6 @@{"name": "clerum-control-ui",- "version": "0.1.563",+ "version": "0.1.564","private": true,"scripts": {"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",