Options
All
  • Public
  • Public/Protected
  • All
Menu

TAMS Club Calendar Frontend Documentation

Index

Enumerations

Interfaces

Type aliases

Variables

Functions

Type aliases

AccessLevel: -1 | 0 | 1 | 2
EventType: "event" | "ga" | "meeting" | "volunteering" | "other"

Type of the event, can be used as filter on the event list

LinkProps: { activeClassName?: string; as?: NextLinkProps["as"]; href: NextLinkProps["href"]; linkAs?: NextLinkProps["as"]; noLinkStyle?: boolean } & Omit<NextLinkComposedProps, "to" | "linkAs" | "href"> & Omit<MuiLinkProps, "href">
Resource: "events" | "clubs" | "volunteering"

Valid resource types, used in the edit history object

StatusResponse: { status: number }

Return object for fetch requests that only have a status

Type declaration

  • status: number

    The HTTP status code

Variables

History: { prototype: History }

Type declaration

Link: ForwardRefExoticComponent<Pick<LinkProps, "href" | "download" | "hrefLang" | "media" | "ping" | "rel" | "target" | "type" | "referrerPolicy" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "as" | "replace" | "scroll" | "shallow" | "passHref" | "prefetch" | "locale" | "linkAs" | keyof CommonProps | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "sx" | "variant" | "variantMapping" | "key" | "TypographyClasses" | "underline" | "activeClassName" | "noLinkStyle"> & RefAttributes<HTMLAnchorElement>> = ...
NextLinkComposed: ForwardRefExoticComponent<NextLinkComposedProps & RefAttributes<HTMLAnchorElement>> = ...
StyledSpan: StyledComponent<MUIStyledCommonProps<Theme>, DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}> = ...

The styled span component is a component with the MUI sx styling system applied to it.

theme: Theme = ...
theme: Theme = ...

