Skip to content

Commit

Permalink
Merge pull request #1655 from aswanthabam/dev
Browse files Browse the repository at this point in the history
feat: Learning Circle Pages
  • Loading branch information
nashnsulthan authored Oct 20, 2024
2 parents e34e5cc + b4a95c7 commit 31e19ea
Show file tree
Hide file tree
Showing 24 changed files with 1,407 additions and 316 deletions.
413 changes: 245 additions & 168 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"@chakra-ui/react": "^2.6.1",
"@emotion/react": "^11.10.6",
"@emotion/styled": "^11.10.6",
"@types/react-star-ratings": "^2.3.3",
"@types/react-tabs": "^5.0.5",
"axios": "^1.3.4",
"file-saver": "^2.0.5",
Expand All @@ -35,6 +36,7 @@
"react-router-dom": "^6.9.0",
"react-select": "^5.7.7",
"react-spinners": "^0.13.8",
"react-star-ratings": "^2.3.0",
"react-tabs": "^6.0.1",
"react-tag-input-component": "^2.0.2",
"react-tooltip": "^5.18.1",
Expand Down
15 changes: 15 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ import UserInterest from "./modules/Common/Authentication/pages/Onboarding/UserI
import LcMeetupIfo from "./modules/Dashboard/modules/LearningCircle/pages/Meetup/LcMeetup";
import OrganizationSetting from "./modules/Dashboard/modules/Settings/pages/Organization/Organization";
import SettingsHome from "./modules/Dashboard/modules/Settings/pages/Settings/SettingsHome";
import LcReportAttendee from "./modules/Dashboard/modules/LearningCircle/pages/LcDashboard/components/LcAttendeeReport";
import LcAdmin from "./modules/Dashboard/modules/LearningCircle/pages/LcAdmin/LcAdmin";

const Profile = lazy(
() => import("./modules/Dashboard/modules/Profile/pages/Profile")
Expand Down Expand Up @@ -365,6 +367,15 @@ function App() {
/>
)
},
{
path: "lc-meetup-verification",
element: (
<AuthChecker
roles={[roles.ADMIN, roles.FELLOW]}
children={<LcAdmin />}
/>
)
},
{
path: "campus-details",
element: (
Expand Down Expand Up @@ -704,6 +715,10 @@ function App() {
path: "learning-circle/meetup/:id",
element: <LcMeetupIfo />
},
{
path: "learning-circle/meetup/:id/attendee-report",
element: <LcReportAttendee />
},
{
path: "learning-circle/details/:id",
element: <LearningCircle />
Expand Down
4 changes: 0 additions & 4 deletions src/modules/Common/Authentication/pages/Onboarding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,6 @@ const Onboarding = (props: Props) => {
setDefaultCommunity([
{ value: foundCommunity.id, label: foundCommunity.title }
]);
console.log(defaultCommunity);
}
}
}, [communityAPI]);
Expand Down Expand Up @@ -1065,9 +1064,6 @@ const Onboarding = (props: Props) => {
: null
}
onChange={OnChangeValue => {
console.log(
OnChangeValue
);
formik.setFieldValue(
"community",
OnChangeValue.map(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ export default function CollegePage() {
}
});
};
// console.log(userData);
return (
<OnboardingTemplate>
<OnboardingHeader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ export default function SignIn() {
});

const onSubmit = (values: any) => {
console.log(values);

if (!otpForm) {
login(
values.emailOrMuId,
Expand Down
1 change: 0 additions & 1 deletion src/modules/Common/Authentication/pages/ResetPassword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const ResetPassword = (props: Props) => {
useEffect(() => {
const paramToken = searchParams.get("token");
setToken(paramToken as string);
console.log(token);
if (token.length > 0 && muid.length === 0) {
getMuid(token, navigate, setMuID);
}
Expand Down
8 changes: 7 additions & 1 deletion src/modules/Dashboard/layouts/DashboardRootLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,15 @@ const DashboardRootLayout = (props: { component?: any }) => {
url: "/dashboard/interest-groups",
title: "Interest Groups",
hasView: true,
roles: [roles.ADMIN]
roles: [roles.ADMIN, roles.FELLOW]
// icon: <i className="fi fi-sr-books"></i>
},
{
url: "/dashboard/lc-meetup-verification",
title: "LC Meetup Verification",
hasView: true,
roles: [roles.ADMIN]
},
{
url: "/dashboard/college-levels",
title: "College Levels",
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import Pagination from "@/MuLearnComponents/Pagination/Pagination";
import Table, { Data } from "@/MuLearnComponents/Table/Table";
import THead from "@/MuLearnComponents/Table/THead";
import { dashboardRoutes } from "@/MuLearnServices/urls";
import { ReactJSXElement } from "@emotion/react/types/jsx-namespace";
import { ReactElement, useEffect, useState } from "react";
import { getVerifiableMeetups } from "../../services/LearningCircleAPIs";

const LcAdmin = () => {
const [isLoading, setIsLoading] = useState<boolean>(false);
const [data, setData] = useState<any[]>([]);
const [currentPage, setCurrentPage] = useState(1);
const [totalPages, setTotalPages] = useState(1);
const [perPage, setPerPage] = useState(20);
const [sort, setSort] = useState("");

useEffect(() => {
setIsLoading(true);
getVerifiableMeetups().then(res => {
console.log(res);
setData(res);
setIsLoading(false);
});
}, []);

const columnOrder: {
column: string;
Label: string;
isSortable: boolean;
wrap?: (
data: string | ReactElement,
id: string,
row: Data
) => ReactJSXElement;
}[] = [
{
column: "learning_circle",
Label: "Learning Circle",
isSortable: false
},
{ column: "title", Label: "Meetup Title", isSortable: false },
{ column: "join_count", Label: "Join Count", isSortable: false },
{
column: "interested_count",
Label: "Interest Count",
isSortable: false
},
{
column: "report_submitted_attendees",
Label: "Report Submitted Attendees",
isSortable: false
},
{
column: "held_on",
Label: "Started At",
isSortable: false
}
];
return (
<>
<Table
isloading={isLoading}
rows={data}
page={currentPage}
perPage={perPage}
columnOrder={columnOrder}
id={["id"]}
onVerifyClick={() => {}}
>
<THead
columnOrder={columnOrder}
onIconClick={() => {}}
action={false}
/>
<div>
{!isLoading && (
<Pagination
currentPage={currentPage}
totalPages={totalPages}
margin="10px 0"
handleNextClick={() => {}}
handlePreviousClick={() => {}}
onSearchText={() => {}}
onPerPageNumber={() => {}}
perPage={perPage}
setPerPage={setPerPage}
/>
)}
</div>
{/*use <Blank/> when u don't need <THead /> or <Pagination inside <Table/> cause <Table /> needs atleast 2 children*/}
</Table>
</>
);
};

export default LcAdmin;
Loading

0 comments on commit 31e19ea

Please sign in to comment.