Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
4 changes: 2 additions & 2 deletions frontend/src/app/members/[memberKey]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ const UserDetailsPage: React.FC = () => {

useEffect(() => {
const fetchData = async () => {
const result = await fetchHeatmapData(memberKey as string)
const result = await fetchHeatmapData(memberKey)
if (!result) {
setIsPrivateContributor(true)
return
}
if (result?.contributions) {
setUsername(memberKey as string)
setUsername(memberKey)
setData(result as HeatmapData)
}
}
Expand Down
7 changes: 4 additions & 3 deletions frontend/src/components/CardDetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ const DetailsCard = ({
userSummary,
}: DetailsCardProps) => {
const { data } = useSession()
const session = data as ExtendedSession | null

// compute styles based on type prop
const typeStylesMap = {
Expand All @@ -126,9 +127,9 @@ const DetailsCard = ({
)}
{type === 'module' &&
accessLevel === 'admin' &&
admins?.some(
(admin) => admin.login === ((data as ExtendedSession)?.user?.login as string)
) && <EntityActions type="module" programKey={programKey} moduleKey={entityKey} />}
admins?.some((admin) => admin.login === session?.user?.login) && (
<EntityActions type="module" programKey={programKey} moduleKey={entityKey} />
)}
{!isActive && <StatusBadge status="inactive" size="md" />}
{isArchived && type === 'repository' && <StatusBadge status="archived" size="md" />}
{IS_PROJECT_HEALTH_ENABLED && type === 'project' && healthMetricsData.length > 0 && (
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/ChapterMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const ChapterMap = ({
})

mapRef.current.on('mouseout', (e: L.LeafletMouseEvent) => {
const originalEvent = e.originalEvent as MouseEvent
const originalEvent = e.originalEvent
const relatedTarget = originalEvent.relatedTarget as Node | null
const container = mapRef.current?.getContainer()
const mapParent = container?.parentElement
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/MultiSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const MultiSearchBar: React.FC<MultiSearchBarProps> = ({
if (filteredEvents.length > 0) {
results.push({
indexName: 'events',
hits: filteredEvents.slice(0, suggestionCount) as Event[],
hits: filteredEvents.slice(0, suggestionCount),
totalPages: 1,
})
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/SingleModuleCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const SingleModuleCard: React.FC<SingleModuleCardProps> = ({ module, accessLevel

const isAdmin =
accessLevel === 'admin' &&
admins?.some((admin) => admin.login === ((data as ExtendedSession)?.user?.login as string))
admins?.some((admin) => admin.login === (data as ExtendedSession)?.user?.login)

// Extract programKey from pathname (e.g., /my/mentorship/programs/[programKey])
const programKey = pathname?.split('/programs/')[1]?.split('/')[0] || ''
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/components/UserMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import Link from 'next/link'
import { signIn } from 'next-auth/react'
import { useEffect, useId, useRef, useState } from 'react'
import { FaGithub } from 'react-icons/fa'
import { ExtendedSession } from 'types/auth'

export default function UserMenu({
isGitHubAuthEnabled,
Expand All @@ -19,7 +18,7 @@ export default function UserMenu({
const [isOpen, setIsOpen] = useState(false)
const dropdownRef = useRef<HTMLDivElement>(null)
const dropdownId = useId()
const isProjectLeader = (session as ExtendedSession)?.user?.isLeader
const isProjectLeader = session?.user?.isLeader
const isOwaspStaff = session?.user?.isOwaspStaff

useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/hooks/useSearchPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export function useSearchPage<T>({

if ('hits' in response) {
setItems(response.hits)
setTotalPages(response.totalPages as number)
setTotalPages(response.totalPages)
} else {
handleAppError(response)
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/utils/env.server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const GITHUB_CLIENT_ID = process.env.NEXT_SERVER_GITHUB_CLIENT_ID!
export const GITHUB_CLIENT_SECRET = process.env.NEXT_SERVER_GITHUB_CLIENT_SECRET!
export const GITHUB_CLIENT_ID = process.env.NEXT_SERVER_GITHUB_CLIENT_ID
export const GITHUB_CLIENT_SECRET = process.env.NEXT_SERVER_GITHUB_CLIENT_SECRET
export const NEXTAUTH_URL = process.env.NEXTAUTH_URL

export const IS_GITHUB_AUTH_ENABLED = Boolean(GITHUB_CLIENT_ID && GITHUB_CLIENT_SECRET)