Skip to content

Calendar · Search params & storage

3 modules · 31 exports · 1 repository · 11 e2e tests · 6 routes

The state Calendar keeps in the URL and in the browser's storage. Every param has a default and never fails to decode, see Search params, and each definition should have an assertRoundTrips test. The definitions of the whole app are listed in the reference.

Search params

URL calendarSearchParams

app/features/calendar/calendar-search-params.ts:50

ParamValueDefaultLoaderDescription
modes
v.pipe(
	v.array(modeShortWithSpecial),
	v.minLength(1),
	v.maxLength(modesShortWithSpecial.length),
)
[...modesShortWithSpecial]true
modesExact v.boolean()falsetrue
games
v.pipe(
	v.array(gamesShortSchema),
	v.minLength(1),
	v.maxLength(gamesShort.length),
)
[...gamesShort]true
preferredVersus
v.pipe(
	v.array(v.picklist(versusShort)),
	v.minLength(1),
	v.maxLength(versusShort.length),
)
[...versusShort]true
preferredStartTime v.picklist(["ANY", "EU", "NA", "AU"])"ANY"true
tagsIncluded calendarFilterTagsArr[]true
tagsExcluded calendarFilterTagsArr[]true
isSendou v.boolean()falsetrue
isRanked v.boolean()falsetrue
minTeamCount v.pipe(v.number(), v.integer(), v.minValue(0))0true
minTier tierNumberBEST_TIER_NUMBERtrue
maxTier tierNumberWORST_TIER_NUMBERtrue
orgsIncluded v.pipe(v.array(v.pipe(v.string(), v.maxLength(100))), v.maxLength(10))[]true
orgsExcluded v.pipe(v.array(v.pipe(v.string(), v.maxLength(100))), v.maxLength(10))[]true
authorIdsExcluded
v.pipe(
	v.array(v.pipe(v.number(), v.integer(), v.gtValue(0))),
	v.maxLength(10),
)
[]true
useDefaults v.boolean()truetrue

False once the user has edited the filters, making the URL win over their saved defaults.

day v.nullable(dayNumber)nulltrue
month v.nullable(monthNumber)nulltrue
year v.nullable(yearNumber)nulltrue

Used in calendar.tsxcalendar-urls.tsFiltersBar.tsxcalendar.server.tscalendar[.]ics.server.tscalendar.tsx

URL calendarEventsSearchParams

app/features/calendar/calendar-search-params.ts:130

ParamValueDefaultLoaderDescription
view v.nullable(v.picklist(VIEW_FILTERS))nullfalse

Used in events.tsx

URL calendarNewSearchParams

app/features/calendar/calendar-search-params.ts:134

ParamValueDefaultLoaderDescription
eventId v.nullable(v.pipe(v.number(), v.integer(), v.gtValue(0)))nulltrue
copyEventId v.nullable(v.pipe(v.number(), v.integer(), v.gtValue(0)))nulltrue
tournament v.boolean()falsetrue

Used in calendar-urls.tscalendar.new.server.tscalendar.new.tsx