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

Made all the necessary changes according to the recent timetable #142

Open
wants to merge 39 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
2885cec
Add testing scripts
AetherPrior Jun 14, 2020
b0d6a7f
Finishing touches
AetherPrior Jun 15, 2020
8194b68
Make ready for deploy
AetherPrior Aug 14, 2020
86f4040
Fix 11th hour
AetherPrior Aug 14, 2020
04d9b22
Update CONTRIBUTING.md
hvj7 Aug 20, 2020
b1c8182
Update README.md
hvj7 Aug 20, 2020
638d22d
Multiple Updates for Corona sem
AetherPrior Aug 14, 2020
8744e77
Show create page
AetherPrior Aug 16, 2020
2f71697
Merge pull request #6 from AetherPrior/Scripts
Aviral14 Oct 13, 2020
11ee9f2
add various ui changes
arcane810 Oct 13, 2020
63e66b5
support 11th hour in timetable preview
arcane810 Oct 13, 2020
294acff
Merge pull request #7 from arcane810/ui-changes
AetherPrior Oct 14, 2020
4469377
Update README.md
hvj7 Oct 24, 2020
401b921
Spacing and Resizing
hvj7 Oct 24, 2020
958d087
Adding Borders
hvj7 Oct 24, 2020
0ae6cee
Merge pull request #10 from HarshvardhanJha1/readme
Aviral14 Oct 24, 2020
3864b52
Change in orientation
AetherPrior Oct 14, 2020
45b4709
Prettier and padding
AetherPrior Oct 14, 2020
253b79e
Update timetable
hvj7 Jan 11, 2021
ebe35cc
Change color on HELForm
hvj7 Jan 11, 2021
0be49a9
Redesign Create Timetable Tab
hvj7 Jan 11, 2021
bc63d2e
Add Scrollbar
hvj7 Jan 11, 2021
483570f
Merge pull request #11 from HarshvardhanJha1/redesign
Aviral14 Jan 11, 2021
9933818
Update Images
hvj7 Jan 11, 2021
543f99c
Generic timetable update *sigh*
AetherPrior Jan 12, 2021
143eb60
Update commit *sigh*
AetherPrior Aug 17, 2021
e64ce36
Fix tt.json
AetherPrior Aug 17, 2021
7b89663
Fix logout bug, Change helform slots
AetherPrior Aug 17, 2021
4c6c566
Merge pull request #13 from crux-bphc/logout-fix
AetherPrior Aug 17, 2021
a55c76e
Applied timetable changes of 19 Aug 2021
arjav2002 Aug 19, 2021
2237ef6
Merge pull request #15 from arjav2002/master
arjav2002 Aug 19, 2021
928132a
Applied timetable changes of 19 Aug 2021
arjav2002 Aug 19, 2021
1cb7a37
conflicts fixed
arjav2002 Aug 19, 2021
9f61325
fixed formatting error
arjav2002 Aug 19, 2021
aad61a7
Middle click easter egg, TT updates
AetherPrior Aug 19, 2021
a4fd1d9
TT Bump
AetherPrior Jan 12, 2022
0515ff2
Merge pull request #18 from crux-bphc/maintenance_Sem2_2021_22
AetherPrior Jan 12, 2022
f4d5524
made timetable changes
amrataansh Jan 23, 2022
eb9201e
TimeTable Changes
amrataansh Jan 25, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add various ui changes
  • Loading branch information
