= {};
+ acceptedList.forEach(user_id => {
+ map[user_id] = true;
+ });
+ rejectedList.forEach(user_id => (map[user_id] = false));
+ // console.log(map);
+ submitLcReport(params.meet_id ?? "", report, map).then(res => {
+ if (res) {
+ navigate(-1);
+ }
+ });
+ };
+
+ return (
+ <>
+ {selectedAttendee && (
+
+
+
+ {selectedAttendee.full_name.split(" ")[0]}'s Report
+
+
Report
+
{selectedAttendee.report}
+
Links
+
+
+ {selectedAttendee.report_link}
+
+
+
{
+ setSelectedAttendee(null);
+ }}
+ >
+ Close
+
+
+
+
+ )}
+
+
{
+ navigate(-1);
+ }}
+ >
+
+ Learning Circles
+
+
+
Report Submission
+
+
Attendees
+
+ From the listed attendees of your learning circle,
+ review the report submitted by them and approve/reject
+ it to submit report.
+
+
+ {reportInfo
+ ? reportInfo.attendees.map((attendee, index) => {
+ return (
+
+
+
+ {index + 1}.
+
+
+
+ {attendee.full_name}
+
+ {/*
+ {attendee.muid}
+ */}
+
+ {attendee.report != null &&
+ attendee.report != "" ? (
+
+ {acceptedList.includes(
+ attendee.user_id
+ ) ? (
+
+ Accepted
+
+ ) : rejectedList.includes(
+ attendee.user_id
+ ) ? (
+
+ Rejected
+
+ ) : null}
+
+ {!reportSubmitted &&
+ (acceptedList.includes(
+ attendee.user_id
+ ) ||
+ rejectedList.includes(
+ attendee.user_id
+ )) && (
+ {
+ handleReset(
+ attendee
+ );
+ }}
+ >
+
+
+ )}
+
+ {reportSubmitted ||
+ (!acceptedList.includes(
+ attendee.user_id
+ ) &&
+ !rejectedList.includes(
+ attendee.user_id
+ )) ? (
+ {
+ handleView(
+ attendee
+ );
+ }}
+ >
+
+
+ ) : null}
+ {!acceptedList.includes(
+ attendee.user_id
+ ) &&
+ !rejectedList.includes(
+ attendee.user_id
+ ) ? (
+ <>
+ {
+ handleReject(
+ attendee
+ );
+ }}
+ >
+
+
+
+ {
+ handleAccept(
+ attendee
+ );
+ }}
+ >
+
+
+ >
+ ) : null}
+
+ ) : (
+
+ Attendee report not submitted
+
+ )}
+
+ );
+ })
+ : null}
+
+
+
+ {reportSubmitted
+ ? "Report Already Submitted"
+ : "Submit Report"}
+
+
+
+
+ >
+ );
+}
diff --git a/src/modules/Dashboard/modules/LearningCircleV2/pages/dashboard/DashboardLC.tsx b/src/modules/Dashboard/modules/LearningCircleV2/pages/dashboard/DashboardLC.tsx
index 89d6cd23e..2453b932a 100644
--- a/src/modules/Dashboard/modules/LearningCircleV2/pages/dashboard/DashboardLC.tsx
+++ b/src/modules/Dashboard/modules/LearningCircleV2/pages/dashboard/DashboardLC.tsx
@@ -53,7 +53,7 @@ export default function DashboardLC() {
{circleInfo.next_meetup.title}
- {/* {
var url =
`${window.location.protocol}//${window.location.host}/dashboard/learningcircle/meetup/${circleInfo.next_meetup.id}` +
@@ -78,7 +78,7 @@ export default function DashboardLC() {
>
Copy Link
- */}
+
{
@@ -134,7 +134,7 @@ export default function DashboardLC() {
style={{ padding: "5px 40px" }}
onClick={() => {
navigate(
- "/dashboard/learningcircle/attendee-report/" +
+ "/dashboard/learningcircle/report/" +
circleInfo.next_meetup.id
);
}}
diff --git a/src/modules/Dashboard/modules/LearningCircleV2/pages/moreInfoLC/MoreInfoLC.module.css b/src/modules/Dashboard/modules/LearningCircleV2/pages/moreInfoLC/MoreInfoLC.module.css
index 232c5f474..6a30865c7 100644
--- a/src/modules/Dashboard/modules/LearningCircleV2/pages/moreInfoLC/MoreInfoLC.module.css
+++ b/src/modules/Dashboard/modules/LearningCircleV2/pages/moreInfoLC/MoreInfoLC.module.css
@@ -1,3 +1,20 @@
+.joinCodeInput {
+ width: 70%;
+ margin: 10px;
+ padding: 0.5rem;
+ border: 1px solid #d1d1d1;
+ border-radius: 0.5rem;
+ font-size: 1rem;
+ margin-right: 1rem;
+ color: #000;
+}
+.joinInfo {
+ color: #515151;
+ font-size: 1rem;
+ margin-top: 0.5rem;
+ display: block;
+ padding: 20px;
+}
.container {
display: flex;
flex-direction: column;
diff --git a/src/modules/Dashboard/modules/LearningCircleV2/pages/moreInfoLC/MoreInfoLC.tsx b/src/modules/Dashboard/modules/LearningCircleV2/pages/moreInfoLC/MoreInfoLC.tsx
index ae23235ce..b5f603cf8 100644
--- a/src/modules/Dashboard/modules/LearningCircleV2/pages/moreInfoLC/MoreInfoLC.tsx
+++ b/src/modules/Dashboard/modules/LearningCircleV2/pages/moreInfoLC/MoreInfoLC.tsx
@@ -2,7 +2,7 @@ import styles from "./MoreInfoLC.module.css";
import { FiChevronLeft } from "react-icons/fi";
import { CiLocationOn, CiClock2 } from "react-icons/ci";
import { PowerfulButton } from "@/MuLearnComponents/MuButtons/MuButton";
-import { useNavigate, useParams } from "react-router-dom";
+import { useNavigate, useParams, useSearchParams } from "react-router-dom";
import { useEffect, useState } from "react";
import {
getMeetupInfo,
@@ -23,13 +23,21 @@ export default function MoreInfoLC() {
const [isModalOpen, setIsModalOpen] = useState(false);
const [meetCode, setMeetCode] = useState("");
const params = useParams();
+ const [searchParams, setSearchParams] = useSearchParams();
useEffect(() => {
+ var code = searchParams.get("code");
+ if (code) {
+ setMeetCode(code);
+ }
getMeetupInfo(params.id ?? "").then(res => {
setMeetup(res as any);
});
}, []);
const handleMainButton = () => {
+ if (meetup?.attendee?.is_report_submitted) {
+ navigate(`/dashboard/learningcircle/report/${meetup.id}`);
+ }
if (meetup?.is_started) {
if (meetup.attendee && meetup.attendee.is_joined) {
if (!meetup.attendee.is_report_submitted) {
@@ -38,6 +46,17 @@ export default function MoreInfoLC() {
);
}
} else {
+ if (meetCode) {
+ handleJoin();
+ setMeetup({
+ ...meetup,
+ attendee: {
+ ...(meetup.attendee as any),
+ is_joined: 1
+ }
+ });
+ return;
+ }
setIsModalOpen(true);
}
} else {
diff --git a/src/modules/Dashboard/modules/LearningCircleV2/services/LearningCircleAPIs.ts b/src/modules/Dashboard/modules/LearningCircleV2/services/LearningCircleAPIs.ts
index 7dff083d3..56926e193 100644
--- a/src/modules/Dashboard/modules/LearningCircleV2/services/LearningCircleAPIs.ts
+++ b/src/modules/Dashboard/modules/LearningCircleV2/services/LearningCircleAPIs.ts
@@ -6,6 +6,60 @@ import toast from "react-hot-toast";
const openstreetmapurl =
"https://nominatim.openstreetmap.org/search?format=json&q=";
+export const getLcReportInfo = async (
+ meet_id: string
+): Promise => {
+ try {
+ const response = await privateGateway.get(
+ learningCircleRoutes.getLcReportInfo + meet_id
+ );
+ return response.data.response;
+ } catch (err) {
+ const error = err as AxiosError;
+ toast.error(
+ ((error?.response?.data as any)?.message?.general ?? [
+ "Unexpected error occured."
+ ])[0]
+ );
+ return null;
+ }
+};
+
+export const submitLcReport = async (
+ meet_id: string,
+ report: string,
+ attendees: Record
+): Promise => {
+ try {
+ const response = await privateGateway.post(
+ learningCircleRoutes.getLcReportInfo + meet_id,
+ {
+ report: report,
+ attendees: attendees
+ }
+ );
+ if (response.status === 200) {
+ toast.success(
+ [response.data?.message?.general ?? "Report Submited.."][0]
+ );
+ return true;
+ }
+ toast.error(
+ (response.data?.message?.general ?? ["Unable to submit report."])[0]
+ );
+ return false;
+ } catch (err) {
+ const error = err as AxiosError;
+ console.log(error);
+ toast.error(
+ ((error.response as any)?.data?.message?.general ?? [
+ "Unable to join learning circle."
+ ])[0]
+ );
+ return false;
+ }
+};
+
export const searchCoordinates = async (
searchString: string
): Promise => {
diff --git a/src/modules/Dashboard/modules/LearningCircleV2/services/LearningCircleInterface.d.ts b/src/modules/Dashboard/modules/LearningCircleV2/services/LearningCircleInterface.d.ts
index b11d4f961..b6c93adc6 100644
--- a/src/modules/Dashboard/modules/LearningCircleV2/services/LearningCircleInterface.d.ts
+++ b/src/modules/Dashboard/modules/LearningCircleV2/services/LearningCircleInterface.d.ts
@@ -82,3 +82,16 @@ interface CircleMeetingAttendee {
is_report_submitted: boolean;
is_lc_approved: boolean;
}
+
+interface LCReportInfo {
+ is_report_submitted: boolean;
+ report: string | null;
+ attendees: {
+ user_id: string;
+ full_name: string;
+ muid: string;
+ is_lc_approved: boolean;
+ report: string | null;
+ report_link: string | null;
+ }[];
+}
diff --git a/src/services/urls.ts b/src/services/urls.ts
index 8d1d65eb6..9514919f3 100644
--- a/src/services/urls.ts
+++ b/src/services/urls.ts
@@ -6,6 +6,7 @@ import {
import {
createLearningCircle,
getCreatedLearningCircles,
+ getLcReportInfo,
getLearningCircleInfo,
scheduleMeetup
} from "src/modules/Dashboard/modules/LearningCircleV2/services/LearningCircleAPIs";
@@ -55,7 +56,8 @@ export const learningCircleRoutes = {
submitAttendeeReport:
"/api/v1/dashboard/learningcircle/meeting/attendee-report/",
getMeetups: "/api/v1/dashboard/learningcircle/meeting/list/",
- joinMeetup: "/api/v1/dashboard/learningcircle/meeting/join/"
+ joinMeetup: "/api/v1/dashboard/learningcircle/meeting/join/",
+ getLcReportInfo: "/api/v1/dashboard/learningcircle/meeting/report/"
};
export const dashboardRoutes = {
forgetPassword: "/api/v1/dashboard/user/forgot-password/",