From f04cb08e72769d9926db6febc6efd8336d8830b4 Mon Sep 17 00:00:00 2001 From: ttpl-rt-217 Date: Mon, 25 Nov 2024 12:41:37 +0530 Subject: [PATCH 1/3] Login Page simlar to admin and UI improvement --- src/components/PieChartGraph.tsx | 139 +++++++++--------- src/pages/login.tsx | 54 ++++++- .../observation/[observationId]/index.tsx | 2 +- src/styles/globals.css | 13 +- 4 files changed, 134 insertions(+), 74 deletions(-) diff --git a/src/components/PieChartGraph.tsx b/src/components/PieChartGraph.tsx index 2cda35ec..bb7f0edd 100644 --- a/src/components/PieChartGraph.tsx +++ b/src/components/PieChartGraph.tsx @@ -62,81 +62,84 @@ const PieChartGraph: React.FC = ({ stagesCount }) => { }; return ( + - - Stages and Number of Students - - - - - - - {data.map((entry, index) => ( - - ))} - + Stages and Number of Students + - {isMobile ? ( - - ) : ( - + + + + {data.map((entry, index) => ( + - )} - - - + ))} + + + {isMobile ? ( + + ) : ( + + )} + + + + ); }; diff --git a/src/pages/login.tsx b/src/pages/login.tsx index 1fdfcb28..895a665d 100644 --- a/src/pages/login.tsx +++ b/src/pages/login.tsx @@ -359,10 +359,16 @@ const LoginPage = () => { : null; return ( + {loading && ( @@ -373,9 +379,13 @@ const LoginPage = () => { alignItems={'center'} justifyContent={'center'} zIndex={99} - sx={{ margin: '32px 0 65px' }} + sx={{ margin: '5px 10px 25px', }} > - App Logo{' '} + + App Logo + @@ -406,18 +416,19 @@ const LoginPage = () => { /> +
{ darkMode === 'dark' ? 'rgba(0, 0, 0, 0.9) 0px 2px 8px 0px' : 'rgba(99, 99, 99, 0.2) 0px 2px 8px 0px', + marginTop: '50px', }, + '@media (max-width: 900px)': { + marginTop: '-25px', + } + }} > + + + {loading && ( + + )} + + + App Logo + + + - {entityContent} + {entityContent} {/* {totalCountForCenter > 6 && entity === ObservationEntityType.CENTER && ( Date: Mon, 25 Nov 2024 14:29:00 +0530 Subject: [PATCH 2/3] Issue #000 bug: topic subtopic issue solved --- src/components/SessionCardFooter.tsx | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/components/SessionCardFooter.tsx b/src/components/SessionCardFooter.tsx index 3c01b948..aa136a71 100644 --- a/src/components/SessionCardFooter.tsx +++ b/src/components/SessionCardFooter.tsx @@ -121,6 +121,11 @@ const SessionCardFooter: React.FC = ({ fetchTopicSubtopic(); }, [item]); + const handleComponentOpen = () => { + setSelectedTopic(''); + setSelectedSubtopics([]); + }; + const handleTopicSelection = (topic: string) => { setSelectedTopic(topic); console.log(topic); @@ -219,6 +224,15 @@ const SessionCardFooter: React.FC = ({ updateTopicSubtopic(); }; + const handleClick = () => { + handleComponentOpen(); + if (topicList && transformedTasks && eventStatus === EventStatus.UPCOMING) { + handleOpen(); + } else { + handleError(); + } + }; + useEffect(() => { const startDateTime = convertUTCToIST(item?.startDateTime); const startDate = startDateTime.date; @@ -332,13 +346,7 @@ const SessionCardFooter: React.FC = ({ cursor: 'pointer', alignItems: 'center', }} - onClick={ - topicList && - transformedTasks && - eventStatus === EventStatus.UPCOMING - ? handleOpen - : handleError - } + onClick={handleClick} > Date: Mon, 25 Nov 2024 15:16:06 +0530 Subject: [PATCH 3/3] Issue #000 bug: Pre and post requisite content cards are not visible - issue solved --- public/locales/en/common.json | 52 ++++++++++++++++----------------- src/components/TopicDetails.tsx | 19 +++++++++++- 2 files changed, 43 insertions(+), 28 deletions(-) diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 634e86e4..18cf0a1c 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -439,7 +439,8 @@ "START_TIME_ERROR": "Start time cannot be later than end time.", "END_TIME_ERROR": "End time cannot be earlier than start time.", "START_DATE_ERROR": "Start date cannot be later than end date.", - "END_DATE_ERROR": "End date cannot be earlier than start date." + "END_DATE_ERROR": "End date cannot be earlier than start date.", + "IDENTIFIER_NOT_FOUND": "Identifier not found! Cannot Open Content!" }, "MANAGE_USERS": { "CENTERS_REQUESTED_SUCCESSFULLY": "Center requested successfully", @@ -596,35 +597,32 @@ "BOARD": "Board", "CHOOSE_BOARD": "Choose which Board the Learner is going to be enrolled in", "CHOOSE_SUBJECT": "Choose which subjects the learner is enrolling for", - "SUBJECTS_ENROLLED":"Subjects Enrolled", - "EXAM_REGISTRATION_FEES_PAID":"Exam Registration Fees Paid?", + "SUBJECTS_ENROLLED": "Subjects Enrolled", + "EXAM_REGISTRATION_FEES_PAID": "Exam Registration Fees Paid?", "EDIT": "Edit", "SURE_GO_BACK": "Are you sure you want to go back? Your progress might be lost." }, "OBSERVATION": { "OBSERVATION_START": "Start Observation", - "OBSERVATION_DETAILS":"Observation Details", - "ADD_ENTITY":"Add {{entityType}} in observation list", - "SEARCH_ENTITY":"Search {{entityType}} name", - "OBSERVATIONS":"{{name}} Observations", - "SEARCH_OBSERVATIONS":"Search Observations", - "CONTINUE":"Continue", - "SUBMITTED":"Submitted", - "FORM_SAVED_SUCCESSFULLY":"Form changes saved successfully", - "FORM_SUBMIT_SUCCESSFULLY":"Form submitted successfully", - "NOT_STARTED":"Not Started", - "COMPLETED":"Completed", - "INPROGRESS":"In-Progress", - "NO_DATA_FOUND":"No {{entity}} found", - "NO_RESULT_FOUND":"No Observations found for {{entity}}", - "NO_OBSERVATION_EXPIRED":"No observation expired for {{entity}}", - "DAYS_LEFT":"Days left", - "THIS_OBSERVATION_EXPIRED":"This observation is expired", - "DUE_DATE":"Due date", - "SURVEY_FORMS":"Survey Forms", - "OBSERVATION_STATUS":"Observation Status" - - -} - + "OBSERVATION_DETAILS": "Observation Details", + "ADD_ENTITY": "Add {{entityType}} in observation list", + "SEARCH_ENTITY": "Search {{entityType}} name", + "OBSERVATIONS": "{{name}} Observations", + "SEARCH_OBSERVATIONS": "Search Observations", + "CONTINUE": "Continue", + "SUBMITTED": "Submitted", + "FORM_SAVED_SUCCESSFULLY": "Form changes saved successfully", + "FORM_SUBMIT_SUCCESSFULLY": "Form submitted successfully", + "NOT_STARTED": "Not Started", + "COMPLETED": "Completed", + "INPROGRESS": "In-Progress", + "NO_DATA_FOUND": "No {{entity}} found", + "NO_RESULT_FOUND": "No Observations found for {{entity}}", + "NO_OBSERVATION_EXPIRED": "No observation expired for {{entity}}", + "DAYS_LEFT": "Days left", + "THIS_OBSERVATION_EXPIRED": "This observation is expired", + "DUE_DATE": "Due date", + "SURVEY_FORMS": "Survey Forms", + "OBSERVATION_STATUS": "Observation Status" + } } diff --git a/src/components/TopicDetails.tsx b/src/components/TopicDetails.tsx index 1beb1b45..dd43998b 100644 --- a/src/components/TopicDetails.tsx +++ b/src/components/TopicDetails.tsx @@ -16,6 +16,7 @@ import { EventStatus } from '@/utils/app.constant'; import { RequisiteType } from '../../app.config'; import NoDataFound from './common/NoDataFound'; import router from 'next/router'; +import { showToastMessage } from './Toastify'; interface TopicDetailsProps { topic: string; subTopic: []; @@ -60,7 +61,11 @@ const TopicDetails: React.FC = ({ const handlePlayers = (identifier: string) => { sessionStorage.setItem('previousPage', window.location.href); - router.push(`/play/content/${identifier}`); + if (identifier !== undefined && identifier !== '') { + router.push(`/play/content/${identifier}`); + } else { + showToastMessage(t('CENTER_SESSION.IDENTIFIER_NOT_FOUND'), 'error'); + } }; return ( @@ -198,6 +203,10 @@ const TopicDetails: React.FC = ({ handlePlayers(item?.identifier)} > = ({ handlePlayers(item?.identifier)} > = ({ handlePlayers(item?.identifier)} >