arcane810 committed Oct 13, 2020
commit 11ee9f21ceadcdc3161916c1fad6eb7eb692c211
16 changes: 9 additions & 7 deletions client/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ const App = () => {
<Provider store={store}>
<BrowserRouter history={history}>
<Navbar />
<Route exact path='/' component={Landing} />
<Route exact path='/checkloggedin' component={CheckLoggedIn} />
<SemiPrivateRoute exact path='/helform' component={HelForm} />
<PrivateRoute exact path='/Dashboard' component={Dashboard} />
<PrivateRoute exact path='/helData' component={HELData} />
<PrivateRoute exact path='/create' component={CreateTimeTable} />
<PrivateRoute exact path='/aboutUs' component={About} />
<Route exact path="/" component={Landing} />
<div className="body-wrapper">
<Route exact path="/checkloggedin" component={CheckLoggedIn} />
<SemiPrivateRoute exact path="/helform" component={HelForm} />
<PrivateRoute exact path="/Dashboard" component={Dashboard} />
<PrivateRoute exact path="/helData" component={HELData} />
<PrivateRoute exact path="/create" component={CreateTimeTable} />
<PrivateRoute exact path="/aboutUs" component={About} />
</div>
</BrowserRouter>
</Provider>
);
Expand Down
120 changes: 53 additions & 67 deletions client/src/components/tabs/Dashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,92 +91,78 @@ const Dashboard = (props) => {
return (
<>
<AlertBox />
<h4 className='title'>Saved Timetables</h4>
<div
className={classes.grid}
style={{ position: "relative", left: "2vw" }}
>
<Grid container style={{ backgroundColor: "#74b9ff" }}>
<h4>Saved Timetables</h4>
<div>
<Grid container>
{(TTData.savedTT || data).map((itemc) => {
return (
<>
<Grid item xs={6}>
<div key={itemc._id} id={itemc._id}>
<Card className={classes.root}>
<CardContent>
<Typography
color='textSecondary'
gutterBottom
<Grid item>
<div key={itemc._id} id={itemc._id}>
<Card className={classes.root}>
<CardContent>
<h5>{itemc.name}</h5>
</CardContent>
<CardActions>
<Link
to="/create"
onClick={() => {
props.editTT(itemc);
}}
>
<Button
variant="contained"
color="primary"
size="small"
>
Name
</Typography>
<Typography variant='h5' component='h2'>
{itemc.name}
</Typography>
</CardContent>
<CardActions>
<Link
to='/create'
Edit
</Button>
</Link>

<Button
onClick={() => {
deleteTT(itemc._id);
}}
variant="contained"
color="secondary"
size="small"
>
Delete
</Button>
{itemc.isShared ? (
<Button
variant="contained"
size="small"
onClick={() => {
props.editTT(itemc);
toggleShare(itemc._id, "Unshared");
}}
>
<Button
variant='contained'
color='primary'
size='small'
>
Edit
</Button>
</Link>

Unshare
</Button>
) : (
<Button
variant="contained"
size="small"
onClick={() => {
deleteTT(itemc._id);
toggleShare(itemc._id, "Shared");
}}
variant='contained'
color='secondary'
size='small'
>
Delete
Share
</Button>
{itemc.isShared ? (
<Button
variant='contained'
size='small'
onClick={() => {
toggleShare(itemc._id, "Unshared");
}}
>
Unshare
</Button>
) : (
<Button
variant='contained'
size='small'
onClick={() => {
toggleShare(itemc._id, "Shared");
}}
>
Share
</Button>
)}
</CardActions>
</Card>
</div>
</Grid>
</>
)}
</CardActions>
</Card>
</div>
</Grid>
);
})}
</Grid>
</div>

<h4 className='title'>Publicly Shared Timetables</h4>
<h4>Publicly Shared Timetables</h4>
<ShareTimeTable />
</>
);
} else {
return <h4>FETCHING LATEST DATA....</h4>;
return <h4>Fetching Latest Data....</h4>;
}
};

Expand Down
176 changes: 79 additions & 97 deletions client/src/components/tabs/ShareTimeTable.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useState } from "react";
import { Link } from "react-router-dom";
import Creatable from "react-select";
import Select from "react-select";
import { components } from "react-select";
import Typography from "@material-ui/core/Typography";
import Grid from "@material-ui/core/Grid";
Expand Down Expand Up @@ -63,6 +64,13 @@ const branches = [
{ value: "PHA", label: "Pharmacy" },
{ value: "PHY", label: "Physics" },
];
const years = [
{ value: "1", label: "First" },
{ value: "2", label: "Second" },
{ value: "3", label: "Third" },
{ value: "4", label: "Fourth" },
{ value: "5", label: "Fifth" },
];

