Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixed google calendar integration bug #76

Open
wants to merge 14 commits into
base: staging
Choose a base branch
from
3 changes: 1 addition & 2 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ const config = {
MIXPANEL_PROJECT_TOKEN: process.env.REACT_APP_MIXPANEL_PROJECT_TOKEN,
},
production: {
// API_BASE_URL: process.env.REACT_APP_AWS_BACKEND_URL,
API_BASE_URL: "https://stg.api.susunjadwal.cs.ui.ac.id/susunjadwal/api",
API_BASE_URL: process.env.REACT_APP_AWS_BACKEND_URL,
BASE_URL: "/",
},
development: {
Expand Down
37 changes: 37 additions & 0 deletions src/containers/Admin/Feedbacks/feedback.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions src/containers/BuildSchedule/CourseClass.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import styled from "styled-components";
// import { useMixpanel } from "hooks/useMixpanel";
import { useMixpanel } from "hooks/useMixpanel";
import { useSelector, useDispatch } from "react-redux";
import { addSchedule, removeSchedule } from "redux/modules/schedules";
import { useColorModeValue } from "@chakra-ui/react";
Expand Down Expand Up @@ -100,8 +100,7 @@ function CourseClass({ course, courseClass }) {
dispatch(removeSchedule(item));
} else {
dispatch(addSchedule(item));
// TODO: Re-enable mixpanel or change to other analytics
// useMixpanel.track("select_course");
useMixpanel.track("select_course");
}
};

Expand Down
8 changes: 3 additions & 5 deletions src/containers/BuildSchedule/SelectMajor.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
// import { useMixpanel } from "hooks/useMixpanel";
import { useMixpanel } from "hooks/useMixpanel";
import { Flex } from "@chakra-ui/react";
import FACULTIES from "utils/faculty-base-additional-info.json";
import { useForm } from "react-hook-form";
Expand Down Expand Up @@ -29,13 +29,11 @@ function SelectMajor({ theme, isMobile, setMajorSelected, show }) {
}

useEffect(() => {
// TODO: Re-enable mixpanel or change to other analytics
// if (selectedFaculty) useMixpanel.track("select_faculty");
if (selectedFaculty) useMixpanel.track("select_faculty");
}, [selectedFaculty]);

useEffect(() => {
// TODO: Re-enable mixpanel or change to other analytics
// if (selectedMajorName) useMixpanel.track("select_prodi");/
if (selectedMajorName) useMixpanel.track("select_prodi");
}, [selectedMajorName]);

return (
Expand Down
12 changes: 5 additions & 7 deletions src/containers/BuildSchedule/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, useState, useCallback, useRef } from "react";
import { useSelector, useDispatch } from "react-redux";
// import { useMixpanel } from "hooks/useMixpanel";
import { useMixpanel } from "hooks/useMixpanel";
import {
Button,
useColorModeValue,
Expand Down Expand Up @@ -97,15 +97,13 @@ function BuildSchedule() {
}
});

// TODO: Re-enable mixpanel or change to other analytics
// useEffect(() => {
// useMixpanel.track("open_buat_jadwal");
// }, []);
useEffect(() => {
useMixpanel.track("open_buat_jadwal");
}, []);

useEffect(() => {
if (isInitialMount.current) isInitialMount.current = false;
// TODO: Re-enable mixpanel or change to other analytics
// else useMixpanel.track("search_course");
else useMixpanel.track("search_course");
}, [value]);

return (
Expand Down
11 changes: 4 additions & 7 deletions src/containers/Contributors/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useCallback, useEffect, useState } from "react";
// import { useMixpanel } from "hooks/useMixpanel";
import { useMixpanel } from "hooks/useMixpanel";
import { Text, Box, Button, Flex, useColorModeValue } from "@chakra-ui/react";
import { ChevronLeftIcon } from "@chakra-ui/icons";
import { Link } from "react-router-dom";
Expand Down Expand Up @@ -36,8 +36,7 @@ const Contributors = () => {
}, [fetchContributors]);

useEffect(() => {
// TODO: Re-enable mixpanel or change to other analytics
// useMixpanel.track("open_contributors");
useMixpanel.track("open_contributors");
}, []);

const MergeContributors = (contributors, otherContributors) => {
Expand Down Expand Up @@ -91,8 +90,7 @@ const Contributors = () => {
avatar={user.avatar_url}
github={user.html_url}
contributions={user.contributions}
// TODO: Re-enable mixpanel or change to other analytics
// onClick={() => useMixpanel.track("see_contributor_detail")}
onClick={() => useMixpanel.track("see_contributor_detail")}
/>
));

