+
+
+
+
+ {this.CustomButton("Preview", 1)}
+ {this.CustomButton("Midsem Schedule", 2)}
+ {this.CustomButton("Compre Schedule", 3)}
+ {this.CustomButton("Export PNG", 4)}
+ {
+ this.props.clearAll();
+ }}
+ >
+ Clear All Entries
+
+
+ Save TimeTable
+
+
+
+
+
+
+
>
) : this.state.view === 1 ? (
<>
{this.CustomButton("Preview", 0)}
+
+
>
) : this.state.view === 2 ? (
<>
{this.CustomButton("Midsem Schedule", 0)}
+
+
>
) : this.state.view === 3 ? (
<>
{this.CustomButton("Compre Schedule", 0)}
+
+
>
) : this.state.view === 4 ? (
<>
{this.CustomButton("Export As PNG", 0)}
+
>
) : null}
diff --git a/client/src/components/timetable/PreviewTT.jsx b/client/src/components/timetable/PreviewTT.jsx
index 43537d2..3b3795c 100644
--- a/client/src/components/timetable/PreviewTT.jsx
+++ b/client/src/components/timetable/PreviewTT.jsx
@@ -1,47 +1,51 @@
-import { Component } from "react";
-import React from "react";
-import { connect } from "react-redux";
-import PropTypes from "prop-types";
-import { deleteSection } from "../../redux/actions/UpdateTimeTable";
-import "../../styles/Timetable.css";
-
-const ntw = require("number-to-words");
+import { Component } from "react"
+import React from "react"
+import { connect } from "react-redux"
+import PropTypes from "prop-types"
+import { deleteSection } from "../../redux/actions/UpdateTimeTable"
+import "../../styles/Timetable.css"
+const ntw = require("number-to-words")
class PreviewTT extends Component {
constructor(props) {
- super(props);
- this.populateTimetable.bind(this);
- this.gridArray = [];
+ super(props)
+ this.populateTimetable.bind(this)
+ this.infoRedirect.bind(this)
+ this.gridArray = []
+ }
+ infoRedirect(courseCode){
+ let courseName = courseCode.toString().replace(' ','_')
+ window.open("https://reviews.bphc.xyz/courses/"+courseName)
}
populateTimetable() {
var gridList = [
- ["Time", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
- ["Monday", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
- ["Tuesday", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
- ["Wednesday", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
- ["Thursday", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
- ["Friday", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
- ["Saturday", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
- ];
+ ["Time", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
+ ["Monday", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ ["Tuesday", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ ["Wednesday", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ ["Thursday", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ ["Friday", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ ["Saturday", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ ]
- let Map = {};
- Map["M"] = 1;
- Map["T"] = 2;
- Map["W"] = 3;
- Map["Th"] = 4;
- Map["F"] = 5;
- Map["S"] = 6;
+ let Map = {}
+ Map["M"] = 1
+ Map["T"] = 2
+ Map["W"] = 3
+ Map["Th"] = 4
+ Map["F"] = 5
+ Map["S"] = 6
- let divStyle = {};
- var days = ["M", "T", "W", "Th", "F", "S"];
- var hours = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
- var day, hour;
+ let divStyle = {}
+ var days = ["M", "T", "W", "Th", "F", "S"]
+ var hours = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
+ var day, hour
for (day of days) {
for (hour of hours) {
- divStyle = {};
- let section = this.props.TimeTable[day][ntw.toWords(hour)];
- let str = "";
+ divStyle = {}
+ let section = this.props.TimeTable[day][ntw.toWords(hour)]
+ let str = ""
if (gridList[Map[day]][hour] === -1) {
- continue;
+ continue
} else if (!section.courseCode) {
str = (
{" "}
- );
+ )
} else {
if (section.numHours > 1) {
for (let i = 1; i < section.numHours; i++) {
- gridList[Map[day]][hour + i] = -1;
+ gridList[Map[day]][hour + i] = -1
}
divStyle = {
gridRowStart: `${hour + 1}`,
gridColumnStart: `${Map[day] + 1}`,
gridCoulmnEnd: `${Map[day] + 2}`,
- gridRowEnd: `span ${section.numHours}`
- };
+ gridRowEnd: `span ${section.numHours}`,
+ }
}
str = (
- <>
-
- this.props.onRemove(section.section, section.courseCode)
+
{
+ if (!e) var e = window.event;
+ if (e.button == 1){
+ e.preventDefault()
+ this.infoRedirect(section.courseCode)
}
- >
-
- {section.courseName}
-
-
- {section.courseCode}
-
- {section.sectionRoom}
+ else if(e.button==0){
+ this.props.onRemove(section.section, section.courseCode)
+ }
+ }
+ }
+ >
+
Click to remove section
+
+ {section.courseName}
- >
- );
+ {section.courseCode}
+
+ {section.section}
+
+
+ )
}
- gridList[Map[day]][hour] = str;
+ gridList[Map[day]][hour] = str
}
}
for (let i = 0; i <= 6; i++) {
- for (let j = 0; j <= 10; j++) {
+ for (let j = 0; j <= 11; j++) {
if (j === 0 || i === 0) {
gridList[i][j] = (
{gridList[i][j]}
- );
+ )
}
}
}
- return gridList;
+ return gridList
}
render() {
- this.gridArray = this.populateTimetable();
- let divsToRender = [];
- for (let i = 0; i <= 10; i++) {
+ this.gridArray = this.populateTimetable()
+ let divsToRender = []
+ for (let i = 0; i <= 11; i++) {
for (let j = 0; j <= 6; j++) {
if (this.gridArray[j][i] === -1);
else {
- divsToRender.push(<>{this.gridArray[j][i]}>);
+ divsToRender.push(<>{this.gridArray[j][i]}>)
}
}
}
- return
{divsToRender}
;
+ return
{divsToRender}
}
}
-const mapStateToProps = state => {
+const mapStateToProps = (state) => {
return {
- TimeTable: state.updateTT.myTimeTable
- };
-};
+ TimeTable: state.updateTT.myTimeTable,
+ }
+}
-const mapDispatchToProps = dispatch => {
+const mapDispatchToProps = (dispatch) => {
return {
onRemove: (section, courseCode) =>
- dispatch(deleteSection(section, courseCode))
- };
-};
+ dispatch(deleteSection(section, courseCode)),
+ }
+}
PreviewTT.propTypes = {
TimeTable: PropTypes.object.isRequired,
- onRemove: PropTypes.func.isRequired
-};
+ onRemove: PropTypes.func.isRequired,
+}
-export default connect(mapStateToProps, mapDispatchToProps)(PreviewTT);
+export default connect(mapStateToProps, mapDispatchToProps)(PreviewTT)
diff --git a/client/src/components/timetable/SearchTabs.jsx b/client/src/components/timetable/SearchTabs.jsx
index 0ba0a69..3f49dfb 100644
--- a/client/src/components/timetable/SearchTabs.jsx
+++ b/client/src/components/timetable/SearchTabs.jsx
@@ -1,7 +1,7 @@
import React, { Component } from "react";
import "react-tabs/style/react-tabs.css";
import M from "materialize-css";
-import "materialize-css/dist/css/materialize.min.css";
+// import 'materialize-css/dist/css/materialize.min.css';
import PropTypes from "prop-types";
import SearchHel from "./SearchHel.jsx";
import Search from "../utils/Search.jsx";
@@ -15,23 +15,26 @@ class SearchTabs extends Component {
super(props);
this.state = {
initial: this.props.allCourses,
- current: this.props.allCourses
+ current: this.props.allCourses,
};
this.filterItems = this.filterItems.bind(this);
}
filterItems(input) {
- let filterCourses = obj =>
+ let filterCourses = (obj) =>
Object.keys(obj)
.filter(
- item =>
+ (item) =>
item.toLowerCase().search(input.target.value.toLowerCase()) !==
-1 ||
obj[item]["name"]
.toLowerCase()
.search(input.target.value.toLowerCase()) !== -1
)
- .reduce((res, key) => {res[key] = obj[key]; return res}, {});
+ .reduce((res, key) => {
+ res[key] = obj[key];
+ return res;
+ }, {});
let updatedlist = filterCourses(this.state.initial);
this.setState({ current: updatedlist });
}
@@ -39,26 +42,26 @@ class SearchTabs extends Component {
render() {
return (
<>
-
+
-
+
-
+
-
+
-
+
-
+
-
+
>
@@ -45,7 +45,7 @@ class SectionTabs extends Component {
}
SectionTabs.propTypes = {
- getSections: PropTypes.func.isRequired
+ getSections: PropTypes.func.isRequired,
};
export default SectionTabs;
diff --git a/client/src/components/utils/Navbar.jsx b/client/src/components/utils/Navbar.jsx
index 130b8f5..6bd301e 100644
--- a/client/src/components/utils/Navbar.jsx
+++ b/client/src/components/utils/Navbar.jsx
@@ -10,61 +10,59 @@ export const Navbar = ({ submitted, user, isAuthenticated, logout }) => {
} else if ((!submitted && user && user.submittedForm) || submitted) {
return (
-
-
-
-
-
-
-
-
-
- Dashboard
-
-
- Statistics
-
-
- Create TimeTable
-
-
- About
-
-
-
- Logout{" "}
-
-
-
-
+
+
+
+
+
+
+
+
+ Dashboard
+
+
+ Statistics
+
+
+ Create TimeTable
+
+
+ About
+
+
+
+ Logout{" "}
+
+
+
);
} else {
return (
-
-
-
+
+
+
-
+
-
+
Logout{" "}
@@ -77,14 +75,14 @@ export const Navbar = ({ submitted, user, isAuthenticated, logout }) => {
};
Navbar.propTypes = {
- logout: PropTypes.func.isRequired
+ logout: PropTypes.func.isRequired,
};
-const mapStateToProps = state => {
+const mapStateToProps = (state) => {
return {
submitted: state.helForm.submitted,
user: state.auth.user,
- isAuthenticated: state.auth.isAuthenticated
+ isAuthenticated: state.auth.isAuthenticated,
};
};
diff --git a/client/src/components/utils/YearSelector.jsx b/client/src/components/utils/YearSelector.jsx
index 3356b23..a52ff53 100644
--- a/client/src/components/utils/YearSelector.jsx
+++ b/client/src/components/utils/YearSelector.jsx
@@ -6,14 +6,14 @@ import FormControl from "@material-ui/core/FormControl";
import "../../styles/HelForm.css";
-const YearSelector = props => {
+const YearSelector = (props) => {
const [yearData, setYear] = useState({
- year: props.initialYear
+ year: props.initialYear,
});
const { year } = yearData;
- const handleYearChange = e => {
+ const handleYearChange = (e) => {
if (e.target.checked) {
props.onYearChange(e.target.value);
}
@@ -25,17 +25,17 @@ const YearSelector = props => {
["2", "Second"],
["3", "Third"],
["4", "Fourth"],
- ["5", "Fifth"]
+ ["5", "Fifth"],
];
let str = [];
- yearList.map(Year => {
+ yearList.map((Year) => {
str.push(
}
+ control={ }
label={Year[1]}
key={Year[0]}
- className='text-black'
+ className="text-black"
onChange={handleYearChange}
checked={year === Year[0]}
/>
@@ -44,14 +44,14 @@ const YearSelector = props => {
});
return (
- Select year:
-
+ Select year:
+
{str}
diff --git a/client/src/redux/actions/auth.js b/client/src/redux/actions/auth.js
index 99c1d46..ba22494 100644
--- a/client/src/redux/actions/auth.js
+++ b/client/src/redux/actions/auth.js
@@ -69,6 +69,7 @@ export const logout = () => async dispatch => {
})
.then(() => {
localStorage.removeItem("loggedIn");
+ window.location.reload();
})
.catch(err => {
// TODO: Can choose to pass error and show alert. For when alerts are implemented.
diff --git a/client/src/redux/middlewares/index.js b/client/src/redux/middlewares/index.js
index 363e28e..64eb153 100644
--- a/client/src/redux/middlewares/index.js
+++ b/client/src/redux/middlewares/index.js
@@ -1,5 +1,5 @@
import { applyMiddleware } from "redux";
-import { composeWithDevTools } from "redux-devtools-extension";
+import { composeWithDevTools } from "redux-devtools-extension/developmentOnly";
import { getSelectedCourseMiddleware } from "./SelectCourseMiddlewares";
import { closeDialogMiddleware } from "./dialog";
import thunk from "redux-thunk";
diff --git a/client/src/schemas/WeekDay.js b/client/src/schemas/WeekDay.js
index 5555356..992aecb 100644
--- a/client/src/schemas/WeekDay.js
+++ b/client/src/schemas/WeekDay.js
@@ -12,6 +12,7 @@ class WeekDay {
this.eight = new Entry();
this.nine = new Entry();
this.ten = new Entry();
+ this.eleven = new Entry();
}
}
diff --git a/client/src/styles/App.css b/client/src/styles/App.css
index 48891b9..085c991 100644
--- a/client/src/styles/App.css
+++ b/client/src/styles/App.css
@@ -37,7 +37,27 @@
}
}
-#root
-{
+#root {
float: none;
}
+
+.body {
+ background-color: #eeeeee;
+}
+
+.body-wrapper {
+ padding: 10px 30px;
+}
+
+.nav-logo {
+ float: left;
+}
+
+.nav-logout {
+ float: right;
+}
+
+.nav-container {
+ height: 64px;
+ background-color: #3f51b5;
+}
diff --git a/client/src/styles/Dashboard.css b/client/src/styles/Dashboard.css
index 897ca4f..e69de29 100644
--- a/client/src/styles/Dashboard.css
+++ b/client/src/styles/Dashboard.css
@@ -1,4 +0,0 @@
-
-body {
- background-color: #cadcfc;
-}
\ No newline at end of file
diff --git a/client/src/styles/ShareTT.css b/client/src/styles/ShareTT.css
index 3b3116f..a61459e 100644
--- a/client/src/styles/ShareTT.css
+++ b/client/src/styles/ShareTT.css
@@ -1,82 +1,61 @@
/* Containers */
-.container-helform {
- display: flex;
- width: 100%;
- }
- .half-width {
- width: 50%;
- white-space: nowrap;
- }
-
- /* Form */
- .course-disp {
- float: right;
- width: 40%;
- }
-
- .form-whole {
- width: 100%;
- }
-
- .form-group {
- float: left;
- width: 59.5%;
- padding-top: 1.25%;
- padding-left: 0.5%;
- }
-
- .course-inp {
- width: 74%;
- }
-
- .branch-inp {
- padding-top: 5px;
- }
-
- .wide-menu-row {
- height: 30px;
- text-align: center;
- color: gray;
- }
-
- .label-mod {
- padding-left: 2%;
- width: 10%;
- padding-top: 3vh;
- height: 4vh;
- }
-
- .left-width {
- width: 59.5%;
- }
-
- /* Buttons */
- .btn-mod {
- width: 10%;
- height: 5vh;
- padding-left: 1.5%;
- }
-
- .btn-hf {
- cursor: pointer;
- }
- .btn-big {
- width: 50%;
- height: 5vh;
- }
-
- /* Select component styling */
- .select-container {
- background-color: rgba(116, 185, 255,1);
- }
-
- /* Radio group */
- .radio-grp {
- padding-top: 2vh;
- height: 4vh;
- }
-
- /* Text */
- .text-black {
- color: black;
- }
+.branch-year-container {
+ display: flex;
+ width: 100%;
+ max-width: 720px;
+ gap: 10px;
+}
+.half-width {
+ width: 50%;
+ white-space: nowrap;
+ float: left;
+}
+
+/* Form */
+.course-disp {
+ float: right;
+ width: 40%;
+}
+
+.form-whole {
+ width: 100%;
+}
+
+.form-group {
+ float: left;
+ width: 59.5%;
+ padding-top: 1.25%;
+ padding-left: 0.5%;
+}
+
+.course-inp {
+ width: 74%;
+}
+
+.branch-inp {
+ padding-top: 5px;
+}
+
+.wide-menu-row {
+ height: 30px;
+ text-align: center;
+ color: gray;
+}
+
+.label-mod {
+ padding-left: 2%;
+ width: 10%;
+ padding-top: 3vh;
+ height: 4vh;
+}
+
+/* Radio group */
+.radio-grp {
+ padding-top: 2vh;
+ height: 4vh;
+}
+
+/* Text */
+.text-black {
+ color: black;
+}
diff --git a/client/src/styles/Timetable.css b/client/src/styles/Timetable.css
index 2cc8b5a..a796f77 100644
--- a/client/src/styles/Timetable.css
+++ b/client/src/styles/Timetable.css
@@ -1,114 +1,151 @@
-:root {
- --row-gap: 0.5vh;
- --header-column-width: 10%;
- --reg-column-width: 15%;
- }
+.gridElement {
+ display: grid;
+ grid-template-columns: 7% 15% 15% 15% 15% 15% 15%;
+ row-gap: 0.5%;
+ column-gap: 0.5%;
+ transition-duration: 0.4s;
+ grid-template-rows: 7.87% 7.87% 7.87% 7.87% 7.87% 7.87% 7.87% 7.87% 7.87% 7.87% 7.87% 7.87%;
+ height: 80vh;
+ min-height: 768px;
+}
-body
-{
- background-color: #cadcfc;
+.gridElement > div {
+ box-sizing: border-box;
+ background-color: #313131;
+ text-align: center;
+ padding: 10px 10px;
+ border-radius: 3px;
+ color: white;
+ box-shadow: 2px 1.5px 2px 0.5px rgba(1, 4, 7, 0.5);
}
-.gridElement
-{
- display: grid;
- grid-template-columns: 7% 15% 15% 15% 15% 15% 15%;
- row-gap: 0.75vh;
- column-gap:0.5%;
- background-color: #0984e3;
- padding: 3px;
- border-radius: 5px;
- grid-template-rows: 8.08vh 8.08vh 8.08vh 8.08vh 8.08vh 8.08vh 8.08vh 8.08vh 8.08vh 8.08vh 8.08vh ;
- transition-duration: 0.4s;
+.gridItem .gridItemText {
+ visibility: hidden;
+ width: 120px;
+ background-color: black;
+ color: #fff;
+ text-align: center;
+ border-radius: 6px;
+ padding: 5px 0;
+
+ /* Position the tooltip */
+ position: absolute;
+ z-index: 1;
+}
+.gridItem:hover .gridItemText{
+ visibility: visible;
+ font-size: 125%
}
-.gridElement > div
-{
- background-color: #313131;
- position: relative;
- text-align: center;
- padding: 10px 10px;
- font-size: 67%;
- border-radius: 3px;
- color: white;
- box-shadow: 2px 1.5px 2px 0.5px rgba(1, 4, 7, 0.5);
+.gridItem {
+ background-color: #333333;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ min-height: 60px;
+ font-size: 75%;
+
}
+.gridItem:hover {
+ box-shadow: 2px 1.7px 2px 0.7px rgba(1, 4, 7, 0.76);
+ transition-duration: 0.4s;
+ cursor:pointer;
+}
+.courseElement {
+ display: grid;
+ grid-template-columns: 5% 45% 10% 10% 10% 10% 10%;
+ grid-template-rows: 5vh;
+}
+.courseElement:hover {
+ display: grid;
+ grid-template-columns: 5% 45% 10% 10% 10% 10% 10%;
+ grid-template-rows: 5vh;
+ background-color: #0984e3;
+ cursor: pointer;
+}
+.examElement {
+ display: grid;
+ grid-template-columns: 10% 60% 15% 15%;
+ column-gap: 0.5vh;
+ grid-template-rows: 5vh;
+}
-.gridItem
-{
- background-color: #333333;
- display: flex;
- align-items: center;
- justify-content: center;
+.courseItem {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 14;
+ padding: 10px;
}
-.gridItem:hover
-{
- /*background-color: #aaaaaa;*/
- box-shadow: 2px 2px 5px 5px rgba(1, 4, 7, 0.76);
- transition-duration: 0.4s;
- font-size: 75%;
- /*color: black;*/
+.searchItem {
+ display: flex;
+ /* align-items: center; */
+ /* justify-content: center; */
+ font-size: 14;
+ padding: 10px;
}
+.courseWindow {
+ margin: 5px;
+ padding: 5px;
+ /* background-color: rgba(116, 185, 255, 1); */
+ height: 45vh;
+ overflow: auto;
+ font-size: 14px;
+ text-align: justify;
+}
-.courseElement
-{
- display: grid;
- grid-template-columns: 5% 45% 10% 10% 10% 10% 10%;
- grid-template-rows: 5vh;
-}
-.courseElement:hover
-{
- display: grid;
- grid-template-columns: 5% 45% 10% 10% 10% 10% 10%;
- grid-template-rows: 5vh;
- background-color: #0984e3;
- cursor: pointer;
-}
-.examElement
-{
- display: grid;
- grid-template-columns: 10% 60% 15% 15%;
- column-gap: 0.5vh;
- grid-template-rows: 5vh;
+.courseSearch {
+ margin: 5px;
+ padding: 5px;
+ /* background-color: rgba(116, 185, 255, 1); */
+ height: 65vh;
+ overflow: auto;
+ text-align: justify;
}
-.courseItem
-{
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 14;
+.courseSearch :hover {
+ cursor: pointer;
+ background-color: #0984e3;
+}
+.input-field ::placeholder {
+ color: black;
}
-.courseWindow
-{
- margin:5px;
- padding:5px;
- background-color: rgba(116, 185, 255,1);
- height: 45vh;
- overflow: auto;
- font-size: 14px;
- text-align:justify;
-}
-.courseSearch
-{
- margin:5px;
- padding:5px;
- background-color: rgba(116, 185, 255,1);
- height: 65vh;
- overflow: auto;
- text-align:justify;
+.create-timetable-container {
+ display: block;
}
-.courseSearch :hover{
- cursor: pointer;
- background-color: #0984e3;
-}
-.input-field ::placeholder{
- color: black;
-
-}
\ No newline at end of file
+.timetable-preview {
+ min-height: 540px;
+ min-width: 540px;
+ flex: 2;
+}
+
+.create-timetable-toolbar {
+ width: 100%;
+ display: flex;
+ flex-wrap: wrap;
+ gap: 5px;
+}
+
+.toolbar-button {
+ flex: 1;
+ min-width: 4vw;
+}
+
+@media only screen and (min-width: 768px) {
+ /* For desktop: */
+ .create-timetable-container {
+ display: flex;
+ gap: 20px;
+ flex-wrap: wrap;
+ flex-grow: 0;
+ }
+ .courses-list {
+ display: flex;
+ }
+}
diff --git a/client/src/utils/CreateTTUtils.js b/client/src/utils/CreateTTUtils.js
index 72e61ea..4824ad9 100644
--- a/client/src/utils/CreateTTUtils.js
+++ b/client/src/utils/CreateTTUtils.js
@@ -32,9 +32,7 @@ export function checkClashOrDelete(tt, courseCode, sched) {
[hours, days, room] = sched;
for (let day of days) {
for (let hour of hours) {
- if (tt[day][ntw.toWords(hour)].sectionRoom === room) {
- return false;
- } else if (
+ if (
String(tt[day][ntw.toWords(hour)].courseCode) === courseCode[0]
) {
return false;
diff --git a/package.json b/package.json
index aa96bf1..daddea5 100644
--- a/package.json
+++ b/package.json
@@ -8,54 +8,55 @@
"dependencies": {
"bcryptjs": "^2.4.3",
"body-parser": "^1.19.0",
- "config": "^3.3.1",
+ "config": "^3.3.6",
"cookie-session": "^1.4.0",
"cors": "^2.8.5",
- "debug": "^4.1.1",
- "dotenv": "^8.2.0",
+ "debug": "^4.3.2",
+ "dotenv": "^10.0.0",
"express": "^4.17.1",
- "express-validator": "^6.4.0",
- "moment": "^2.24.0",
+ "express-validator": "^6.12.1",
"jsonwebtoken": "^8.5.1",
- "mongoose": "^5.9.9",
- "node-sass": "^4.13.1",
+ "moment": "^2.29.1",
+ "mongoose": "^5.13.7",
+ "node-sass": "^6.0.1",
"node-sass-middleware": "^0.11.0",
+ "npm-check-updates": "^11.8.3",
"passport": "^0.4.1",
"passport-google-oauth20": "^2.0.0",
- "react": "^16.13.1",
- "react-dom": "^16.13.1",
- "react-router-dom": "^5.1.2"
+ "react": ">=17.0.2",
+ "react-dom": ">=17.0.2",
+ "react-router-dom": "^5.2.0"
},
"devDependencies": {
- "@babel/cli": "^7.8.4",
- "@babel/core": "^7.9.0",
- "@babel/node": "^7.8.7",
- "@babel/plugin-proposal-class-properties": "^7.8.3",
- "@babel/plugin-proposal-decorators": "^7.8.3",
- "@babel/plugin-proposal-do-expressions": "^7.8.3",
- "@babel/plugin-proposal-export-default-from": "^7.8.3",
- "@babel/plugin-proposal-export-namespace-from": "^7.8.3",
- "@babel/plugin-proposal-function-bind": "^7.8.3",
- "@babel/plugin-proposal-function-sent": "^7.8.3",
- "@babel/plugin-proposal-json-strings": "^7.8.3",
- "@babel/plugin-proposal-logical-assignment-operators": "^7.8.3",
- "@babel/plugin-proposal-nullish-coalescing-operator": "^7.8.3",
- "@babel/plugin-proposal-numeric-separator": "^7.8.3",
- "@babel/plugin-proposal-optional-chaining": "^7.9.0",
- "@babel/plugin-proposal-pipeline-operator": "^7.8.3",
- "@babel/plugin-proposal-throw-expressions": "^7.8.3",
+ "@babel/cli": "^7.14.8",
+ "@babel/core": "^7.15.0",
+ "@babel/node": "^7.14.9",
+ "@babel/plugin-proposal-class-properties": "^7.14.5",
+ "@babel/plugin-proposal-decorators": "^7.14.5",
+ "@babel/plugin-proposal-do-expressions": "^7.14.5",
+ "@babel/plugin-proposal-export-default-from": "^7.14.5",
+ "@babel/plugin-proposal-export-namespace-from": "^7.14.5",
+ "@babel/plugin-proposal-function-bind": "^7.14.5",
+ "@babel/plugin-proposal-function-sent": "^7.14.5",
+ "@babel/plugin-proposal-json-strings": "^7.14.5",
+ "@babel/plugin-proposal-logical-assignment-operators": "^7.14.5",
+ "@babel/plugin-proposal-nullish-coalescing-operator": "^7.14.5",
+ "@babel/plugin-proposal-numeric-separator": "^7.14.5",
+ "@babel/plugin-proposal-optional-chaining": "^7.14.5",
+ "@babel/plugin-proposal-pipeline-operator": "^7.15.0",
+ "@babel/plugin-proposal-throw-expressions": "^7.14.5",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
- "@babel/plugin-syntax-import-meta": "^7.8.3",
- "@babel/preset-env": "^7.9.5",
- "@babel/preset-react": "^7.9.4",
- "babel-plugin-add-module-exports": "^1.0.2",
- "babel-plugin-react-html-attrs": "^2.1.0",
- "chai": "^4.2.0",
+ "@babel/plugin-syntax-import-meta": "^7.10.4",
+ "@babel/preset-env": "^7.15.0",
+ "@babel/preset-react": "^7.14.5",
+ "babel-plugin-add-module-exports": "^1.0.4",
+ "babel-plugin-react-html-attrs": "^3.0.5",
+ "chai": "^4.3.4",
"chai-http": "^4.3.0",
- "concurrently": "^5.1.0",
- "cypress": "^4.4.0",
- "mocha": "^7.1.1",
- "nodemon": "^2.0.3"
+ "concurrently": "^6.2.1",
+ "cypress": "^8.3.0",
+ "mocha": "^9.0.3",
+ "nodemon": "^2.0.12"
},
"scripts": {
"server": "nodemon server --exec babel-node",
@@ -75,7 +76,7 @@
"url": "https://github.com/Dryft-bits/ChronoFactorem/issues"
},
"peerDependencies": {
- "react": ">=16.13.1",
- "react-dom": ">=16.13.1"
+ "react": ">=17.0.2",
+ "react-dom": ">=17.0.2"
}
}
diff --git a/server/models/TimeTable.js b/server/models/TimeTable.js
index 37e62f3..3341f1e 100644
--- a/server/models/TimeTable.js
+++ b/server/models/TimeTable.js
@@ -7,37 +7,37 @@ const TimeTableSchema = new Schema(
ownerId: {
type: Schema.Types.ObjectId,
required: true,
- ref: "student"
+ ref: "student",
},
name: {
- type: String
+ type: String,
},
- branch:{
+ branch: {
type: Array,
},
- year:{
+ year: {
type: Number,
},
- username:{
- type: String
+ username: {
+ type: String,
},
TimeTable: {
type: TimeTable,
- required: true
+ required: true,
},
Courses: [
{
- type: Object
- }
+ type: Object,
+ },
],
date: {
type: Date,
- default: Date.now
+ default: Date.now,
},
isShared: {
type: Boolean,
- default: false
- }
+ default: true,
+ },
},
{ minimize: false }
);
diff --git a/server/models/schemas/WeekDay.js b/server/models/schemas/WeekDay.js
index a1a8b7d..1edd36c 100644
--- a/server/models/schemas/WeekDay.js
+++ b/server/models/schemas/WeekDay.js
@@ -12,6 +12,6 @@ class WeekDay {
this.eight = new Entry();
this.nine = new Entry();
this.ten = new Entry();
+ this.eleven = new Entry();
}
}
-