From 7c25a46dc126c4cb32b3304b477f173cb4f54823 Mon Sep 17 00:00:00 2001 From: sonaligarud Date: Fri, 13 Sep 2024 17:42:44 +0530 Subject: [PATCH 1/4] Task #226404 - [FE] - Few urls and configurations are hardcoded, need to update those using config files --- .../public/locales/be/translation.json | 6 +- .../public/locales/en/translation.json | 9 +- .../public/locales/gg/translation.json | 8 +- .../public/locales/hi/translation.json | 6 +- .../public/locales/ma/translation.json | 7 +- .../public/locales/mal/translation.json | 6 +- .../public/locales/ta/translation.json | 6 +- .../public/locales/te/translation.json | 6 +- packages/nulp_elite/src/App.js | 16 +-- .../src/components/FeedbackPopup.js | 53 --------- .../nulp_elite/src/components/VotingCard.js | 26 ----- .../nulp_elite/src/configs/urlConfig.json | 1 + .../src/pages/connections/AddConnections.js | 36 ------ .../nulp_elite/src/pages/connections/chat.js | 1 - .../src/pages/connections/message.js | 79 +------------ .../nulp_elite/src/pages/content/Player.js | 1 - .../src/pages/content/joinCourse.js | 99 +---------------- .../src/pages/events/eventDetails.js | 32 +----- .../nulp_elite/src/pages/profile/Profile.js | 40 +------ .../src/pages/profile/certificate.js | 4 +- packages/nulp_elite/src/pages/profileData.js | 95 +--------------- .../nulp_elite/src/pages/registration/Otp.js | 8 +- .../src/pages/registration/Registration.js | 7 +- .../src/pages/voting/votingDashboard.js | 2 - .../src/pages/voting/votingDetails.js | 104 +----------------- 25 files changed, 63 insertions(+), 595 deletions(-) diff --git a/packages/nulp_elite/public/locales/be/translation.json b/packages/nulp_elite/public/locales/be/translation.json index 281922aa..1d88a009 100644 --- a/packages/nulp_elite/public/locales/be/translation.json +++ b/packages/nulp_elite/public/locales/be/translation.json @@ -296,5 +296,9 @@ "ADMIN":"অ্যাডমিন", "LEARNING_REPORT":"লার্নিং রিপোর্ট", "POPULAR_COURSES" : "জনপ্রিয় কোর্স", - "RECENTLY_ADDED":"সম্প্রতি যোগ করা হয়েছে" + "RECENTLY_ADDED":"সম্প্রতি যোগ করা হয়েছে", + "THIS_CONTENT_IS_DERIVED_FROM":"এই বিষয়বস্তুটি এখান থেকে নেওয়া হয়েছে", + "PUBLISHED_ON_NULP_BY":"NULP-এ প্রকাশিত", + "ACCEPT_THE_NULP_TERMS_OF_USE" : "আমার বয়স 18+ বছর এবং আমি NULP ব্যবহারের শর্তাবলী বুঝি এবং স্বীকার করি", + "As_A_PATENT_GUARDIAN_ACCEPT_THE_NULP_TERMS_OF_USE": "একজন পিতা-মাতা/অভিভাবক হিসাবে আমি NULP ব্যবহারের শর্তাবলী বুঝি এবং স্বীকার করি যে আমার সন্তান প্রদত্ত তথ্যের সাথে NULP-এ নিবন্ধন করতে সম্মত।" } diff --git a/packages/nulp_elite/public/locales/en/translation.json b/packages/nulp_elite/public/locales/en/translation.json index caa9959c..b505f50a 100644 --- a/packages/nulp_elite/public/locales/en/translation.json +++ b/packages/nulp_elite/public/locales/en/translation.json @@ -227,7 +227,7 @@ "OK": "Ok", "BLOCK_USER_LIST": "Block user list", "ARE_YOU_SURE_YOU_WANT_TO_REJECT_THIS_REQUEST": " Are you sure you want to reject this request?", - "ARE_YOU_SURE_YOU_WANT_TO_BLOCK_THIS_USER": " Are you sure you want to block this user?", + "ARE_YOU_SURE_YOU_WANT_TO_BLOCK_THIS_USER": "Are you sure you want to block this user?", "CONNECT_WITH_THEM_TO_GET_INSIGHTS": "Connect with them to get insights on what they do or simply answers to your question!", "NO_RESULT_FOUND": "No result Found", "WEBINAR": "Events", @@ -316,6 +316,9 @@ "ADMIN":"Admin", "LEARNING_REPORT":"Learning Report", "POPULAR_COURSES" : "Popular Courses", - "RECENTLY_ADDED":"Recently Added" - + "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." } diff --git a/packages/nulp_elite/public/locales/gg/translation.json b/packages/nulp_elite/public/locales/gg/translation.json index 1789539b..8d831d1b 100644 --- a/packages/nulp_elite/public/locales/gg/translation.json +++ b/packages/nulp_elite/public/locales/gg/translation.json @@ -306,7 +306,9 @@ "ADMIN":"એડમિન", "LEARNING_REPORT":"લર્નિંગ રિપોર્ટ", "POPULAR_COURSES" : "લોકપ્રિય અભ્યાસક્રમો", - "RECENTLY_ADDED":"તાજેતરમાં ઉમેરાયેલ" - - + "RECENTLY_ADDED":"તાજેતરમાં ઉમેરાયેલ", + "THIS_CONTENT_IS_DERIVED_FROM":"આ સામગ્રી આમાંથી લેવામાં આવી છે", + "PUBLISHED_ON_NULP_BY":"NULP દ્વારા પ્રકાશિત", + "ACCEPT_THE_NULP_TERMS_OF_USE" : "હું 18+ વર્ષનો છું અને NULP ઉપયોગની શરતો સમજું છું અને સ્વીકારું છું", + "As_A_PATENT_GUARDIAN_ACCEPT_THE_NULP_TERMS_OF_USE": "માતાપિતા/વાલી તરીકે હું NULP ઉપયોગની શરતોને સમજું છું અને સ્વીકારું છું અને સ્વીકારું છું કે મારા બાળકને આપેલ માહિતી સાથે NULP પર નોંધણી કરાવવા માટે સંમત થાઓ." } diff --git a/packages/nulp_elite/public/locales/hi/translation.json b/packages/nulp_elite/public/locales/hi/translation.json index 39945995..3abf4b93 100644 --- a/packages/nulp_elite/public/locales/hi/translation.json +++ b/packages/nulp_elite/public/locales/hi/translation.json @@ -298,5 +298,9 @@ "ADMIN":"व्यवस्थापक", "LEARNING_REPORT":"सीखने की रिपोर्ट", "POPULAR_COURSES" : "लोकप्रिय पाठ्यक्रम", - "RECENTLY_ADDED":"हाल ही में जोड़ा" + "RECENTLY_ADDED":"हाल ही में जोड़ा", + "THIS_CONTENT_IS_DERIVED_FROM":"यह सामग्री इससे ली गई है", + "PUBLISHED_ON_NULP_BY":"NULP BY पर प्रकाशित", + "ACCEPT_THE_NULP_TERMS_OF_USE" : "मैं 18+ वर्ष का हूं और NULP उपयोग की शर्तों को समझता हूं और स्वीकार करता हूं", + "As_A_PATENT_GUARDIAN_ACCEPT_THE_NULP_TERMS_OF_USE": "एक माता-पिता/अभिभावक के रूप में मैं NULP उपयोग की शर्तों को समझता हूं और स्वीकार करता हूं और अपने बच्चे को दी गई जानकारी के साथ NULP पर पंजीकरण करने के लिए सहमत करता हूं।" } diff --git a/packages/nulp_elite/public/locales/ma/translation.json b/packages/nulp_elite/public/locales/ma/translation.json index ab5008b1..7fe256c4 100644 --- a/packages/nulp_elite/public/locales/ma/translation.json +++ b/packages/nulp_elite/public/locales/ma/translation.json @@ -298,6 +298,9 @@ "ADMIN":"प्रशासक", "LEARNING_REPORT":"शिकण्याचा अहवाल", "POPULAR_COURSES" : "लोकप्रिय अभ्यासक्रम", - "RECENTLY_ADDED":"अलीकडे जोडले" - + "RECENTLY_ADDED":"अलीकडे जोडले", + "THIS_CONTENT_IS_DERIVED_FROM":"ही सामग्री येथून घेतली आहे", + "PUBLISHED_ON_NULP_BY":"NULP द्वारे प्रकाशित", + "ACCEPT_THE_NULP_TERMS_OF_USE" : "मी 18+ वर्षांचा आहे आणि NULP वापरण्याच्या अटी समजतो आणि स्वीकारतो", + "As_A_PATENT_GUARDIAN_ACCEPT_THE_NULP_TERMS_OF_USE": "पालक/पालक म्हणून मी NULP वापराच्या अटी समजतो आणि स्वीकारतो आणि माझ्या मुलाने दिलेल्या माहितीसह NULP वर नोंदणी करण्यास सहमती देतो." } diff --git a/packages/nulp_elite/public/locales/mal/translation.json b/packages/nulp_elite/public/locales/mal/translation.json index 1871c15b..a77e0629 100644 --- a/packages/nulp_elite/public/locales/mal/translation.json +++ b/packages/nulp_elite/public/locales/mal/translation.json @@ -298,5 +298,9 @@ "ADMIN":"അഡ്മിൻ", "LEARNING_REPORT":"പഠന റിപ്പോർട്ട്", "POPULAR_COURSES" : "ജനപ്രിയ കോഴ്സുകൾ", - "RECENTLY_ADDED":"അടുത്തിടെ ചേർത്തത് " + "RECENTLY_ADDED":"അടുത്തിടെ ചേർത്തത് ", + "THIS_CONTENT_IS_DERIVED_FROM":"ഈ ഉള്ളടക്കം ഉരുത്തിരിഞ്ഞത്", + "PUBLISHED_ON_NULP_BY":"NULP-ൽ പ്രസിദ്ധീകരിച്ചത്", + "ACCEPT_THE_NULP_TERMS_OF_USE" : "എനിക്ക് 18+ വയസ്സുണ്ട്, NULP ഉപയോഗ നിബന്ധനകൾ മനസ്സിലാക്കുകയും അംഗീകരിക്കുകയും ചെയ്യുന്നു", + "As_A_PATENT_GUARDIAN_ACCEPT_THE_NULP_TERMS_OF_USE": "ഒരു രക്ഷിതാവ്/രക്ഷകൻ എന്ന നിലയിൽ, NULP ഉപയോഗ നിബന്ധനകൾ ഞാൻ മനസ്സിലാക്കുകയും അംഗീകരിക്കുകയും ചെയ്യുന്നു, തന്നിരിക്കുന്ന വിവരങ്ങൾക്കൊപ്പം NULP-ൽ രജിസ്റ്റർ ചെയ്യാൻ എൻ്റെ കുട്ടി സമ്മതിക്കുന്നു." } diff --git a/packages/nulp_elite/public/locales/ta/translation.json b/packages/nulp_elite/public/locales/ta/translation.json index 47b20a4e..eccda7e2 100644 --- a/packages/nulp_elite/public/locales/ta/translation.json +++ b/packages/nulp_elite/public/locales/ta/translation.json @@ -323,5 +323,9 @@ "ADMIN":"நிர்வாகி", "LEARNING_REPORT":"கற்றல் அறிக்கை", "POPULAR_COURSES" : " జనాదరణ పొందిన కోర్సులు", - "RECENTLY_ADDED":"ఇటీవల జోడించబడింది" + "RECENTLY_ADDED":"ఇటీవల జోడించబడింది", + "THIS_CONTENT_IS_DERIVED_FROM":"இந்த உள்ளடக்கம் இதிலிருந்து பெறப்பட்டது", + "PUBLISHED_ON_NULP_BY":"NULP ஆல் வெளியிடப்பட்டது", + "ACCEPT_THE_NULP_TERMS_OF_USE" : "எனக்கு 18+ வயது மற்றும் NULP பயன்பாட்டு விதிமுறைகளைப் புரிந்து ஏற்றுக்கொள்கிறேன்", + "As_A_PATENT_GUARDIAN_ACCEPT_THE_NULP_TERMS_OF_USE": "ஒரு பெற்றோர்/பாதுகாவலராக நான் NULP பயன்பாட்டு விதிமுறைகளைப் புரிந்துகொண்டு ஏற்றுக்கொள்கிறேன், கொடுக்கப்பட்ட தகவலுடன் NULP இல் பதிவுசெய்ய என் குழந்தை ஒப்புக்கொள்கிறேன்." } diff --git a/packages/nulp_elite/public/locales/te/translation.json b/packages/nulp_elite/public/locales/te/translation.json index 3d82c98d..13e6ed40 100644 --- a/packages/nulp_elite/public/locales/te/translation.json +++ b/packages/nulp_elite/public/locales/te/translation.json @@ -261,5 +261,9 @@ "ADMIN":"నిర్వాహకుడు", "LEARNING_REPORT":"లెర్నింగ్ రిపోర్ట్", "POPULAR_COURSES" : "జనాదరణ పొందిన కోర్సులు", - "RECENTLY_ADDED":"ఇటీవల జోడించబడింది" + "RECENTLY_ADDED":"ఇటీవల జోడించబడింది", + "THIS_CONTENT_IS_DERIVED_FROM":"ఈ కంటెంట్ దీని నుండి తీసుకోబడింది", + "PUBLISHED_ON_NULP_BY":"NULP ద్వారా ప్రచురించబడింది", + "ACCEPT_THE_NULP_TERMS_OF_USE" : "నాకు 18+ సంవత్సరాలు మరియు NULP ఉపయోగ నిబంధనలను అర్థం చేసుకుని, అంగీకరిస్తున్నాను", + "As_A_PATENT_GUARDIAN_ACCEPT_THE_NULP_TERMS_OF_USE": "తల్లిదండ్రులుగా/సంరక్షకుడిగా నేను NULP ఉపయోగ నిబంధనలను అర్థం చేసుకున్నాను & అంగీకరిస్తున్నాను, అందించిన సమాచారంతో NULPలో నమోదు చేసుకోవడానికి నా బిడ్డ అంగీకరిస్తున్నాను." } diff --git a/packages/nulp_elite/src/App.js b/packages/nulp_elite/src/App.js index f4635f6f..104fe33d 100644 --- a/packages/nulp_elite/src/App.js +++ b/packages/nulp_elite/src/App.js @@ -1,26 +1,13 @@ import React, { useEffect, useState } from "react"; - import "./App.css"; import "./styles/style.css"; import { NativeBaseProvider, - Box, - Stack, - VStack, - Text, - HStack, - Button, - extendTheme, - Actionsheet, - ScrollView, } from "native-base"; import { BrowserRouter as Router, Route, Routes } from "react-router-dom"; -import { DEFAULT_THEME, H2, initializeI18n } from "@shiksha/common-lib"; -import { useTranslation, initReactI18next } from "react-i18next"; -import i18n from "i18next"; +import { initializeI18n } from "@shiksha/common-lib"; import * as util from "services/utilService"; -// import { ChakraProvider } from "@chakra-ui/react"; import Profile from "pages/profile/Profile"; import Certificate from "pages/profile/certificate"; import FAQPage from "pages/FAQPage"; @@ -48,7 +35,6 @@ import Dashboard from "pages/events/dashboard"; import VotingList from "pages/voting/votingList"; import createForm from "pages/voting/createForm"; import VotingDetails from "pages/voting/votingDetails"; -import { truncate } from "lodash"; import votingDashboard from "pages/voting/votingDashboard"; import pollsDetails from "pages/voting/pollsDetails"; const urlConfig = require("./configs/urlConfig.json"); diff --git a/packages/nulp_elite/src/components/FeedbackPopup.js b/packages/nulp_elite/src/components/FeedbackPopup.js index 446c7d92..6eec6bf3 100644 --- a/packages/nulp_elite/src/components/FeedbackPopup.js +++ b/packages/nulp_elite/src/components/FeedbackPopup.js @@ -13,7 +13,6 @@ import { TextField, } from "@mui/material"; import StarIcon from "@mui/icons-material/Star"; -import { styled } from "@mui/material/styles"; import IconButton from "@mui/material/IconButton"; import CloseIcon from "@mui/icons-material/Close"; import * as util from "../../src/services/utilService"; @@ -28,14 +27,6 @@ const FeedbackPopup = ({ open, onClose, contentId }) => { const [checkboxes, setCheckboxes] = useState({}); const _userId = util.userId(); - // const BootstrapDialog = styled(Dialog)(({ theme }) => ({ - // "& .MuiDialogContent-root": { - // padding: theme.spacing(2), - // }, - // "& .MuiDialogActions-root": { - // padding: theme.spacing(1), - // }, - // })); // Mapping of checkbox names to labels const checkboxLabels = { conceptWell: "Understood the concept well", @@ -112,21 +103,12 @@ const FeedbackPopup = ({ open, onClose, contentId }) => { }; const response = await axios.post(url, request); - console.log("response.data", response.data); - - console.log("Rating:", rating); - console.log("Selected Checkboxes:", selectedCheckboxes); - console.log("Additional Feedback:", additionalFeedback); - onClose(); } catch (error) { console.error("Error submitting feedback:", error); } }; - // const handleClose = () => { - // setOpen(false); - // }; const renderCheckboxes = () => { if (rating >= 5) { @@ -338,41 +320,6 @@ const FeedbackPopup = ({ open, onClose, contentId }) => { - - // - // Feedback - // - // Rate Us - // - // } - // emptyIcon={} - // precision={1} - // /> - // - // {rating} {rating === 1 ? "star" : "stars"} - // - // - // - // {ratingMessages[rating]} - // - // {renderCheckboxes()} - // - // - // - // - // - // ); }; diff --git a/packages/nulp_elite/src/components/VotingCard.js b/packages/nulp_elite/src/components/VotingCard.js index 7ab0bcc8..1b7be2b2 100644 --- a/packages/nulp_elite/src/components/VotingCard.js +++ b/packages/nulp_elite/src/components/VotingCard.js @@ -4,7 +4,6 @@ import CardContent from "@mui/material/CardContent"; import Button from "@mui/material/Button"; import Typography from "@mui/material/Typography"; import Box from "@mui/material/Box"; -import Modal from "@mui/material/Modal"; import { useTranslation } from "react-i18next"; import TodayOutlinedIcon from "@mui/icons-material/TodayOutlined"; import ArrowForwardIosOutlinedIcon from "@mui/icons-material/ArrowForwardIosOutlined"; @@ -20,7 +19,6 @@ import { } from "react-share"; import { styled } from "@mui/material/styles"; import Dialog from "@mui/material/Dialog"; -import DialogTitle from "@mui/material/DialogTitle"; import DialogContent from "@mui/material/DialogContent"; import DialogActions from "@mui/material/DialogActions"; import IconButton from "@mui/material/IconButton"; @@ -96,16 +94,6 @@ export default function VotingCard({ items, index, onClick }) { }; const isVotingEnded = new Date(items.end_date) < new Date(); - - const formatDate = (dateString) => { - const date = new Date(dateString); - return date.toLocaleDateString("en-GB", { - day: "2-digit", - month: "long", - year: "numeric", - }); - }; - const fetchPoll = async (pollId) => { try { const response = await axios.get( @@ -250,13 +238,6 @@ export default function VotingCard({ items, index, onClick }) { )} - {/* - App Icon - */} @@ -368,13 +349,6 @@ export default function VotingCard({ items, index, onClick }) { - {/* - App Icon - */} {pollResult?.map((option, index) => ( diff --git a/packages/nulp_elite/src/configs/urlConfig.json b/packages/nulp_elite/src/configs/urlConfig.json index cb2b1894..4650f216 100644 --- a/packages/nulp_elite/src/configs/urlConfig.json +++ b/packages/nulp_elite/src/configs/urlConfig.json @@ -49,6 +49,7 @@ "framework": "board,gradeLevel,medium,class,subject" }, "URLS": { + "CUSTOM_EVENT_FETCH_RECORDINGS":"/custom_event/fetch_recordings?event_id=", "LEARNER_PREFIX": "/learner/", "DISCUSSIONS_FORUM_PREFIX": "/discussion/", "DEVICE_PREFIX": "/device/", diff --git a/packages/nulp_elite/src/pages/connections/AddConnections.js b/packages/nulp_elite/src/pages/connections/AddConnections.js index 7307710d..265330d0 100644 --- a/packages/nulp_elite/src/pages/connections/AddConnections.js +++ b/packages/nulp_elite/src/pages/connections/AddConnections.js @@ -15,7 +15,6 @@ import TextField from "@mui/material/TextField"; import Divider from "@mui/material/Divider"; import Box from "@mui/material/Box"; import Typography from "@mui/material/Typography"; -import Search from "components/search"; import { useLocation, Navigate, useNavigate } from "react-router-dom"; import * as util from "../../services/utilService"; import Header from "components/header"; @@ -24,7 +23,6 @@ import CheckCircleOutlineIcon from "@mui/icons-material/CheckCircleOutline"; import CancelOutlinedIcon from "@mui/icons-material/CancelOutlined"; import { useTranslation } from "react-i18next"; import { useStore } from "configs/zustandStore"; -import { Link as RouterLink } from "react-router-dom"; import Pagination from "@mui/material/Pagination"; import Popover from "@mui/material/Popover"; import { Container } from "@mui/material"; @@ -35,14 +33,12 @@ const designations = require("../../configs/designations.json"); const urlConfig = require("../../configs/urlConfig.json"); import Autocomplete from "@mui/material/Autocomplete"; import ToasterCommon from "../ToasterCommon"; -import ForumOutlinedIcon from "@mui/icons-material/ForumOutlined"; import Grid from "@mui/material/Grid"; import Chat from "./chat"; import Dialog from "@material-ui/core/Dialog"; import DialogActions from "@material-ui/core/DialogActions"; import DialogContent from "@material-ui/core/DialogContent"; import DialogContentText from "@material-ui/core/DialogContentText"; -import DialogTitle from "@material-ui/core/DialogTitle"; import FloatingChatIcon from "components/FloatingChatIcon"; const routeConfig = require("../../configs/routeConfig.json"); // Define modal styles @@ -1281,7 +1277,6 @@ const AddConnections = () => { const handleUnblockUser = async (receiverUserId) => { try { const url = `${urlConfig.URLS.DIRECT_CONNECT.UNBLOCK}`; - console.log("UnBlocking User"); const data = await axios.post( url, @@ -2039,15 +2034,6 @@ Backdrop.propTypes = { open: PropTypes.bool, }; -const blue = { - 200: "#99CCFF", - 300: "#66B2FF", - 400: "#3399FF", - 500: "#007FFF", - 600: "#0072E5", - 700: "#0066CC", -}; - const grey = { 50: "#F3F6F9", 100: "#E5EAF2", @@ -2070,14 +2056,6 @@ const Modal = styled(BaseModal)` justify-content: center; `; -const StyledBackdrop = styled(Backdrop)` - z-index: -1; - position: fixed; - inset: 0; - background-color: rgb(0 0 0 / 0.5); - -webkit-tap-highlight-color: transparent; -`; - const style = { position: "absolute", top: "50%", @@ -2119,18 +2097,4 @@ const ModalContent = styled("div")( ` ); -const TriggerButton = styled(Button)( - ({ theme }) => css` - font-weight: 600; - font-size: 0.875rem; - line-height: 1.5; - padding: 8px 16px; - border-radius: 8px; - transition: all 150ms ease; - cursor: pointer; - - } - ` -); - export default AddConnections; diff --git a/packages/nulp_elite/src/pages/connections/chat.js b/packages/nulp_elite/src/pages/connections/chat.js index 1afd854e..6b3435e6 100644 --- a/packages/nulp_elite/src/pages/connections/chat.js +++ b/packages/nulp_elite/src/pages/connections/chat.js @@ -489,7 +489,6 @@ const Chat = ({ const handleBlockUserConfirmed = async (reason) => { try { const url = `${urlConfig.URLS.DIRECT_CONNECT.BLOCK}`; - console.log("Blocking User"); await axios.post( url, diff --git a/packages/nulp_elite/src/pages/connections/message.js b/packages/nulp_elite/src/pages/connections/message.js index c4e6e9b9..11db21b5 100644 --- a/packages/nulp_elite/src/pages/connections/message.js +++ b/packages/nulp_elite/src/pages/connections/message.js @@ -8,7 +8,6 @@ import { DialogTitle, DialogContent, DialogActions, - TextareaAutosize, } from "@mui/material"; import Box from "@mui/material/Box"; import * as util from "../../services/utilService"; @@ -17,7 +16,6 @@ import { useNavigate } from "react-router-dom"; import { useStore } from "configs/zustandStore"; import { IconButton, Menu, MenuItem } from "@mui/material"; import ArrowBackIcon from "@mui/icons-material/ArrowBack"; -import MenuIcon from "@mui/icons-material/Menu"; import BlockIcon from "@mui/icons-material/Block"; import SendIcon from "@mui/icons-material/Send"; import { useTranslation } from "react-i18next"; @@ -26,7 +24,6 @@ import CheckCircleOutlineIcon from "@mui/icons-material/CheckCircleOutline"; import Typography from "@mui/material/Typography"; const urlConfig = require("../../configs/urlConfig.json"); import ToasterCommon from "../ToasterCommon"; -import Modal from "@mui/material/Modal"; const moment = require("moment"); const timezone = require("moment-timezone"); @@ -178,7 +175,6 @@ const Message = (props) => { if (message.trim() !== "") { try { const url = `${urlConfig.URLS.DIRECT_CONNECT.SEND_CHAT}`; - console.log("Sending message:", message); await axios.post( url, @@ -208,7 +204,6 @@ const Message = (props) => { const updateMessage = async () => { try { const url = `${urlConfig.URLS.DIRECT_CONNECT.UPDATE_CHAT}`; - console.log("updating message:", message); const data = await axios.put( url, @@ -279,7 +274,6 @@ const Message = (props) => { const handleUnblockUser = async () => { try { const url = `${urlConfig.URLS.DIRECT_CONNECT.UNBLOCK}`; - console.log("UnBlocking User"); const data = await axios.post( url, @@ -295,7 +289,6 @@ const Message = (props) => { } ); - console.log("User unblocked successfully!"); // Reload the page after unblocking the user if (data) { window.location.reload(); @@ -309,7 +302,6 @@ const Message = (props) => { const handleBlockUserConfirmed = async () => { try { const url = `${urlConfig.URLS.DIRECT_CONNECT.BLOCK}`; - console.log("Blocking User"); await axios.post( url, @@ -399,7 +391,7 @@ const Message = (props) => { - Are you sure you want to block this user? + {t("ARE_YOU_SURE_YOU_WANT_TO_BLOCK_THIS_USER")} { )} - //
- //
- // - // - // - // - // - //
- // - // Anya Gupta - // - // Content creator, commisioner - //
- //
- //
- // - // {!isBlocked && ( - // - // - // {t("BLOCK")} - // - // )} - // {showUnblockOption && ( - // - // - // {t("UNBLOCK")} - // - // )} - // - - //
- //
- // - // Anya Gupta is a manager with the department of Revenue and taxes and has actively contributed to the growth and authenticity of the knowledge curated for the betterment of the department. - // Connect with them to get insights on what they do or simply answers to your question! - // - //
- // - // - - //
); }; diff --git a/packages/nulp_elite/src/pages/content/Player.js b/packages/nulp_elite/src/pages/content/Player.js index 9c255fe6..61823816 100644 --- a/packages/nulp_elite/src/pages/content/Player.js +++ b/packages/nulp_elite/src/pages/content/Player.js @@ -29,7 +29,6 @@ import AccordionSummary from '@mui/material/AccordionSummary'; import AccordionDetails from '@mui/material/AccordionDetails'; import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; import md5 from 'md5'; -import { TroubleshootRounded } from "@mui/icons-material"; const urlConfig = require("../../configs/urlConfig.json"); const Player = () => { diff --git a/packages/nulp_elite/src/pages/content/joinCourse.js b/packages/nulp_elite/src/pages/content/joinCourse.js index 084a3e90..9c525555 100644 --- a/packages/nulp_elite/src/pages/content/joinCourse.js +++ b/packages/nulp_elite/src/pages/content/joinCourse.js @@ -20,12 +20,9 @@ import Button from "@mui/material/Button"; import Typography from "@mui/material/Typography"; import Breadcrumbs from "@mui/material/Breadcrumbs"; import Link from "@mui/material/Link"; -import ShareOutlinedIcon from "@mui/icons-material/ShareOutlined"; import Grid from "@mui/material/Grid"; -import { useParams, useNavigate, useLocation } from "react-router-dom"; +import { useNavigate, useLocation } from "react-router-dom"; import axios from "axios"; -import SummarizeOutlinedIcon from "@mui/icons-material/SummarizeOutlined"; -import ArrowBackOutlinedIcon from "@mui/icons-material/ArrowBackOutlined"; import * as util from "../../services/utilService"; import Snackbar from "@mui/material/Snackbar"; import MuiAlert from "@mui/material/Alert"; @@ -37,7 +34,6 @@ import Modal from "@mui/material/Modal"; import appConfig from "../../configs/appConfig.json"; const urlConfig = require("../../configs/urlConfig.json"); import ToasterCommon from "../ToasterCommon"; -import { TextField } from "@mui/material"; import Chat from "pages/connections/chat"; import { FacebookShareButton, @@ -47,10 +43,7 @@ import { FacebookIcon, WhatsappIcon, LinkedinIcon, - TwitterIcon, } from "react-share"; -import AddConnections from "pages/connections/AddConnections"; -// import speakerOne from "./../assets/speakerOne.png"; import CheckCircleIcon from "@mui/icons-material/CheckCircle"; const routeConfig = require("../../configs/routeConfig.json"); @@ -93,9 +86,6 @@ const JoinCourse = () => { if (contentId && contentId.endsWith("=")) { contentId = contentId.slice(0, -1); } - - // const { contentId } = location.state || {}; - // const { contentId } = useParams(); const _userId = util.userId(); // Assuming util.userId() is defined const shareUrl = window.location.href; // Current page URL const [showMore, setShowMore] = useState(false); @@ -320,10 +310,6 @@ const JoinCourse = () => { }; const calculateProgress = async () => { - console.log("batchDetails?-------", batchDetails); - - console.log("batchDetails?.batchId", batchDetails?.batchId); - console.log("courseData?-----", courseData); console.log( "courseData?.result?.content?.children", @@ -426,9 +412,6 @@ const JoinCourse = () => { const url = `${urlConfig.URLS.CONTENT_PREFIX}${urlConfig.URLS.COURSE.USER_CONTENT_STATE_READ}`; const response = await axios.post(url, request); const data = response.data; - - console.log("API Response Data:", data); - setCourseProgress(data); checkCourseComplition(allContents, data); @@ -569,15 +552,6 @@ const JoinCourse = () => { }; const isEnrolled = () => { - // console.log("userCourseData?.courses", userCourseData?.courses); - // console.log( - // "userCourseData?.courses", - // userCourseData?.courses?.map((course) => course.contentId) - // ); - // console.log( - // "userCourseData?.courses?.some", - // userCourseData?.courses?.some((course) => course.contentId === contentId) - // ); return ( userCourseData && userCourseData.courses && @@ -616,8 +590,6 @@ const JoinCourse = () => { }; const renderActionButton = () => { - // console.log("ConsumedContents", ConsumedContents); - // console.log("allContents", allContents); if (isEnrolled() || enrolled) { if (isNotStarted) { return ( @@ -1083,14 +1055,6 @@ const JoinCourse = () => { width: "100%", }} /> - {/* - {" "} - {userData?.result?.content?.name} - - - {" "} - {userData?.result?.content?.description} - */}
@@ -1101,21 +1065,6 @@ const JoinCourse = () => { lg={4} className="sm-p-25 left-container mt-9 xs-px-0 xs-pl-15 mb-20" > - {/* - - {t("ALL_CONTENT")} - - - {t("LEARNING_HISTORY")} - - */} { {userData?.result?.content?.name} - {/* - - {t("BACK")} - - */} - - {/* - - */} {" "} @@ -1442,23 +1372,23 @@ className="xs-hide accordionBoxShadow" {t("CREDITS")}

- COPYRIGHT + {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 } -
This content is derived from
+
{t("THIS_CONTENT_IS_DERIVED_FROM")}

- CONTENT + {t("CONTENT")}

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

- LICENSE TERMS + {t("LICENSE_TERMS")}

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

- PUBLISHED ON NULP BY + {t("PUBLISHED_ON_NULP_BY")}

{userData?.result?.content?.orgDetails?.orgName}
@@ -1567,23 +1497,6 @@ className="xs-hide accordionBoxShadow" {" "} {renderActionButton()}
- - {/* - - {t("START_LEARNING")} - - {t("JOIN_COURSE_MESSAGE")} - - - */} {courseData && courseData?.result?.content && ( <> diff --git a/packages/nulp_elite/src/pages/events/eventDetails.js b/packages/nulp_elite/src/pages/events/eventDetails.js index 73d78ae3..8f006bf0 100644 --- a/packages/nulp_elite/src/pages/events/eventDetails.js +++ b/packages/nulp_elite/src/pages/events/eventDetails.js @@ -6,13 +6,12 @@ import Container from "@mui/material/Container"; import FloatingChatIcon from "../../components/FloatingChatIcon"; import Typography from "@mui/material/Typography"; import Grid from "@mui/material/Grid"; -import { useParams, useNavigate, useLocation } from "react-router-dom"; +import { useLocation } from "react-router-dom"; import Box from "@mui/material/Box"; import Button from "@mui/material/Button"; import { getAllContents } from "services/contentService"; import TodayOutlinedIcon from "@mui/icons-material/TodayOutlined"; import AccessAlarmsOutlinedIcon from "@mui/icons-material/AccessAlarmsOutlined"; -import ArrowForwardIosOutlinedIcon from "@mui/icons-material/ArrowForwardIosOutlined"; import Breadcrumbs from "@mui/material/Breadcrumbs"; import Link from "@mui/material/Link"; import AdjustOutlinedIcon from "@mui/icons-material/AdjustOutlined"; @@ -355,32 +354,7 @@ const checkIfExpired = (registrationEndDate, endTime) => { setIsLoading(false); } }; - // const checkEnrolledCourse = async () => { - // try { - // const url = `${urlConfig.URLS.LEARNER_PREFIX}${urlConfig.URLS.COURSE.GET_ENROLLED_COURSES}/${_userId}?contentType=Event`; - // const response = await fetch(url); - // if (!response.ok) { - // showErrorMessage(t("FAILED_TO_FETCH_DATA")); - // throw new Error(t("FAILED_TO_FETCH_DATA")); - // } - // const data = await response.json(); - // console.log("enrollment data ---", data.result.courses); - // setUserCourseData(data.result.courses); - // if (data.result.courses.length > 0) { - // data.result.courses.map((event) => { - // console.log("check enrollment list API 1-----", event); - // if (event.identifier === eventId) { - // alert("list match"); - // setIsEnrolled(true); - // } - // }); - // } - // console.log("check enrollment list API 2-----", isEnrolled); - // } catch (error) { - // console.error("Error while fetching courses:", error); - // showErrorMessage(t("FAILED_TO_FETCH_DATA")); - // } - // }; + const handleGoBack = () => { navigate(-1); // Navigate back in history }; @@ -686,7 +660,7 @@ const checkIfExpired = (registrationEndDate, endTime) => { const getEventRecording = async () => { try { - const url = "/custom_event/fetch_recordings?event_id=" + eventId; + const url= `${urlConfig.URLS.CUSTOM_EVENT_FETCH_RECORDINGS}` + eventId; const response = await axios.get(url); setRecording(response.data); } catch (error) { diff --git a/packages/nulp_elite/src/pages/profile/Profile.js b/packages/nulp_elite/src/pages/profile/Profile.js index 9179e1a1..bfff978f 100644 --- a/packages/nulp_elite/src/pages/profile/Profile.js +++ b/packages/nulp_elite/src/pages/profile/Profile.js @@ -5,25 +5,18 @@ import Header from "components/header"; import Container from "@mui/material/Container"; import Box from "@mui/material/Box"; import CardContent from "@mui/material/CardContent"; -import Card from "@mui/material/Card"; import Typography from "@mui/material/Typography"; -import PersonIcon from "@mui/icons-material/Person"; import ModeEditIcon from "@mui/icons-material/ModeEdit"; import EmojiEventsOutlinedIcon from "@mui/icons-material/EmojiEventsOutlined"; -import TimelapseOutlinedIcon from "@mui/icons-material/TimelapseOutlined"; import Grid from "@mui/material/Grid"; -import LibraryAddCheckOutlinedIcon from "@mui/icons-material/LibraryAddCheckOutlined"; import ReceiptLongIcon from "@mui/icons-material/ReceiptLong"; import FloatingChatIcon from "../../components/FloatingChatIcon"; -import CircularProgressWithLabel from "../../components/CircularProgressWithLabel"; -import RestoreOutlinedIcon from "@mui/icons-material/RestoreOutlined"; import SettingsOutlinedIcon from "@mui/icons-material/SettingsOutlined"; import * as util from "../../services/utilService"; import { useNavigate } from "react-router-dom"; -import SearchBox from "components/search"; import ContinueLearning from "./continueLearning"; import SelectPreference from "pages/SelectPreference"; -import { Dialog, DialogTitle, DialogContent, Alert } from "@mui/material"; +import { Alert } from "@mui/material"; import _ from "lodash"; import Modal from "@mui/material/Modal"; const designations = require("../../configs/designations.json"); @@ -1302,37 +1295,6 @@ const Profile = () => { {t("DOWNLOAD CERTIFICATES")} - - {/* { - if ( - reason === "backdropClick" || - reason === "escapeKeyDown" - ) { - setOpenModal(true); - } else { - handleCloseModal(); - } - }} - > - - - {t("SELECT_PREFERENCE")} - - - - */} { const [initialFirstName, setInitialFirstName] = useState(""); const [initialLastName, setInitialLastName] = useState(""); + const { t } = useTranslation(); useEffect(() => { const url = `${urlConfig.URLS.LEARNER_PREFIX}${urlConfig.URLS.USER.GET_PROFILE}${_userId}`; @@ -226,98 +224,11 @@ const PopupForm = ({ open, handleClose }) => { className="custom-btn-primary " disabled={isSubmitDisabled} > - Submit + {t("SUBMIT")}
- // - // User Information - // - // setFirstName(e.target.value)} - // /> - // setLastName(e.target.value)} - // /> - // setOrganisation(e.target.value)} - // /> - // setBio(e.target.value)} - // /> - // - // option.value === userType)} - // onChange={(selectedOption) => setUserType(selectedOption.value)} - // placeholder="Select User Type *" - // isClearable - // /> - // {userType === 'other' && ( - // setCustomUserType(e.target.value)} - // /> - // )} - // - // - // - // - // - // ); }; diff --git a/packages/nulp_elite/src/pages/registration/Otp.js b/packages/nulp_elite/src/pages/registration/Otp.js index 1f4bac26..96d9b9be 100644 --- a/packages/nulp_elite/src/pages/registration/Otp.js +++ b/packages/nulp_elite/src/pages/registration/Otp.js @@ -9,7 +9,6 @@ import { } from "@mui/material"; import { useTranslation } from "react-i18next"; import { useNavigate, Navigate } from "react-router-dom"; -import image from "../../assets/bg.png"; import { useStore } from "configs/zustandStore"; const axios = require("axios"); import FormControlLabel from "@mui/material/FormControlLabel"; @@ -291,12 +290,11 @@ const Otp = () => { const tncText = age < 18 ? ( - As a parent/guardian I understand & accept the NULP Terms of Use agree - my child to register on NULP with the given information. + {t("As_A_PATENT_GUARDIAN_ACCEPT_THE_NULP_TERMS_OF_USE")} ) : ( - I am 18+ years old and understand and accept the NULP Terms of Use + {t("ACCEPT_THE_NULP_TERMS_OF_USE")} ); const handleCheckboxChange = (event) => { @@ -398,7 +396,7 @@ const Otp = () => { className="sm-w-700" > -

Terms and Conditions

+

{t("TERMS_CONDITIONS")}