Skip to content
Merged
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
Binary file modified docs/design/evidence/task-031-revoked-by-after-mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion frontend/src/v2/__tests__/V2ConnectorTools.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ test('rows carry the states table: a live grant pulses when used in the last 10
await waitFor(() => expect(liveDot).toHaveClass('v2-connector-row__dot--pulse'));
const gone = screen.getByRole('button', { name: 'View GitHub in Ops' });
expect(within(gone).getByText('revoked by sam 10m ago')).toBeInTheDocument();
expect(gone.closest('.v2-connector-row')).toHaveClass('v2-connector-row--dead');
expect(gone.querySelector('.v2-connector-row__dot')).toHaveClass('v2-connector-row__dot--empty');
// No not-yet row and no Add without a catalogue: nothing the server does not enforce.
expect(screen.queryByText('not granted')).not.toBeInTheDocument();
Expand Down Expand Up @@ -137,7 +138,7 @@ test('Revoke is two-click and posts the revoke verb, then reloads; a dead grant
fireEvent.click(screen.getByRole('button', { name: 'View GitHub in Ops' }));
const gone = await screen.findByRole('complementary', { name: 'Grant details' });
expect(within(gone).queryByRole('button', { name: 'Revoke' })).not.toBeInTheDocument();
expect(within(gone).getByText(/Revoked 10m ago\./)).toBeInTheDocument();
expect(within(gone).getByText(/Revoked by sam 10m ago\./)).toBeInTheDocument();
await waitFor(() => expect(within(gone).getByText('No calls yet.')).toBeInTheDocument());
});

Expand Down
1 change: 1 addition & 0 deletions frontend/src/v2/__tests__/v2-layout-invariants.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1773,6 +1773,7 @@ describe('v2 layout invariants (CSS rule presence)', () => {
expect(connectorCss).toMatch(/@media \(max-width: 760px\) \{[\s\S]*?\.v2-connectors \{ min-height: 0; gap: 24px; margin: -12px -18px 0;/);
expect(connectorCss).toMatch(/\.v2-root button\.v2-connector-row__selection \{ grid-column: 1 \/ -1;/);
expect(connectorCss).toMatch(/\.v2-root button\.v2-connector-row__selection \.v2-connector-row__details \{ grid-column: 1 \/ -1; grid-row: 2;/);
expect(connectorCss).toMatch(/\.v2-connector-row:not\(.v2-connector-row--dead\) \.v2-connector-row__detail \{ display: none; \}/);
});

describe('TASK-122 Phase A — the ruled restyle (Sam, 2026-09-03; spec on TASK-122)', () => {
Expand Down
7 changes: 5 additions & 2 deletions frontend/src/v2/components/V2ConnectorTools.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ const V2ConnectorTools: React.FC<Props> = ({ pods }) => {
: t('tools.expiredLine', { defaultValue: 'expired {{rel}}', rel: relativeTime(grant.expiresAt) }))
: `${audienceLabels(grant)} ${t('tools.mayUse', { defaultValue: 'may use it' })} · ${asksFirst(grant)}`;
return (
<article key={grant.grantId} className={`v2-connector-row${isSelected ? ' v2-connector-row--selected' : ''}`}>
<article key={grant.grantId} className={`v2-connector-row${isSelected ? ' v2-connector-row--selected' : ''}${dead ? ' v2-connector-row--dead' : ''}`}>
<button
type="button"
className="v2-connector-row__selection"
Expand Down Expand Up @@ -529,6 +529,7 @@ const V2ConnectorTools: React.FC<Props> = ({ pods }) => {
const dead = isDead(grant);
const podId = grantPodId(grant);
const granter = memberName(grant.grantedBy);
const revokedBy = memberName(grant.revokedBy);
const entry = entryFor(grant);
const counts = trail?.counts;
return (
Expand All @@ -542,7 +543,9 @@ const V2ConnectorTools: React.FC<Props> = ({ pods }) => {
: t('tools.grantedOn', { defaultValue: 'Granted {{rel}}.', rel: relativeTime(grant.createdAt) })}
{' '}
{grant.revokedAt
? t('tools.endedRevoked', { defaultValue: 'Revoked {{rel}}.', rel: relativeTime(grant.revokedAt) })
? (revokedBy
? t('tools.endedRevokedBy', { defaultValue: 'Revoked by {{member}} {{rel}}.', member: revokedBy, rel: relativeTime(grant.revokedAt) })
: t('tools.endedRevoked', { defaultValue: 'Revoked {{rel}}.', rel: relativeTime(grant.revokedAt) }))
: (isExpired(grant)
? t('tools.endedExpired', { defaultValue: 'Expired {{rel}}.', rel: relativeTime(grant.expiresAt) })
: t('tools.endsRel', { defaultValue: 'Ends {{rel}}.', rel: relativeTime(grant.expiresAt) }))}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/v2/v2.css
Original file line number Diff line number Diff line change
Expand Up @@ -9829,7 +9829,7 @@ body.modern-ui.v2-canvas {
.v2-connector-row--not-yet .v2-connector-row__name { grid-column: 1; grid-row: 1; }
.v2-connector-row--not-yet .v2-connector-row__details { grid-column: 1 / -1; grid-row: 2; }
.v2-connector-row--not-yet .v2-connector-row__when { grid-column: 1 / -1; grid-row: 3; padding-right: 0; }
.v2-connector-row__detail { display: none; }
.v2-connector-row:not(.v2-connector-row--dead) .v2-connector-row__detail { display: none; }
.v2-root button.v2-connector-row__action, .v2-root a.v2-connector-row__action { grid-column: 2; grid-row: 1; z-index: 1; }
.v2-connectors__new-row { grid-template-columns: minmax(0, 1fr); }
.v2-connectors__providers { width: fit-content; }
Expand Down
Loading