Skip to content

Commit 4a996f4

Browse files
waleedlatif1claude
andcommitted
fix(audit-logs): fix OAuth label displaying as "Oauth" in filter dropdown
ACRONYMS set stored 'OAuth' but lookup used toUpperCase() producing 'OAUTH' which never matched. Now store all acronyms uppercase and use a display override map for special casing like OAuth. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent bb514a6 commit 4a996f4

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

apps/sim/ee/audit-logs/constants.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
import type { ComboboxOption } from '@/components/emcn'
22
import { AuditResourceType } from '@/lib/audit/types'
33

4-
const ACRONYMS = new Set(['API', 'BYOK', 'MCP', 'OAuth'])
4+
const ACRONYMS = new Set(['API', 'BYOK', 'MCP', 'OAUTH'])
5+
6+
const DISPLAY_OVERRIDES: Record<string, string> = { OAUTH: 'OAuth' }
57

68
function formatResourceLabel(key: string): string {
7-
const words = key.split('_')
8-
return words
9+
return key
10+
.split('_')
911
.map((w) => {
1012
const upper = w.toUpperCase()
11-
if (ACRONYMS.has(upper)) return upper
13+
if (ACRONYMS.has(upper)) return DISPLAY_OVERRIDES[upper] ?? upper
1214
return w.charAt(0).toUpperCase() + w.slice(1).toLowerCase()
1315
})
1416
.join(' ')
15-
.replace('OAUTH', 'OAuth')
1617
}
1718

1819
export const RESOURCE_TYPE_OPTIONS: ComboboxOption[] = [

0 commit comments

Comments
 (0)