From ce0b768e4fcc2019df144881d71b8658ed8b0dee Mon Sep 17 00:00:00 2001 From: Fabian Emilius Date: Tue, 27 Aug 2024 01:47:32 +0200 Subject: [PATCH 01/13] Add MyTasksSection component --- client/src/pages/DashboardPage/DashboardPage.tsx | 2 ++ .../components/MyTasksSection/MyTasksSection.tsx | 5 +++++ 2 files changed, 7 insertions(+) create mode 100644 client/src/pages/DashboardPage/components/MyTasksSection/MyTasksSection.tsx diff --git a/client/src/pages/DashboardPage/DashboardPage.tsx b/client/src/pages/DashboardPage/DashboardPage.tsx index a6018bb0..5f73cab3 100644 --- a/client/src/pages/DashboardPage/DashboardPage.tsx +++ b/client/src/pages/DashboardPage/DashboardPage.tsx @@ -11,6 +11,7 @@ import ThesesGanttChart from '../../components/ThesesGanttChart/ThesesGanttChart import { useHasGroupAccess } from '../../hooks/authentication' import { Link } from 'react-router-dom' import ApplicationModal from '../../components/ApplicationModal/ApplicationModal' +import MyTasksSection from './components/MyTasksSection/MyTasksSection' const DashboardPage = () => { usePageTitle('Dashboard') @@ -24,6 +25,7 @@ const DashboardPage = () => { Dashboard + My Theses {managementAccess && ( diff --git a/client/src/pages/DashboardPage/components/MyTasksSection/MyTasksSection.tsx b/client/src/pages/DashboardPage/components/MyTasksSection/MyTasksSection.tsx new file mode 100644 index 00000000..63878979 --- /dev/null +++ b/client/src/pages/DashboardPage/components/MyTasksSection/MyTasksSection.tsx @@ -0,0 +1,5 @@ +const MyTasksSection = () => { + return null +} + +export default MyTasksSection From 3d451e2313f9309a6cd4c7d0516080323151cc75 Mon Sep 17 00:00:00 2001 From: Fabian Emilius Date: Wed, 28 Aug 2024 01:07:45 +0200 Subject: [PATCH 02/13] Implement Feedback --- .../AuthenticatedArea/AuthenticatedArea.tsx | 44 ++++++------ .../ApplicationReviewForm.tsx | 2 +- .../AuthenticatedFilePreview.tsx | 30 ++++++--- .../DocumentEditor/DocumentEditor.tsx | 1 + .../src/components/GanttChart/GanttChart.tsx | 1 + client/src/components/TopicData/TopicData.tsx | 10 ++- .../PublishedTheses/PublishedTheses.tsx | 1 + .../LegacySubmitApplicationPage.tsx | 67 +++++++++++++------ .../LegacySuccessfulSubmission.tsx | 22 ------ .../ReplaceTopicModal/ReplaceTopicModal.tsx | 29 ++++---- .../MotivationStep/MotivationStep.tsx | 18 ++++- .../SubmitAssessmentModal.tsx | 45 ++++++------- .../ThesisCommentsList/ThesisCommentsList.tsx | 8 ++- .../ThesisConfigSection.tsx | 8 +-- .../ThesisFinalGradeSection.tsx | 2 +- .../SubmitFinalGradeModal.tsx | 25 ++++--- .../ThesisInfoSection/ThesisInfoSection.tsx | 11 ++- .../ThesisProposalSection.tsx | 7 +- .../ThesisVisibilitySelect.tsx | 35 ++++++++++ .../ThesisWritingSection.tsx | 14 ++-- client/src/requests/payloads/application.ts | 1 + client/src/requests/responses/application.ts | 3 +- client/src/requests/responses/topic.ts | 2 +- .../ls1/constants/ThesisVisibility.java | 1 + .../ls1/controller/ApplicationController.java | 1 + .../ls1/controller/DashboardController.java | 45 +++++++++++-- .../controller/PublishedThesisController.java | 2 +- .../ls1/controller/ThesisController.java | 14 ++-- .../ls1/controller/TopicController.java | 4 +- .../ls1/controller/UserController.java | 6 +- .../payload/CreateApplicationPayload.java | 1 + .../LegacyCreateApplicationPayload.java | 1 + .../payload/ReplaceTopicPayload.java | 2 +- .../thesistrack/ls1/dto/ApplicationDto.java | 2 + .../thesistrack/ls1/dto/DashboardDto.java | 4 -- .../ls1/dto/PublishedPresentationDto.java | 31 +++++++++ .../java/thesistrack/ls1/dto/TaskDto.java | 10 +++ .../java/thesistrack/ls1/dto/TopicDto.java | 5 +- .../thesistrack/ls1/entity/Application.java | 3 + .../java/thesistrack/ls1/entity/Thesis.java | 6 +- .../java/thesistrack/ls1/entity/Topic.java | 7 +- .../ThesisPresentationRepository.java | 8 ++- .../ls1/service/ApplicationService.java | 4 +- .../ls1/service/DashboardService.java | 44 ++++++++++++ .../ls1/service/MailingService.java | 1 + .../ls1/service/ThesisService.java | 2 +- .../thesistrack/ls1/service/TopicService.java | 8 +-- .../ls1/utility/RequestValidator.java | 22 ++++++ .../db/changelog/changes/06_topics.sql | 5 ++ 49 files changed, 440 insertions(+), 185 deletions(-) delete mode 100644 client/src/pages/LegacySubmitApplicationPage/components/LegacySuccessfulSubmission/LegacySuccessfulSubmission.tsx create mode 100644 client/src/pages/ThesisPage/components/ThesisVisibilitySelect/ThesisVisibilitySelect.tsx delete mode 100644 server/src/main/java/thesistrack/ls1/dto/DashboardDto.java create mode 100644 server/src/main/java/thesistrack/ls1/dto/PublishedPresentationDto.java create mode 100644 server/src/main/java/thesistrack/ls1/dto/TaskDto.java 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}}