mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 07:29:16 +00:00
## Context Replaces the individual filters on the Account audit logs page with the filter bar to match a consistent UX across log surfaces <img width="1206" height="360" alt="image" src="https://github.com/user-attachments/assets/c5bdfd7e-3277-4695-b9fc-1791df8720c7" /> Also uses the `supportOperators` param for the `FilterBar` to support "OR" based operations when filtering for projects <img width="1219" height="97" alt="image" src="https://github.com/user-attachments/assets/d4748e6c-d1f3-4f23-b767-e0f4bb1c0a1c" /> The main changes for the `FilterBar` component made in this PR (which would be more relevant for the design team) are: - Added a divider between the options and "New group" - Originally didn't have a divider - So there's a clearer distinction that the "New group" isn't a option to set as the value for - Add a new `defaultGroupOperator` prop - Originally defaults to `AND` - However, in the context of Audit Logs when filtering for projects, you'd expect `OR` to be the default to filter across several projects (`AND` wouldn't make sense here)
25 lines
769 B
TypeScript
25 lines
769 B
TypeScript
import { describe, expect, it } from 'vitest'
|
||
|
||
import { parseTimeRange, serializeTimeRange } from './Logs.timeRange'
|
||
|
||
const range: [Date, Date] = [new Date('2026-09-22T02:00:00Z'), new Date('2026-09-22T03:00:00Z')]
|
||
|
||
describe('serializeTimeRange / parseTimeRange', () => {
|
||
it('round-trips a date range', () => {
|
||
expect(parseTimeRange(serializeTimeRange(range))).toEqual(range)
|
||
})
|
||
|
||
it.each([
|
||
undefined,
|
||
null,
|
||
'',
|
||
'invalid',
|
||
'2026-09-22T02:00:00Z',
|
||
'invalid – 2026-09-22T03:00:00Z',
|
||
'2026-09-22T03:00:00Z – 2026-09-22T02:00:00Z',
|
||
'2026-09-22T02:00:00Z – 2026-09-22T03:00:00Z – 2026-09-22T04:00:00Z',
|
||
])('rejects an invalid or incomplete range: %s', (value) => {
|
||
expect(parseTimeRange(value)).toBeUndefined()
|
||
})
|
||
})
|