Functions

  • AccessInfo(props: AccessInfoProps): Element
  • ActionBar(): Element
  • Displays an action bar for the home page for switching between views. The component will listen for changes to the route and display the "active" route accordingly.

    Returns Element

  • AddButton(props: AddButtonProps): Element
  • AppIcon(props: AppIconProps): Element
  • CalendarDay(props: CalendarDayPopup): Element
  • Represents a single grid cell in the calendar view. The CalendarDay will render a list of events for the day up to a certain limit, and will render a button that the user can click to see more events.

    Parameters

    • props: CalendarDayPopup

    Returns Element

  • CalendarEvent(props: CalendarEventProps): Element
  • CalendarPopup(props: CalendarPopupProps): Element
  • ChangeUserPermissions(): Element
  • Changelog(): Element
  • ClubCard(props: ClubCardProps): Element
  • A card displaying the image and basic info for a club Utilizes the MUI Card component, with the CardActionArea wrapped in a NavLink to the club's page.

    Parameters

    • props: ClubCardProps

    Returns Element

  • ClubTable(props: any): Element
  • Displays the clubs in a table. The clubs prop will be mapped to table rows. For descriptions, the newline character will be replaced with a pipe character.

    Parameters

    • props: any

      React props object

    Returns Element

  • CommitteeCard(props: CommitteeCardProps): Element
  • ControlledCheckbox(props: ControlledCheckboxProps): Element
  • ControlledFilterCheckbox(props: any): Element
  • ControlledSelect(props: ControlledSelectProps): Element
  • Displays a controlled select to edit. If the select input is in an array of objects, then you must define the parentName, index, and name. This value will be concatenated inside of the component to form the name (ie. [parentName].[index].[name]) All children should be instances of MenuItem components, as the select options

    Parameters

    • props: ControlledSelectProps

    Returns Element

  • ControlledTextField(props: ControlledTextFieldProps): Element
  • CustomImage(props: any): Element
  • Displays an image given a dynamic src. The image will by default be objectFit: cover and try to fit 100% of the width if no width prop is specified.

    Parameters

    • props: any

      React props object

    Returns Element

  • DateInput(props: DateInputProps): Element
  • DateSection(props: DateSectionProps): Element
  • DateTimeInput(props: DateTimeInputProps): Element
  • DeleteButton(props: DeleteButtonProps): Element
  • DesktopMenu(props: DesktopMenuProps): Element
  • EditCommitteeList(props: EditCommitteeListProps): Element
  • EditCommitttee(props: EditCommitteeProps): Element
  • EditExec(props: EditExecProps): Element
  • EditExecList(props: EditExecListProps): Element
  • EditLink(props: EditLinkProps): Element
  • EditLinkList(): Element
  • EditLogin(): Element
  • EditWrapper(props: HTMLProps<HTMLDivElement>): Element
  • Wraps history components, giving margins and padding, as well as showing all content on a paper container, with the EditLogin component on top

    Parameters

    • props: HTMLProps<HTMLDivElement>

    Returns Element

  • EventEntry(__namedParameters: EventEntryProps): Element
  • EventListSection(props: EventListSectionProps): Element
  • ExecCard(props: ExecCardProps): Element
  • FeedbackForm(): Element
  • FilterItem(props: FilterItemProps): Element
  • Displays a specific volunteering filter, with a passed in icon, color, and status. If the status resolves to false, the filter will be hidden with "display: none".

    Parameters

    • props: FilterItemProps

    Returns Element

  • FilterList(props: FilterListProps): Element
  • Show a list of filters for the volunteer list, each of which has an icon and a specific color to denote that filter. The specific filter will only be shown if it is true.

    Parameters

    • props: FilterListProps

    Returns Element

  • FormBox(props: FormBoxProps): Element
  • Simple flex div wrapper for form elements that displays horizontally on larger screens and vertically on smaller screens. Use the Spacer component to add spacing (it will also adapt to be vertical spacing on smaller screens).

    Parameters

    • props: FormBoxProps

    Returns Element

  • FormWrapper(props: FormWrapperProps): Element
  • GithubIcon(): Element
  • HistoryPopup(props: HistoryPopupProps): Element
  • HomeBase(props: HomeBaseProps): Element
  • Base for all home pages, contains an action bar and a drawer with external links that both can be hidden manually.

    Parameters

    • props: HomeBaseProps

    Returns Element

  • HomeDrawerList(): Element
  • Shows a list of external links on the home page This component is only a list of links as it will be placed in two different drawers depending on if the page is in mobile or not.

    Returns Element

  • HowToUse(): Element
  • ImageUpload(props: ImageUploadProps): Element
  • Component to handle image uploading. By default, this component will show a preview of the image that is currently being used, as well as a button to upload a new image. When an image is uploaded, a popup will appear asking the user to crop the image. Once the user crops the image, the preview image will be updated and the values will be stored in the form controller, to be uploaded to the server when the form is submitted.

    Parameters

    • props: ImageUploadProps

    Returns Element

  • LinkInput(props: LinkInputProps): Element
  • LinkInputList(props: LinkInputListProps): Element
  • Loading(props: LoadingProps): Element
  • LocationSelect(props: LocationSelectProps): Element
  • Select a location from the list of predefined rooms using a ControlledSelect component, with an option to select "none" by default or "other" at the bottom of the list

    Parameters

    • props: LocationSelectProps

    Returns Element

  • ManageResources(): Element
  • MaterialSymbol(props: MaterialSymbolProps): Element
  • Menu(props: MenuProps): Element
  • Displays the Appbar at the top of the screen which serves as a navigation menu and theme switcher.

    Parameters

    • props: MenuProps

    Returns Element

  • MenuColorBar(): Element
  • MenuIcon(props: PropsWithChildren<MenuIconProps>): Element
  • Icon wrapper for the menu that displays a custom tooltip and highlighted styles when hovered over.

    Parameters

    • props: PropsWithChildren<MenuIconProps>

    Returns Element

  • MenuLink(props: MenuLinkProps): Element
  • A link in the navbar that is styled to highlight when hovered over and displays a different style when active. This component will also automatically set the "active" state of the link based on the current path.

    Parameters

    • props: MenuLinkProps

    Returns Element

  • MobileMenu(props: MobileMenuProps): Element
  • PageWrapper(props: PageWrapperProps): Element
  • Paragraph(props: ParagraphProps): Element
  • Formats a paragraph of text. This will split the text into its respective paragraphs, adding a slight space between each body section. Additionally, all links starting with http or https will be linked correctly as a link element.

    Parameters

    • props: ParagraphProps

    Returns Element

  • Popup(__namedParameters: PopupProps): Element
  • Displays a popup whenever event is updated. For this to happen, props.event.time must be set to the current time.

    Parameters

    • __namedParameters: PopupProps

    Returns Element

  • ReservationDay(props: ReservationDayProps): Element
  • Creates a grid of reservations for a specific day. This grid is essentially a table with the hours as the columns and each different possible reservation location as the rows.

    Parameters

    • props: ReservationDayProps

    Returns Element

  • ReservationEntry(props: ReservationEntryProps): Element
  • ReservationMonth(props: ReservationMonthProps): Element
  • Creates a grid of reservations for a specific day. This grid is essentially a table with the hours as the columns and each different possible reservation location as the rows.

    Parameters

    • props: ReservationMonthProps

    Returns Element

  • ResourceMeta(props: ResourceMetaProps): Element
  • RobotBlockMeta(): Element
  • Robot blocking meta tag that tells search engines to not display this page in search results. Used for the admin, auth, and any other pages that search engines should not see. This is also useful for hiding errored pages from search engines!

    Returns Element

  • SortSelect(props: SortSelectProps): Element
  • Simple component to display a select menu and icon button to select the sorting method and order based on a supplied string array.

    Parameters

    • props: SortSelectProps

    Returns Element

  • Spacer(): Element
  • TitleMeta(props: TitleMetaProps): Element
  • Meta tags for pages that only have a title and url, for all pages that are not resource displays: [resource lists and utility pages]

    Parameters

    • props: TitleMetaProps

    Returns Element

  • TrashCan(props: TrashCanProps): Element
  • TwoButtonBox(props: TwoButtonBoxProps): Element
  • UnauthorizedAlert(props: UnauthorizedAlertProps): Element
  • UploadBackdrop(props: UploadBackdropProps): Element
  • ViewFeedback(): Element
  • ViewSwitcher(props: ViewSwitcherProps): Element
  • Shows a button that will switch between a list view and grid view icon. This component will set the tableView prop to true if it is currently in the table view, or else it will set the state to false. The displayed icon will be opposite and have the tooltip "Switch to [list/grid] view".

    Parameters

    • props: ViewSwitcherProps

    Returns Element

  • VolunteeringCard(props: VolunteeringCardProps): Element
  • VolunteeringTable(props: any): Element
  • calculateEditDate(editDate: number): string
  • Calculates how long ago an edit was made, given the edit date, and displays it in the most reasonable time interval

    Parameters

    • editDate: number

      Milliseconds representing the edit date (UTC)

    Returns string

    Edit date display string

  • createClub(id?: string, name?: string, advised?: boolean, links?: string[], description?: string, coverImgThumbnail?: string, coverImg?: string, execs?: Exec[], committees?: Committee[]): Club
  • Creates a Club object

    Parameters

    • id: string = null
    • name: string = ''
    • advised: boolean = false
    • links: string[] = ...
    • description: string = ''
    • coverImgThumbnail: string = ''
    • coverImg: string = ''
    • execs: Exec[] = []
    • committees: Committee[] = []

    Returns Club

  • createClubImageBlobs(coverPhoto?: Blob, profilePictures?: Blob[]): ClubImageBlobs
  • createCommittee(name?: string, description?: string, heads?: string[], links?: string[]): Committee
  • createEmotionCache(): EmotionCache
  • createEvent(id?: string, eventId?: string, editorId?: string, name?: string, type?: EventType, club?: string, description?: string, start?: number, end?: number, location?: string, noEnd?: boolean, publicEvent?: boolean, reservation?: boolean, repeatingId?: string, repeatsUntil?: number): CalEvent
  • Creates an Event object

    Parameters

    • id: string = null
    • eventId: string = null
    • editorId: string = null
    • name: string = ''
    • type: EventType = 'event'
    • club: string = ''
    • description: string = ''
    • start: number = ...
    • end: number = ...
    • location: string = 'none'
    • noEnd: boolean = false
    • publicEvent: boolean = false
    • reservation: boolean = false
    • repeatingId: string = null
    • repeatsUntil: number = null

    Returns CalEvent

  • createExec(name?: string, position?: string, description?: string, img?: string): Exec
  • createExternalLink(name?: string, url?: string, icon?: string): ExternalLink
  • createFilters(limited?: boolean, semester?: boolean, setTimes?: boolean, weekly?: boolean, open?: boolean): Filters
  • Creates a Filters object

    Parameters

    • limited: boolean = false
    • semester: boolean = false
    • setTimes: boolean = false
    • weekly: boolean = false
    • open: boolean = true

    Returns Filters

  • createPopupEvent(message: string, severity: 0 | 1 | 2 | 3 | 4): PopupEvent
  • Creates a PopupEvent object

    Parameters

    • message: string

      String message to display

    • severity: 0 | 1 | 2 | 3 | 4

      Severity where 0 (none), 1 (info), 2 (success), 3 (warning), and 4 (error)

    Returns PopupEvent

  • createTextData<T>(type?: string, data: T): TextData<T>
  • createVolunteering(id?: string, name?: string, club?: string, description?: string, filters?: Filters): Volunteering
  • darkSwitch(theme: Theme, lightStyle: string, darkStyle: string): string
  • Sets a style depending on whether or not the theme is light/dark

    Parameters

    • theme: Theme

      The Mui theme object

    • lightStyle: string

      Light theme style

    • darkStyle: string

      Dark theme style

    Returns string

    Either the dark or light theme style, depending on the current mode

  • darkSwitchGrey(theme: Theme): string
  • Sets a grey (400/600) depending on whether or not the theme is light/dark

    Parameters

    • theme: Theme

      The Mui theme object

    Returns string

    grey[600] for light theme and grey[400] for dark theme

  • deleteAdminResource(resource: string, id: string): Promise<StatusResponse>
  • Deletes a resource given its resource name and id

    Parameters

    • resource: string

      Resource to delete

    • id: string

      ID of the resource to delete

    Returns Promise<StatusResponse>

  • formatDate(millis: number, format: string): string
  • Formats a UTC millisecond date while converting to central timezone

    Parameters

    • millis: number

      UTC millisecond time to format

    • format: string

      Dayjs format to format the time to

    Returns string

  • formatEventDate(event: CalEvent): string
  • Formats the full date of the event. Includes an end date if not the same as the start date.

    Parameters

    Returns string

    The formatted full date

  • formatEventDateTime(event: CalEvent): string
  • formatEventTime(event: CalEvent, noEnd?: boolean, checkSame?: boolean): string
  • Formats the time of the event. Includes an end time if not the same as the start time.

    Parameters

    • event: CalEvent

      The event object

    • noEnd: boolean = false

      If true, will not show an end time

    • checkSame: boolean = false

      If true, will check to see if start !== end and return the end time. This is used for the EventDisplay component

    Returns string

    The formatted time for the event in the format [h:mma - h:mma]

  • formatTime(millis: number, format: string, checkMidnight?: boolean): string
  • Formats a UTC millisecond time while converting to central timezone

    Parameters

    • millis: number

      UTC millisecond time to format

    • format: string

      Dayjs format to format the time to

    • checkMidnight: boolean = false

      If true, will check for midnight/noon and return those words if true

    Returns string

    The formatted time or midnight/noon if checkMidnight is true

  • getAccessLevel(ctx: GetServerSidePropsContext<ParsedUrlQuery, PreviewData>): Promise<AccessLevel>
  • getAdminResources(resource: Resource, page?: number, limit?: number, sort?: string, reverse?: boolean, filter: GridFilterItem): Promise<ResourceFetchResponse<AdminResourceList>>
  • Gets a list of resources based on search terms

    Parameters

    • resource: Resource

      Resource type to get

    • page: number = 1

      Page number to get

    • limit: number = 10

      Number of items per page

    • sort: string = ''

      Sorting method used

    • reverse: boolean = false

      True if reverse sort

    • filter: GridFilterItem

      Filter object

    Returns Promise<ResourceFetchResponse<AdminResourceList>>

  • getBackendUrl(): string
  • getCdnUrl(): string
  • getClub(id: string): Promise<ResourceFetchResponse<Club>>
  • Gets a specific club by ID.

    Parameters

    • id: string

    Returns Promise<ResourceFetchResponse<Club>>

  • getClubList(): Promise<ListFetchResponse<Club>>
  • getCookie(name: string): string
  • Gets a cookie; returns the value or null

    Parameters

    • name: string

      Key for the cookie

    Returns string

    Value of the cookie or null if not found

  • getEvent(id: string): Promise<ResourceFetchResponse<SingleEvent>>
  • getEventList(): Promise<ListFetchResponse<CalEvent>>
  • getEventListInRange(start: number, end: number): Promise<ListFetchResponse<CalEvent>>
  • Returns a list of public events between two dates

    Parameters

    • start: number

      Starting time to get events from

    • end: number

      Ending time to get events to

    Returns Promise<ListFetchResponse<CalEvent>>

  • getExternalLinks(): Promise<ListFetchResponse<ExternalLink>>
  • getFeedback(): Promise<ListFetchResponse<Feedback>>
  • getHistory(resource: string, id: string): Promise<ResourceFetchResponse<HistoryItemData>>
  • Gets the list of edit histories for a specific resource with the given ID.

    Parameters

    • resource: string

      The resource to get

    • id: string

      The ID to get the history of

    Returns Promise<ResourceFetchResponse<HistoryItemData>>

  • getHistoryList(start?: string): Promise<ResourceFetchResponse<HistoryListData>>
  • Gets the list of history objects starting from the start ID. If no ID is defined, this will return the last 50 edits.

    Parameters

    • Optional start: string

      The ID of the oldest edit to start retrieving from

    Returns Promise<ResourceFetchResponse<HistoryListData>>

  • getNow(): number
  • getOverlappingReservations(location: string, start: number, end: number): Promise<ListFetchResponse<CalEvent>>
  • Looks for reservations that overlap a specified time range

    Parameters

    • location: string

      Location to check

    • start: number

      UTC millisecond start time to search

    • end: number

      UTC millisecond end time to search

    Returns Promise<ListFetchResponse<CalEvent>>

  • getParams(key: string): string | null
  • getReservationList(week?: number): Promise<ListFetchResponse<CalEvent>>
  • Gets the list of all reservations in a week If week is not defined, will get the current week's reservations by default

    Parameters

    • week: number = null

      UTC time for the current week to get; this can be any time within the week

    Returns Promise<ListFetchResponse<CalEvent>>

  • getRoomReservationList(room: string, month?: number): Promise<ListFetchResponse<CalEvent>>
  • Gets the list of all reservations for a specific room in a specific month

    Parameters

    • room: string

      Location to search

    • month: number = null

      Month to show

    Returns Promise<ListFetchResponse<CalEvent>>

  • getTokenFromCookies(ctx: GetServerSidePropsContext<ParsedUrlQuery, PreviewData>): string
  • Extracts the user login token from the cookies

    Parameters

    • ctx: GetServerSidePropsContext<ParsedUrlQuery, PreviewData>

    Returns string

  • getUserById(id: string): Promise<ResourceFetchResponse<User>>
  • Gets the name of the user with the provided ID. This will only be used on the history list page.

    Parameters

    • id: string

      User ID

    Returns Promise<ResourceFetchResponse<User>>

  • getUserEvents(token: string): Promise<ListFetchResponse<CalEvent>>
  • Gets the list of all events that the user created

    Parameters

    • token: string

    Returns Promise<ListFetchResponse<CalEvent>>

  • getUserInfo(token: string): Promise<ResourceFetchResponse<User>>
  • Gets the information of a logged in user, will return a 401 error if the user is not logged in.

    Parameters

    • token: string

      User auth token

    Returns Promise<ResourceFetchResponse<User>>

  • getUserList(page?: number, limit?: number, sort?: string, reverse?: boolean, filter: GridFilterItem): Promise<ResourceFetchResponse<AdminResourceList>>
  • Gets a list of users based on search terms

    Parameters

    • page: number = 1

      Page number to get

    • limit: number = 10

      Number of items per page

    • sort: string = ''

      Sorting method used

    • reverse: boolean = false

      True if reverse sort

    • filter: GridFilterItem

      Filter object

    Returns Promise<ResourceFetchResponse<AdminResourceList>>

  • getVolunteering(id: string): Promise<ResourceFetchResponse<Volunteering>>
  • getVolunteeringList(): Promise<ListFetchResponse<Volunteering>>
  • isNotMidnight(time: number): 0 | 1
  • isSameDate(first: number, second: number): boolean
  • Checks if the date is the same between two UTC millisecond times, in the current time zone.

    Parameters

    • first: number

      The first UTC millisecond time

    • second: number

      The second UTC millisecond time

    Returns boolean

    True if the two times fall on the same date (between 00:00:00.000 and 23:59:59.999)

  • locationToString(location: string): string
  • Converts a location to a string

    Parameters

    • location: string

      Location value

    Returns string

    String representation of the location, or null if no location

  • parseDateParams(dates: string[]): Dayjs
  • Parses the parameters in the url, with the format being /YYYY/M/D. If one more more is missing, will return the 1st of each value in its place. If there are no values, then it will return today's date.

    Parameters

    • dates: string[]

      Date list from the parameters

    Returns Dayjs

    Dayjs object containing the date specified in the url

  • Will split up multiple day events to be displayed correctly. This will essentially create a new event for each day of the multi-day event.

    Parameters

    • eventList: CalEvent[]

      The unparsed event list

    Returns CalEvent[]

    The event list with split up events across days

  • parseLinks(text: string): React.ReactFragment
  • Takes in text and a classname, parses the links, and creates a Fragment with the links in Link elements. Uses a regular expression to parse links in paragraphs -- must begin with http or https.

    Parameters

    • text: string

      The text to parse and display

    Returns React.ReactFragment

    A React jsx fragment containing text and link components

  • parseReservations(reservationList: CalEvent[], date: Dayjs, useMonth?: boolean, room?: Room): JSX.Element[]
  • Function to break up reservations by day and filter out reservations outside of the defined time range.

    Parameters

    • reservationList: CalEvent[]

      List of reservations

    • date: Dayjs

      Date to get reservations; this can be any day in the week (or month if useMonth)

    • useMonth: boolean = false

      If true, will return a list of reservations within the current month

    • Optional room: Room

      Room object, required if useMonth is true

    Returns JSX.Element[]

    List of ReservationDay elements for each reservation set

  • Performs a token exchange/login request after the Google auth flow returns tokens

    Parameters

    • tokenId: string

    Returns Promise<FetchResponse>

  • This function will remove all deleted links and return a string list of the values, with the empty ones removed

    Parameters

    • list: LinkInputData[]

      List of link objects with deleted and value attributes

    Returns string[]

  • Updates a club

    Parameters

    • club: Club

      Club object

    • images: ClubImageBlobs

      Club image blobs object

    • execPhotos: boolean[]

      True for the execs that have new images; should be same length as club.execs

    • id: string

      ID of the club to update

    Returns Promise<StatusResponse>

  • redirect(path: string): void
  • removeCookie(name: string): void
  • setCookie(name: string, value: any): void
  • Sets a cookie as a <key, value> string pair All values will be cast to a string by universal-cookie!

    Parameters

    • name: string

      Key for the cookie

    • value: any

      Value for the cookie

    Returns void

  • toTz(millis: number): Dayjs
  • Returns the dayjs object, corrected to central timezone

    Parameters

    • millis: number

      UTC millisecond time

    Returns Dayjs

    The dayjs object in the correct timezone

Generated using TypeDoc