Expand Down Expand Up @@ -139,8 +137,7 @@ const Contributors = () => {
<a
href="https://ristek.link/oss-discord"
rel="noopener noreferrer"
// TODO: Re-enable mixpanel or change to other analytics
// onClick={() => useMixpanel.track("gabung_discord")}
onClick={() => useMixpanel.track("gabung_discord")}
target="_blank"
>
<Button
Expand Down
7 changes: 3 additions & 4 deletions src/containers/Header/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Link, useLocation } from "react-router-dom";
import { useSelector } from "react-redux";
// import { useMixpanel } from "hooks/useMixpanel";
import { useMixpanel } from "hooks/useMixpanel";
import React from "react";

import {
Expand Down Expand Up @@ -93,9 +93,8 @@ function Header() {
type="checkbox"
onClick={() => {
toggleColorMode();
// TODO: Re-enable mixpanel or change to other analytics
// if (theme === "light") useMixpanel.track("dark_mode");
// else useMixpanel.track("light_mode");
if (theme === "light") useMixpanel.track("dark_mode");
else useMixpanel.track("light_mode");
}}
checked={theme === "light" ? false : true}
/>
Expand Down
8 changes: 3 additions & 5 deletions src/containers/Login/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useSelector, useDispatch } from "react-redux";
import { Fade, Button, Box, useColorModeValue } from "@chakra-ui/react";
// import { useMixpanel } from "hooks/useMixpanel";
import { useMixpanel } from "hooks/useMixpanel";
import React, { useEffect, useState, useMemo, useRef } from "react";
import { Link } from "react-router-dom";
import { parse } from "query-string";
Expand Down Expand Up @@ -399,8 +399,7 @@ function Login({ history, location }) {
href="https://ristek.link/oss-discord"
rel="noopener noreferrer"
target="_blank"
// TODO: Re-enable mixpanel or change to other analytics
// onClick={() => useMixpanel.track("gabung_discord")}
onClick={() => useMixpanel.track("gabung_discord")}
>
<DiscordButton _hover={{ background: "primary.Purple" }}>
Join Discord
Expand All @@ -409,8 +408,7 @@ function Login({ history, location }) {
<div style={{ minWidth: "16px", minHeight: "16px" }}></div>
<Link
to="/kontributor"
// TODO: Re-enable mixpanel or change to other analytics
// onClick={() => useMixpanel.track("see_contributor_detail")}
onClick={() => useMixpanel.track("see_contributor_detail")}
>
<DiscordButton variant="outline">Lihat Kontributor</DiscordButton>
</Link>
Expand Down
6 changes: 2 additions & 4 deletions src/containers/ScheduleList/ScheduleDetail.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useRef } from "react";
// import { useMixpanel } from "hooks/useMixpanel";
import { useMixpanel } from "hooks/useMixpanel";
import { Link } from "react-router-dom";
import { useSelector } from "react-redux";
import styled from "styled-components";
Expand Down Expand Up @@ -67,9 +67,7 @@ const ScheduleDetail = ({
return (
<>
<Link
// TODO: Re-enable mixpanel or change to other analytics
// onClick={() => useMixpanel.track("open_jadwal")}
onClick={null}
onClick={() => useMixpanel.track("open_jadwal")}
to={`/jadwal/${schedule.id}`}
>
<Card key={`${schedule.name}-${idx}`} mode={theme}>
Expand Down
11 changes: 4 additions & 7 deletions src/containers/ScheduleList/SortByTermButton.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
// import { useMixpanel } from "hooks/useMixpanel";
import { useMixpanel } from "hooks/useMixpanel";
import { useSelector } from "react-redux";
import {
Menu,
Expand Down Expand Up @@ -50,8 +50,7 @@ const SortByTermButton = ({ isSortByLatest, setSortByLatest }) => {
display="flex"
justifyContent="center"
alignItems="center"
// TODO: Re-enable mixpanel or change to other analytics
// onClick={() => useMixpanel.track("sort_daftar_jadwal")}
onClick={() => useMixpanel.track("sort_daftar_jadwal")}
/>
<MenuList>
<MenuOptionGroup
Expand All @@ -62,8 +61,7 @@ const SortByTermButton = ({ isSortByLatest, setSortByLatest }) => {
<MenuItemOption
onClick={() => {
setSortByLatest(true);
// TODO: Re-enable mixpanel or change to other analytics
// useMixpanel.track("sort_semester_terbaru");
useMixpanel.track("sort_semester_terbaru");
}}
value="desc"
>
Expand All @@ -72,8 +70,7 @@ const SortByTermButton = ({ isSortByLatest, setSortByLatest }) => {
<MenuItemOption
onClick={() => {
setSortByLatest(false);
// TODO: Re-enable mixpanel or change to other analytics
// useMixpanel.track("sort_semester_terlama");
useMixpanel.track("sort_semester_terlama");
}}
value="asc"
>
Expand Down
11 changes: 4 additions & 7 deletions src/containers/ScheduleList/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, useState, useRef } from "react";
import ReactGA from "react-ga";
// import { useMixpanel } from "hooks/useMixpanel";
import { useMixpanel } from "hooks/useMixpanel";
import { useHistory } from "react-router";
import {
Button,
Expand Down Expand Up @@ -118,14 +118,12 @@ const ScheduleList = () => {
}, [filteredSchedules, isSortByLatest]);

useEffect(() => {
// TODO: Re-enable mixpanel or change to other analytics
// useMixpanel.track("open_daftar_jadwal");
useMixpanel.track("open_daftar_jadwal");
}, []);

useEffect(() => {
if (isInitialMount.current) isInitialMount.current = false;
// TODO: Re-enable mixpanel or change to other analytics
// else useMixpanel.track("search_daftar_jadwal");
else useMixpanel.track("search_daftar_jadwal");
}, [query]);

const performDeleteSchedule = async (userId, scheduleId) => {
Expand Down Expand Up @@ -325,8 +323,7 @@ const ScheduleList = () => {
}
onMouseDown={() => {
setQuery(document.getElementById("input").value);
// TODO: Re-enable mixpanel or change to other analytics
// useMixpanel.track("search_daftar_jadwal");
useMixpanel.track("search_daftar_jadwal");
}}
fontSize={isMobile && "14px"}
px={isMobile && "4px"}
Expand Down
11 changes: 4 additions & 7 deletions src/containers/SelectedCourses/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import ReactGA from "react-ga";
import styled from "styled-components";
// import { useMixpanel } from "hooks/useMixpanel";
import { useMixpanel } from "hooks/useMixpanel";
import { withRouter } from "react-router";

import { useSelector, useDispatch } from "react-redux";
Expand Down Expand Up @@ -161,8 +161,7 @@ function SelectedCourses({ history, scheduleId, isEditing }) {
<Button
onClick={() => {
onClose();
// TODO: Re-enable mixpanel or change to other analytics
// useMixpanel.track("cancel");
useMixpanel.track("cancel");
}}
variant="outline"
borderColor={
Expand All @@ -180,8 +179,7 @@ function SelectedCourses({ history, scheduleId, isEditing }) {
? handleDeleteSchedule()
: updateSchedule();

// TODO: Re-enable mixpanel or change to other analytics
// useMixpanel.track("simpan_jadwal");
useMixpanel.track("simpan_jadwal");
}}
variant="solid"
bg={theme === "light" ? "primary.Purple" : "dark.LightPurple"}
Expand Down Expand Up @@ -245,8 +243,7 @@ function SelectedCourses({ history, scheduleId, isEditing }) {

<Button
onClick={() => {
// TODO: Re-enable mixpanel or change to other analytics
// useMixpanel.track("open_simpan_modal");
useMixpanel.track("open_simpan_modal");
onOpen();
}}
disabled={isConflict || totalCredits > 24 || schedules.length === 0}
Expand Down
14 changes: 5 additions & 9 deletions src/containers/UpdateCourses/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect } from "react";
import ReactGA from "react-ga";
import Helmet from "react-helmet";
// import { useMixpanel } from "hooks/useMixpanel";
import { useMixpanel } from "hooks/useMixpanel";
import styled from "styled-components";
import { useForm } from "react-hook-form";
import { useSelector } from "react-redux";
Expand Down Expand Up @@ -42,22 +42,19 @@ const UpdateCourses = () => {
const password = watch("password");

useEffect(() => {
// TODO: Re-enable mixpanel or change to other analytics
// useMixpanel.track("open_update_matkul");
useMixpanel.track("open_update_matkul");
}, []);

useEffect(() => {
if (username && !isUsernameChanged) {
// TODO: Re-enable mixpanel or change to other analytics
// useMixpanel.track("update_matkul_fill_username");
useMixpanel.track("update_matkul_fill_username");
setIsUsernameChanged(true);
}
}, [username, isUsernameChanged]);

useEffect(() => {
if (password && !isPasswordChanged) {
// TODO: Re-enable mixpanel or change to other analytics
// useMixpanel.track("update_matkul_fill_password");
useMixpanel.track("update_matkul_fill_password");
setIsPasswordChanged(true);
}
}, [password, isPasswordChanged]);
Expand Down Expand Up @@ -136,8 +133,7 @@ const UpdateCourses = () => {
w={{ sm: "100%", lg: "unset" }}
bg={theme === "light" ? "primary.Purple" : "dark.LightPurple"}
color={theme === "light" ? "white" : "dark.White"}
// TODO: Re-enable mixpanel or change to other analytics
// onClick={() => useMixpanel.track("update_matkul")}
onClick={() => useMixpanel.track("update_matkul")}
>
Update Jadwal
</Button>
Expand Down
Loading