Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
f6a6989
moved graph into separate component
SeijiEmery Jul 19, 2018
7b578e3
moved graph view into separate component
SeijiEmery Jul 19, 2018
ab369aa
separated GraphViewApp into GraphViewLoader and GraphViewAssembly
SeijiEmery Jul 19, 2018
e80b8ac
fixed => export default
SeijiEmery Jul 19, 2018
a2cd81d
refactored window content out of Popup
SeijiEmery Jul 19, 2018
42c3890
refactored out course details window
SeijiEmery Jul 19, 2018
0d3abe2
started scaffolding search bar; giving up on popmenu (for now...)
SeijiEmery Jul 19, 2018
190fa81
got basic fuzzy search working
SeijiEmery Jul 19, 2018
64125cf
started running w/ full dataset; fixed initial performance issue quit…
SeijiEmery Jul 19, 2018
0b3e7d1
implemented levenshtein (doesn't really work that well tho)
SeijiEmery Jul 19, 2018
f31df92
[Eslint] Clean up code
xuyanwen2012 Jul 19, 2018
37fcdf1
Added drawer
ThePatrickLauderdale Jul 19, 2018
6bd508a
Tooltip component
wendyrliang Jul 20, 2018
f23c218
Tooltip
wendyrliang Jul 20, 2018
ca29e8d
Starting login page
xuyanwen2012 Jul 20, 2018
00568bf
setup UCSD API
xuyanwen2012 Jul 20, 2018
28e8249
Merge branch 'sprint3' of https://github.com/SeijiEmery/CourseGraph i…
xuyanwen2012 Jul 20, 2018
fa21906
Cleanup code
xuyanwen2012 Jul 20, 2018
7f4b17e
Tooltip
wendyrliang Jul 20, 2018
83e9f74
Tooltip/popup
wendyrliang Jul 20, 2018
22ab265
scrolling, dummy graph filter
ThePatrickLauderdale Jul 21, 2018
f4ffe53
added graph filter alogrithmn
ThePatrickLauderdale Jul 21, 2018
e97de45
filter function
Kuahoo Jul 21, 2018
4e15250
prototype graph filter
Kuahoo Jul 21, 2018
e768829
Graph can be filtered
ThePatrickLauderdale Jul 21, 2018
e4837db
Multiple classes can be selected
ThePatrickLauderdale Jul 21, 2018
bea7cf6
removed duplicate filteralgroithm
Kuahoo Jul 22, 2018
f365c37
Can deselect courses
ThePatrickLauderdale Jul 22, 2018
f6c1b1b
commented out consoles logs
ThePatrickLauderdale Jul 22, 2018
35203a0
Merge branch 'sprint3' of https://github.com/coursegraph/CourseGraph …
Kuahoo Jul 22, 2018
af5bc51
changed ListItemText values
Kuahoo Jul 22, 2018
25ad42a
styled selected listItem
Kuahoo Jul 22, 2018
c63030a
Eslint fix
xuyanwen2012 Jul 22, 2018
d53ade2
Remove Redux and Doc gen
xuyanwen2012 Jul 22, 2018
fda2961
Merge branch 'sprint3' of https://github.com/coursegraph/CourseGraph …
Kuahoo Jul 22, 2018
ea55974
Merge branch 'sprint3' of https://github.com/coursegraph/CourseGraph …
Kuahoo Jul 22, 2018
e5b56fa
expanded filterGraph algorithmn
ThePatrickLauderdale Jul 22, 2018
9584e08
Chips instead of an ugly list
ThePatrickLauderdale Jul 23, 2018
acbd22b
Adding Floating Action Button component
xuyanwen2012 Jul 23, 2018
b5789d6
Merge branch 'sprint3' of https://github.com/SeijiEmery/CourseGraph i…
xuyanwen2012 Jul 23, 2018
9dc526e
Merge branch 'sprint3' of https://github.com/SeijiEmery/CourseGraph i…
xuyanwen2012 Jul 23, 2018
f30334b
refactored colors (deselect broken)
SeijiEmery Jul 23, 2018
ca577f7
fixed node deselection; cleanup
SeijiEmery Jul 23, 2018
aae48c1
resolved merge conflict
SeijiEmery Jul 23, 2018
0217ce3
graph_view double click
wendyrliang Jul 23, 2018
053be43
Refactored graph_view_assembly
ThePatrickLauderdale Jul 23, 2018
612a398
Merge branch 'sprint3' of https://github.com/coursegraph/CourseGraph …
ThePatrickLauderdale Jul 23, 2018
10da594
Count UCSD department Objects
xuyanwen2012 Jul 23, 2018
779efbd
minor refactor filterAlgorithm
ThePatrickLauderdale Jul 23, 2018
aa6cf23
Merge branch 'sprint3' of https://github.com/coursegraph/CourseGraph …
ThePatrickLauderdale Jul 23, 2018
f657ea8
Account pages, setting up login pages
xuyanwen2012 Jul 23, 2018
9d9d9c6
Login POST request done
xuyanwen2012 Jul 23, 2018
856e680
Added GraphSelection class (untested, probably incomplete)
ThePatrickLauderdale Jul 23, 2018
610f9b2
Home Page
xuyanwen2012 Jul 23, 2018
964c000
Merge branch 'sprint3' of https://github.com/SeijiEmery/CourseGraph i…
xuyanwen2012 Jul 23, 2018
a96514d
GraphSelection class updated (still buggy)
ThePatrickLauderdale Jul 23, 2018
7c15299
Merge branch 'sprint3' of https://github.com/coursegraph/CourseGraph …
ThePatrickLauderdale Jul 23, 2018
3fdb46e
Code Cleanup
xuyanwen2012 Jul 23, 2018
0556759
added hoverNode event
wendyrliang Jul 23, 2018
024e6e3
User can now register account
xuyanwen2012 Jul 24, 2018
fa2d512
Introducing Home Page that can navigate us to UCSD page or UCSD page
xuyanwen2012 Jul 24, 2018
8bb2e16
Extract Home page panel components
xuyanwen2012 Jul 24, 2018
fee8868
fixed graph view (was iterating over values, not keys. please read up…
SeijiEmery Jul 24, 2018
176b44c
Switch to simple login system
xuyanwen2012 Jul 24, 2018
e0822c0
Rearrange files
xuyanwen2012 Jul 24, 2018
ef6b203
Implement server-side fetch
xuyanwen2012 Jul 24, 2018
6fa218b
Remove console Warning
xuyanwen2012 Jul 24, 2018
a4b43f5
Minimal Refactoring
xuyanwen2012 Jul 24, 2018
b31b88b
Continue refactoring + Serve UCSD graph data
xuyanwen2012 Jul 25, 2018
12a0011
Update Favicon
xuyanwen2012 Jul 25, 2018
ffa6b5e
Change API URL to or actuall server
xuyanwen2012 Jul 25, 2018
cd1d1f3
Fix Floating button bug, add true Fullpage graph view
xuyanwen2012 Jul 25, 2018
ce967f5
Graph Color by department
xuyanwen2012 Jul 25, 2018
e889db0
Refactoring Code style
xuyanwen2012 Jul 25, 2018
9e4018a
Refactoring Code Style
xuyanwen2012 Jul 25, 2018
696138c
Graph Info Card
xuyanwen2012 Jul 25, 2018
0c35cae
Update fetch
xuyanwen2012 Jul 25, 2018
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
17 changes: 8 additions & 9 deletions components/Header.jsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import React from 'react';
import NextHead from 'next/head';
// import NProgress from 'nprogress';
// import Router from 'next/router';
import NProgress from 'nprogress';
import Router from 'next/router';

// Router.onRouteChangeStart = (url) => {
// console.log(`Loading: ${url}`);
// NProgress.start();
// };
//
// Router.onRouteChangeComplete = () => NProgress.done();
// Router.onRouteChangeError = () => NProgress.done();
Router.onRouteChangeStart = (url) => {
NProgress.start();
};

Router.onRouteChangeComplete = () => NProgress.done();
Router.onRouteChangeError = () => NProgress.done();

/**
* A header Component that provide Progress bar
Expand Down
58 changes: 0 additions & 58 deletions components/Login.jsx

This file was deleted.

46 changes: 27 additions & 19 deletions components/PopMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,26 @@ const inStyle = {
fontSize: '14px',
};

class CourseDetailsWindow extends React.Component {
render() {
const course = this.props.course;
return (
<div className="modal">
<a className="close" onClick={this.props.onClose}>&times;</a>
<div className="header">
{`${course.name} ${course.title}`}
</div>
<div className={'content'}>
<p>{`Instructor: ${course.instructor}`}</p>
<p>{`Terms: ${course.terms}`}</p>
<p>{`GE: ${course.geCategories}`}</p>
<p>{`Division: ${course.division}`}</p>
<p>{`Description: ${course.description}`}</p>
</div>
</div>
);
}
}

class PopMenu extends React.Component {
constructor(props) {
Expand Down Expand Up @@ -109,35 +129,23 @@ class PopMenu extends React.Component {
<div ref={node => {
this.node = node;
}} style={lStyle} id="listDiv" onScroll={this.onListScroll}>
<List>{data.map(({name, title, instructor, terms, description, geCategories, division}) => (
<List>{data.map((course) => (
<div ref={this.setWrapperRef}>
<Popup trigger={
<ListItem
style={pStyle}
key={name + `${n++}`}
key={course.name + `${n++}`}
dense
divider
button
>
<ListItemText primary={name + ' ' + title}
secondary={`Instr: ${instructor}`}/>
<ListItemText primary={name + ' ' + this.props.title}
secondary={`Instr: ${this.props.instructor}`}/>
</ListItem>
} modal>
{close => (
<div className="modal">
<a className="close" onClick={close}>&times;</a>
<div className="header">
{`${name} ${title}`}
</div>
<div className={'content'}>
<p>{`Instructor: ${instructor}`}</p>
<p>{`Terms: ${terms}`}</p>
<p>{`GE: ${geCategories}`}</p>
<p>{`Division: ${division}`}</p>
<p>{`Description: ${description}`}</p>
</div>
</div>
)}
{close =>
<CourseDetailsWindow course={course} onClose={close} />
}
</Popup>
</div>
))}
Expand Down
74 changes: 52 additions & 22 deletions components/Popups.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,42 @@
import React from 'react';
import Popup from 'reactjs-popup';

class CourseDetailsPanel extends React.Component {
render() {
const course = this.props.course;
return (
<div className={'content'}>
<p>{'Instructor: '}{course.instructor}</p>
<p>{'Time: '}{course.time}</p>
<p>{'Location: '}{course.location}</p>
</div>
);
}
}

class CourseDetailsWindow extends React.Component {
render() {
const course = this.props.course;
return (
<div className="modal">
<a className="close" onClick={this.props.onClose}>&times;</a>
<button onClick={this.props.onSelectDefTag('N/A')}>N/A</button>
<button onClick={this.props.onSelectDefTag('In Progress')}>In Progress</button>
<button onClick={this.props.onSelectDefTag('Finished')}>Finished</button>
<div className="header">{course.course_number}</div>
<CourseDetailsPanel course={course} />
</div>
);
}
}

class Popups extends React.Component {
constructor(props) {
super(props);
this.handleClick = this.handleClick.bind(this);
this.removeDefTags = this.removeDefTags.bind(this);
this.selectDefTag = this.selectDefTag.bind(this);
this.state = {
tags: [] || props.tags,
deftags: [] || props.tags,
};
}

Expand All @@ -21,36 +50,37 @@ class Popups extends React.Component {
}),
};

handleClick(e) {
removeDefTags() {
if (this.state.deftags === 'N/A'
|| this.state.deftags === 'In Progress'
|| this.state.deftags === 'Finished') {
this.state.deftags = '';
}
}

selectDefTag(e) {
this.removeDefTags();
if (e === 'N/A') {
this.state.tags = 'N/A';
this.state.deftags = 'N/A';
}
if (e === 'In Progress') {
this.state.tags = 'In Progress';
this.state.deftags = 'In Progress';
}
if (e === 'Finished') {
this.state.tags = 'Finished';
this.state.deftags = 'Finished';
}
console.log(`get tags: ${this.state.tags}`);
}

render() {
return <div>
<Popup trigger={<a className="button">{this.props.myLists.course_title}</a>} modal>
{close => (
<div className="modal">
<a className="close" onClick={close}>&times;</a>
<button onClick={() => this.handleClick('N/A')}>N/A</button>
<button onClick={() => this.handleClick('In Progress')}>In Progress</button>
<button onClick={() => this.handleClick('Finished')}>Finished</button>
<div className="header">{this.props.myLists.course_number}</div>
<div className={'content'}>
<p>{'Instructor: '}{this.props.myLists.instructor}</p>
<p>{'Time: '}{this.props.myLists.time}</p>
<p>{'Location: '}{this.props.myLists.location}</p>
</div>
</div>
)}
<Popup
trigger={<a className="button">{this.props.myLists.course_title}</a>} modal>
{close =>
<CourseDetailsWindow
course={this.props.myLists}
onClose={close}
onSelectDefTag={(tag) => this.selectDefTag(tag)} />
}
</Popup>
</div>;
}
Expand Down
1 change: 1 addition & 0 deletions components/Search.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Configure, Highlight, Hits, SearchBox } from 'react-instantsearch/dom';

import { InstantSearch } from './Instantsearch';

/**
Expand Down
23 changes: 0 additions & 23 deletions components/SearchBar.jsx

This file was deleted.

86 changes: 86 additions & 0 deletions components/Tooltip.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import React from 'react';
import PropTypes from 'prop-types';

// The modal "window"
const modalStyle = {
backgroundColor: '#fff',
borderRadius: 5,
maxWidth: 500,
minHeight: 300,
margin: '0 auto',
padding: 30,
};

class Tooltip extends React.Component {
static propTypes = {
content: PropTypes.object,
trigger: PropTypes.object,
};

static defaultProps = {
content: '',
trigger: '',
};

constructor(props) {
super(props);
this.handleMouseOver = this.handleMouseOver.bind(this);
this.handleMouseOut = this.handleMouseOut.bind(this);
this.handleClick = this.handleClick.bind(this);
this.handleOutsideClick = this.handleOutsideClick.bind(this);
this.state = {
isOpen: false,
};
}

handleMouseOver = () => {
this.setState({isOpen: true});
};

handleMouseOut = () => {
this.setState({isOpen: false});
};

handleClick = () => {
if (!this.state.isOpen) {
document.addEventListener('click', this.handleOutsideClick, false);
} else {
document.removeEventListener('click', this.handleOutsideClick, false);
}
this.setState({
isOpen: this.state.isOpen,
});
};

handleOutsideClick = (e) => {
if (this.node.contains(e.target)) {
return;
}
this.handleClick();
};


render() {
return (
<div>
<div
onMouseOver={this.handleMouseOver}
onMouseOut={this.handleMouseOut}
onClick={this.handleClick}
onClose={this.handleOutsideClick}
>
{this.props.trigger}
</div>
<div>
{this.state.isOpen &&
<div style={modalStyle}>
{this.props.content}
</div>
}
</div>
</div>
);
}
}

export default Tooltip;
Loading