From b491d9f7cb97bfaee32ecb97cf89356ce7d33784 Mon Sep 17 00:00:00 2001 From: amirhossein-haerian Date: Fri, 30 Aug 2024 08:00:34 +0200 Subject: [PATCH] fix(KUI-1378): improve the code and fix an issue --- .../js/app/components/RoundInformation/PlannedModules.jsx | 3 --- .../RoundInformation/RoundInformationInfoGrid.jsx | 5 +---- public/js/app/hooks/usePlannedModules.js | 6 +++--- 3 files changed, 4 insertions(+), 10 deletions(-) delete mode 100644 public/js/app/components/RoundInformation/PlannedModules.jsx diff --git a/public/js/app/components/RoundInformation/PlannedModules.jsx b/public/js/app/components/RoundInformation/PlannedModules.jsx deleted file mode 100644 index 5bab6da4..00000000 --- a/public/js/app/components/RoundInformation/PlannedModules.jsx +++ /dev/null @@ -1,3 +0,0 @@ -import React from 'react' - -export const PlannedModules = ({ plannedModules }) => diff --git a/public/js/app/components/RoundInformation/RoundInformationInfoGrid.jsx b/public/js/app/components/RoundInformation/RoundInformationInfoGrid.jsx index ceb880a6..cdd2cb98 100644 --- a/public/js/app/components/RoundInformation/RoundInformationInfoGrid.jsx +++ b/public/js/app/components/RoundInformation/RoundInformationInfoGrid.jsx @@ -3,7 +3,6 @@ import { useLanguage } from '../../hooks/useLanguage' import InfoModal from '../InfoModal' import { CourseMemoLink } from './CourseMemoLink' import { CourseScheduleLink } from './CourseScheduleLink' -import { PlannedModules } from './PlannedModules' // Calculates if a "Show more" button should be displayed, and creates props for content and button elements. const useShowMoreContent = content => { @@ -117,9 +116,7 @@ function RoundInformationInfoGrid({ courseCode, courseRound, plannedModules }) {

{courseRound.round_seats || translation.courseRoundInformation.round_no_seats_limit}

- - - + diff --git a/public/js/app/hooks/usePlannedModules.js b/public/js/app/hooks/usePlannedModules.js index 6588cb41..82e840c0 100644 --- a/public/js/app/hooks/usePlannedModules.js +++ b/public/js/app/hooks/usePlannedModules.js @@ -6,7 +6,7 @@ import { useMissingInfo } from './useMissingInfo' const MISSING_INFO = '' -export const usePlannedModules = ({ courseCode, semester, applicationCode }) => { +export const usePlannedModules = ({ courseCode, selectedSemester, applicationCode }) => { const context = useWebContext() const { missingInfoLabel } = useMissingInfo() @@ -16,10 +16,10 @@ export const usePlannedModules = ({ courseCode, semester, applicationCode }) => () => ({ basePath, courseCode, - semester, + selectedSemester, applicationCode, }), - [basePath, courseCode, semester, applicationCode] + [basePath, courseCode, selectedSemester, applicationCode] ) const { data, isError, isLoading } = useApi(getPlannedModules, requestData, null, MISSING_INFO)