diff --git a/client/src/app/layout/AuthenticatedArea/AuthenticatedArea.tsx b/client/src/app/layout/AuthenticatedArea/AuthenticatedArea.tsx index 74ce8343..309e6474 100644 --- a/client/src/app/layout/AuthenticatedArea/AuthenticatedArea.tsx +++ b/client/src/app/layout/AuthenticatedArea/AuthenticatedArea.tsx @@ -89,14 +89,17 @@ const AuthenticatedArea = (props: PropsWithChildren) => const [minimizedState, setMinimized] = useLocalStorage('navigation_minimized', { usingJson: true, }) - const [debouncedMinimized] = useDebouncedValue(minimizedState, minimizeAnimationDuration) + const [debouncedMinimized] = useDebouncedValue( + collapseNavigation || minimizedState, + minimizeAnimationDuration, + ) // only use debounced State if value is false because otherwise the text is formatted weirdly if you expand the navigation - const minimized = minimizedState || debouncedMinimized + const minimized = opened ? false : minimizedState || !!debouncedMinimized const location = useLocation() const navigationType = useNavigationType() - const showHeader = useIsSmallerBreakpoint('md') || collapseNavigation + const showHeader = useIsSmallerBreakpoint('md') const auth = useAuthenticationContext() useEffect(() => { @@ -126,9 +129,9 @@ const AuthenticatedArea = (props: PropsWithChildren) => ) => > - + @@ -204,17 +202,19 @@ const AuthenticatedArea = (props: PropsWithChildren) => {!minimized && Logout} - - setMinimized((prev) => !prev)} - > - {minimized ? : } - - + {!collapseNavigation && ( + + setMinimized((prev) => !prev)} + > + {minimized ? : } + + + )} diff --git a/client/src/components/ApplicationReviewForm/ApplicationReviewForm.tsx b/client/src/components/ApplicationReviewForm/ApplicationReviewForm.tsx index 5887fb7d..379b5371 100644 --- a/client/src/components/ApplicationReviewForm/ApplicationReviewForm.tsx +++ b/client/src/components/ApplicationReviewForm/ApplicationReviewForm.tsx @@ -61,7 +61,7 @@ const ApplicationReviewForm = (props: IApplicationReviewFormProps) => { title: application.topic?.title || application.thesisTitle || '', comment: application.comment || '', type: - application.topic?.type || GLOBAL_CONFIG.thesis_types[application.user.studyDegree || ''] + application.thesisType || GLOBAL_CONFIG.thesis_types[application.user.studyDegree || ''] ? application.user.studyDegree : null, advisors: application.topic?.advisors.map((advisor) => advisor.userId) ?? [], diff --git a/client/src/components/AuthenticatedFilePreview/AuthenticatedFilePreview.tsx b/client/src/components/AuthenticatedFilePreview/AuthenticatedFilePreview.tsx index 2c88c558..62d6c0b8 100644 --- a/client/src/components/AuthenticatedFilePreview/AuthenticatedFilePreview.tsx +++ b/client/src/components/AuthenticatedFilePreview/AuthenticatedFilePreview.tsx @@ -1,7 +1,9 @@ import { useMemo, useState } from 'react' -import { Button, Space, Stack, Text } from '@mantine/core' +import { Button, Center, Group, Space, Stack, Text } from '@mantine/core' import { downloadFile } from '../../utils/blob' import { useApiFile } from '../../hooks/fetcher' +import { Link } from 'react-router-dom' +import { GLOBAL_CONFIG } from '../../config/global' interface IAuthenticatedIframeProps { url: string @@ -9,10 +11,11 @@ interface IAuthenticatedIframeProps { title?: string height?: number allowDownload?: boolean + includeLink?: boolean } const AuthenticatedFilePreview = (props: IAuthenticatedIframeProps) => { - const { url, filename, allowDownload = true, title, height } = props + const { url, filename, allowDownload = true, includeLink = false, title, height } = props const [file, setFile] = useState() @@ -27,12 +30,23 @@ const AuthenticatedFilePreview = (props: IAuthenticatedIframeProps) => { {title && {title}}