Skip to content

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

TypeScript

Merge remote-tracking branch 'origin/dev' into feat/gfs-ux-improvement

M4835eec5f9b2
diff --cc control-ui/app/globals.css
index 553cbd98a,40e24b6ca..cc27cad8d
--- a/control-ui/app/globals.css
+++ b/control-ui/app/globals.css
@@@ -13893,32 -13352,17 +13890,17 @@@ button.cu-gfs-tree__button:focus-visibl
color: var(--cu-text-muted);
}
- .cu-gfs-existing-access__item > .cu-btn {
- flex: 0 0 auto;
- white-space: nowrap;
- }
-
- .cu-gfs-existing-access__revoke.cu-btn {
- min-width: 1.5rem;
- min-height: 1.5rem;
- padding: 0;
- border: 0;
- border-radius: 999px;
- background: transparent;
- color: var(--cu-text);
- font-size: 0.9rem;
- font-weight: 700;
- line-height: 1;
- }
-
- .cu-gfs-existing-access__revoke.cu-btn:hover:not(:disabled) {
- border-color: transparent;
- background: transparent;
- color: var(--cu-text);
+ .cu-gfs-existing-access__inherit {
+ gap: calc(var(--cu-space-1) / 2);
- border: 1px solid rgba(var(--cu-success-rgb), 0.24);
- background: rgba(var(--cu-success-rgb), 0.055);
- color: var(--cu-success);
++ border: 1px solid rgba(var(--cu-accent-rgb), 0.24);
++ background: rgba(var(--cu-accent-rgb), 0.055);
++ color: var(--cu-accent);
}
- .cu-gfs-existing-access__revoke.cu-btn:focus-visible {
- border-color: transparent;
+ .cu-gfs-existing-access__inherit svg {
+ width: var(--cu-space-2);
+ height: var(--cu-space-2);
+ flex: 0 0 var(--cu-space-2);
}
.cu-gfs-existing-access__error {
diff --cc control-ui/components/GfsGrantPanel.tsx
index 41f67d146,e25953b9e..e9462cc5e
--- a/control-ui/components/GfsGrantPanel.tsx
+++ b/control-ui/components/GfsGrantPanel.tsx
@@@ -1,10 -1,13 +1,12 @@@
'use client'
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
+ import { RecordList, RecordListRow, RowActionMenu } from '@clerum/frontend-components'
import { useConfirmDialog } from '@components/ConfirmDialog'
-import { GfsPermissionDropdown } from '@components/GfsPermissionDropdown'
-import { GFS_PERMISSION_LABELS } from '@components/GfsPermissionDropdown/constants'
import { GfsSubjectPicker } from '@components/GfsSubjectPicker'
+import { SelectionDropdown } from '@components/SelectionDropdown'
import type { SelectionDropdownOption } from '@components/SelectionDropdown/types'
+ import { IconFolder } from '@components/Sidebar/icons'
import { useToast } from '@components/Toast'
import { Button, CheckboxField } from '@components/ui'
import { GFS_MAX_BULK_SUBJECTS } from '@constants/gfsGrantSubjects'
@@@ -274,19 -305,46 +276,36 @@@ export function GfsGrantPanel({ resourc
}
}
- function subjectLabel(item: GfsExistingAccessItem): string {
- if (item.subject.type === 'operator') return 'Operator'
- const option = bulkSubjectOptions.find(
- candidate =>
- candidate.subject.type === item.subject.type && candidate.subject.id === item.subject.id
- )
- if (option) return option.label
- const typeLabel =
- item.subject.type === 'host'
- ? 'Agent or workflow'
- : item.subject.type.charAt(0).toUpperCase() + item.subject.type.slice(1)
- return item.subject.id ? `${typeLabel} · ${item.subject.id}` : typeLabel
- submitShareRef.current = () => {
- void submit('share')
-- }
-
- useEffect(() => {
- if (!onCreateShareActionChange) return
- onCreateShareActionChange(() => submitShareRef.current(), !canSubmit || !canCreateShare)
- return () => onCreateShareActionChange(null, true)
- }, [canCreateShare, canSubmit, onCreateShareActionChange])
-
+ const subjectLabel = useCallback(
+ (item: GfsExistingAccessItem): string => {
+ if (item.subject.type === 'operator') return 'Operator'
+ const option = bulkSubjectOptions.find(
+ candidate =>
+ candidate.subject.type === item.subject.type && candidate.subject.id === item.subject.id
+ )
+ if (option) return option.label
+ const typeLabel =
+ item.subject.type === 'host'
+ ? 'Agent or workflow'
+ : item.subject.type.charAt(0).toUpperCase() + item.subject.type.slice(1)
+ return item.subject.id ? `${typeLabel} · ${item.subject.id}` : typeLabel
+ },
+ [bulkSubjectOptions]
+ )
+
+ const sortedExistingAccess = useMemo(
+ () =>
+ [...existingAccess].sort(
+ (left, right) =>
+ subjectLabel(left).localeCompare(subjectLabel(right), undefined, {
+ numeric: true,
+ sensitivity: 'base',
+ }) ||
+ left.kind.localeCompare(right.kind) ||
+ left.id.localeCompare(right.id)
+ ),
+ [existingAccess, subjectLabel]
+ )
async function revokeAccess(item: GfsExistingAccessItem) {
const label = subjectLabel(item)
@@@ -421,84 -432,79 +440,93 @@@
{error}
</p>
) : null}
- <section className="cu-gfs-existing-access" aria-label="Who has access">
- <div className="cu-gfs-existing-access__header">
- <h4>Who has access</h4>
- <p>Existing grants on this resource. Revoking is immediate.</p>
- </div>
- {existingAccessLoading ? (
- <p className="cu-gfs-existing-access__empty" role="status">
- Loading access…
- </p>
- ) : existingAccessError ? (
- <div className="cu-gfs-existing-access__error">
- <p role="alert" className="cu-field__error">
- {existingAccessError}
- </p>
- <Button size="sm" disabled={actionPending} onClick={() => void loadExistingAccess()}>
- Retry
- </Button>
+ {!subjectValid ? (
+ <section className="cu-gfs-existing-access" aria-label="People with access">
+ <div className="cu-gfs-existing-access__header">
+ <h4>People with access</h4>
</div>
- ) : existingAccess.length === 0 ? (
- <p className="cu-gfs-existing-access__empty">No direct grants or shares yet.</p>
- ) : (
- <RecordList className="cu-gfs-existing-access__list" aria-label="Resource access">
- {sortedExistingAccess.map(item => {
- const label = subjectLabel(item)
- const coversDescendants =
- item.kind === 'grant' ? item.inherit : item.includeDescendants
- return (
- <RecordListRow
- className="cu-gfs-existing-access__item"
- data-testid={`gfs-access-row-${item.kind}-${item.id}`}
- data-access-id={item.id}
- key={`${item.kind}:${item.id}`}
- >
- <span className="cu-gfs-existing-access__identity">
- <span className="cu-gfs-existing-access__subject">{label}</span>
- <span className="cu-gfs-existing-access__detail">
- {item.kind === 'grant' ? 'Direct grant' : 'Direct share'} ·{' '}
- {item.subject.type}
+ {existingAccessLoading ? (
+ <p className="cu-gfs-existing-access__empty" role="status">
+ Loading access…
+ </p>
+ ) : existingAccessError ? (
+ <div className="cu-gfs-existing-access__error">
+ <p role="alert" className="cu-field__error">
+ {existingAccessError}
+ </p>
+ <Button size="sm" disabled={actionPending} onClick={() => void loadExistingAccess()}>
+ Retry
+ </Button>
+ </div>
+ ) : existingAccess.length === 0 ? (
+ <p className="cu-gfs-existing-access__empty">No direct grants or shares yet.</p>
+ ) : (
- <ul className="cu-gfs-existing-access__list" aria-label="Resource access">
- {existingAccess.map(item => {
++ <RecordList className="cu-gfs-existing-access__list" aria-label="Resource access">
++ {sortedExistingAccess.map(item => {
+ const label = subjectLabel(item)
++ const coversDescendants =
++ item.kind === 'grant' ? item.inherit : item.includeDescendants
+ return (
- <li
++ <RecordListRow
+ className="cu-gfs-existing-access__item"
+ data-testid={`gfs-access-row-${item.kind}-${item.id}`}
++ data-access-id={item.id}
+ key={`${item.kind}:${item.id}`}
+ >
+ <span className="cu-gfs-existing-access__identity">
+ <span className="cu-gfs-existing-access__subject">{label}</span>
+ <span className="cu-gfs-existing-access__detail">
+ {item.kind === 'grant' ? 'Direct grant' : 'Direct share'} ·{' '}
+ {item.subject.type}
+ </span>
</span>
- </span>
- <span className="cu-gfs-existing-access__meta">
- <span className="cu-gfs-existing-access__chips" aria-label="Permissions">
- {item.permissions.map(permission => (
- <span className="cu-gfs-existing-access__permission" key={permission}>
- {GFS_PERMISSION_LABELS[permission] ?? permission}
+ <span className="cu-gfs-existing-access__meta">
+ {item.kind === 'grant' ? (
+ <SelectionDropdown
+ ariaLabel={`Access role for ${label}`}
+ className="cu-gfs-existing-access__role"
+ disabled={actionPending}
+ multiple={false}
+ onChange={next =>
+ void updateAccessRole(item, (next[0] ?? 'read') as AccessRole)
+ }
+ options={ROLE_OPTIONS}
+ placeholder="Role"
+ searchable={false}
+ showSelectedChips={false}
+ value={[roleForPermissions(item.permissions)]}
+ />
+ ) : (
+ <span className="cu-gfs-existing-access__role-label">
+ {roleForPermissions(item.permissions) === 'editor' ? 'Editor' : 'Read'}
</span>
- ))}
+ )}
++ {coversDescendants ? (
++ <span className="cu-gfs-existing-access__inherit">
++ <IconFolder />
++ Includes contents
++ </span>
++ ) : null}
</span>
- <Button
- aria-label={`Remove ${item.kind} access for ${label}`}
- className="cu-gfs-existing-access__revoke"
- data-testid={`gfs-revoke-${item.kind}-${item.id}`}
- title={`Remove ${item.kind} access for ${label}`}
- size="sm"
- disabled={actionPending}
- onClick={() => void revokeAccess(item)}
- variant="ghost"
- >
- X
- </Button>
- </li>
- {coversDescendants ? (
- <span className="cu-gfs-existing-access__inherit">
- <IconFolder />
- Includes contents
- </span>
- ) : null}
- </span>
- <RowActionMenu
- actions={[
- {
- key: 'remove',
- label: 'Remove access',
- danger: true,
- disabled: actionPending,
- onSelect: () => void revokeAccess(item),
- },
- ]}
- ariaLabel={`Actions for ${item.kind === 'grant' ? 'direct grant to' : 'direct share to'} ${label}`}
- />
- </RecordListRow>
- )
- })}
- </RecordList>
- )}
- </section>
++ <RowActionMenu
++ actions={[
++ {
++ key: 'remove',
++ label: 'Remove access',
++ danger: true,
++ disabled: actionPending,
++ onSelect: () => void revokeAccess(item),
++ },
++ ]}
++ ariaLabel={`Actions for ${item.kind === 'grant' ? 'direct grant to' : 'direct share to'} ${label}`}
++ />
++ </RecordListRow>
+ )
+ })}
- </ul>
++ </RecordList>
+ )}
+ </section>
+ ) : null}
{confirmDialog}
</div>
)
diff --cc control-ui/components/__tests__/GfsGrantPanel.bulk.test.tsx
index 674ffecce,d97599c64..aea5ae784
--- a/control-ui/components/__tests__/GfsGrantPanel.bulk.test.tsx
+++ b/control-ui/components/__tests__/GfsGrantPanel.bulk.test.tsx
@@@ -143,21 -179,15 +143,16 @@@ describe('GfsGrantPanel bulk access', (
.mockResolvedValueOnce({ items: [] })
renderPanel()
- const existing = await screen.findByRole('region', { name: 'Who has access' })
+ const existing = await screen.findByRole('region', { name: 'People with access' })
expect(within(existing).getByText('Ada Lovelace')).toBeTruthy()
expect(within(existing).getByText('Direct grant · user')).toBeTruthy()
- expect(within(existing).getByText('Read')).toBeTruthy()
- expect(within(existing).getByText('Write')).toBeTruthy()
+ expect(
+ within(existing).getByRole('button', { name: 'Access role for Ada Lovelace' })
+ ).toHaveTextContent('Editor')
- expect(within(existing).getByText('X')).toBeTruthy()
- expect(
- within(existing).getByRole('button', { name: 'Remove grant access for Ada Lovelace' })
- .className
- ).toContain('cu-gfs-existing-access__revoke')
-
fireEvent.click(
- within(existing).getByRole('button', { name: 'Remove grant access for Ada Lovelace' })
+ 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' }))
@@@ -171,42 -201,109 +166,145 @@@
expect(mockGetGfsShares).toHaveBeenCalledTimes(2)
})
+ it('changes an existing member between Editor and Read', async () => {
+ const persistedGrant = {
+ id: '33333333-3333-3333-3333-333333333333',
+ drive: 'main',
+ resourceId: resource.resourceId,
+ subject: userSubject,
+ permissions: ['read', 'write', 'delete', 'manage_acl', 'share'],
+ inherit: false,
+ }
+ mockGetGfsGrants
+ .mockResolvedValueOnce({ items: [persistedGrant] })
+ .mockResolvedValueOnce({ items: [{ ...persistedGrant, permissions: ['read', 'share'] }] })
+ mockPutGfsGrant.mockResolvedValue(successfulMutation(userSubject))
+ renderPanel()
+
+ const role = await screen.findByRole('button', { name: 'Access role for Ada Lovelace' })
+ expect(role).toHaveTextContent('Editor')
+ fireEvent.click(role)
+ fireEvent.click(screen.getByRole('option', { name: 'Read' }))
+
+ await waitFor(() =>
+ expect(mockPutGfsGrant).toHaveBeenCalledWith({
+ drive: 'main',
+ resourceId: resource.resourceId,
+ subject: userSubject,
+ permissions: ['read', 'share'],
+ inherit: false,
+ })
+ )
+ await waitFor(() =>
+ expect(
+ screen.getByRole('button', { name: 'Access role for Ada Lovelace' })
+ ).toHaveTextContent('Read')
+ )
+ })
+
+ 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' })
++ const existing = await screen.findByRole('region', { name: 'People with 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: [
+ {
+ id: '11111111-1111-1111-1111-111111111111',
+ email: '[email protected]',
+ name: 'Ada Lovelace',
+ displayName: 'Ada Lovelace',
+ picture: null,
+ activeTeamCount: 1,
+ },
+ {
+ id: '11111111-1111-1111-1111-111111111110',
+ email: '[email protected]',
+ name: 'Ada Lovelace',
+ displayName: 'Ada Lovelace',
+ picture: null,
+ activeTeamCount: 1,
+ },
+ ],
+ })
+ mockGetGfsGrants.mockResolvedValue({
+ items: [
+ {
+ id: '77777777-7777-7777-7777-777777777777',
+ drive: 'main',
+ resourceId: resource.resourceId,
+ subject: { type: 'operator' },
+ permissions: ['read'],
+ inherit: false,
+ },
+ {
+ id: '33333333-3333-3333-3333-333333333333',
+ drive: 'main',
+ resourceId: resource.resourceId,
+ subject: userSubject,
+ permissions: ['read'],
+ inherit: false,
+ },
+ {
+ id: '22222222-2222-2222-2222-222222222222',
+ drive: 'main',
+ resourceId: resource.resourceId,
+ subject: { type: 'user', id: '11111111-1111-1111-1111-111111111110' },
+ permissions: ['read'],
+ inherit: false,
+ },
+ ],
+ })
+ renderPanel()
+
+ const list = await screen.findByRole('list', { name: 'Resource access' })
+ await waitFor(() => expect(within(list).getAllByText('Ada Lovelace')).toHaveLength(2))
+ const rows = within(list).getAllByRole('listitem')
+ expect(rows.map(row => row.textContent)).toEqual([
+ expect.stringContaining('Ada Lovelace'),
+ expect.stringContaining('Ada Lovelace'),
+ expect.stringContaining('Operator'),
+ ])
+ expect(rows.map(row => row.getAttribute('data-access-id'))).toEqual([
+ '22222222-2222-2222-2222-222222222222',
+ '33333333-3333-3333-3333-333333333333',
+ '77777777-7777-7777-7777-777777777777',
+ ])
+ })
+
it('self-heals a row that another admin already revoked without hiding other errors', async () => {
mockGetGfsGrants
.mockResolvedValueOnce({
@@@ -229,10 -326,11 +327,11 @@@
})
)
renderPanel()
- const existing = await screen.findByRole('region', { name: 'Who has access' })
+ const existing = await screen.findByRole('region', { name: 'People with access' })
fireEvent.click(
- within(existing).getByRole('button', { name: 'Remove grant access for Ada Lovelace' })
+ 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' }))
@@@ -264,10 -362,11 +363,11 @@@
})
)
renderPanel()
- const existing = await screen.findByRole('region', { name: 'Who has access' })
+ const existing = await screen.findByRole('region', { name: 'People with access' })
fireEvent.click(
- within(existing).getByRole('button', { name: 'Remove grant access for Ada Lovelace' })
+ 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 --cc control-ui/e2e/support/gfs-bulk-operator-journey.test.ts
index 5c1be0006,79fc0d649..7fbb30a60
--- a/control-ui/e2e/support/gfs-bulk-operator-journey.test.ts
+++ b/control-ui/e2e/support/gfs-bulk-operator-journey.test.ts
@@@ -38,15 -39,15 +38,12 @@@ async function chooseGrantSubject
await option.click()
}
--async function choosePermission(
++async function chooseRole(
panel: ReturnType<Page['getByRole']>,
-- permissionName: string
++ roleName: 'Read' | 'Editor'
): Promise<void> {
-- const menu = panel.getByRole('menu', { name: 'Permissions' })
-- if (!(await menu.isVisible().catch(() => false))) {
-- await panel.getByRole('button', { name: 'Permissions', exact: true }).click()
-- }
-- await menu.getByRole('menuitemcheckbox', { name: permissionName, exact: true }).click()
++ await panel.getByRole('button', { name: 'Access role for selected recipients' }).click()
++ await panel.getByRole('option', { name: roleName, exact: true }).click()
}
export async function exerciseGfsBulkOperatorJourney(page: Page): Promise<void> {
@@@ -60,7 -61,7 +57,7 @@@
const targetTeam = seedE2EUserTeam(E2E_TEST_EMAIL, teamName)
const workflowRecipe = seedGfsWorkflowRecipeFixture(workflowName)
const grantPanel = () =>
-- page.getByRole('dialog', { name: `Manage folder ${fixture.name}`, exact: true })
++ page.getByRole('dialog', { name: `Share folder ${fixture.name}`, exact: true })
const folderRow = (name: string) =>
page
.getByRole('list', { name: 'Current folder resources' })
@@@ -87,7 -88,7 +84,7 @@@
await expect(panel.getByLabel('Subject ID')).toHaveCount(0)
await expect(
panel.getByRole('checkbox', { name: 'Include contents of this folder' })
-- ).toBeChecked()
++ ).toHaveCount(0)
await chooseGrantSubject(panel, E2E_TEST_EMAIL, E2E_TEST_NAME)
await chooseGrantSubject(panel, targetTeam.name, targetTeam.name)
@@@ -95,42 -96,44 +92,31 @@@
await expect(selectedSubjects).toContainText(E2E_TEST_NAME)
await expect(selectedSubjects).toContainText(targetTeam.name)
-- await choosePermission(panel, 'Manage access')
-- await choosePermission(panel, 'Share')
++ await chooseRole(panel, 'Editor')
await chooseGrantSubject(panel, 'chatllm', 'chatllm (Stateful)')
await chooseGrantSubject(panel, 'chatllm-stateless', 'chatllm-stateless (Stateless)')
await expect(selectedSubjects).toContainText('chatllm (Stateful)')
await expect(selectedSubjects).toContainText('chatllm-stateless (Stateless)')
-- await expect(panel.getByText(/host selections are limited to read and write/i)).toBeVisible()
--
-- await panel.getByRole('button', { name: 'Permissions', exact: true }).click()
-- const permissionMenu = panel.getByRole('menu', { name: 'Permissions' })
-- await expect(
-- permissionMenu.getByRole('menuitemcheckbox', { name: 'Manage access' })
-- ).toHaveCount(0)
-- await expect(permissionMenu.getByRole('menuitemcheckbox', { name: 'Share' })).toHaveCount(0)
-- await expect(permissionMenu.getByRole('menuitemcheckbox', { name: 'Delete' })).toHaveCount(0)
- await expect(panel.getByRole('button', { name: 'Create share', exact: true })).toBeDisabled()
-
++ await expect(panel.getByText(/use read\/write access only/i)).toBeVisible()
await chooseGrantSubject(panel, workflowRecipe.name, workflowRecipe.name)
await expect(selectedSubjects).toContainText(workflowRecipe.name)
await expect(selectedSubjects.getByRole('button', { name: /^Remove / })).toHaveCount(5)
-- await choosePermission(panel, 'Read')
-- await choosePermission(panel, 'Write')
++ await expect(
++ panel.getByRole('checkbox', { name: 'Include contents of this folder' })
++ ).toBeChecked()
++ await expect(
++ panel.getByRole('button', { name: 'Access role for selected recipients' })
++ ).toContainText('Editor')
})
-- await test.step('operator confirms one atomic bulk grant and sees persisted access', async () => {
++ await test.step('operator shares one atomic bulk grant and sees persisted access', async () => {
const panel = grantPanel()
const grantResponsePromise = page.waitForResponse(
response =>
response.request().method() === 'PUT' &&
response.url().includes('/control-api/api/v1/gfs/grants')
)
-- await panel.getByRole('button', { name: 'Grant access', exact: true }).click()
-- const dialog = page.getByRole('alertdialog')
-- await expect(dialog).toContainText('Grant access?')
-- await expect(dialog).toContainText(fixture.name)
-- await expect(dialog).toContainText(/5 subjects/i)
-- await expect(dialog).toContainText(/read, write/)
-- await dialog.getByRole('button', { name: 'Grant' }).click()
++ await panel.getByRole('button', { name: 'Share', exact: true }).click()
const grantResponse = await grantResponsePromise
expect(grantResponse.status(), `${grantResponse.url()} ${await grantResponse.text()}`).toBe(
200
@@@ -151,7 -154,7 +137,7 @@@
expect(submittedBody.subject).toBeUndefined()
expect(submittedBody.subjects).toEqual(expectedSubjects)
expect(submittedBody.permissions).toEqual(['read', 'write'])
-- await expect(page.getByText('Grant saved.').last()).toBeVisible({ timeout: 15_000 })
++ await expect(page.getByText('Access shared.').last()).toBeVisible({ timeout: 15_000 })
for (const subject of expectedSubjects) {
await expect
@@@ -181,7 -184,7 +167,7 @@@
await test.step('closing and reopening the modal rehydrates persisted access and allows revocation', async () => {
const panel = grantPanel()
-- await panel.getByRole('button', { name: 'Close manage dialog' }).click()
++ await panel.getByRole('button', { name: 'Close share dialog' }).click()
await expect(panel).toHaveCount(0)
await page.reload()
@@@ -190,10 -193,10 +176,14 @@@
const row = folderRow(fixture.name)
await expect(row).toBeVisible({ timeout: 20_000 })
await row.getByRole('button', { name: `Actions for ${fixture.name}` }).click()
-- await page.getByRole('menuitem', { name: 'Manage access' }).click()
++ await page.getByRole('menuitem', { name: 'Share' }).hover()
++ await page
++ .getByRole('menu', { name: `Share options for ${fixture.name}` })
++ .getByRole('menuitem', { name: 'Share' })
++ .click()
const reopenedPanel = grantPanel()
await expect(reopenedPanel).toBeVisible()
-- const existingAccess = reopenedPanel.getByRole('region', { name: 'Who has access' })
++ const existingAccess = reopenedPanel.getByRole('region', { name: 'People with access' })
await expect(existingAccess.getByText(E2E_TEST_NAME, { exact: true })).toBeVisible()
await expect(existingAccess.getByText(targetTeam.name, { exact: true })).toBeVisible()
await expect(existingAccess.getByText('chatllm (Stateful)', { exact: true })).toBeVisible()
@@@ -201,16 -204,15 +191,19 @@@
existingAccess.getByText('chatllm-stateless (Stateless)', { exact: true })
).toBeVisible()
await expect(existingAccess.getByText(workflowRecipe.name, { exact: true })).toBeVisible()
-- await expect(existingAccess.getByText('Direct grant · host')).toHaveCount(5)
++ await expect(existingAccess.getByText('Direct grant · user')).toHaveCount(1)
++ await expect(existingAccess.getByText('Direct grant · team')).toHaveCount(1)
++ await expect(existingAccess.getByText('Direct grant · host')).toHaveCount(3)
const revokeResponsePromise = page.waitForResponse(
response =>
response.request().method() === 'DELETE' &&
response.url().includes('/control-api/api/v1/gfs/grants/')
)
- await existingAccess.getByRole('button', { name: `Actions for ${E2E_TEST_NAME}` }).click()
+ await existingAccess
- .getByRole('button', { name: `Remove grant access for ${E2E_TEST_NAME}` })
++ .getByRole('button', { name: `Actions for direct grant to ${E2E_TEST_NAME}` })
+ .click()
+ await page.getByRole('menuitem', { name: 'Remove access' }).click()
const confirmation = page.getByRole('alertdialog')
await expect(confirmation).toContainText('Remove access?')
await confirmation.getByRole('button', { name: 'Remove access' }).click()
@@@ -243,13 -253,13 +236,9 @@@
const panel = grantPanel()
await chooseGrantSubject(panel, 'Operator', 'Operator')
await expect(panel.getByRole('button', { name: 'Remove Operator' })).toBeVisible()
-- await choosePermission(panel, 'Read')
-- await panel.getByRole('button', { name: 'Grant access', exact: true }).click()
-- const dialog = page.getByRole('alertdialog')
-- await expect(dialog).toContainText('Grant access?')
-- await expect(dialog).toContainText(/operator/i)
-- await dialog.getByRole('button', { name: 'Grant' }).click()
-- await expect(page.getByText('Grant saved.').last()).toBeVisible({ timeout: 15_000 })
++ await chooseRole(panel, 'Read')
++ await panel.getByRole('button', { name: 'Share', exact: true }).click()
++ await expect(page.getByText('Access shared.').last()).toBeVisible({ timeout: 15_000 })
await expect
.poll(
() =>
@@@ -259,16 -269,16 +248,16 @@@
}),
{ timeout: 15_000, intervals: [250, 500, 1_000] }
)
-- .toMatchObject({ permissions: ['read'], inherit: true, grantedBy: 'operator:' })
++ .toMatchObject({ permissions: ['read', 'share'], inherit: true, grantedBy: 'operator:' })
})
await test.step('operator cannot submit without visible subject and permissions', async () => {
const panel = grantPanel()
await expect(panel.getByLabel('Subject ID')).toHaveCount(0)
-- await expect(panel.getByRole('button', { name: 'Grant access', exact: true })).toBeDisabled()
++ await expect(panel.getByRole('button', { name: 'Share', exact: true })).toHaveCount(0)
await panel.getByRole('combobox', { name: SUBJECT_PICKER_LABEL }).fill('not-a-uuid')
await expect(panel.getByText('No subjects found.')).toBeVisible()
-- await expect(panel.getByRole('button', { name: 'Grant access', exact: true })).toBeDisabled()
++ await expect(panel.getByRole('button', { name: 'Share', exact: true })).toHaveCount(0)
})
} finally {
try {
diff --cc control-ui/e2e/support/gfs-per-host-isolation-journey.test.ts
index 324d711f4,324d711f4..9befe4f57
--- a/control-ui/e2e/support/gfs-per-host-isolation-journey.test.ts
+++ b/control-ui/e2e/support/gfs-per-host-isolation-journey.test.ts
@@@ -19,7 -19,7 +19,7 @@@ export async function exerciseGfsPerHos
}: PerHostIsolationJourneyInput): Promise<void> {
await test.step('operator updates one first-party host without changing the other host grants', async () => {
const panel = page.getByRole('dialog', {
-- name: `Manage folder ${fixture.name}`,
++ name: `Share folder ${fixture.name}`,
exact: true,
})
const subjectSearch = panel.getByRole('combobox', {
@@@ -31,20 -31,20 +31,12 @@@
await expect(targetHost).toBeVisible({ timeout: 20_000 })
await targetHost.click()
-- await panel.getByRole('button', { name: 'Permissions', exact: true }).click()
-- await panel.getByRole('menuitemcheckbox', { name: 'Read', exact: true }).click()
--
const grantResponsePromise = page.waitForResponse(
response =>
response.request().method() === 'PUT' &&
response.url().includes('/control-api/api/v1/gfs/grants')
)
-- await panel.getByRole('button', { name: 'Grant access', exact: true }).click()
-- const confirmation = page.getByRole('alertdialog')
-- await expect(confirmation).toContainText('Grant access?')
-- await expect(confirmation).toContainText(/1 subject/i)
-- await expect(confirmation).toContainText(/read/)
-- await confirmation.getByRole('button', { name: 'Grant' }).click()
++ await panel.getByRole('button', { name: 'Share', exact: true }).click()
const grantResponse = await grantResponsePromise
expect(grantResponse.status(), `${grantResponse.url()} ${await grantResponse.text()}`).toBe(200)
@@@ -56,7 -56,7 +48,7 @@@
expect(submittedBody.subject).toBeUndefined()
expect(submittedBody.subjects).toEqual([{ type: 'host', id: TARGET_HOST_SUBJECT_ID }])
expect(submittedBody.permissions).toEqual(['read'])
-- await expect(page.getByText('Grant saved.').last()).toBeVisible({ timeout: 15_000 })
++ await expect(page.getByText('Access shared.').last()).toBeVisible({ timeout: 15_000 })
await expect
.poll(
diff --cc control-ui/e2e/support/gfs-resource-crud-journey.test.ts
index bc307298e,d936f2d3c..079920978
--- a/control-ui/e2e/support/gfs-resource-crud-journey.test.ts
+++ b/control-ui/e2e/support/gfs-resource-crud-journey.test.ts
@@@ -37,18 -35,14 +37,18 @@@ export async function exerciseGfsResour
await copyButton.click()
await expect.poll(() => page.evaluate(() => navigator.clipboard.readText())).toBe(fixture.uri)
await actionsButton.click()
- await page.getByRole('menuitem', { name: 'Manage access' }).click()
+ await page.getByRole('menuitem', { name: 'Share' }).hover()
+ await page
+ .getByRole('menu', { name: `Share options for ${fixture.name}` })
+ .getByRole('menuitem', { name: 'Share' })
+ .click()
await expect(
-- page.getByRole('dialog', { name: `Manage folder ${fixture.name}`, exact: true })
++ page.getByRole('dialog', { name: `Share folder ${fixture.name}`, exact: true })
).toBeVisible()
})
await test.step('operator creates, uploads, renames, replaces, and deletes resources from the folder UI', async () => {
-- await page.getByRole('button', { name: 'Close manage dialog' }).click()
++ await page.getByRole('button', { name: 'Close share dialog' }).click()
await folderRow(fixture.name).getByRole('button', { name: fixture.name, exact: true }).click()
const currentResources = page.getByRole('list', { name: 'Current folder resources' })
await expect(
@@@ -188,9 -182,9 +188,13 @@@
await folderRow(fixture.name)
.getByRole('button', { name: `Actions for ${fixture.name}` })
.click()
-- await page.getByRole('menuitem', { name: 'Manage access' }).click()
++ await page.getByRole('menuitem', { name: 'Share' }).hover()
++ await page
++ .getByRole('menu', { name: `Share options for ${fixture.name}` })
++ .getByRole('menuitem', { name: 'Share' })
++ .click()
await expect(
-- page.getByRole('dialog', { name: `Manage folder ${fixture.name}`, exact: true })
++ page.getByRole('dialog', { name: `Share folder ${fixture.name}`, exact: true })
).toBeVisible()
})
}
diff --cc desktop-app/src/gfs/uriHandler.ts
index c471032e6,454167375..2f0e988c3
--- a/desktop-app/src/gfs/uriHandler.ts
+++ b/desktop-app/src/gfs/uriHandler.ts
@@@ -107,21 -109,12 +109,23 @@@ export interface GfsResourceView
path: string | null
version: number
bytes: number
+ /** ISO 8601 UTC. Optional while older backends omit the additive field. */
+ updatedAt?: string
}
+/**
+ * Children-listing item: the resource view plus the server-computed `read`
+ * decision for the listing caller. Listing authorizes the directory only, so
+ * a child can be listed yet unreadable (e.g. a non-inheriting folder grant);
+ * `readable` is absent on older servers and must be treated as unknown, not
+ * as true.
+ */
+export interface GfsChildView extends GfsResourceView {
+ readable?: boolean
+}
+
export interface GfsChildrenPage {
- items: GfsResourceView[]
+ items: GfsChildView[]
nextCursor: string | null
}