Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ class RaceComponent(

var visible by BooleanSettingRef(fieldName = "L谩that贸", description = "Bekapcsolt 谩llapotban a toplista megjelenik a felhaszn谩l贸k sz谩m谩ra")

var leaderboardTags by StringSettingRef(fieldName = "Toplista c铆mk茅k", description = "A toplista c铆mk茅i, vessz艖vel elv谩lasztva. Csak a megadott c铆mk茅kkel rendelkez艖 kateg贸ri谩k jelennek meg a toplist谩ban.")

var extraCategoriesVisible by BooleanSettingRef(fieldName = "Extra kateg贸ri谩k l谩that贸ak",
description = "Bekapcsolt 谩llapotban az extra kateg贸ri谩s toplist谩k is megjelennek")

Expand Down
1 change: 1 addition & 0 deletions frontend/src/api/contexts/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ export interface News {
export interface Race {
title: string
visible: boolean
leaderboardTags: string
defaultCategoryDescription: string
freestyleCategoryName: string
extraCategoriesVisible: boolean
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/common-components/CollapsableTableRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ type CollapsableTableRowProps = {
suffix?: string
categorized?: boolean
showDescription: boolean
tagsShown?: string[] | null
}

export const CollapsableTableRow = ({
Expand All @@ -27,7 +28,8 @@ export const CollapsableTableRow = ({
suffix,
showGroup,
categorized = false,
showDescription
showDescription,
tagsShown = null
}: CollapsableTableRowProps) => {
const [isOpen, setIsOpen] = useState(false)
const isGroupLink = typeof data.groupId !== 'undefined'
Expand All @@ -50,7 +52,7 @@ export const CollapsableTableRow = ({
<TableCell>
<div className="flex flex-col md:flex-row md:items-center gap-1">
<span>{data.name}</span>
{data.label && <TeamLabel name={data.label} color={data.labelColor} />}
{data.label && (tagsShown?.includes(data.label) || !tagsShown) && <TeamLabel name={data.label} color={data.labelColor} />}
</div>
</TableCell>
{showGroup && (
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/common-components/LeaderboardTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ type LeaderboardTableProps = {
suffix?: string
detailed?: boolean
categorized?: boolean
tagsShown?: string[] | null
}

export const LeaderBoardTable = ({
Expand All @@ -22,7 +23,8 @@ export const LeaderBoardTable = ({
detailed = false,
categorized = false,
showDescription = false,
searchEnabled = false
searchEnabled = false,
tagsShown = null
}: LeaderboardTableProps) => {
const dataWithPosition = useMemo(() => data.map((item, index) => ({ ...item, position: index + 1 })), [data])

Expand Down Expand Up @@ -66,6 +68,7 @@ export const LeaderBoardTable = ({
suffix={suffix}
categorized={categorized}
showDescription={showDescription}
tagsShown={tagsShown}
/>
))}
</TableBody>
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/pages/race/components/RaceBoard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ const RaceBoard = ({ data, component, isError, isLoading }: Props) => {
if (!component || !component.visible) return <ComponentUnavailable />
if (isError || isLoading || !data) return <PageStatus isLoading={isLoading} isError={isError} title={component.title} />

const tagsShown = component.leaderboardTags.split(',').map((tag) => tag.trim())

return (
<CmschPage title={data.categoryName}>
<h1 className="text-3xl font-bold font-heading mb-3">{data.categoryName}</h1>
Expand All @@ -37,6 +39,7 @@ const RaceBoard = ({ data, component, isError, isLoading }: Props) => {
showGroup={true}
suffix="mp"
showDescription={showDescription}
tagsShown={tagsShown.length > 0 ? tagsShown : null}
/>
</CmschPage>
)
Expand Down
Loading