const ShareTimeTable = (props) => {
const [formData, setFormData] = useState({
Expand Down Expand Up @@ -124,10 +132,10 @@ const ShareTimeTable = (props) => {
e.preventDefault();
if (!branch || branch.length === 0) {
window.alert("Please enter your branch");
} else if (year === "" || isNaN(year)) {
} else if (year.value === "" || isNaN(year.value)) {
window.alert("Please enter your year");
} else {
submitToMongo(branch, year);
submitToMongo(branch, year.value);
}
};

Expand All @@ -138,7 +146,7 @@ const ShareTimeTable = (props) => {
{optionSelectedLength < 2 ? (
props.children
) : (
<div className='wide-menu-row'>
<div className="wide-menu-row">
You cannot select more than 2 branches
</div>
)}
Expand All @@ -152,112 +160,86 @@ const ShareTimeTable = (props) => {
const classes = useStyles();
return (
<>
<h5 className='title' style={{ textAlign: "center" }}>
Please Enter your Branch and year below:
</h5>
<form className='form-whole' onSubmit={onSubmit}>
<div className='container-helform'>
<Creatable
<h5>Please Select your Branch and year below:</h5>
<form className="form-whole" onSubmit={onSubmit}>
<div className="branch-year-container">
<Select
components={{ Menu }}
onChange={handleBranchChange}
value={branch}
isMulti
isValidNewOption={isValidNewOption}
options={branch && branch.length >= 2 ? branch : branches}
className='left-width branch-inp'
placeholder='Select branch (select 2 branches for dual degree)'
theme={(theme) => ({
...theme,
borderRadius: 2,
colors: {
...theme.colors,
primary25: "#0984e3",
neutral0: "rgba(116, 185, 255,1)",
},
})}
className="left-width"
placeholder="Select branch (select 2 branches for dual degree)"
/>
<Select
onChange={handleYearChange}
value={year}
isValidNewOption={isValidNewOption}
options={years}
className="left-width"
placeholder="Select Year"
/>
<YearSelector
{/* <YearSelector
onYearChange={handleYearChange}
initialYear={year}
></YearSelector>
></YearSelector> */}
<input type="submit" className="btn btn-primary" value="Go" />
</div>
<br></br>
<input
type='submit'
className='btn btn-primary btn-go btn-big'
value='GO'
/>
</form>
<br></br>
<div
className={classes.grid}
style={{ position: "relative", left: "2vw" }}
>
<Grid container style={{ backgroundColor: "#74b9ff" }}>
{!loading && TTs.length !== 0 ? (
TTs.map((itemc) => {
return (
<>
<Grid item xs={6}>
<div key={itemc._id} id={itemc._id}>
<Card className={classes.root}>
<CardContent>
<Typography
className={classes.title}
color='textSecondary'
gutterBottom
>
Timetable Name
</Typography>
<Typography variant='h5' component='h2'>
{itemc.name}
</Typography>
<Typography color='textSecondary'>
Shared by
</Typography>
<Typography variant='h6' component='h6'>
{itemc.username}
</Typography>
<Typography
variant='body2'
color='textSecondary'
component='p'
>
Date:{" "}
{itemc.date.substr(0, itemc.date.indexOf("T"))}
<br />
{"Time: "}{" "}
{itemc.date.substr(itemc.date.indexOf("T") + 1, 9)}
</Typography>
</CardContent>
<CardActions>
<Link
to='/create'
onClick={() => {
props.editTT(itemc);
}}
>
<Button
variant='contained'
color='primary'
size='large'
>
View/Edit
</Button>
</Link>
</CardActions>
</Card>
</div>
</Grid>
</>
);
})
) : loading ? (
<h4>Loading</h4>
) : (
<h4 className='title'>No Shared Timetables</h4>
)}
</Grid>
<br />
<div>
{!loading && TTs.length !== 0 ? (
TTs.map((itemc) => {
return (
<Grid item xs={6}>
<div key={itemc._id} id={itemc._id}>
<Card className={classes.root}>
<CardContent>
<Typography variant="h5" component="h2">
{itemc.name}
</Typography>
<Typography color="textSecondary">Shared by</Typography>
{itemc.username}
<Typography
variant="body2"
color="textSecondary"
component="p"
>
Date: {itemc.date.substr(0, itemc.date.indexOf("T"))}
<br />
{"Time: "}{" "}
{itemc.date.substr(itemc.date.indexOf("T") + 1, 9)}
</Typography>
</CardContent>
<CardActions>
<Link
to="/create"
onClick={() => {
props.editTT(itemc);
}}
>
<Button
variant="contained"
color="primary"
size="large"
>
View/Edit
</Button>
</Link>
</CardActions>
</Card>
</div>
</Grid>
);
})
) : loading ? (
<h4>Loading</h4>
) : (
<h4>No Shared Timetables</h4>
)}
</div>
</>
);
Expand Down
Loading