Files
Ali Waseem 50ccd39b31 fix(studio): use warning tokens for previously used JWT signing key badge (#45460)
## Summary
- Replaces invalid Tailwind purple classes on the "previously used" JWT
key badge with the design system's warning tokens, matching the
bg-*-200/text-*-600/border-*-500 pattern used by the in_use and revoked
variants
- text-purple-1200 didn't exist (Tailwind purple scale stops at 950) and
the design system has no purple palette, which is why the badge rendered
with off-theme default Tailwind purple

Resolves
[FE-3128](https://linear.app/supabase/issue/FE-3128/fix-previous-key-button-color-in-jwt-rotation-modal)

## Test plan
- [x] Open the Rotate JWT signing key modal — "Previous key" badge
should match the warning palette and visually fit alongside
Standby/Current
- [x] JWT signing keys table row with status `previously_used` renders
with the same warning styling

## Example 
<img width="426" height="570" alt="image"
src="https://github.com/user-attachments/assets/34baca2b-48c0-4cd3-b997-d5c029182ad4"
/>
2026-05-01 14:18:17 +00:00

40 lines
1.9 KiB
TypeScript

import { JwtSecretUpdateError, JwtSecretUpdateProgress } from '@supabase/shared-types/out/events'
import { JWTSigningKey } from '@/data/jwt-signing-keys/jwt-signing-keys-query'
export const statusLabels: Record<JWTSigningKey['status'], string> = {
in_use: 'Current key',
standby: 'Standby key',
previously_used: 'Previous key',
revoked: 'Revoked',
}
export const statusColors: Record<JWTSigningKey['status'], string> = {
standby: 'bg-surface-300 text-foreground border border-foreground-muted',
in_use: 'bg-brand-200 text-brand-600 border-brand-500',
previously_used: 'bg-warning-200 text-warning-600 border-warning-500',
revoked: 'bg-destructive-200 text-destructive-600 border-destructive-500',
}
export const JWT_SECRET_UPDATE_ERROR_MESSAGES = {
[JwtSecretUpdateError.APIServicesConfigurationUpdateFailed]:
'failed to update configuration for API services',
[JwtSecretUpdateError.APIServicesRestartFailed]: 'failed to restart API services',
[JwtSecretUpdateError.DatabaseAdminAPIConfigurationUpdateFailed]:
'failed to update configuration for database admin API',
[JwtSecretUpdateError.PostgreSQLRestartFailed]: 'failed to restart PostgreSQL service',
[JwtSecretUpdateError.SupabaseAPIKeyUpdateFailed]: 'failed to update Supabase API key',
[JwtSecretUpdateError.APIGatewayUpdateFailed]: 'failed to update API Gateway',
}
export const JWT_SECRET_UPDATE_PROGRESS_MESSAGES = {
[JwtSecretUpdateProgress.RestartedAPIServices]: 'restarted API services',
[JwtSecretUpdateProgress.RestartedPostgreSQL]: 'restarted PostgreSQL service',
[JwtSecretUpdateProgress.Started]: 'started updating',
[JwtSecretUpdateProgress.UpdatedAPIServicesConfiguration]:
'updated configuration for API services',
[JwtSecretUpdateProgress.UpdatedDatabaseAdminAPIConfiguration]:
'updated configuration for database admin API',
[JwtSecretUpdateProgress.UpdatedAPIGatewayConfiguration]: 'updated configuration for API Gateway',
}