From ce06a1f5206907981b9fe80ffd8a024598af913d Mon Sep 17 00:00:00 2001 From: sonaligarud Date: Wed, 28 Aug 2024 11:14:40 +0530 Subject: [PATCH 01/17] Bug #225739 - [Webapp] On hovering top trending events graph,unable to see the full event name. --- packages/nulp_elite/src/pages/events/dashboard.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/nulp_elite/src/pages/events/dashboard.js b/packages/nulp_elite/src/pages/events/dashboard.js index 9e37e98d..ce931e1a 100644 --- a/packages/nulp_elite/src/pages/events/dashboard.js +++ b/packages/nulp_elite/src/pages/events/dashboard.js @@ -512,12 +512,12 @@ const Dashboard = () => { const handleVisibilityFilterChange = (event) => { setVisibilityFilter(event.target.value); }; -// const eventNames = topEvent?.map((event) => event.event_name); -const eventNames = topEvent?.map((event) => { - return event?.event_name?.length > 10 - ? event?.event_name.substring(0, 10) + "..." - : event?.event_name; -}); +const eventNames = topEvent?.map((event) => event.event_name); +// const eventNames = topEvent?.map((event) => { +// return event?.event_name?.length > 10 +// ? event?.event_name.substring(0, 10) + "..." +// : event?.event_name; +// }); const eventTopUser = topEvent?.map((event) => parseInt(event.user_count)); const listOfDesignation = topDesignation?.map( From 37acf4ca4afc9737b79bb89d0120ff920cb08e90 Mon Sep 17 00:00:00 2001 From: Mahesh Mahajan Date: Wed, 28 Aug 2024 12:44:59 +0530 Subject: [PATCH 02/17] TASK : #0000 Designation Filter Displays All Records When No Results Are Available In Add Connection Page --- .../src/pages/connections/AddConnections.js | 74 +++++++++++-------- .../src/pages/profile/certificate.js | 2 +- 2 files changed, 44 insertions(+), 32 deletions(-) diff --git a/packages/nulp_elite/src/pages/connections/AddConnections.js b/packages/nulp_elite/src/pages/connections/AddConnections.js index b9dd0f28..7307710d 100644 --- a/packages/nulp_elite/src/pages/connections/AddConnections.js +++ b/packages/nulp_elite/src/pages/connections/AddConnections.js @@ -1071,9 +1071,18 @@ const AddConnections = () => { }; if (userDesignation && userDesignation?.length > 0) { filters.userId = userDesignation; + const responseUserData = await handleFilterChange(filters); + setUserSearchData(responseUserData); + }else if(event.length===0){ + const responseUserData = await handleFilterChange(filters); + setUserSearchData(responseUserData); } - const responseUserData = await handleFilterChange(filters); - setUserSearchData(responseUserData); + else{ + filters.userId = ""; + const responseUserData = await handleFilterChange(filters); + } + + }; const handleUserNameFilter = async (event) => { @@ -1937,37 +1946,40 @@ const AddConnections = () => { /> - {userSearchData && - userSearchData?.map((item) => ( + {userSearchData && userSearchData.length > 0 ? ( + userSearchData?.map((item) => ( handleUserClick(item)} + key={item.id} // Add key prop to each List element + sx={{ fontSize: "14px" }} + onClick={() => handleUserClick(item)} > - - - {item.id !== loggedInUserId && ( // Conditionally render the link - { - showMessages(item.userId); - }} - > - {t("INVITE")} - - )} - - - - ))} + + + {item.id !== loggedInUserId && ( // Conditionally render the link + { + showMessages(item.userId); + }} + > + {t("INVITE")} + + )} + + + + )) + ) : ( + + {t("NO_USERS_FOUND")} + + )} + { filename: `${certificateName}.pdf`, image: { type: "jpeg", quality: 0.98 }, html2canvas: { scale: 2 }, - jsPDF: { unit: "in", format: "letter", orientation: "portrait" }, + jsPDF: { unit: "in", format: "letter", orientation: "landscape" }, }; html2pdf().set(opt).from(element).save(); From d0c30cc63b793955ca470df74cbb38d95b224677 Mon Sep 17 00:00:00 2001 From: Mahesh Mahajan Date: Wed, 28 Aug 2024 14:24:05 +0530 Subject: [PATCH 03/17] TASK : #0000 Removed Learner prefix from enrollment-list API call --- packages/nulp_elite/src/pages/events/eventList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nulp_elite/src/pages/events/eventList.js b/packages/nulp_elite/src/pages/events/eventList.js index 22672012..a8aa1614 100644 --- a/packages/nulp_elite/src/pages/events/eventList.js +++ b/packages/nulp_elite/src/pages/events/eventList.js @@ -222,7 +222,7 @@ const EventList = (props) => { "Content-Type": "application/json", }; try { - const url = `${urlConfig.URLS.LEARNER_PREFIX}${urlConfig.URLS.CUSTOM_EVENT.CUSTOM_ENROLL_LIST}`; + const url = `${urlConfig.URLS.CUSTOM_EVENT.CUSTOM_ENROLL_LIST}`; // const url = `https://devnulp.niua.org/custom_event/enrollment-list`; const response = await getAllContents(url, data, headers); console.log("My data ---", response.data.result.event); From 2321b0d8f708362dd85a5c7b568fa8c5c454f56d Mon Sep 17 00:00:00 2001 From: Mahesh Mahajan Date: Wed, 28 Aug 2024 14:54:25 +0530 Subject: [PATCH 04/17] Task : #0000 Pass createdOn instead of lastPublishOn filter to search API on domain List Page --- .../nulp_elite/src/pages/search/DomainList.js | 31 +++++-------------- 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/packages/nulp_elite/src/pages/search/DomainList.js b/packages/nulp_elite/src/pages/search/DomainList.js index 4db5dfcf..9464825a 100644 --- a/packages/nulp_elite/src/pages/search/DomainList.js +++ b/packages/nulp_elite/src/pages/search/DomainList.js @@ -207,34 +207,17 @@ const DomainList = ({ globalSearchQuery }) => { filters: { se_boards: [null], primaryCategory: [ - "Collection", - "Resource", - "Content Playlist", - "Course Assessment", - "Digital Textbook", - "eTextbook", - "Explanation Content", - "Learning Resource", - "Lesson Plan Unit", - "Practice Question Set", - "Teacher Resource", - "Textbook Unit", - "LessonPlan", - "FocusSpot", - "Learning Outcome Definition", - "Curiosity Questions", - "MarkingSchemeRubric", - "ExplanationResource", - "ExperientialResource", - "Practice Resource", - "TVLesson", - "Exam Question", + "Good Practices", + "Reports", + "Manual/SOPs", + "Content", + "Quiz / Test" ], visibility: ["Default", "Parent"], }, limit: 100, sort_by: { - lastPublishedOn: "desc", + createdOn: "desc", }, fields: [ "name", @@ -346,7 +329,7 @@ const DomainList = ({ globalSearchQuery }) => { }, limit: 100, sort_by: { - lastPublishedOn: "desc", + createdOn: "desc", }, fields: [ "name", From 44e5dac77c12f4ec130dda96f36bbab7de88334e Mon Sep 17 00:00:00 2001 From: paritshivani Date: Thu, 29 Aug 2024 12:12:39 +0530 Subject: [PATCH 05/17] cert mesg changes --- packages/nulp_elite/src/pages/content/joinCourse.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/nulp_elite/src/pages/content/joinCourse.js b/packages/nulp_elite/src/pages/content/joinCourse.js index 4b940996..4bf1f0fa 100644 --- a/packages/nulp_elite/src/pages/content/joinCourse.js +++ b/packages/nulp_elite/src/pages/content/joinCourse.js @@ -1310,6 +1310,8 @@ const JoinCourse = () => { + {batchDetails && batchDetails.cert_templates && + { )} +} { - {/* {isEnrolled && batchDetails == 'undefined' && */} + {isEnrolled && batchDetails && batchDetails.cert_templates == null && - {/* } */} + }
@@ -1794,6 +1797,8 @@ className="accordionBoxShadow" + {batchDetails && batchDetails.cert_templates && + +} Date: Thu, 29 Aug 2024 14:46:24 +0530 Subject: [PATCH 06/17] feedback form changes --- packages/nulp_elite/src/components/FeedbackPopup.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/nulp_elite/src/components/FeedbackPopup.js b/packages/nulp_elite/src/components/FeedbackPopup.js index 2c2a14c3..446c7d92 100644 --- a/packages/nulp_elite/src/components/FeedbackPopup.js +++ b/packages/nulp_elite/src/components/FeedbackPopup.js @@ -85,6 +85,7 @@ const FeedbackPopup = ({ open, onClose, contentId }) => { }; const handleAdditionalFeedbackChange = (event) => { + console.log("handleAdditionalFeedbackChange----",event) setAdditionalFeedback(event.target.value); }; @@ -95,8 +96,11 @@ const FeedbackPopup = ({ open, onClose, contentId }) => { Object.keys(checkboxes).forEach((key) => { if (checkboxes[key] && checkboxLabels[key] !== "Other") { selectedCheckboxes.push(checkboxLabels[key]); + }else if(checkboxLabels[key] == "Other" && additionalFeedback != "") { + selectedCheckboxes.push(checkboxLabels[key]); } }); + console.log("selectedCheckboxes----",selectedCheckboxes) const url = `${urlConfig.URLS.FEEDBACK.CREATE}`; const request = { From 75e8fe8a660b39028291c2cf9f69f4edfb0f3c20 Mon Sep 17 00:00:00 2001 From: paritshivani Date: Thu, 29 Aug 2024 14:48:50 +0530 Subject: [PATCH 07/17] spell correct --- packages/nulp_elite/public/locales/en/translation.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nulp_elite/public/locales/en/translation.json b/packages/nulp_elite/public/locales/en/translation.json index 04e254da..75e3a8c6 100644 --- a/packages/nulp_elite/public/locales/en/translation.json +++ b/packages/nulp_elite/public/locales/en/translation.json @@ -186,8 +186,8 @@ "BATCH_EXPIRED_MESSAGE": "You cannot enroll in this batch as it is closed.", "LEAVE_COURSE_CONFIRMATION_TITLE": "Batch Unenrolment", "LEAVE_COURSE_CONFIRMATION_MESSAGE": "Do you want to unenrol from this batch?", - "ENROLLMENT_SUCCESS_MESSAGE": "Enroled Successfully", - "UNENROLLMENT_SUCCESS_MESSAGE": " Unenroled Successfully", + "ENROLLMENT_SUCCESS_MESSAGE": "Enrolled Successfully", + "UNENROLLMENT_SUCCESS_MESSAGE": " Unenrolled Successfully", "YOUR_CHAT_REQUEST_IS_PENDING": "Your chat request is pending. Please wait for the creator to accept the chat invitation", "CHAT_WITH_CREATOR": "Chat with creator", "CONNECT_WITH_CREATOR": "Connect with creator", From 8150a19570b97d1c64581032ea22da02d19e4524 Mon Sep 17 00:00:00 2001 From: paritshivani Date: Thu, 29 Aug 2024 17:51:34 +0530 Subject: [PATCH 08/17] unregister event issue and certificate msg changes --- .../nulp_elite/src/configs/urlConfig.json | 2 +- .../src/pages/content/joinCourse.js | 80 +++++++++++++------ .../src/pages/events/eventDetails.js | 2 +- 3 files changed, 56 insertions(+), 28 deletions(-) diff --git a/packages/nulp_elite/src/configs/urlConfig.json b/packages/nulp_elite/src/configs/urlConfig.json index 8b88a4b9..c4d5e8b0 100644 --- a/packages/nulp_elite/src/configs/urlConfig.json +++ b/packages/nulp_elite/src/configs/urlConfig.json @@ -424,7 +424,7 @@ "REGISTER": "/custom_event/registration", "REPORT": "/custom_event/reports", "CUSTOM_ENROLL_LIST": "/custom_event/enrollment-list", - "UNREGISTER": "custom_event/unregister", + "UNREGISTER": "/custom_event/unregister", "UPDATE_REGISTER": "/custom_event/registration/update", "CUSTOM_COMPOSITE_SEARCH": "/custom_event/composite/search", "READ_BY_ID": "/custom_event/read/event" diff --git a/packages/nulp_elite/src/pages/content/joinCourse.js b/packages/nulp_elite/src/pages/content/joinCourse.js index 4bf1f0fa..d1de6301 100644 --- a/packages/nulp_elite/src/pages/content/joinCourse.js +++ b/packages/nulp_elite/src/pages/content/joinCourse.js @@ -1310,7 +1310,7 @@ const JoinCourse = () => { - {batchDetails && batchDetails.cert_templates && + {batchDetails && batchDetails.cert_templates != null && { expandIcon={} aria-controls="panel1-content" id="panel1-header" - className="h4-title" + className="xs-hide h4-title" > {t("CERTIFICATION_CRITERIA")} @@ -1352,6 +1352,32 @@ const JoinCourse = () => { } + + +{isEnrolled && batchDetails && batchDetails.cert_templates == null && + + + + {t("CERT_NOT_ATTACHED")}: + + + + } { - {isEnrolled && batchDetails && batchDetails.cert_templates == null && - - - - {t("CERT_NOT_ATTACHED")}: - - - }
@@ -1797,7 +1800,7 @@ className="accordionBoxShadow" - {batchDetails && batchDetails.cert_templates && + {batchDetails && batchDetails.cert_templates != null && } + +{isEnrolled && batchDetails && batchDetails.cert_templates == null && + + + + {t("CERT_NOT_ATTACHED")}: + + + + } { } setUnShowEnrollmentSnackbar(true); - registerEvent(formData, detailData); + // registerEvent(formData, detailData); } else { console.log("err-----", response); } From 707a7c7d42d68e30e3bf03ebfdeb69dca59111db Mon Sep 17 00:00:00 2001 From: Mahesh Mahajan Date: Fri, 30 Aug 2024 11:30:46 +0530 Subject: [PATCH 09/17] TASK : #225942 Show Default notifications to user --- .../nulp_elite/src/components/Notification.js | 208 ++++++++++++++++++ packages/nulp_elite/src/components/header.js | 49 ++++- .../nulp_elite/src/configs/urlConfig.json | 5 + 3 files changed, 261 insertions(+), 1 deletion(-) create mode 100644 packages/nulp_elite/src/components/Notification.js diff --git a/packages/nulp_elite/src/components/Notification.js b/packages/nulp_elite/src/components/Notification.js new file mode 100644 index 00000000..4a39237a --- /dev/null +++ b/packages/nulp_elite/src/components/Notification.js @@ -0,0 +1,208 @@ +import React, { useState, useEffect } from "react"; +import { + Dialog, + DialogTitle, + DialogContent, + DialogActions, + List, + ListItem, + ListItemText, + Button, + Typography, + IconButton, +} from "@mui/material"; +import DeleteIcon from "@mui/icons-material/Delete"; +import CloseIcon from "@mui/icons-material/Close"; +import { useNavigate } from "react-router-dom"; +import * as util from "../services/utilService"; +const urlConfig = require("../configs/urlConfig.json"); + +const NotificationPopup = ({ open, handleClose, updateNotificationCount }) => { + const [notifications, setNotifications] = useState([]); + const _userId = util.userId(); + const navigate = useNavigate(); + const [NotificationCount , setNotificationCount] = useState(0) + + useEffect(() => { + const fetchNotifications = async () => { + try { + const url = `${urlConfig.URLS.LEARNER_PREFIX}${urlConfig.URLS.NOTIFICATION.READ}${_userId}`; + const response = await fetch(url); + const data = await response.json(); + if (data?.result?.feeds) { + const sortedNotifications = data.result.feeds.sort((a, b) => { + if (a.status === "unread" && b.status !== "unread") return -1; + if (a.status !== "unread" && b.status === "unread") return 1; + return 0; + }); + setNotifications(sortedNotifications); + updateNotificationCount( + sortedNotifications.filter((notif) => notif.status === "unread").length + ); + setNotificationCount( + sortedNotifications.filter((notif) => notif.status === "unread").length + ); + } + } catch (error) { + console.error("Error fetching notifications:", error); + } + }; + + if (open) { + fetchNotifications(); + } + }, [open, _userId, updateNotificationCount]); + + const handleNotificationClick = async (notificationId, status, actionType) => { + try { + const url = `${urlConfig.URLS.LEARNER_PREFIX}${urlConfig.URLS.NOTIFICATION.UPDATE}`; + const requestBody = { + request: { + ids: [notificationId], + userId: _userId, + }, + }; + + const response = await fetch(url, { + method: "PATCH", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(requestBody), + }); + + const result = await response.json(); + + if (result?.responseCode === "OK") { + if (actionType === "certificateUpdate") { + navigate("/webapp/profile"); + } + } else { + console.error("Failed to update notification:", result); + } + } catch (error) { + console.error("Error updating notification:", error); + } + }; + + const handleDeleteNotification = async (notificationIds) => { + try { + const url =`${urlConfig.URLS.LEARNER_PREFIX}${urlConfig.URLS.NOTIFICATION.DELETE}`; + const requestBody = { + request: { + ids: notificationIds, + userId: _userId, + category: "group-feed", + }, + }; + + const response = await fetch(url, { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(requestBody), + }); + + const result = await response.json(); + + if (result?.responseCode === "OK") { + setNotifications((prevNotifications) => + prevNotifications.filter((notif) => !notificationIds.includes(notif.id)) + ); + updateNotificationCount(notifications.length - notificationIds.length); + } else { + console.error("Failed to delete notifications:", result); + } + } catch (error) { + console.error("Error deleting notifications:", error); + } + }; + + const handleClearAllNotifications = () => { + const allNotificationIds = notifications.map((notification) => notification.id); + handleDeleteNotification(allNotificationIds); + }; + + const formatDate = (timestamp) => { + const date = new Date(timestamp); + return new Intl.DateTimeFormat("en-US", { + weekday: "short", + day: "numeric", + month: "long", + hour: "numeric", + minute: "numeric", + }).format(date); + }; + + return ( + + + {NotificationCount} {"New Notification (s)"} + + + + + + {notifications.length > 0 ? ( + + {notifications.map((notification) => { + const { id, action, status, createdOn } = notification; + const { description, title, type } = JSON.parse(action.template.data); + + return ( + handleNotificationClick(id, status, action.type)} + > + + + {formatDate(createdOn)} + + {title} + + } + secondary={description} + primaryTypographyProps={{ + style: status === "unread" ? { fontWeight: "bold" } : {}, + }} + secondaryTypographyProps={{ + style: status === "unread" ? { fontWeight: "bold" } : {}, + }} + /> + { + e.stopPropagation(); + handleDeleteNotification([id]); + }} + > + + + + ); + })} + + ) : ( + No Notifications Found + )} + + + + + + ); +}; + +export default NotificationPopup; diff --git a/packages/nulp_elite/src/components/header.js b/packages/nulp_elite/src/components/header.js index 8635e698..07af6547 100644 --- a/packages/nulp_elite/src/components/header.js +++ b/packages/nulp_elite/src/components/header.js @@ -10,6 +10,7 @@ import Tooltip from "@mui/material/Tooltip"; import AccountCircleOutlinedIcon from "@mui/icons-material/AccountCircleOutlined"; import TextField from "@mui/material/TextField"; import IconButton from "@mui/material/IconButton"; +import { Badge } from "@mui/material"; import SearchIcon from "@mui/icons-material/Search"; import Link from "@mui/material/Link"; import DevicesIcon from "@mui/icons-material/Devices"; @@ -40,6 +41,7 @@ import Grid from "@mui/material/Grid"; import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown"; import { ExpandLess, ExpandMore } from "@mui/icons-material"; import { Collapse, List } from "@mui/material"; +import NotificationPopup from "./Notification"; function Header({ globalSearchQuery }) { const { t } = useTranslation(); @@ -68,6 +70,10 @@ function Header({ globalSearchQuery }) { const [openSubmenu, setOpenSubmenu] = useState(false); const [open, setOpen] = useState(false); const [show, setShow] = React.useState(false); + const [openNotification, setOpenNotification] = useState(false); + const [notificationCount, setNotificationCount] = useState(0); + + const handleTooltipClose = () => { setOpen(false); }; @@ -124,6 +130,45 @@ function Header({ globalSearchQuery }) { }); }; + const handleClickOpenNotification = () => { + setOpenNotification(true); + }; + + const fetchNotifications = async () => { + try { + const url = `${urlConfig.URLS.LEARNER_PREFIX}${urlConfig.URLS.NOTIFICATION.READ}${_userId}`; + const response = await fetch(url); + const data = await response.json(); + + if (data?.result?.feeds) { + const unreadCount = data.result.feeds.filter( + (notif) => notif.status === "unread" + ).length; + setNotificationCount(unreadCount); + } + } catch (error) { + console.error("Error fetching notifications:", error); + } + }; + + useEffect(() => { + fetchNotifications(); + + const intervalId = setInterval(() => { + fetchNotifications(); + }, 20000); + + return () => clearInterval(intervalId); + }, [_userId]); + + const handleCloseNotification = () => { + setOpenNotification(false); + }; + + const updateNotificationCount = (count) => { + setNotificationCount(count); + }; + const handleInputChange = (event) => { setSearchQuery(event.target.value); }; @@ -467,7 +512,8 @@ function Header({ globalSearchQuery }) { - + + @@ -505,6 +551,7 @@ function Header({ globalSearchQuery }) { */} + {/* diff --git a/packages/nulp_elite/src/configs/urlConfig.json b/packages/nulp_elite/src/configs/urlConfig.json index 8b88a4b9..2c437d23 100644 --- a/packages/nulp_elite/src/configs/urlConfig.json +++ b/packages/nulp_elite/src/configs/urlConfig.json @@ -442,6 +442,11 @@ "FEEDBACK": { "CREATE" : "/custom_feedback/create", "LIST" : "/custom_feedback/list" + }, + "NOTIFICATION" : { + "READ": "notification/v1/feed/read/", + "UPDATE" : "notification/v1/feed/update", + "DELETE" : "notification/v1/feed/delete" } } } From 2cf875fce358a13ae06d4a20a1b8300081738a8e Mon Sep 17 00:00:00 2001 From: ManojNathIC Date: Fri, 30 Aug 2024 13:02:39 +0530 Subject: [PATCH 10/17] Task #0000:private poll in dashboard --- .../src/pages/voting/votingDashboard.js | 351 +++++++++--------- 1 file changed, 182 insertions(+), 169 deletions(-) diff --git a/packages/nulp_elite/src/pages/voting/votingDashboard.js b/packages/nulp_elite/src/pages/voting/votingDashboard.js index d46724aa..d9f89c51 100644 --- a/packages/nulp_elite/src/pages/voting/votingDashboard.js +++ b/packages/nulp_elite/src/pages/voting/votingDashboard.js @@ -9,7 +9,15 @@ import Box from "@mui/material/Box"; import axios from "axios"; import { useTranslation } from "react-i18next"; import DashboardOutlinedIcon from "@mui/icons-material/DashboardOutlined"; -import { Alert, Button, Card, CardContent, DialogActions, DialogTitle, Tooltip } from "@mui/material"; +import { + Alert, + Button, + Card, + CardContent, + DialogActions, + DialogTitle, + Tooltip, +} from "@mui/material"; import TodayOutlinedIcon from "@mui/icons-material/TodayOutlined"; import ArrowForwardIosOutlinedIcon from "@mui/icons-material/ArrowForwardIosOutlined"; import IconButton from "@mui/material/IconButton"; @@ -83,40 +91,38 @@ const votingDashboard = () => { const [dialogOpen, setDialogOpen] = useState(false); const [selectedPollId, setSelectedPollId] = useState(null); - - const handleDialogOpen = (id, event) => { - event.stopPropagation(); + event.stopPropagation(); setDialogOpen(true); - setSelectedPollId(id); + setSelectedPollId(id); }; const handleDialogClose = () => { setDialogOpen(false); }; - const handleDeletePollConfirmed = async (event) => { - event.stopPropagation(); - try { - const response = await axios.delete( - `${urlConfig.URLS.POLL.DELETE_POLL}?poll_id=${selectedPollId}` - ); - if (response.status === 200) { - setDialogOpen(false); - // console.log(response.params.status); - setToasterMessage("Poll deleted successfully"); - fetchPolls(); - setPoll((prevPolls) => { - const updatedPolls = prevPolls.filter( - (poll) => poll.poll_id !== selectedPollId - ); - return updatedPolls; - }); - } - } catch (error) { - console.error("Error deleting poll", error); + const handleDeletePollConfirmed = async (event) => { + event.stopPropagation(); + try { + const response = await axios.delete( + `${urlConfig.URLS.POLL.DELETE_POLL}?poll_id=${selectedPollId}` + ); + if (response.status === 200) { + setDialogOpen(false); + // console.log(response.params.status); + setToasterMessage("Poll deleted successfully"); + fetchPolls(); + setPoll((prevPolls) => { + const updatedPolls = prevPolls.filter( + (poll) => poll.poll_id !== selectedPollId + ); + return updatedPolls; + }); } - }; + } catch (error) { + console.error("Error deleting poll", error); + } + }; useEffect(() => { const timer = setTimeout(() => { @@ -177,13 +183,16 @@ const votingDashboard = () => { }; try { - const response = await fetch(`${urlConfig.URLS.POLL.LIST}`, { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(requestBody), - }); + const response = await fetch( + `${urlConfig.URLS.POLL.LIST}?dashboard=true`, + { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(requestBody), + } + ); if (!response.ok) { throw new Error("Failed to fetch polls"); @@ -254,8 +263,6 @@ const votingDashboard = () => { fetchPolls(); }; - - const openSocialMediaLink = (event, url) => { event.stopPropagation(); event.preventDefault(); @@ -468,8 +475,9 @@ const votingDashboard = () => { ))} @@ -593,7 +601,7 @@ const votingDashboard = () => { type="button" className="custom-btn-primary ml-20 lg-mt-20 mb-10" onClick={(event) => { - event.stopPropagation(); + event.stopPropagation(); handleDialogOpen(items.poll_id, event); }} > @@ -808,8 +816,9 @@ const votingDashboard = () => { ))} @@ -856,15 +865,16 @@ const votingDashboard = () => { Edit + type="button" + className="custom-btn-primary ml-20 lg-mt-20 mb-10" + onClick={(event) => { + event.stopPropagation(); + handleDialogOpen(items.poll_id, event); + }} + > + Delete{" "} + + { ))} @@ -1113,16 +1124,16 @@ const votingDashboard = () => { + type="button" + className="custom-btn-primary ml-20 lg-mt-20 mb-10" + onClick={(event) => { + event.stopPropagation(); + handleDialogOpen(items.poll_id, event); + }} + > + Delete{" "} + + - + + )}
); From 2e13215c2ea5d943510947e116c891adadfc4941 Mon Sep 17 00:00:00 2001 From: sonaligarud Date: Fri, 30 Aug 2024 16:00:06 +0530 Subject: [PATCH 11/17] Feedback #226011 - Nulp Assist must be visible small 'Text should come after hover on the icon' on all pages --- packages/nulp_elite/src/components/FloatingChatIcon.js | 6 ++++-- packages/nulp_elite/src/styles/style.css | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/nulp_elite/src/components/FloatingChatIcon.js b/packages/nulp_elite/src/components/FloatingChatIcon.js index d126f784..af576691 100644 --- a/packages/nulp_elite/src/components/FloatingChatIcon.js +++ b/packages/nulp_elite/src/components/FloatingChatIcon.js @@ -1,5 +1,5 @@ import React, { useState } from "react"; -import { Popover, Typography } from "@mui/material"; +import { Popover, Tooltip, Typography } from "@mui/material"; import { makeStyles } from "@material-ui/core"; import { Link } from "react-router-dom"; import HeadsetMicOutlinedIcon from "@mui/icons-material/HeadsetMicOutlined"; @@ -49,6 +49,7 @@ const FloatingChatIcon = () => { title="ChatBot" /> + { height: "3 2px", // Adjust the size as needed }} /> - {t("NULP_ASSIST")} + + ); }; diff --git a/packages/nulp_elite/src/styles/style.css b/packages/nulp_elite/src/styles/style.css index 20cb766a..8e166982 100644 --- a/packages/nulp_elite/src/styles/style.css +++ b/packages/nulp_elite/src/styles/style.css @@ -697,7 +697,7 @@ button { .chatIcon { bottom: 162px; - width: 175px; + width: 65px; height: 46px; background: #484848; border-radius: 10px; From 52344882da3f4624280ea2c161fdf9afe50cf1f5 Mon Sep 17 00:00:00 2001 From: Mahesh Mahajan Date: Fri, 30 Aug 2024 17:44:37 +0530 Subject: [PATCH 12/17] TASK : #0000 show only public events on all event page --- .../src/pages/events/eventDetails.js | 19 ++++++++++++++----- .../nulp_elite/src/pages/events/eventList.js | 17 ++++++++++++++--- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/packages/nulp_elite/src/pages/events/eventDetails.js b/packages/nulp_elite/src/pages/events/eventDetails.js index 3ed9784b..ba028e40 100644 --- a/packages/nulp_elite/src/pages/events/eventDetails.js +++ b/packages/nulp_elite/src/pages/events/eventDetails.js @@ -607,6 +607,7 @@ const EventDetails = () => { const url = `${urlConfig.URLS.CUSTOM_EVENT.UPDATE_REGISTER}?event_id=${detailData.identifier}&user_id=${_userId}`; const RequestBody = { + name: formData?.name, email: formData?.email, designation: formData?.designation, organisation: formData?.organisation, @@ -616,12 +617,20 @@ const EventDetails = () => { }; try { - await axios.put(url, RequestBody); - console.log("update tegister successfull"); - } catch (error) { - console.error("Error updating vote", error); + const response = await axios.put(url, RequestBody); + + if (response?.data?.responseCode === "OK") { + console.log("Update register successful"); + + setIsAlreadyFilledRegistration(true); + } else { + console.error("Failed to update registration", response.data); } - }; + } catch (error) { + console.error("Error updating registration", error); + } +}; + const unEnroll = async (formData) => { try { const url = `${urlConfig.URLS.LEARNER_PREFIX}${urlConfig.URLS.COURSE.UNENROLL_USER_COURSE}`; diff --git a/packages/nulp_elite/src/pages/events/eventList.js b/packages/nulp_elite/src/pages/events/eventList.js index a8aa1614..792eadf8 100644 --- a/packages/nulp_elite/src/pages/events/eventList.js +++ b/packages/nulp_elite/src/pages/events/eventList.js @@ -111,7 +111,14 @@ const EventList = (props) => { // fetchAllData(); fetchMyEvents(); fetchUserData(); - }, []); + }, [ subDomainFilter, + endDateFilter, + startDateFilter, + searchQuery, + domainName, + domain, + currentPage, + subDomainFilter,]); useEffect(() => { fetchAllData(); }, [ @@ -168,7 +175,7 @@ const EventList = (props) => { const fetchAllData = async () => { console.log("searchQuery", searchQuery); let filters = { - + eventVisibility:"Public", objectType: ["Event"], ...((domainfilter?.se_board != null || domainName != null) && { board: domainfilter?.se_board || [domainName], @@ -212,7 +219,11 @@ const EventList = (props) => { let data = JSON.stringify({ request: { status: "Live", - filters: { user_id: _userId }, + filters: { user_id: _userId , ...((domainfilter?.se_board != null || domainName != null) && { + board: domainfilter?.se_board || [domainName], + }), ...(subDomainFilter && { gradeLevel: subDomainFilter }), + ...(startDate && { startDate: startDate }),}, + query: searchQuery, limit: 10, sort_by: { created_at: "desc" }, offset: 0, From 683a85a3c23d22287f13682250b428054f04463b Mon Sep 17 00:00:00 2001 From: sonaligarud Date: Fri, 30 Aug 2024 18:06:15 +0530 Subject: [PATCH 13/17] Bug #226005 - [Webapp] Make Faq word in capital letters on the footer and in help page --- packages/nulp_elite/public/locales/en/translation.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nulp_elite/public/locales/en/translation.json b/packages/nulp_elite/public/locales/en/translation.json index 75e3a8c6..3da626f2 100644 --- a/packages/nulp_elite/public/locales/en/translation.json +++ b/packages/nulp_elite/public/locales/en/translation.json @@ -132,7 +132,7 @@ "NEW_PASSWORD": "New Password", "TERMS_CONDITIONS": "Terms and conditions", "SELECT_CATEGORY": "Select category", - "FAQS": "Faq(s)", + "FAQS": "FAQ(s)", "NIUA": "NIUA", "MOHUA": "MoHUA", "ABOUT_US": "About Us", From 2af9bd9c0d89a20246abbc4357d7ae77a3402d16 Mon Sep 17 00:00:00 2001 From: sonaligarud Date: Mon, 2 Sep 2024 11:10:55 +0530 Subject: [PATCH 14/17] Feedback #226017 - On profile page hide the Organization from profile bio keep id and Organization Name. --- packages/nulp_elite/src/pages/profile/Profile.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nulp_elite/src/pages/profile/Profile.js b/packages/nulp_elite/src/pages/profile/Profile.js index c0c43494..6e69f8e2 100644 --- a/packages/nulp_elite/src/pages/profile/Profile.js +++ b/packages/nulp_elite/src/pages/profile/Profile.js @@ -738,11 +738,11 @@ const Profile = () => { ID:{" "} {userData?.result?.response?.userName || "NA"} - + {/* organisations:{" "} {userData?.result?.response?.organisations ?.orgName || "NA"} - + */} {userInfo?.length ? ( From e20caa01b36ec6a14c0803285687d96326f60d64 Mon Sep 17 00:00:00 2001 From: sonaligarud Date: Mon, 2 Sep 2024 12:10:26 +0530 Subject: [PATCH 15/17] Bug #226015 - All messages in the chat box are right aligned. They should be left aligned --- packages/nulp_elite/src/styles/style.css | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/nulp_elite/src/styles/style.css b/packages/nulp_elite/src/styles/style.css index 8e166982..acdb28d7 100644 --- a/packages/nulp_elite/src/styles/style.css +++ b/packages/nulp_elite/src/styles/style.css @@ -1546,6 +1546,15 @@ button { .addConnectChat .jss5 { position: inherit !important; + width: auto !important; + text-align: right !important; + font-size: 15px !important; + } + + .addConnectChat.jss6.undefined { + width: auto !important; + text-align: left !important; + font-size: 15px !important; } .mr-13 { @@ -2093,7 +2102,7 @@ button { position: fixed !important; width: 100%; z-index: 99999; - top: 80px; + overflow-y: scroll; } .domain-fixed .mt-180 { margin-top: 180px !important; @@ -2104,7 +2113,8 @@ button { position: fixed !important; width: 100%; z-index: 99999; - top: 80px; + overflow-y: scroll; + padding: 0px 0px 0px 40px; } .domain-fixed .mt-180 { margin-top: 180px !important; From a5243e477fcadad15077b5aa577319b943471806 Mon Sep 17 00:00:00 2001 From: Mahesh Mahajan Date: Mon, 2 Sep 2024 12:14:35 +0530 Subject: [PATCH 16/17] TASK : #0000 Pagination on my events tab --- packages/nulp_elite/src/pages/events/eventList.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/nulp_elite/src/pages/events/eventList.js b/packages/nulp_elite/src/pages/events/eventList.js index 792eadf8..a8eead3e 100644 --- a/packages/nulp_elite/src/pages/events/eventList.js +++ b/packages/nulp_elite/src/pages/events/eventList.js @@ -82,6 +82,7 @@ const EventList = (props) => { const [domainList, setDomainList] = useState([]); const { domainquery } = location.state || {}; const [totalPages, setTotalPages] = useState(1); + const [totalPage, setTotalPage] = useState(1) const [currentPage, setCurrentPage] = useState(1); const { t } = useTranslation(); const [toasterOpen, setToasterOpen] = useState(false); @@ -226,7 +227,7 @@ const EventList = (props) => { query: searchQuery, limit: 10, sort_by: { created_at: "desc" }, - offset: 0, + offset: 10 * (currentPage - 1), // Use currentPage for pagination }, }); const headers = { @@ -234,10 +235,10 @@ const EventList = (props) => { }; try { const url = `${urlConfig.URLS.CUSTOM_EVENT.CUSTOM_ENROLL_LIST}`; - // const url = `https://devnulp.niua.org/custom_event/enrollment-list`; const response = await getAllContents(url, data, headers); console.log("My data ---", response.data.result.event); setMyData(response.data.result.event); + setTotalPage(Math.ceil(response.data.result.totalCount / 10)); } catch (error) { console.log("m data error---", error); showErrorMessage(t("FAILED_TO_FETCH_DATA")); @@ -449,6 +450,11 @@ const EventList = (props) => { )} + Date: Mon, 2 Sep 2024 14:15:12 +0530 Subject: [PATCH 17/17] Bug #225930 - Inconsistent Button Positions on Poll Cards for Polls With and Without Keywords --- .../src/pages/voting/votingDashboard.js | 16 +--------------- packages/nulp_elite/src/styles/style.css | 5 ++++- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/packages/nulp_elite/src/pages/voting/votingDashboard.js b/packages/nulp_elite/src/pages/voting/votingDashboard.js index d9f89c51..dbccc422 100644 --- a/packages/nulp_elite/src/pages/voting/votingDashboard.js +++ b/packages/nulp_elite/src/pages/voting/votingDashboard.js @@ -460,7 +460,7 @@ const votingDashboard = () => { )} - + {items?.poll_keywords && ( <> {items.poll_keywords @@ -499,20 +499,6 @@ const votingDashboard = () => { )} - {/* - App Icon - */}