From e3c17c36bd292e22284c40fdb9f9580fd52aed5f Mon Sep 17 00:00:00 2001 From: paritshivani Date: Fri, 27 Sep 2024 19:32:59 +0530 Subject: [PATCH 1/9] language update --- .../public/locales/en/translation.json | 39 ++++++++++--------- .../nulp_elite/src/pages/registration/Otp.js | 8 +--- 2 files changed, 22 insertions(+), 25 deletions(-) diff --git a/packages/nulp_elite/public/locales/en/translation.json b/packages/nulp_elite/public/locales/en/translation.json index 6fa249f8..6e0896ab 100644 --- a/packages/nulp_elite/public/locales/en/translation.json +++ b/packages/nulp_elite/public/locales/en/translation.json @@ -295,26 +295,27 @@ "VIEW_STATUS": "View Status", "SEARCH_FOR_POLL": "Search for a Poll", "NO_POLL_AVAILABLE_NOW": " It looks like there are no polls at the moment.", - "ADMIN":"Admin", - "LEARNING_REPORT":"Learning Report", - "POPULAR_COURSES" : "Popular Courses", - "RECENTLY_ADDED":"Recently Added", - "THIS_CONTENT_IS_DERIVED_FROM":"This content is derived from", - "PUBLISHED_ON_NULP_BY":"PUBLISHED ON NULP BY", - "ACCEPT_THE_NULP_TERMS_OF_USE" : "I am 18+ years old and understand and accept the NULP Terms of Use", + "ADMIN": "Admin", + "LEARNING_REPORT": "Learning Report", + "POPULAR_COURSES": "Popular Courses", + "RECENTLY_ADDED": "Recently Added", + "THIS_CONTENT_IS_DERIVED_FROM": "This content is derived from", + "PUBLISHED_ON_NULP_BY": "PUBLISHED ON NULP BY", + "ACCEPT_THE_NULP_TERMS_OF_USE": "I am 18+ years old and understand and accept the NULP Terms of Use", "As_A_PATENT_GUARDIAN_ACCEPT_THE_NULP_TERMS_OF_USE": "As a parent/guardian I understand & accept the NULP Terms of Use agree my child to register on NULP with the given information.", "CONTENT_DERIVED_FROM": "This content is derived from", - "FILTERS":"Filters", - "EXPLORE_CONTENT":"Explore Content", + "FILTERS": "Filters", + "EXPLORE_CONTENT": "Explore Content", "COURSE_SUCCESSFULLY_COMPLETED": "Course completed Successfully", - "ID":"ID", - "ORGANIZATION_NAME":"Organization Name", - "ROLE":"Role", - "NO_CERTIFICATES_FOUND":"No certificates found", - "NOT_ENROLL_MESSAGE":"You are not enrolled in any course. Enroll now!", - "FIRST_NAME":"First Name", - "LAST_NAME":"Last Name", - "NO_CHAT_REQUEST" : "No Chat Request", - "PHONE":"Phone", - "PHONE_NUMBER":"(+91 11) 24617517, 24617543, 24617595" + "ID": "ID", + "ORGANIZATION_NAME": "Organization Name", + "ROLE": "Role", + "NO_CERTIFICATES_FOUND": "No certificates found", + "NOT_ENROLL_MESSAGE": "You are not enrolled in any course. Enroll now!", + "FIRST_NAME": "First Name", + "LAST_NAME": "Last Name", + "NO_CHAT_REQUEST": "No Chat Request", + "PHONE": "Phone", + "PHONE_NUMBER": "(+91 11) 24617517, 24617543, 24617595", + "SESSION_TIMEOUT_MESSAGE": "Failed to fetch data.please try again." } diff --git a/packages/nulp_elite/src/pages/registration/Otp.js b/packages/nulp_elite/src/pages/registration/Otp.js index 96d9b9be..4c9b0519 100644 --- a/packages/nulp_elite/src/pages/registration/Otp.js +++ b/packages/nulp_elite/src/pages/registration/Otp.js @@ -289,13 +289,9 @@ const Otp = () => { const age = new Date().getFullYear() - birthYear; const tncText = age < 18 ? ( - - {t("As_A_PATENT_GUARDIAN_ACCEPT_THE_NULP_TERMS_OF_USE")} - + {t("As_A_PATENT_GUARDIAN_ACCEPT_THE_NULP_TERMS_OF_USE")} ) : ( - - {t("ACCEPT_THE_NULP_TERMS_OF_USE")} - + {t("ACCEPT_THE_NULP_TERMS_OF_USE")} ); const handleCheckboxChange = (event) => { setIsChecked(event.target.checked); From b824fd9b143c3c069b28b5023afc6ca43e44a719 Mon Sep 17 00:00:00 2001 From: paritshivani Date: Tue, 1 Oct 2024 11:54:19 +0530 Subject: [PATCH 2/9] learnathon structure --- packages/nulp_elite/src/components/learnathon/lernHomeBanner.js | 0 packages/nulp_elite/src/pages/learnathon/LernReview.js | 0 packages/nulp_elite/src/pages/learnathon/lernCreatorForm.js | 0 packages/nulp_elite/src/pages/learnathon/lernCreatorList.js | 0 packages/nulp_elite/src/pages/learnathon/lernReviewerList.js | 0 5 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 packages/nulp_elite/src/components/learnathon/lernHomeBanner.js create mode 100644 packages/nulp_elite/src/pages/learnathon/LernReview.js create mode 100644 packages/nulp_elite/src/pages/learnathon/lernCreatorForm.js create mode 100644 packages/nulp_elite/src/pages/learnathon/lernCreatorList.js create mode 100644 packages/nulp_elite/src/pages/learnathon/lernReviewerList.js diff --git a/packages/nulp_elite/src/components/learnathon/lernHomeBanner.js b/packages/nulp_elite/src/components/learnathon/lernHomeBanner.js new file mode 100644 index 00000000..e69de29b diff --git a/packages/nulp_elite/src/pages/learnathon/LernReview.js b/packages/nulp_elite/src/pages/learnathon/LernReview.js new file mode 100644 index 00000000..e69de29b diff --git a/packages/nulp_elite/src/pages/learnathon/lernCreatorForm.js b/packages/nulp_elite/src/pages/learnathon/lernCreatorForm.js new file mode 100644 index 00000000..e69de29b diff --git a/packages/nulp_elite/src/pages/learnathon/lernCreatorList.js b/packages/nulp_elite/src/pages/learnathon/lernCreatorList.js new file mode 100644 index 00000000..e69de29b diff --git a/packages/nulp_elite/src/pages/learnathon/lernReviewerList.js b/packages/nulp_elite/src/pages/learnathon/lernReviewerList.js new file mode 100644 index 00000000..e69de29b From 97fc46aa6d5ba6f81e22b26066013f681e1bbdd2 Mon Sep 17 00:00:00 2001 From: sonaligarud Date: Tue, 1 Oct 2024 14:40:33 +0530 Subject: [PATCH 3/9] Bug #225510 - mobile- Subdomain Selection: Long Text Not Fully Visible in Preferences Popup --- packages/nulp_elite/src/styles/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nulp_elite/src/styles/style.css b/packages/nulp_elite/src/styles/style.css index 8afcf9d5..5efe98a8 100644 --- a/packages/nulp_elite/src/styles/style.css +++ b/packages/nulp_elite/src/styles/style.css @@ -3720,7 +3720,7 @@ input:required::after { border-radius: 7px; } .css-qiwgdb.MuiSelect-select { - white-space: initial; + white-space: initial !important; } .mb-20{ margin-bottom: 20px; From d47c40f7d3c9e4f43068a69da23f51443061f88d Mon Sep 17 00:00:00 2001 From: paritshivani Date: Tue, 1 Oct 2024 16:47:36 +0530 Subject: [PATCH 4/9] commiting create component basic --- packages/nulp_elite/src/App.js | 17 +- .../nulp_elite/src/configs/routeConfig.json | 7 +- .../src/pages/learnathon/lernCreatorForm.js | 296 ++++++++++++++++++ 3 files changed, 311 insertions(+), 9 deletions(-) diff --git a/packages/nulp_elite/src/App.js b/packages/nulp_elite/src/App.js index 0b3ed72b..61a632d4 100644 --- a/packages/nulp_elite/src/App.js +++ b/packages/nulp_elite/src/App.js @@ -1,9 +1,7 @@ import React, { useEffect, useState } from "react"; import "./App.css"; import "./styles/style.css"; -import { - NativeBaseProvider, -} from "native-base"; +import { NativeBaseProvider } from "native-base"; import { BrowserRouter as Router, Route, Routes } from "react-router-dom"; import { initializeI18n } from "@shiksha/common-lib"; import * as util from "services/utilService"; @@ -36,11 +34,12 @@ import createForm from "pages/voting/createForm"; import VotingDetails from "pages/voting/votingDetails"; import votingDashboard from "pages/voting/votingDashboard"; import pollsDetails from "pages/voting/pollsDetails"; +import LernCreatorForm from "pages/learnathon/lernCreatorForm"; const urlConfig = require("./configs/urlConfig.json"); const routeConfig = require("./configs/routeConfig.json"); import PopupForm from "pages/profileData"; import axios from "axios"; -import ReactGA from 'react-ga4'; +import ReactGA from "react-ga4"; function App() { // const [t] = useTranslation(); @@ -53,8 +52,7 @@ function App() { const _userId = util.userId(); const [orgId, setOrgId] = useState(); const [userData, setUserData] = React.useState(false); - ReactGA.initialize('G-QH3SHT9MTG'); - + ReactGA.initialize("G-QH3SHT9MTG"); const routes = [ { @@ -213,6 +211,11 @@ function App() { path: routeConfig.ROUTES.POLL.POLLS_VIEW_ALL, component: pollsDetails, }, + { + moduleName: "nulp_elite", + path: routeConfig.ROUTES.LEARNATHON.CREATELEARNCONTENT, + component: LernCreatorForm, + }, ]; createForm; initializeI18n( @@ -286,7 +289,7 @@ function App() { console.error("Error fetching user data:", error); } }; -console.log("dev here") + console.log("dev here"); fetchData(); UserData(); }, []); diff --git a/packages/nulp_elite/src/configs/routeConfig.json b/packages/nulp_elite/src/configs/routeConfig.json index 78c17fdd..d923004c 100644 --- a/packages/nulp_elite/src/configs/routeConfig.json +++ b/packages/nulp_elite/src/configs/routeConfig.json @@ -6,8 +6,8 @@ "DASHBOARD_PAGE": { "DASHBOARD": "/webapp/dashboard" }, - "LEARNING_REPORT":"/dashBoard/allDashboard", - "ADMIN":"/dashBoard/addusess", + "LEARNING_REPORT": "/dashBoard/allDashboard", + "ADMIN": "/dashBoard/addusess", "ALL_CONTENT_PAGE": { "ALL_CONTENT": "/webapp/all" }, @@ -83,6 +83,9 @@ "POLL_FORM": "/webapp/createform", "POLL_DASHBOARD": "/webapp/pollDashboard", "POLLS_VIEW_ALL": "/webapp/pollsDetails" + }, + "LEARNATHON": { + "CREATELEARNCONTENT": "/webapp/learnthon" } } } diff --git a/packages/nulp_elite/src/pages/learnathon/lernCreatorForm.js b/packages/nulp_elite/src/pages/learnathon/lernCreatorForm.js index e69de29b..d4e0e581 100644 --- a/packages/nulp_elite/src/pages/learnathon/lernCreatorForm.js +++ b/packages/nulp_elite/src/pages/learnathon/lernCreatorForm.js @@ -0,0 +1,296 @@ +import React, { useState } from "react"; +import { + TextField, + Button, + MenuItem, + Checkbox, + FormControlLabel, + Tooltip, + IconButton, + Typography, + Box, +} from "@mui/material"; +import HelpOutlineIcon from "@mui/icons-material/HelpOutline"; + +const categories = [ + "State / UT / SPVs / ULBs / Any Other", + "Industry", + "Academia", +]; + +const themes = [ + "NULP Domain 1", + "NULP Domain 2", + "NULP Domain 3", + "NULP Domain 4", + "NULP Domain 5", + "NULP Domain 6", + "NULP Domain 7", + "NULP Domain 8", + "NULP Domain 9", + "NULP Domain 10", + "Others", +]; + +const LernCreatorForm = () => { + const [formData, setFormData] = useState({ + userName: "", + email: "", + mobileNumber: "", + category: "", + organisation: "", + department: "", + theme: "", + otherTheme: "", + title: "", + description: "", + file: null, + consent: false, + }); + + const [guidelineLink, setGuidelineLink] = useState(""); + + const handleChange = (e) => { + const { name, value } = e.target; + setFormData({ + ...formData, + [name]: value, + }); + }; + + const handleFileChange = (e) => { + setFormData({ + ...formData, + file: e.target.files[0], + }); + }; + + const handleCheckboxChange = (e) => { + setFormData({ + ...formData, + consent: e.target.checked, + }); + }; + + const handleCategoryChange = (e) => { + const category = e.target.value; + setFormData({ ...formData, category }); + + // Set appropriate guideline link based on category + if (category === "State / UT / SPVs / ULBs / Any Other") { + setGuidelineLink("link-to-state-guidelines.pdf"); + } else if (category === "Industry") { + setGuidelineLink("link-to-industry-guidelines.pdf"); + } else if (category === "Academia") { + setGuidelineLink("link-to-academia-guidelines.pdf"); + } else { + setGuidelineLink(""); + } + }; + + const handleSubmit = (action) => { + if (!formData.consent) { + alert("You must accept the terms and conditions."); + return; + } + + // Handle form submission (draft or review) + console.log("Form submitted:", formData); + if (action === "draft") { + alert("Saved as draft"); + } else if (action === "review") { + alert("Sent for review"); + } + }; + + return ( + + + Lern Creator Form + + +
+ + + + + + + + {categories.map((option) => ( + + {option} + + ))} + + + {guidelineLink && ( + + Link to Guidelines + + )} + + + + + + + {themes.map((theme) => ( + + {theme} + + ))} + + + {formData.theme === "Others" && ( + + )} + + + + + +
+ + + + + + +
+ + + } + label="I accept the terms and conditions" + /> + + + + + + + + + + + +
+ ); +}; + +export default LernCreatorForm; From f56f8e52bedde277c591951fdbe6705564e066d1 Mon Sep 17 00:00:00 2001 From: sonaligarud Date: Thu, 3 Oct 2024 12:54:34 +0530 Subject: [PATCH 5/9] Task #228134 - [FE] - Registration side changes for learnathon (webapp) --- .../public/locales/be/translation.json | 6 +- .../public/locales/en/translation.json | 6 +- .../public/locales/gg/translation.json | 6 +- .../public/locales/hi/translation.json | 6 +- .../public/locales/ma/translation.json | 6 +- .../public/locales/mal/translation.json | 6 +- .../public/locales/ta/translation.json | 6 +- .../public/locales/te/translation.json | 6 +- packages/nulp_elite/src/App.js | 2 + packages/nulp_elite/src/components/header.js | 12 +- .../src/components/learnathon/LernModal.js | 99 ++++ .../nulp_elite/src/pages/search/DomainList.js | 528 ++++++++++-------- packages/nulp_elite/src/styles/style.css | 7 + 13 files changed, 448 insertions(+), 248 deletions(-) create mode 100644 packages/nulp_elite/src/components/learnathon/LernModal.js diff --git a/packages/nulp_elite/public/locales/be/translation.json b/packages/nulp_elite/public/locales/be/translation.json index fa23a728..33ff334d 100644 --- a/packages/nulp_elite/public/locales/be/translation.json +++ b/packages/nulp_elite/public/locales/be/translation.json @@ -317,5 +317,9 @@ "NO_CHAT_REQUEST": "কোনো চ্যাট অনুরোধ নেই", "PHONE":"ফোন", - "PHONE_NUMBER":"(+91 11) 24617517, 24617543, 24617595" + "PHONE_NUMBER":"(+91 11) 24617517, 24617543, 24617595", + "LERN_title":"Learnathon 2.0", + "LERN_MESSAGE":"Learnathon 2.0 20/09/2024 থেকে 20/10/2024 পর্যন্ত শুরু হয়েছে। আপনি এখন আপনার জমাগুলি তৈরি এবং ভাগ করতে পারেন!", + "CREATE_CONTENT":"সামগ্রী তৈরি করুন", + "REQUEST_TO_CREATE":"তৈরি করার অনুরোধ" } diff --git a/packages/nulp_elite/public/locales/en/translation.json b/packages/nulp_elite/public/locales/en/translation.json index 5dd84928..661141cf 100644 --- a/packages/nulp_elite/public/locales/en/translation.json +++ b/packages/nulp_elite/public/locales/en/translation.json @@ -316,5 +316,9 @@ "LAST_NAME":"Last Name", "NO_CHAT_REQUEST" : "No Chat Request", "PHONE":"Phone", - "PHONE_NUMBER":"(+91 11) 24617517, 24617543, 24617595" + "PHONE_NUMBER":"(+91 11) 24617517, 24617543, 24617595", + "LERN_title":"Learnathon 2.0", + "LERN_MESSAGE":"Learnathon 2.0 has started from 20/09/2024 to 20/10/2024. You can now create and share your submissions!", + "CREATE_CONTENT":"Create Content", + "REQUEST_TO_CREATE":"Request to Create" } diff --git a/packages/nulp_elite/public/locales/gg/translation.json b/packages/nulp_elite/public/locales/gg/translation.json index 72de3600..af24cd87 100644 --- a/packages/nulp_elite/public/locales/gg/translation.json +++ b/packages/nulp_elite/public/locales/gg/translation.json @@ -324,5 +324,9 @@ "LAST_NAME":"છેલ્લું નામ", "NO_CHAT_REQUEST": "કોઈ ચેટ વિનંતી નથી", "PHONE":"ફોન", - "PHONE_NUMBER":"(+91 11) 24617517, 24617543, 24617595" + "PHONE_NUMBER":"(+91 11) 24617517, 24617543, 24617595", + "LERN_title":"લર્નથોન 2.0", + "LERN_MESSAGE":"લર્નથોન 2.0 20/09/2024 થી 20/10/2024 સુધી શરૂ થઈ છે. તમે હવે તમારા સબમિશન બનાવી અને શેર કરી શકો છો!", + "CREATE_CONTENT":"સામગ્રી બનાવો", + "REQUEST_TO_CREATE":"બનાવવાની વિનંતી" } diff --git a/packages/nulp_elite/public/locales/hi/translation.json b/packages/nulp_elite/public/locales/hi/translation.json index 79124644..9429b27a 100644 --- a/packages/nulp_elite/public/locales/hi/translation.json +++ b/packages/nulp_elite/public/locales/hi/translation.json @@ -315,5 +315,9 @@ "LAST_NAME":"अंतिम नाम", "NO_CHAT_REQUEST": "कोई चैट अनुरोध नहीं", "PHONE":"फोन", - "PHONE_NUMBER":"(+91 11) 24617517, 24617543, 24617595" + "PHONE_NUMBER":"(+91 11) 24617517, 24617543, 24617595", + "LERN_title":"लर्नथॉन 2.0", + "LERN_MESSAGE":"लर्नथॉन 2.0 20/09/2024 से 20/10/2024 तक शुरू हो चुका है। अब आप अपने सबमिशन बना और साझा कर सकते हैं!", + "CREATE_CONTENT":"सामग्री बनाएँ", + "REQUEST_TO_CREATE":"बनाने का अनुरोध" } diff --git a/packages/nulp_elite/public/locales/ma/translation.json b/packages/nulp_elite/public/locales/ma/translation.json index c4adb363..6aad9d48 100644 --- a/packages/nulp_elite/public/locales/ma/translation.json +++ b/packages/nulp_elite/public/locales/ma/translation.json @@ -316,6 +316,10 @@ "LAST_NAME":"आडनाव", "NO_CHAT_REQUEST": "चॅट विनंती नाही", "PHONE":"फोन", - "PHONE_NUMBER":"(+91 11) 24617517, 24617543, 24617595" + "PHONE_NUMBER":"(+91 11) 24617517, 24617543, 24617595", + "LERN_title":"लर्नथॉन 2.0", + "LERN_MESSAGE":"लर्नथॉन 2.0 20/09/2024 ते 20/10/2024 पर्यंत सुरू झाली आहे. तुम्ही आता तुमचे सबमिशन तयार आणि शेअर करू शकता!", + "CREATE_CONTENT":"सामग्री तयार करा", + "REQUEST_TO_CREATE":"तयार करण्याची विनंती" } diff --git a/packages/nulp_elite/public/locales/mal/translation.json b/packages/nulp_elite/public/locales/mal/translation.json index 63c41051..2d5115aa 100644 --- a/packages/nulp_elite/public/locales/mal/translation.json +++ b/packages/nulp_elite/public/locales/mal/translation.json @@ -316,5 +316,9 @@ "LAST_NAME":"അവസാന നാമം", "NO_CHAT_REQUEST": "ചാറ്റ് അഭ്യര്‍ത്ഥനയില്ല", "PHONE":"ഫോൺ", - "PHONE_NUMBER":"(+91 11) 24617517, 24617543, 24617595" + "PHONE_NUMBER":"(+91 11) 24617517, 24617543, 24617595", + "LERN_title":"ലേണത്തോൺ 2.0", + "LERN_MESSAGE":"ലേണത്തോൺ 2.0 20/09/2024 മുതൽ 20/10/2024 വരെ ആരംഭിച്ചു. നിങ്ങൾക്ക് ഇപ്പോൾ നിങ്ങളുടെ സമർപ്പിക്കലുകൾ സൃഷ്ടിക്കാനും പങ്കിടാനും കഴിയും!", + "CREATE_CONTENT":"ഉള്ളടക്കം സൃഷ്ടിക്കുക", + "REQUEST_TO_CREATE":"സൃഷ്ടിക്കാനുള്ള അഭ്യർത്ഥന" } diff --git a/packages/nulp_elite/public/locales/ta/translation.json b/packages/nulp_elite/public/locales/ta/translation.json index 47cdf866..89537f35 100644 --- a/packages/nulp_elite/public/locales/ta/translation.json +++ b/packages/nulp_elite/public/locales/ta/translation.json @@ -341,5 +341,9 @@ "LAST_NAME":"கடைசி பெயர்", "NO_CHAT_REQUEST": "சாட் கோரிக்கை இல்லை", "PHONE":"தொலைபேசி", - "PHONE_NUMBER":"(+91 11) 24617517, 24617543, 24617595" + "PHONE_NUMBER":"(+91 11) 24617517, 24617543, 24617595", + "LERN_title":"கற்றல் 2.0", + "LERN_MESSAGE":"கற்றல் 2.0 20/09/2024 முதல் 20/10/2024 வரை தொடங்கியது. நீங்கள் இப்போது உங்கள் சமர்ப்பிப்புகளை உருவாக்கி பகிரலாம்!", + "CREATE_CONTENT":"உள்ளடக்கத்தை உருவாக்கவும்", + "REQUEST_TO_CREATE":"உருவாக்க கோரிக்கை" } diff --git a/packages/nulp_elite/public/locales/te/translation.json b/packages/nulp_elite/public/locales/te/translation.json index 1f10a2ba..442d41db 100644 --- a/packages/nulp_elite/public/locales/te/translation.json +++ b/packages/nulp_elite/public/locales/te/translation.json @@ -280,5 +280,9 @@ "NO_CHAT_REQUEST": "చాట్ అభ్యర్థన లేదు", "PHONE":"ఫోన్", "PHONE_NUMBER":"(+91 11) 24617517, 24617543, 24617595", - "WHAT_DO_YOU_WANT_TO_LEARN_TODAY":"ఈరోజు మీరు ఏమి నేర్చుకోవాలనుకుంటున్నారు" + "WHAT_DO_YOU_WANT_TO_LEARN_TODAY":"ఈరోజు మీరు ఏమి నేర్చుకోవాలనుకుంటున్నారు", + "LERN_title":"లెర్నాథాన్ 2.0", + "LERN_MESSAGE":"లెర్నాథాన్ 2.0 20/09/2024 నుండి 20/10/2024 వరకు ప్రారంభమైంది. మీరు ఇప్పుడు మీ సమర్పణలను సృష్టించవచ్చు మరియు భాగస్వామ్యం చేయవచ్చు!", + "CREATE_CONTENT":"కంటెంట్‌ని సృష్టించండి", + "REQUEST_TO_CREATE":"సృష్టించడానికి అభ్యర్థన" } diff --git a/packages/nulp_elite/src/App.js b/packages/nulp_elite/src/App.js index 61a632d4..9293955b 100644 --- a/packages/nulp_elite/src/App.js +++ b/packages/nulp_elite/src/App.js @@ -40,6 +40,7 @@ const routeConfig = require("./configs/routeConfig.json"); import PopupForm from "pages/profileData"; import axios from "axios"; import ReactGA from "react-ga4"; +import LernModal from "components/learnathon/LernModal"; function App() { // const [t] = useTranslation(); @@ -325,6 +326,7 @@ function App() { ))} + {/* */} {/* */} diff --git a/packages/nulp_elite/src/components/header.js b/packages/nulp_elite/src/components/header.js index ad3f27bf..0096583a 100644 --- a/packages/nulp_elite/src/components/header.js +++ b/packages/nulp_elite/src/components/header.js @@ -216,7 +216,9 @@ function Header({ globalSearchQuery }) { boxShadow: searchQuery ? '0 2px 4px rgba(0, 0, 0, 0.2)' : 'none', color: searchQuery ? '#fff' : "#000" }; - +const handleLogout =() => { + sessionStorage.setItem('isModalShown', 'false'); +} return ( <> - + + {t("LOGOUT")} @@ -672,7 +676,7 @@ function Header({ globalSearchQuery }) { - + - + {t("LOGOUT")} diff --git a/packages/nulp_elite/src/components/learnathon/LernModal.js b/packages/nulp_elite/src/components/learnathon/LernModal.js new file mode 100644 index 00000000..b21c6651 --- /dev/null +++ b/packages/nulp_elite/src/components/learnathon/LernModal.js @@ -0,0 +1,99 @@ +import React, { useState, useEffect } from 'react'; +import { Modal, Box, Typography, IconButton } from '@mui/material'; +import * as util from "services/utilService"; +const urlConfig = require("../../configs/urlConfig.json"); +import CloseIcon from "@mui/icons-material/Close"; +import Divider from '@mui/material/Divider'; +import { useTranslation } from "react-i18next"; + +const LernModal = () => { + const { t } = useTranslation(); + const [isModalOpen, setIsModalOpen] = useState(() => { + // Check if the modal has been shown in the current session + const isModalShown = sessionStorage.getItem('isModalShown'); + return isModalShown !== 'true'; // Show modal if not already shown + }); + + const [lernUser, setLernUser] = useState([]); + const _userId = util.userId(); + + const handleClose = () => { + setIsModalOpen(false); + sessionStorage.setItem('isModalShown', 'true'); // Set flag to not show modal again + }; + + const fetchData = async () => { + try { + const url = `${urlConfig.URLS.LEARNER_PREFIX}${urlConfig.URLS.USER.GET_PROFILE}${_userId}`; + const response = await fetch(url); + const data = await response.json(); + const rolesData = data.result.response.channel; + setLernUser(rolesData); + } catch (error) { + console.error("Error fetching user data:", error); + } + }; + + // Fetch data when the component mounts or _userId changes + useEffect(() => { + if (_userId) { + fetchData(); + } + }, [_userId]); + + const style = { + position: "absolute", + top: "50%", + left: "50%", + transform: "translate(-50%, -50%)", + width: 400, + bgcolor: "background.paper", + border: "2px solid #000", + boxShadow: 24, + p: 4, + overflow: "auto", + }; + + return ( +
+ + + + + + {t("LERN_title")} + + + + + + + + + + + + + + {t("LERN_MESSAGE")} + + + + {lernUser === 'nulp-lern' ? ( + {t("CREATE_CONTENT")} + ) : ( + {t("REQUEST_TO_CREATE")} + )} + + + +
+ ); +}; + +export default LernModal; diff --git a/packages/nulp_elite/src/pages/search/DomainList.js b/packages/nulp_elite/src/pages/search/DomainList.js index f2325bd4..06f3aa42 100644 --- a/packages/nulp_elite/src/pages/search/DomainList.js +++ b/packages/nulp_elite/src/pages/search/DomainList.js @@ -1,5 +1,5 @@ import React, { useState, useEffect } from "react"; -import { createTheme} from "@mui/material/styles"; +import { createTheme } from "@mui/material/styles"; import { useTranslation } from "react-i18next"; import Grid from "@mui/material/Grid"; import { styled } from "@mui/material/styles"; @@ -9,7 +9,7 @@ import Box from "@mui/material/Box"; import domainWithImage from "../../assets/domainImgForm.json"; import Header from "../../components/header"; import * as frameworkService from ".././../services/frameworkService"; -import { useNavigate} from "react-router-dom"; +import { useNavigate } from "react-router-dom"; import Footer from "../../components/Footer"; import { object } from "yup"; import Alert from "@mui/material/Alert"; @@ -30,6 +30,7 @@ import FloatingChatIcon from "components/FloatingChatIcon"; import * as util from "../../services/utilService"; import { Loading } from "@shiksha/common-lib"; + const Item = styled(Paper)(({ theme }) => ({ backgroundColor: theme.palette.mode === "dark" ? "#1A2027" : "#fff", ...theme.typography.body2, @@ -72,6 +73,33 @@ const DomainList = ({ globalSearchQuery }) => { const [searchQuery, setSearchQuery] = useState(globalSearchQuery || ""); + const [isModalOpen, setIsModalOpen] = useState(() => { + // Check if the modal has been shown in the current session + const isModalShown = sessionStorage.getItem('isModalShown'); + return isModalShown !== 'true'; // Show modal if not already shown + }); + + const [lernUser, setLernUser] = useState([]); + const _userId = util.userId(); + const fetchData = async () => { + try { + const url = `${urlConfig.URLS.LEARNER_PREFIX}${urlConfig.URLS.USER.GET_PROFILE}${_userId}`; + const response = await fetch(url); + const data = await response.json(); + const rolesData = data.result.response.channel; + setLernUser(rolesData); + } catch (error) { + console.error("Error fetching user data:", error); + } + }; + + // Fetch data when the component mounts or _userId changes + useEffect(() => { + if (_userId) { + fetchData(); + } + }, [_userId]); + const showErrorMessage = (msg) => { setToasterMessage(msg); setTimeout(() => { @@ -379,243 +407,187 @@ const DomainList = ({ globalSearchQuery }) => {
{toasterMessage && } - - - {/* Search Box */} - - - - - ), + + + {/* Search Box */} + - - - {isMobile ? ( - - {error && {error}} - - - {t("SELECT_YOUR_PREFERRED_DOMAIN")}: - + > + + + + ), + }} + /> + - - {data && - data.slice(0, 10).map((term) => ( - - loadContents(term)} - style={{ - display: "flex", - flexDirection: "row", - alignItems: "center", - }} - className="domainlist-bx" + {isMobile ? ( + + {error && {error}} + + + {t("SELECT_YOUR_PREFERRED_DOMAIN")}: + + + + {data && + data.slice(0, 10).map((term) => ( + - - - -
loadContents(term)} + style={{ + display: "flex", + flexDirection: "row", + alignItems: "center", + }} + className="domainlist-bx" > - {term.name} -
-
-
- ))} -
-
- - ) : domain ? ( - - ) : ( - - // - )} - - - {error && {error}} - - -

- - {" "} - - {t("POPULAR_COURSES")}{" "} - {" "} - -

- {isMobile ? ( - - {isLoading ? ( - - ) : error ? ( - {error} - ) : popularCourses.length > 0 ? ( -
- - {popularCourses.slice(0, 10).map((items, index) => ( - - - handleCardClick(items.identifier, items.contentType) - } - /> + + + +
+ {term.name} +
- // - ))} -
-
-
- ) : ( - - )} -
- ) : ( - - {isLoading ? ( - - ) : error ? ( - {error} - ) : popularCourses.length > 0 ? ( - - {popularCourses.slice(0, 10).map((items) => ( - - - handleCardClick(items.identifier, items.contentType) - } - /> - - // + ))} -
-
- ) : ( - - )} +
- )} -
-
- - - {error && {error}} - - -

+ ) : domain ? ( + + ) : ( + + // + )} + + + + {error && {error}} + - {" "} - - {t("RECENTLY_ADDED")}{" "} - {" "} - -

- {isMobile ? ( - - {isLoading ? ( - - ) : error ? ( - {error} - ) : recentlyAddedCourses.length > 0 ? ( -
- - {recentlyAddedCourses.slice(0, 10).map((items, index) => ( - - - handleCardClick(items.identifier, items.contentType) - } - /> - - ))} -
+ + + + {t("LERN_title")} + + + + + {t("LERN_MESSAGE")} -
- ) : ( - - )} + + + + {lernUser === 'nulp-lern' ? ( + {t("CREATE_CONTENT")} + ) : ( + {t("REQUEST_TO_CREATE")} + )} + + +
- ) : ( - - {isLoading ? ( - - ) : error ? ( - {error} - ) : recentlyAddedCourses.length > 0 ? ( -
+ + +

+ + {" "} + + {t("POPULAR_COURSES")}{" "} + {" "} + +

+ {isMobile ? ( + + {isLoading ? ( + + ) : error ? ( + {error} + ) : popularCourses.length > 0 ? ( +
+ + {popularCourses.slice(0, 10).map((items, index) => ( + + + handleCardClick(items.identifier, items.contentType) + } + /> + + // + ))} +
+
+
+ ) : ( + + )} +
+ ) : ( + + {isLoading ? ( + + ) : error ? ( + {error} + ) : popularCourses.length > 0 ? ( - {recentlyAddedCourses.slice(0, 10).map((items) => ( - + {popularCourses.slice(0, 10).map((items) => ( + @@ -623,18 +595,102 @@ const DomainList = ({ globalSearchQuery }) => { } /> + // ))}
-
- ) : ( - - )} -
- )} -
-
- + ) : ( + + )} +
+ )} +
+ + + {error && {error}} + + +

+ + {" "} + + {t("RECENTLY_ADDED")}{" "} + {" "} + +

+ {isMobile ? ( + + {isLoading ? ( + + ) : error ? ( + {error} + ) : recentlyAddedCourses.length > 0 ? ( +
+ + {recentlyAddedCourses.slice(0, 10).map((items, index) => ( + + + handleCardClick(items.identifier, items.contentType) + } + /> + + ))} +
+
+
+ ) : ( + + )} +
+ ) : ( + + {isLoading ? ( + + ) : error ? ( + {error} + ) : recentlyAddedCourses.length > 0 ? ( +
+ + {recentlyAddedCourses.slice(0, 10).map((items) => ( + + + handleCardClick(items.identifier, items.contentType) + } + /> + + ))} +
+
+
+ ) : ( + + )} +
+ )} +
+
+
diff --git a/packages/nulp_elite/src/styles/style.css b/packages/nulp_elite/src/styles/style.css index 8afcf9d5..697618de 100644 --- a/packages/nulp_elite/src/styles/style.css +++ b/packages/nulp_elite/src/styles/style.css @@ -3727,4 +3727,11 @@ input:required::after { } .url-class{ word-wrap: break-word; +} +.lern-box{ +background-color: #fff; +padding: 30px; +border-radius: 4px; +border: 1px solid #15353f; +margin: 10px; } \ No newline at end of file From 24d8ba60e5a033b5e607e1a238e15e0c0b4b168a Mon Sep 17 00:00:00 2001 From: sonaligarud Date: Thu, 3 Oct 2024 14:22:59 +0530 Subject: [PATCH 6/9] fixes layout on mobile view --- packages/nulp_elite/src/pages/search/DomainList.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nulp_elite/src/pages/search/DomainList.js b/packages/nulp_elite/src/pages/search/DomainList.js index 06f3aa42..bef02eee 100644 --- a/packages/nulp_elite/src/pages/search/DomainList.js +++ b/packages/nulp_elite/src/pages/search/DomainList.js @@ -513,12 +513,12 @@ const DomainList = ({ globalSearchQuery }) => {
- + {t("LERN_MESSAGE")} - + {lernUser === 'nulp-lern' ? ( {t("CREATE_CONTENT")} ) : ( From 78e952d902267616ab20f38b7e2c25dca17690a2 Mon Sep 17 00:00:00 2001 From: Mahesh Mahajan Date: Thu, 3 Oct 2024 15:23:47 +0530 Subject: [PATCH 7/9] Bug #228125 : course detail page] Content under the module is not visible for course --- .../src/pages/content/joinCourse.js | 66 +++++++++++++------ 1 file changed, 45 insertions(+), 21 deletions(-) diff --git a/packages/nulp_elite/src/pages/content/joinCourse.js b/packages/nulp_elite/src/pages/content/joinCourse.js index e81f5df9..9d166ed4 100644 --- a/packages/nulp_elite/src/pages/content/joinCourse.js +++ b/packages/nulp_elite/src/pages/content/joinCourse.js @@ -1605,16 +1605,31 @@ const JoinCourse = () => { > {faqIndex.name} - {faqIndex?.children?.map((faqIndexname) => ( - - handleLinkClick(faqIndexname.identifier) - } - className="h6-title" - > + + + {/* If it's not a content collection, render it like a clickable child */} + {faqIndex.mimeType !== "application/vnd.ekstep.content-collection" ? ( + handleLinkClick(faqIndex.identifier)} + className="h6-title" + > + {faqIndex.name} + {completedContents.includes(faqIndex.identifier) && ( + + )} + + ) : ( + faqIndex?.children?.map((faqIndexname) => ( { {faqIndexname.name} ) : ( - {faqIndexname.name} - {completedContents.includes( - faqIndexname.identifier - ) && ( + handleLinkClick(faqIndexname.identifier)} + className="h6-title" + > + {faqIndexname.name} + {completedContents.includes(faqIndexname.identifier) && ( { float: "right", }} /> - )} - - + )} + )} + {faqIndexname.children && faqIndexname.children.length > 0 && (
@@ -1747,10 +1767,14 @@ const JoinCourse = () => {
)}
- - ))} - - ))} + )) + )} +
+ + ))} + + + Date: Thu, 3 Oct 2024 17:51:59 +0530 Subject: [PATCH 8/9] TASK : #0000 Event crtificate functionality --- .../nulp_elite/src/configs/urlConfig.json | 3 +- .../src/pages/events/eventDetails.js | 86 +++++++++++++++++++ 2 files changed, 88 insertions(+), 1 deletion(-) diff --git a/packages/nulp_elite/src/configs/urlConfig.json b/packages/nulp_elite/src/configs/urlConfig.json index 4650f216..d5bd7cf2 100644 --- a/packages/nulp_elite/src/configs/urlConfig.json +++ b/packages/nulp_elite/src/configs/urlConfig.json @@ -143,7 +143,8 @@ "ADD_CERTIFICATE": "v1/add/template", "ATTACH_CERTIFICATE": "v1/template/add", "CREATE_CERT_TEMPLATE": "asset/v1/create", - "UPLOAD_CERT_TEMPLATE": "asset/v1/upload" + "UPLOAD_CERT_TEMPLATE": "asset/v1/upload", + "CUSTOM_CERTIFICATE_CREATE": "/custom_event/certificate/create" }, "COMPOSITE": { "SEARCH": "composite/v1/search", diff --git a/packages/nulp_elite/src/pages/events/eventDetails.js b/packages/nulp_elite/src/pages/events/eventDetails.js index 5c5e92e8..66245d55 100644 --- a/packages/nulp_elite/src/pages/events/eventDetails.js +++ b/packages/nulp_elite/src/pages/events/eventDetails.js @@ -109,6 +109,8 @@ const EventDetails = () => { const [isChecked, setIsChecked] = useState(false); const [open, setOpen] = React.useState(false); const [recording, setRecording] = useState(); + const [batchCertData,setBatchCertData] = useState(); + const [isCertificateIssued , setIsCertificateIssued] = useState(true) const [isAllreadyFilledRegistation,setIsAlreadyFilledRegistration] = useState(true) const [isExpired , setIsExpired] = useState(false) const handleClickOpen = () => { @@ -286,6 +288,8 @@ const formatTimeWithTimezone = (date) => { getUserData(_userId, "loggedIn"); fetchMyEvents(); getEventRecording(); + fetchData(); + checkCertificateAlreadyIssued(); // checkEnrolledCourse(); }, [_userId, eventId]); @@ -308,6 +312,7 @@ const formatTimeWithTimezone = (date) => { const { result } = response.data; const { response: batchResponse } = result; + setBatchCertData(response.data.result) if (batchResponse && batchResponse.count === 0) { showErrorMessage(t("This course has no active Batches")); @@ -455,6 +460,83 @@ const formatTimeWithTimezone = (date) => { }); }; + const fetchData = async () => { + try { + const url = `${urlConfig.URLS.LEARNER_PREFIX}${urlConfig.URLS.USER.GET_PROFILE}${_userId}?fields=${urlConfig.params.userReadParam.fields}`; + + const header = "application/json"; + const response = await fetch(url, { + // headers: { + // "Content-Type": "application/json", + // }, + }); + const data = await response.json(); + setUserData(data); + } catch (error) { + console.error("Error fetching user data:", error); + showErrorMessage(t("FAILED_TO_FETCH_DATA")); + } + }; + + const checkCertificateAlreadyIssued = async () => { + try{ + const url = `${urlConfig.URLS.LEARNER_PREFIX}${urlConfig.URLS.CERTIFICATE.CERTIF_SEARCH}`; + const requestBody = { + filters: { + recipient: { + id: { + eq: _userId + } + } + } + } + const resopnse = await axios.post(url, requestBody); + setIsCertificateIssued(resopnse.data.some((item) => item.training?.id === eventId)); + + }catch(error){ + console.log("error While calling API "); + } + + } + + const generateCertificate = async () => { + const templateId = Object.keys(batchCertData?.response?.content[0]["certTemplates"])[0]; + const certificateDetails = batchCertData?.response?.content[0]["certTemplates"][templateId]; + try { + const url = `${urlConfig.URLS.CERTIFICATE.CUSTOM_CERTIFICATE_CREATE}`; + const requestBody = { + recipient: { + id: _userId, + name: userData?.result?.response?.firstName + " " + userData?.result?.response?.lastName, + type: "user", + }, + issuer: certificateDetails?.issuer, + training: { + id: detailData?.identifier, + name: detailData?.name, + type: "Event", + batchId: batchData?.batchId, + }, + templateUrl: + certificateDetails?.url, + status: "ACTIVE", + signatoryList: + certificateDetails?.signatoryList, + certificateLabel: "test", + issuedOn: new Date().toISOString(), + }; + if(!isCertificateIssued){ + const response = await axios.post(url, requestBody); + if(response.data.responseCode === "OK"){ + setIsCertificateIssued(true) + } + } + } catch (error) { + console.error("Error creating certificate:", error); + } +}; + + const managePublicPrivateEvent = (button) => { if (eventVisibility && eventVisibility === "Public" && button === "reg") { handleOpenConsentModal(); @@ -865,6 +947,10 @@ const formatTimeWithTimezone = (date) => { type="button" onClick={() => { managePublicPrivateEvent("join"); + // generateCertificate(); + if(detailData.issueCerificate === "Yes"){ + generateCertificate(); + } }} // onClick={attendWebinar} style={{ From cdffdab29d7cc7a06a18bc8c0f9e33e25485e69c Mon Sep 17 00:00:00 2001 From: paritshivani Date: Fri, 4 Oct 2024 18:50:06 +0530 Subject: [PATCH 9/9] disable join button for creator --- .../src/pages/content/joinCourse.js | 1941 +++++++++-------- 1 file changed, 1007 insertions(+), 934 deletions(-) diff --git a/packages/nulp_elite/src/pages/content/joinCourse.js b/packages/nulp_elite/src/pages/content/joinCourse.js index 9d166ed4..da4be659 100644 --- a/packages/nulp_elite/src/pages/content/joinCourse.js +++ b/packages/nulp_elite/src/pages/content/joinCourse.js @@ -57,7 +57,8 @@ const JoinCourse = () => { const [batchDetails, setBatchDetails] = useState(); const [userCourseData, setUserCourseData] = useState({}); const [showEnrollmentSnackbar, setShowEnrollmentSnackbar] = useState(false); - const [showUnEnrollmentSnackbar, setShowUnEnrollmentSnackbar] = useState(false); + const [showUnEnrollmentSnackbar, setShowUnEnrollmentSnackbar] = + useState(false); const [showConsentForm, setShowConsentForm] = useState(false); const [enrolled, setEnrolled] = useState(false); const [progress, setCourseProgress] = useState(); @@ -75,6 +76,7 @@ const JoinCourse = () => { const [open, setOpen] = useState(false); const [chat, setChat] = useState([]); const [childnode, setChildNode] = useState([]); + const [isOwner, setIsOwner] = useState([]); const [formData, setFormData] = useState({ message: "", }); @@ -155,8 +157,11 @@ const JoinCourse = () => { setCreatorId(data?.result?.content?.createdBy); setCourseData(data); setUserData(data); - - const identifiers = data?.result?.content?.children[0]?.children[0]?.identifier; + if (_userId == data?.result?.content?.createdBy) { + setIsOwner(true); + } + const identifiers = + data?.result?.content?.children[0]?.children[0]?.identifier; console.log(identifiers, "setChildNode"); setChildNode(identifiers); @@ -180,7 +185,6 @@ const JoinCourse = () => { setAllContents(allContents); console.log("allContents-------", allContents); - } catch (error) { console.error("Error fetching course data:", error); showErrorMessage(t("FAILED_TO_FETCH_DATA")); @@ -222,7 +226,7 @@ const JoinCourse = () => { batchId: batchDetails.batchId, }); setBatchDetails(batchDetails); - console.log("batchDetail---", batchDetails) + console.log("batchDetail---", batchDetails); } else { console.error("Batch data not found in response"); } @@ -287,12 +291,11 @@ const JoinCourse = () => { if (content.status) { completedCount = completedCount + 1; } - }) + }); if (allContents.length == completedCount) { - setIsCompleted(true) + setIsCompleted(true); } - - } + }; const flattenDeep = async (contents) => { if (contents) { @@ -310,7 +313,6 @@ const JoinCourse = () => { }; const calculateProgress = async () => { - console.log( "courseData?.result?.content?.children", courseData?.result?.content?.children @@ -383,8 +385,9 @@ const JoinCourse = () => { useEffect(() => { const fetchChats = async () => { try { - const url = `${urlConfig.URLS.DIRECT_CONNECT.GET_CHATS - }?sender_id=${_userId}&receiver_id=${creatorId}&is_accepted=${true}`; + const url = `${ + urlConfig.URLS.DIRECT_CONNECT.GET_CHATS + }?sender_id=${_userId}&receiver_id=${creatorId}&is_accepted=${true}`; const response = await axios.get(url, { withCredentials: true, @@ -453,8 +456,8 @@ const JoinCourse = () => { for (let identifier of allContents) { const found = Array.isArray(contentList) ? contentList.find( - (item) => item.contentId === identifier && item.status === 2 - ) + (item) => item.contentId === identifier && item.status === 2 + ) : undefined; if (!found) { @@ -599,29 +602,35 @@ const JoinCourse = () => { return (
- + + {" "} + - - {!isCompleted && + + {" "} + + {!isCompleted && ( - } + )} +
- {showConfirmation && ( @@ -656,37 +665,44 @@ const JoinCourse = () => { <>
- + + {" "} + - - - {!isCompleted && + + + {!isCompleted && ( - } + )}{" "} +
- {showConfirmation && ( - + {t("LEAVE_COURSE_CONFIRMATION_TITLE")} @@ -709,17 +725,11 @@ const JoinCourse = () => { > {t("LEAVE_COURSE")} - )}
- {isCompleted && - - {t("COURSE_SUCCESSFULLY_COMPLETED")} - - } - + {isCompleted && {t("COURSE_SUCCESSFULLY_COMPLETED")}} ); } @@ -791,7 +801,7 @@ const JoinCourse = () => { - ); } } @@ -811,7 +820,7 @@ const JoinCourse = () => { await handleJoinCourse(); // Wait for the user to join the course setShowConsentForm(true); // Open the consent form after joining the course } catch (error) { - setShowEnrollmentSnackbar + setShowEnrollmentSnackbar; console.error("Error:", error); } }; @@ -939,14 +948,13 @@ const JoinCourse = () => { } }; - const handlecopyrightOpen = () => { setcopyrightOpen(true); }; const handlecopyrightClose = () => { setcopyrightOpen(false); - } + }; const handleOpen = () => { setOpen(true); @@ -982,165 +990,173 @@ const JoinCourse = () => {
{toasterMessage && } - - - + - {t("ENROLLMENT_SUCCESS_MESSAGE")} - - - - + {t("ENROLLMENT_SUCCESS_MESSAGE")} + + + - {t("UNENROLLMENT_SUCCESS_MESSAGE")} - - - - { - if (reason === "backdropClick" || reason === "escapeKeyDown") { - setOpenModal(true); - } else { - handleCloseModal(); - } - }} - > - - - {t("CONSENT_FORM_TITLE")} - - - - - - - - - - - - + {t("UNENROLLMENT_SUCCESS_MESSAGE")} + + + + { + if (reason === "backdropClick" || reason === "escapeKeyDown") { + setOpenModal(true); + } else { + handleCloseModal(); + } + }} + > + + + {t("CONSENT_FORM_TITLE")} + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + Speaker One + - - - - - - - - - - - Speaker One - - - - - - - + - {t("ALL_CONTENT")} - - - {userData?.result?.content?.name} - - - - - {" "} - {userData?.result?.content?.name} - + + {t("ALL_CONTENT")} + + + {userData?.result?.content?.name} + + + + + {" "} + {userData?.result?.content?.name} + - {(courseData?.result?.content?.board || - courseData?.result?.content?.se_boards || - courseData?.result?.content?.gradeLevel || - courseData?.result?.content?.se_gradeLevels) && ( + {(courseData?.result?.content?.board || + courseData?.result?.content?.se_boards || + courseData?.result?.content?.gradeLevel || + courseData?.result?.content?.se_gradeLevels) && ( { color: "#424242", fontSize: "10px", margin: "0 10px 3px 6px", - cursor: "auto" + cursor: "auto", }} className="bg-blueShade3" > @@ -1166,21 +1182,23 @@ const JoinCourse = () => { ))} {courseData?.result?.content?.se_boards && - courseData?.result?.content?.se_boards?.map((item, index) => ( - - ))} + courseData?.result?.content?.se_boards?.map( + (item, index) => ( + + ) + )} {courseData?.result?.content?.gradeLevel && courseData?.result?.content?.gradeLevel?.map( (item, index) => ( @@ -1191,7 +1209,7 @@ const JoinCourse = () => { color: "#424242", fontSize: "10px", margin: "0 10px 3px 6px", - cursor: "auto" + cursor: "auto", }} className="bg-blueShade3" > @@ -1209,7 +1227,7 @@ const JoinCourse = () => { color: "#424242", fontSize: "10px", margin: "0 10px 3px 6px", - cursor: "auto" + cursor: "auto", }} className="bg-blueShade3" > @@ -1219,80 +1237,144 @@ const JoinCourse = () => { )} )} - {renderActionButton()} - - - {t("BATCH_DETAILS")}: - + {renderActionButton()} - {t("BATCH_START_DATE")}:{" "} - {batchData?.startDate - ? formatDate(batchData?.startDate) - : "Not Provided"} + {t("BATCH_DETAILS")}: - - {t("BATCH_END_DATE")}:{" "} - {batchData?.endDate - ? formatDate(batchData?.endDate) - : "Not Provided"} - - + {t("BATCH_START_DATE")}:{" "} + {batchData?.startDate + ? formatDate(batchData?.startDate) + : "Not Provided"} + + + {t("BATCH_END_DATE")}:{" "} + {batchData?.endDate + ? formatDate(batchData?.endDate) + : "Not Provided"} + + + {t("LAST_DATE_FOR_ENROLLMENT")}:{" "} + {batchData?.enrollmentEndDate + ? formatDate(batchData.enrollmentEndDate) + : "Not Provided"} + + + + {batchDetails && batchDetails.cert_templates != null && ( + - {t("LAST_DATE_FOR_ENROLLMENT")}:{" "} - {batchData?.enrollmentEndDate - ? formatDate(batchData.enrollmentEndDate) - : "Not Provided"} - - - - {batchDetails && batchDetails.cert_templates != null && + } + aria-controls="panel1-content" + id="panel1-header" + className="xs-hide h4-title" + > + {t("CERTIFICATION_CRITERIA")} + + + {batchDetail && ( +
    +
  • + {t("COMPLETION_CERTIFICATE_ISSUED")} +
  • + {score !== "no certificate" && ( +
  • + {t("CERT_ISSUED_SCORE")} + {` ${score}% `} + {t("ASSESSMENT")} +
  • + )} +
+ )} +
+ + )} + {isEnrolled && + batchDetails && + batchDetails.cert_templates == null && ( + + + {t("CERT_NOT_ATTACHED")} + + + )} { expandIcon={} aria-controls="panel1-content" id="panel1-header" - className="xs-hide h4-title" + className="h4-title" > - {t("CERTIFICATION_CRITERIA")} + {t("OTHER_DETAILS")} - - {batchDetail && ( -
    -
  • - {t("COMPLETION_CERTIFICATE_ISSUED")} -
  • - {score !== "no certificate" && ( -
  • - {t("CERT_ISSUED_SCORE")} - {` ${score}% `} - {t("ASSESSMENT")} -
  • + + + {t("Created By")}:{" "} + {userData && + userData.result && + userData.result.content.creator} + + + {t("Published on NULP by")}:{" "} + {userData && + userData.result && + userData.result?.content?.orgDetails?.orgName} + + + {t("CREATED_ON")}:{" "} + {userData && + userData.result && + formatDate(userData.result.content.children[0].createdOn)} + + + {t("UPDATED_ON")}:{" "} + {userData && + userData.result && + formatDate( + userData.result.content.children[0].lastUpdatedOn )} -
- )} -
-
- } - - - {isEnrolled && batchDetails && batchDetails.cert_templates == null && - - - - {t("CERT_NOT_ATTACHED")} - - - - } - - } - aria-controls="panel1-content" - id="panel1-header" - className="h4-title" - > - {t("OTHER_DETAILS")} - - - - {t("Created By")}:{" "} - {userData && - userData.result && - userData.result.content.creator - } - - - {t("Published on NULP by")}:{" "} - {userData && - userData.result && - userData.result?.content?.orgDetails?.orgName - } - - - {t("CREATED_ON")}:{" "} - {userData && - userData.result && - formatDate(userData.result.content.children[0].createdOn)} - - - {t("UPDATED_ON")}:{" "} - {userData && - userData.result && - formatDate( - userData.result.content.children[0].lastUpdatedOn - )} - - - - {t("CREDITS")} - - - {t("CREDITS")} - -

- {t("COPYRIGHT")} -

- {userData?.result?.content?.orgDetails?.orgName && userData?.result?.content?.copyrightYear - ? `${userData.result.content.orgDetails.orgName}, ${userData.result.content.copyrightYear}` - : userData?.result?.content?.orgDetails?.orgName || userData?.result?.content?.copyrightYear - } -
{t("THIS_CONTENT_IS_DERIVED_FROM")}
-

- {t("CONTENT")} -

- {userData?.result?.content?.name} -

- {t("LICENSE_TERMS")} -

- {userData?.result?.content?.licenseDetails?.name} -

- {t("PUBLISHED_ON_NULP_BY")} -

- {userData?.result?.content?.orgDetails?.orgName} -
- - - -
- - {t("LICENSE_TERMS")}:{" "} - {userData?.result?.content?.licenseDetails?.name} - {t("FOR_DETAILS")}:{" "} - - {userData?.result?.content?.licenseDetails?.url} - - -
-
- + -
- - {chat.length === 0 && ( - - )} - {chat.length > 0 && chat[0]?.is_accepted === false && ( - - - {t("YOUR_CHAT_REQUEST_IS_PENDING")} - + {t("CREDITS")} + + + {t("CREDITS")} + +

+ {t("COPYRIGHT")} +

+ {userData?.result?.content?.orgDetails?.orgName && + userData?.result?.content?.copyrightYear + ? `${userData.result.content.orgDetails.orgName}, ${userData.result.content.copyrightYear}` + : userData?.result?.content?.orgDetails?.orgName || + userData?.result?.content?.copyrightYear} +
{t("THIS_CONTENT_IS_DERIVED_FROM")}
+

+ {t("CONTENT")} +

+ {userData?.result?.content?.name} +

+ {t("LICENSE_TERMS")} +

+ {userData?.result?.content?.licenseDetails?.name} +

+ {t("PUBLISHED_ON_NULP_BY")} +

+ {userData?.result?.content?.orgDetails?.orgName} +
+ + + +
+ + {t("LICENSE_TERMS")}:{" "} + {userData?.result?.content?.licenseDetails?.name} + {t("FOR_DETAILS")}:{" "} + + {userData?.result?.content?.licenseDetails?.url} + + + + + +
+ + {chat.length === 0 && ( + )} + {chat.length > 0 && chat[0]?.is_accepted === false && ( + + + {t("YOUR_CHAT_REQUEST_IS_PENDING")} + + + + )} + {chat.length > 0 && chat[0].is_accepted === true && ( + - - )} - {chat.length > 0 && chat[0].is_accepted === true && ( - + )} + + {_userId && creatorId && ( + +
+ {" "} +
+
)} - - {_userId && creatorId && ( - -
- {" "} -
-
- )} -
- - - - - - - - - - - - Twitter - - - - - - {" "} - {renderActionButton()} - - - {courseData && courseData?.result?.content && ( - <> - - {t("DESCRIPTION")}: - - +
+ + + + + + + + + + + + Twitter + + + + + + {" "} + {renderActionButton()} + + + {courseData && courseData?.result?.content && ( + <> + + {t("DESCRIPTION")}: + + + {courseData?.result?.content?.description.split(" ") + .length > 100 + ? showMore + ? courseData?.result?.content?.description + : courseData?.result?.content?.description + .split(" ") + .slice(0, 30) + .join(" ") + "..." + : courseData?.result?.content?.description} + {courseData?.result?.content?.description.split(" ") - .length > 100 - ? showMore - ? courseData?.result?.content?.description - : courseData?.result?.content?.description - .split(" ") - .slice(0, 30) - .join(" ") + "..." - : courseData?.result?.content?.description} - - {courseData?.result?.content?.description.split(" ").length > - 100 && ( + .length > 100 && ( )} - - )} - + + )} + - - } - aria-controls="panel1-content" - id="panel1-header" - className="h4-title" - style={{ fontWeight: "500" }} + - {t("COURSES_MODULE")} - - - {userData?.result?.content?.children.map((faqIndex) => ( - - } - aria-controls={`panel${faqIndex.id}-content`} - id={`panel${faqIndex.id}-header`} - className="h5-title" + } + aria-controls="panel1-content" + id="panel1-header" + className="h4-title" + style={{ fontWeight: "500" }} + > + {t("COURSES_MODULE")} + + + {userData?.result?.content?.children.map((faqIndex) => ( + - {faqIndex.name} - + } + aria-controls={`panel${faqIndex.id}-content`} + id={`panel${faqIndex.id}-header`} + className="h5-title" + > + {faqIndex.name} + - + {/* If it's not a content collection, render it like a clickable child */} - {faqIndex.mimeType !== "application/vnd.ekstep.content-collection" ? ( + {faqIndex.mimeType !== + "application/vnd.ekstep.content-collection" ? ( { className="h6-title" > {faqIndex.name} - {completedContents.includes(faqIndex.identifier) && ( + {completedContents.includes( + faqIndex.identifier + ) && ( )} - ) : ( - faqIndex?.children?.map((faqIndexname) => ( - - {faqIndexname.children && - faqIndexname.children.length > 0 ? ( - - {faqIndexname.name} - - ) : ( - handleLinkClick(faqIndexname.identifier)} - className="h6-title" + ) : ( + faqIndex?.children?.map((faqIndexname) => ( + - {faqIndexname.name} - {completedContents.includes(faqIndexname.identifier) && ( - - )} - - )} - - {faqIndexname.children && - faqIndexname.children.length > 0 && ( -
- {faqIndexname.children.map((child) => ( - - {child.children && - child.children.length > 0 ? ( - - {child.name} - - ) : ( - - handleLinkClick(child.identifier) - } - className="h6-title" + {faqIndexname.children && + faqIndexname.children.length > 0 ? ( + + {faqIndexname.name} + + ) : ( + + handleLinkClick(faqIndexname.identifier) + } + className="h6-title" + > + {faqIndexname.name} + {completedContents.includes( + faqIndexname.identifier + ) && ( + + )} + + )} + + {faqIndexname.children && + faqIndexname.children.length > 0 && ( +
+ {faqIndexname.children.map((child) => ( + - {child.name} - {completedContents.includes( - child.identifier - ) && ( - - )} - - )} - {child.children && - child.children.length > 0 && ( -
- {child.children.map((grandchild) => ( - 0 ? ( + + {child.name} + + ) : ( + + handleLinkClick(child.identifier) + } + className="h6-title" + > + {child.name} + {completedContents.includes( + child.identifier + ) && ( + + )} + + )} + {child.children && + child.children.length > 0 && ( +
- {grandchild.children && - grandchild.children.length > 0 ? ( - - {grandchild.name} - - ) : ( - - handleLinkClick( - grandchild.identifier - ) - } - className="h6-title" - > - {grandchild.name} - {completedContents.includes( - grandchild.identifier - ) && ( - ( + + {grandchild.children && + grandchild.children.length > + 0 ? ( + + {grandchild.name} + + ) : ( + + onClick={() => + handleLinkClick( + grandchild.identifier + ) + } + className="h6-title" + > + {grandchild.name} + {completedContents.includes( + grandchild.identifier + ) && ( + + )} + )} - + + ) )} - - ))} -
- )} -
- ))} -
- )} -
- )) - )} +
+ )} +
+ ))} +
+ )} +
+ )) + )} +
+
+ ))}
- ))} - - - - - - - - {t("BATCH_DETAILS")}: - - {t("BATCH_START_DATE")}: {formatDate(batchData?.startDate)} + {t("BATCH_DETAILS")}: - - {t("BATCH_END_DATE")}: {formatDate(batchData?.endDate)} - - + {t("BATCH_START_DATE")}: {formatDate(batchData?.startDate)} + + + {t("BATCH_END_DATE")}: {formatDate(batchData?.endDate)} + + + {t("LAST_DATE_FOR_ENROLLMENT")}:{" "} + {formatDate(batchData?.enrollmentEndDate)} + + + + {batchDetails && batchDetails.cert_templates != null && ( + - {t("LAST_DATE_FOR_ENROLLMENT")}:{" "} - {formatDate(batchData?.enrollmentEndDate)} - - - - {batchDetails && batchDetails.cert_templates != null && + } + aria-controls="panel1-content" + id="panel1-header" + className="h4-title" + > + {t("CERTIFICATION_CRITERIA")} + + + {batchDetail && ( +
    +
  • + {t("COMPLETION_CERTIFICATE_ISSUED")} +
  • + {score !== "no certificate" && ( +
  • + {t("CERT_ISSUED_SCORE")} + {` ${score}% `} + {t("ASSESSMENT")} +
  • + )} +
+ )} +
+
+ )} + {isEnrolled && + batchDetails && + batchDetails.cert_templates == null && ( + + + {t("CERT_NOT_ATTACHED")}: + + + )} { id="panel1-header" className="h4-title" > - {t("CERTIFICATION_CRITERIA")} + {t("OTHER_DETAILS")} { borderRadius: "10px", }} > - {batchDetail && ( -
    -
  • - {t("COMPLETION_CERTIFICATE_ISSUED")} -
  • - {score !== "no certificate" && ( -
  • - {t("CERT_ISSUED_SCORE")} - {` ${score}% `} - {t("ASSESSMENT")} -
  • + + {t("CREATED_ON")}:{" "} + {courseData && + courseData.result && + formatDate( + courseData.result.content.children[0].createdOn )} -
- )} + + + {t("UPDATED_ON")}:{" "} + {courseData && + courseData.result && + formatDate( + courseData.result.content.children[0].lastUpdatedOn + )} + + {t("CREDITS")}: + + {t("LICENSE_TERMS")}:{" "} + {courseData?.result?.content?.licenseDetails?.name} + {t("FOR_DETAILS")}:{" "} + + {courseData?.result?.content?.licenseDetails?.url} + +
- } - - {isEnrolled && batchDetails && batchDetails.cert_templates == null && - - - - {t("CERT_NOT_ATTACHED")}: - - - - } - - } - aria-controls="panel1-content" - id="panel1-header" - className="h4-title" - > - {t("OTHER_DETAILS")} - - - - {t("CREATED_ON")}:{" "} - {courseData && - courseData.result && - formatDate(courseData.result.content.children[0].createdOn)} - - - {t("UPDATED_ON")}:{" "} - {courseData && - courseData.result && - formatDate( - courseData.result.content.children[0].lastUpdatedOn +
+ + {chat && chat.length === 0 && ( + + )} + {chat && + chat.length > 0 && + chat[0]?.is_accepted === false && ( + + + {t("YOUR_CHAT_REQUEST_IS_PENDING")} + + + )} - - {t("CREDITS")}: - - {t("LICENSE_TERMS")}:{" "} - {courseData?.result?.content?.licenseDetails?.name} - {t("FOR_DETAILS")}:{" "} - - {courseData?.result?.content?.licenseDetails?.url} - - - - -
- - {chat && chat.length === 0 && ( - - )} - {chat && chat.length > 0 && chat[0]?.is_accepted === false && ( - - - {t("YOUR_CHAT_REQUEST_IS_PENDING")} - + {chat && chat.length > 0 && chat[0].is_accepted === true && ( - - )} - {chat && chat.length > 0 && chat[0].is_accepted === true && ( - + )} + + {_userId && creatorId && ( + +
+ {" "} +
+
)} - - {_userId && creatorId && ( - -
- {" "} -
-
- )} -
- - - - - - - - - - - - Twitter - - +
+ + + + + + + + + + + + Twitter + + +
- - - + +