Association
app/features/associations/core/Association.tsNo overview comment at the top of the file.
- Imports
- no other modules
- Used by
- 1 loader2 actions1 route
Functions & values
export function isVisible(args: IsVisibleArgs)
Unit tests (13)
- returns
- true if visibility is null
- false if not member of the association
- true if member of the association
- true if member of the virtual association
- false if not yet visible
- true if has become visible
- true if has become public
- true if viewer is a friend of the content owner
- false if viewer is not a friend of the content owner
- false for a non-friend when the viewer has the FRIENDS virtual association every user gets
- false for FRIENDS visibility when not logged in
- true when FRIENDS visibility becomes public via notFoundInstructions
- true if has become public (no associations)
Whether the association is in the visibility at any point of its schedule, not only right now.
export function mentionsAssociation({ visibility, associationId, }: { visibility: AssociationVisibility | null; associationId: number; })
Unit tests (1)
- $why× 6
Loaders/scrims
export function isPublic(args: Omit<IsVisibleArgs, "associations">)
Loaders/scrims
Who becomes the admin after the current one leaves. null if no manager can take over, in which case the admin can't leave. Of several managers the one with the lowest user id (the oldest account) is picked, same as team ownership passing on.
export function resolveNewAdmin<T extends { id: number; role: string }>( members: Array<T>, )
Actions/associations
Routes/associations
Not shown, only used by tests: IsVisibleArgs