mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-20 06:29:07 +00:00
add eventsPerPage to schedule (#583)
* add eventsPerPage to schedule --------- Co-authored-by: arc-alex <ac@omnivox.dk>
This commit is contained in:
committed by
GitHub
parent
cbed3e4fe4
commit
140daef7e7
@@ -21,7 +21,6 @@ interface ScheduleProviderProps {
|
|||||||
events: OntimeEvent[];
|
events: OntimeEvent[];
|
||||||
selectedEventId: string | null;
|
selectedEventId: string | null;
|
||||||
isBackstage?: boolean;
|
isBackstage?: boolean;
|
||||||
eventsPerPage?: number;
|
|
||||||
time?: number;
|
time?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -30,7 +29,6 @@ export const ScheduleProvider = ({
|
|||||||
events,
|
events,
|
||||||
selectedEventId,
|
selectedEventId,
|
||||||
isBackstage = false,
|
isBackstage = false,
|
||||||
eventsPerPage = 7,
|
|
||||||
time = 10,
|
time = 10,
|
||||||
}: PropsWithChildren<ScheduleProviderProps>) => {
|
}: PropsWithChildren<ScheduleProviderProps>) => {
|
||||||
const [visiblePage, setVisiblePage] = useState(0);
|
const [visiblePage, setVisiblePage] = useState(0);
|
||||||
@@ -39,6 +37,7 @@ export const ScheduleProvider = ({
|
|||||||
// look for overrides from views
|
// look for overrides from views
|
||||||
const hidePast = isStringBoolean(searchParams.get('hidePast'));
|
const hidePast = isStringBoolean(searchParams.get('hidePast'));
|
||||||
const stopCycle = isStringBoolean(searchParams.get('stopCycle'));
|
const stopCycle = isStringBoolean(searchParams.get('stopCycle'));
|
||||||
|
const eventsPerPage = Number(searchParams.get('eventsPerPage') ?? 7);
|
||||||
|
|
||||||
let selectedEventIndex = events.findIndex((event) => event.id === selectedEventId);
|
let selectedEventIndex = events.findIndex((event) => event.id === selectedEventId);
|
||||||
|
|
||||||
|
|||||||
@@ -208,6 +208,12 @@ export const BACKSTAGE_OPTIONS: ParamField[] = [
|
|||||||
description: 'Schedule will not auto-cycle through events',
|
description: 'Schedule will not auto-cycle through events',
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 'eventsPerPage',
|
||||||
|
title: 'Events per page',
|
||||||
|
description: 'Sets the number of events on the page, can cause overlow',
|
||||||
|
type: 'number',
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export const PUBLIC_OPTIONS: ParamField[] = [
|
export const PUBLIC_OPTIONS: ParamField[] = [
|
||||||
@@ -224,6 +230,12 @@ export const PUBLIC_OPTIONS: ParamField[] = [
|
|||||||
description: 'Schedule will not auto-cycle through events',
|
description: 'Schedule will not auto-cycle through events',
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 'eventsPerPage',
|
||||||
|
title: 'Events per page',
|
||||||
|
description: 'Sets the number of events on the page, can cause overlow',
|
||||||
|
type: 'number',
|
||||||
|
},
|
||||||
];
|
];
|
||||||
export const STUDIO_CLOCK_OPTIONS: ParamField[] = [
|
export const STUDIO_CLOCK_OPTIONS: ParamField[] = [
|
||||||
TIME_FORMAT_OPTION,
|
TIME_FORMAT_OPTION,
|
||||||
|
|||||||
Reference in New Issue
Block a user